|
@@ -288,6 +288,9 @@ public class CwjsPolicyInfoController {
|
|
}else if("saleDirector".equalsIgnoreCase(roleCode)){
|
|
}else if("saleDirector".equalsIgnoreCase(roleCode)){
|
|
//销售总监 看下属
|
|
//销售总监 看下属
|
|
res = cwjsPolicyInfoService.getAllSubordinate(userId);
|
|
res = cwjsPolicyInfoService.getAllSubordinate(userId);
|
|
|
|
+ // 与自己有 关联的人员
|
|
|
|
+ List<String> sale = cwjsSaleAssistantInfoService.getCwSaleAndAssistantListStr(userId);
|
|
|
|
+ res.addAll(sale);
|
|
}else {
|
|
}else {
|
|
//查询 对应的销售或 助理
|
|
//查询 对应的销售或 助理
|
|
res = cwjsSaleAssistantInfoService.getCwSaleAndAssistantListStr(userId);
|
|
res = cwjsSaleAssistantInfoService.getCwSaleAndAssistantListStr(userId);
|
|
@@ -319,8 +322,11 @@ public class CwjsPolicyInfoController {
|
|
// Set<String> userIds= materialReportOverViewService.recursiveQuerySubordinate(userId);
|
|
// Set<String> userIds= materialReportOverViewService.recursiveQuerySubordinate(userId);
|
|
//List<String> userIds = cwjsPolicyInfoService.getAllSubordinate(userId);
|
|
//List<String> userIds = cwjsPolicyInfoService.getAllSubordinate(userId);
|
|
List<CwjsPolicyInfo> removeList = new ArrayList<>();
|
|
List<CwjsPolicyInfo> removeList = new ArrayList<>();
|
|
- cwjsPolicyInfoList.forEach(cwjsPolicy -> {
|
|
|
|
- if(!userIds.contains(cwjsPolicy.getCreateUserId()) && !userId.equalsIgnoreCase(cwjsPolicy.getApprovedProgress())){
|
|
|
|
|
|
+ List<String> subList = cwjsCompanyApprovalUserList.stream().map(CwjsCompanyApprovalUser::getCompanySubjectId).collect(Collectors.toList());
|
|
|
|
+ //政策的主体 不是 审核人的主体 过滤 只保留 和审核人 是一样的主体的 政策
|
|
|
|
+ cwjsPolicyInfoList.forEach(cwjsPolicy -> {
|
|
|
|
+ //if(!userIds.contains(cwjsPolicy.getCreateUserId()) && !userId.equalsIgnoreCase(cwjsPolicy.getApprovedProgress())){
|
|
|
|
+ if(!subList.contains(String.valueOf(cwjsPolicy.getCompanySubjectId()))){
|
|
removeList.add(cwjsPolicy);
|
|
removeList.add(cwjsPolicy);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
@@ -356,21 +362,45 @@ public class CwjsPolicyInfoController {
|
|
|
|
|
|
|
|
|
|
//所有人只要能看到就能有查看的按钮
|
|
//所有人只要能看到就能有查看的按钮
|
|
- cwjsPolicy.setOperation("查看");
|
|
|
|
|
|
+ /* cwjsPolicy.setOperation("查看");
|
|
|
|
|
|
- //查询助理
|
|
|
|
- //List <String> assistantList = cwjsSaleAssistantInfoMapper.getCwAssistantNameListPolicy(userId);
|
|
|
|
- if((userIds.contains(userId) || userId.equals(cwjsPolicy.getCreateUserId())) && cwjsPolicy.getApprovedStatus() == 4){ //创建人是自己且状态是审核拒绝的
|
|
|
|
|
|
+ //查询 对应的销售或 助理
|
|
|
|
+ List <String> assistantList = cwjsSaleAssistantInfoService.getCwSaleAndAssistantListStr(cwjsPolicy.getCreateUserId());
|
|
|
|
+ if((assistantList.contains(userId) || assistantList.contains(cwjsPolicy.getCreateUserId())) && cwjsPolicy.getApprovedStatus() == 4){ //创建人是自己且状态是审核拒绝的
|
|
cwjsPolicy.setOperation("查看|编辑|提交审核");
|
|
cwjsPolicy.setOperation("查看|编辑|提交审核");
|
|
}
|
|
}
|
|
|
|
|
|
if(userId.equals(cwjsPolicy.getApprovedProgress()) && (cwjsPolicy.getApprovedStatus() == 1 || cwjsPolicy.getApprovedStatus() == 2)){
|
|
if(userId.equals(cwjsPolicy.getApprovedProgress()) && (cwjsPolicy.getApprovedStatus() == 1 || cwjsPolicy.getApprovedStatus() == 2)){
|
|
cwjsPolicy.setOperation("查看|审核通过|审核拒绝");
|
|
cwjsPolicy.setOperation("查看|审核通过|审核拒绝");
|
|
}
|
|
}
|
|
- if(userId.equals(cwjsPolicy.getApprovedProgress()) && cwjsPolicy.getApprovedStatus() == 4){
|
|
|
|
|
|
+ if(userId.equals(cwjsPolicy.getApprovedProgress()) && cwjsPolicy.getApprovedStatus() == 4 && !userId.equals(cwjsPolicy.getCreateUserId())){
|
|
cwjsPolicy.setOperation("查看");
|
|
cwjsPolicy.setOperation("查看");
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+*/
|
|
|
|
+ StringBuilder stringBuilder = new StringBuilder();
|
|
|
|
+
|
|
|
|
+ //审核拒绝
|
|
|
|
+ if (cwjsPolicy.getApprovedStatus() == 4){
|
|
|
|
+ //有 销售-助理 关联的人员 都可以编辑
|
|
|
|
+ if(!"admin".equalsIgnoreCase(roleCode) && !"finance".equalsIgnoreCase(roleCode)){
|
|
|
|
+ List <String> saleOrAssis = cwjsSaleAssistantInfoService.getCwSaleAndAssistantListStr(userId);
|
|
|
|
+ if(saleOrAssis.contains(cwjsPolicy.getCreateUserId())){
|
|
|
|
+ stringBuilder.append("编辑").append("|").append("提交审核").append("|");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //待审核
|
|
|
|
+ if (cwjsPolicy.getApprovedStatus() == 1 || cwjsPolicy.getApprovedStatus() == 2){
|
|
|
|
+ if(cwjsPolicy.getApprovedProgress().equals(userId)){
|
|
|
|
+ stringBuilder.append("审核通过").append("|").append("审核拒绝").append("|");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //审核通过
|
|
|
|
+ /*if (cwjsPolicy.getApprovedStatus() == 3){
|
|
|
|
+ stringBuilder.append("查看");
|
|
|
|
+ }*/
|
|
|
|
+ stringBuilder.append("查看").append("|");
|
|
|
|
+ cwjsPolicy.setOperation(stringBuilder.deleteCharAt(stringBuilder.lastIndexOf("|")).toString());
|
|
|
|
|
|
|
|
|
|
|
|
|