瀏覽代碼

政策-总监创建及审核-test

yangzian 3 年之前
父節點
當前提交
d114a81f8c

+ 18 - 9
jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/policy/controller/CwjsPolicyInfoController.java

@@ -202,17 +202,26 @@ public class CwjsPolicyInfoController {
 		 //审核通过 是不是终审,不是就给当前的下一个人发企业微信
 		 if(type == 2){
 
+
 			 //第一个审核人 - 法务
 		 	if(approvalUser.equals("legalAffairs")){
-				cwjsPolicyInfo.setApprovedStatus(1);
-				cwjsPolicyInfo.setApprovedProgress(examineUser.getString("leaderId"));	//设置一下个审核人员  上级
+		 		//查询创建人角色 -- 自己创建的
+				String createUserRole = roleService.getRoleCodeByUserId(cwjsPolicyInfo.getCreateUserId());
+				if (StringUtils.equals("saleDirector",createUserRole)){
+					cwjsPolicyInfo.setApprovedStatus(1);
+					cwjsPolicyInfo.setApprovedProgress(cwjsPolicyInfo.getCreateUserId());	//设置一下个审核人员  是自己
+				}else{
+					cwjsPolicyInfo.setApprovedStatus(1);
+					cwjsPolicyInfo.setApprovedProgress(examineUser.getString("leaderId"));	//设置一下个审核人员  上级
+				}
 		 	}
 
 
+
 			 //查询审核人角色
 			 String roleCode = roleService.getRoleCodeByUserId(approvalUser);
 
-		 	//第二个审核人 = 上级
+			 //第二个审核人 = 上级 = 销售总监
 		 	//if(approvalUser.equals(examineUser.getString("leaderId"))){
 		 	if(StringUtils.equals("saleDirector",roleCode)){//审核人角色为销售总监
 		 		if(examineUser.getString("departName").contains("渠道")){
@@ -595,8 +604,8 @@ public class CwjsPolicyInfoController {
 			cwjsPolicyInfo.setCompanySubjectId(companySubjectId);
 
 
-			//查询销售角色
-			String roleCode = roleService.getRoleCodeByUserId(cwjsPolicyInfo.getSaleId());
+			//查询创建人角色
+			String roleCode = roleService.getRoleCodeByUserId(cwjsPolicyInfo.getCreateUserId());
 
 
 			//政策所属销售的部门 和 上级
@@ -611,10 +620,10 @@ public class CwjsPolicyInfoController {
 				cwjsPolicyInfo.setApprovedStatus(1);
 				firstAudit = "legalAffairs";
 
-				//助理给销售总监创建
-			}else if (StringUtils.equals(cwjsPolicyInfo.getSaleId(),cwjsPolicyInfo.getCreateUserId()) && StringUtils.equals(roleCode,"saleDirector")){
-				//审核人是 销售的 上级
-				firstAudit = examineUser.getString("leaderId");
+				//销售总监创建
+			}else if (StringUtils.equals(roleCode,"saleDirector")){
+				//审核人是 自己
+				firstAudit = cwjsPolicyInfo.getCreateUserId();
 			}else {
 				//创建人的 上级
 				firstAudit = examineUser.getString("leaderId");