提交 5ecbd267 authored 作者: douxy's avatar douxy

增加店内执行计划导出/入功能:补充档期陈列导出策略实现代码

上级 accc16b6
......@@ -65,8 +65,23 @@ public class SalesPermissionAspect {
*/
private void checkPermission(SalesApRequest salesApRequest) {
LoginUser loginUser = SecurityUtils.getLoginUser();
String ancestors = loginUser.getSysUser().getDept().getAncestors();
if (loginUser == null || loginUser.getSysUser() == null) {
throw new CheckedException(ECode.QC_MARKET_EMP_ERROR);
}
// 安全获取 ancestors 和 roles
String ancestors = "";
if (loginUser.getSysUser().getDept() != null) {
ancestors = loginUser.getSysUser().getDept().getAncestors();
if (ancestors == null) {
ancestors = "";
}
}
List<SysRole> roles = loginUser.getSysUser().getRoles();
if (roles == null) {
roles = new ArrayList<>();
}
// 不是区域销售部的人员,可以查看所有
if (!ancestors.contains(constantValue.deptYX) && roles.stream().filter(role -> RoleConstants.OPERATION_CENTER_AP_MANAGER.equals(role.getRoleKey())).findFirst().isPresent()) {
......@@ -97,8 +112,23 @@ public class SalesPermissionAspect {
private void checkPermissionDept(SalesApRequest salesApRequest) {
LoginUser loginUser = SecurityUtils.getLoginUser();
String ancestors = loginUser.getSysUser().getDept().getAncestors();
if (loginUser == null || loginUser.getSysUser() == null) {
return;
}
// 安全获取 ancestors 和 roles
String ancestors = "";
if (loginUser.getSysUser().getDept() != null) {
ancestors = loginUser.getSysUser().getDept().getAncestors();
if (ancestors == null) {
ancestors = "";
}
}
List<SysRole> roles = loginUser.getSysUser().getRoles();
if (roles == null) {
roles = new ArrayList<>();
}
// 不是区域销售部的人员,可以查看所有
if (!ancestors.contains(constantValue.deptYX) && roles.stream().filter(role -> RoleConstants.OPERATION_CENTER_AP_MANAGER.equals(role.getRoleKey())).findFirst().isPresent()) {
......@@ -107,7 +137,15 @@ public class SalesPermissionAspect {
// 是区域销售部的人员按部门查询
String empNo = loginUser.getUsername();
if (loginUser.getSysUser().getDept() == null) {
return;
}
String deptName = loginUser.getSysUser().getDept().getDeptNameSale();
if (deptName == null) {
deptName = "";
}
salesApRequest.setDeptNames("000889".equals(empNo) ? Arrays.asList(deptName, "北京特区") : Arrays.asList(deptName));
}
}
......@@ -28,7 +28,11 @@ public enum ExportAPType {
/**
* 六小金刚策略
*/
SIX_KINGkONG_EXPORT("sixKingKongExportStrategy");
SIX_KINGkONG_EXPORT("sixKingKongExportStrategy"),
/**
* 档期陈列策略
*/
PROMOTION_DISPLAY_EXPORT("promotionDisplayExportStrategy");
private final String strategy;
ExportAPType(String strategy) {
......
......@@ -28,7 +28,11 @@ public enum ImportApType {
/**
* 六小金刚导入策略
*/
SIX_KINGkONG_IMPORT("sixKingKongImportStrategy");
SIX_KINGkONG_IMPORT("sixKingKongImportStrategy"),
/**
* 档期陈列导入策略
*/
PROMOTION_DISPLAY_IMPORT("promotionDisplayImportStrategy");
private final String importStrategy;
ImportApType(String importStrategy) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论