Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
dj
/
YouJia
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 5ce30c04
authored
Oct 10, 2026
by
chenxi
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
优加门店上架导入改动提交,门店上架审核角色由读取常量改为读取配置文件
1 parent
ebb5e840
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
30 deletions
youjia-common/src/main/java/com/youjia/common/constant/CommonConstants.java
youjia-module-store/src/main/java/com/youjia/store/service/impl/StoreImportServiceImpl.java
youjia-common/src/main/java/com/youjia/common/constant/CommonConstants.java
View file @
5ce30c0
...
...
@@ -32,30 +32,5 @@ public final class CommonConstants {
/** 超级管理员角色编码 */
public
static
final
String
ROLE_SYS_ADMIN
=
"SYS_ADMIN"
;
/** 优加商务经理角色编码(门店上架第 1 级审批) */
public
static
final
String
ROLE_YJ_BIZ_MGR
=
"YJ_BIZ_MGR"
;
/** 优加商务经理角色名称(提交时按名称查 sys_role 取 role_code) */
public
static
final
String
ROLE_NAME_YJ_BIZ_MGR
=
"优加商务经理"
;
/** 优加财务经理角色编码(门店上架第 2 级审批) */
public
static
final
String
ROLE_YJ_FINANCE_MGR
=
"YJ_FINANCE_MGR"
;
/** 线上运营角色编码 */
public
static
final
String
ROLE_ONLINE_OPS
=
"ONLINE_OPS"
;
/** 运营主管角色编码 */
public
static
final
String
ROLE_OPS_LEADER
=
"OPS_LEADER"
;
/** 只读观察者角色编码 */
public
static
final
String
ROLE_VIEWER
=
"VIEWER"
;
/** 毫秒时间戳请求头 */
public
static
final
String
HEADER_TIMESTAMP
=
"X-Timestamp"
;
/** 当前登录人透传头(网关 / 上游鉴权域透传) */
public
static
final
String
HEADER_USER_ID
=
"X-User-Id"
;
/** 当前登录人组织透传头 */
public
static
final
String
HEADER_ORG_ID
=
"X-Org-Id"
;
}
youjia-module-store/src/main/java/com/youjia/store/service/impl/StoreImportServiceImpl.java
View file @
5ce30c0
...
...
@@ -28,6 +28,7 @@ import com.youjia.store.mapper.StoreListingMapper;
import
com.youjia.store.remote.StoreImportRemoteValidator
;
import
com.youjia.store.remote.dto.GoodsCategoryDTO
;
import
com.youjia.store.service.StoreImportService
;
import
com.youjia.store.support.StoreApprovalConfig
;
import
com.youjia.store.support.StoreImportCheckResult
;
import
com.youjia.store.support.StoreImportFailFileWriter
;
import
com.youjia.store.support.StoreImportIdempotentGuard
;
...
...
@@ -104,6 +105,7 @@ public class StoreImportServiceImpl implements StoreImportService {
private
final
StoreImportRemoteValidator
storeImportRemoteValidator
;
private
final
SysRoleMapper
sysRoleMapper
;
private
final
SysOrgMapper
sysOrgMapper
;
private
final
StoreApprovalConfig
storeApprovalConfig
;
private
final
OssTemplate
ossTemplate
;
private
final
TransactionTemplate
transactionTemplate
;
private
final
StoreImportIdempotentGuard
idempotentGuard
;
...
...
@@ -569,22 +571,33 @@ public class StoreImportServiceImpl implements StoreImportService {
}
/**
* 第 1 级审批角色编码:按 `sys_role.role_name = '优加商务经理'` 查。
* 第 1 级审批角色编码:取 {@link StoreApprovalConfig}(Nacos `youjia.store.approval.level-role-codes`)
* 下标 0 的角色编码,并校验该角色在 sys_role 中存在且启用。
*/
private
String
resolveLevel1RoleCode
()
{
String
roleCode
=
storeApprovalConfig
.
getRoleCode
(
1
);
if
(!
StringUtils
.
hasText
(
roleCode
))
{
throw
new
BusinessException
(
ResultCode
.
OPERATION_NOT_ALLOWED
,
"第 1 级审批角色未配置,请检查配置项 youjia.store.approval.level-role-codes"
);
}
SysRole
role
=
sysRoleMapper
.
selectOne
(
new
LambdaQueryWrapper
<
SysRole
>()
.
eq
(
SysRole:
:
getRole
Name
,
CommonConstants
.
ROLE_NAME_YJ_BIZ_MGR
)
.
eq
(
SysRole:
:
getRole
Code
,
roleCode
)
.
eq
(
SysRole:
:
getStatus
,
CommonConstants
.
STATUS_ENABLED
)
.
last
(
"limit 1"
));
if
(
role
==
null
||
!
StringUtils
.
hasText
(
role
.
getRoleCode
())
)
{
if
(
role
==
null
)
{
throw
new
BusinessException
(
ResultCode
.
OPERATION_NOT_ALLOWED
,
"审批角色["
+
CommonConstants
.
ROLE_NAME_YJ_BIZ_MGR
+
"]未配置,请联系管理员"
);
"审批角色["
+
roleCode
+
"]在系统中不存在或未启用,"
+
"请检查 sys_role 数据与配置项 youjia.store.approval.level-role-codes"
);
}
return
role
.
getRoleCode
();
}
/**
* 第 1 级审批角色名称:按配置的角色编码到 sys_role 反查名称(不再写死)。
*/
private
String
resolveLevel1RoleName
()
{
return
CommonConstants
.
ROLE_NAME_YJ_BIZ_MGR
;
String
roleCode
=
storeApprovalConfig
.
getRoleCode
(
1
);
return
StringUtils
.
hasText
(
roleCode
)
?
roleNameOf
(
roleCode
)
:
null
;
}
private
String
roleNameOf
(
String
roleCode
)
{
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment