Browse Source

Merge branch 'test'

yangzian 3 years ago
parent
commit
c851022808

+ 144 - 121
jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/policy/controller/CwjsPolicyInfoController.java

@@ -132,10 +132,10 @@ public class CwjsPolicyInfoController {
 	 public Result policyApproval(@RequestParam(name="id") Integer id,
 	 							@RequestParam(name="type") Integer type,
 								  @RequestParam(name="userId") String userId,
-								@RequestParam(name="approvalContent",required=false) String approvalContent){
+								@RequestParam(name="approvalContent",required=false) String approvalContent) {
 
-		CwjsPolicyInfo cwjsPolicyInfo = cwjsPolicyInfoService.getById(id);
-		 if(cwjsPolicyInfo==null) {
+		 CwjsPolicyInfo cwjsPolicyInfo = cwjsPolicyInfoService.getById(id);
+		 if (cwjsPolicyInfo == null) {
 			 return Result.error("政策不存在或已被删除,请重新选择要审核的政策。");
 		 }
 		 cwjsPolicyInfo.setLoginUserId(userId);
@@ -151,26 +151,32 @@ public class CwjsPolicyInfoController {
 		 String approvalUser = cwjsPolicyInfo.getApprovedProgress();
 
 		 //政策所属销售的部门 和 上级
-		 JSONObject examineUser = cwjsPolicyInfoMapper.getUserLeaderAndDirectorByRoleName(cwjsPolicyInfo.getCreateUserId(),"分公司总经理");
+		 JSONObject examineUser = cwjsPolicyInfoMapper.getUserLeaderAndDirectorByRoleName(cwjsPolicyInfo.getCreateUserId(), "分公司总经理");
 		 String firstAudit = "";//第一次审核人
 
 		 // 提交 - 待审核
 		 //华北==> 法务  其他===> 销售上级
-		 if(type == 1){
-		 	if (cwjsPolicyInfo.getAdvancePay() == 0 && cwjsPolicyInfo.getCustomerFlag() == 0){
-				//第一次审核人 -- 法务(法务有多个用户 无法判断审核人 所以 法务审核人为 角色code legalAffairs 占位)
-				//firstAudit = examineUser.getString("directorId");
-				firstAudit = "legalAffairs";
-			}else {
-				//销售的 上级
-				firstAudit = examineUser.getString("leaderId");
-			}
+		 if (type == 1) {
+			 if (cwjsPolicyInfo.getAdvancePay() == 0 && cwjsPolicyInfo.getCustomerFlag() == 0) {
+				 //第一次审核人 -- 法务(法务有多个用户 无法判断审核人 所以 法务审核人为 角色code legalAffairs 占位)
+				 //firstAudit = examineUser.getString("directorId");
+				 firstAudit = "legalAffairs";
+			 } else {
+				 //查询创建人角色 -- 自己创建的
+				 String createUserRole = roleService.getRoleCodeByUserId(cwjsPolicyInfo.getCreateUserId());
+				 if (StringUtils.equals("saleDirector", createUserRole)) {
+					 firstAudit = cwjsPolicyInfo.getCreateUserId();
+				 } else {
+					 //销售的 上级
+					 firstAudit = examineUser.getString("leaderId");
+				 }
+			 }
 
 			 cwjsPolicyInfo.setApprovedStatus(1);
 			 cwjsPolicyInfo.setApprovedProgress(firstAudit);
 
 
-			 if(StringUtils.equals(firstAudit,"legalAffairs")){
+			 if (StringUtils.equals(firstAudit, "legalAffairs")) {
 				 List<JSONObject> legalUserList = cwjsPolicyInfoService.getLegalAffairsUsers();
 				 for (JSONObject jsonObject : legalUserList) {
 					 JSONObject wChatIdByUserId = mailLogMapper.getWChatIdByUserId(jsonObject.getString("userId"));
@@ -178,7 +184,7 @@ public class CwjsPolicyInfoController {
 					 text.append("您有一条销售政策需要审核,该客户为:");
 					 text.append(cwjsPolicyInfo.getCompanyName());
 					 text.append(",请及时登录助手平台-销售政策页面进行审核,谢谢!");
-					 corpWexinUtils.sendMessageByWeChatId(wChatIdByUserId,text.toString());
+					 corpWexinUtils.sendMessageByWeChatId(wChatIdByUserId, text.toString());
 				 }
 			 } else {
 				 JSONObject wChatIdByUserId = mailLogMapper.getWChatIdByUserId(cwjsPolicyInfo.getApprovedProgress());
@@ -186,7 +192,7 @@ public class CwjsPolicyInfoController {
 				 text.append("您有一条销售政策需要审核,该客户为:");
 				 text.append(cwjsPolicyInfo.getCompanyName());
 				 text.append(",请及时登录助手平台-销售政策页面进行审核,谢谢!");
-				 corpWexinUtils.sendMessageByWeChatId(wChatIdByUserId,text.toString());
+				 corpWexinUtils.sendMessageByWeChatId(wChatIdByUserId, text.toString());
 			 }
 
 			 //添加记录
@@ -198,69 +204,77 @@ public class CwjsPolicyInfoController {
 			 policyApprovalLog.setCreateTime(new Date());
 			 policyApprovalLogService.save(policyApprovalLog);
 
-		}
+		 }
 		 //审核通过 是不是终审,不是就给当前的下一个人发企业微信
-		 if(type == 2){
+		 if (type == 2) {
+
 
 			 //第一个审核人 - 法务
-		 	if(approvalUser.equals("legalAffairs")){
-				cwjsPolicyInfo.setApprovedStatus(1);
-				cwjsPolicyInfo.setApprovedProgress(examineUser.getString("leaderId"));	//设置一下个审核人员  上级
-		 	}
+			 if (approvalUser.equals("legalAffairs")) {
+				 //查询创建人角色 -- 自己创建的
+				 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("渠道")){
-					cwjsPolicyInfo.setApprovedStatus(3);
-					cwjsPolicyInfoService.updateById(cwjsPolicyInfo);
-
-					/**
-					 * 终审通过后 添加 起始时间
-					 */
-					reportSettlementService.cwjsPRofit(cwjsPolicyInfo);
-					return Result.successMsg("审核通过",cwjsPolicyInfo);
-				}
-
-				if(examineUser.getString("departName").contains("销售")){
-					//华北 ---> 自动转老板
-					if (cwjsPolicyInfo.getCompanyId().equals("d57fecdcf7a94d009736d9c850731582")){
-						//查询 是否符合条件
-						List<JSONObject> autoConveryList = cwjsPolicyInfoMapper.selAutoConveryInfo(cwjsPolicyInfo.getAccountingPeriod(),cwjsPolicyInfo.getMediaType(),
-								cwjsPolicyInfo.getAdvancePay(),cwjsPolicyInfo.getRebateType(),cwjsPolicyInfo.getRebateRate());
-						if (!Check.isNull(autoConveryList)){
-							cwjsPolicyInfoService.automaticConveyBossExamine(cwjsPolicyInfo);
-							cwjsPolicyInfoService.updateById(cwjsPolicyInfo);
-							log.info("-----自动转老板");
-							return Result.successMsg("审核通过",cwjsPolicyInfo);
-						}else {
-							//结束
-							cwjsPolicyInfo.setApprovedStatus(3);
-							cwjsPolicyInfoService.updateById(cwjsPolicyInfo);
-
-							/**
-							 * 终审通过后 添加 起始时间
-							 */
-							reportSettlementService.cwjsPRofit(cwjsPolicyInfo);
-							return Result.successMsg("审核通过",cwjsPolicyInfo);
-
-						}
-					}else {
-						// 下一步审核 分公司总经理
-						cwjsPolicyInfo.setApprovedStatus(1);
-						cwjsPolicyInfo.setApprovedProgress(examineUser.getString("directorId"));	//设置一下个审核人员  分公司总经理
+			 //第二个审核人 = 上级 = 销售总监
+			 //if(approvalUser.equals(examineUser.getString("leaderId"))){
+			 if (StringUtils.equals("saleDirector", roleCode)) {//审核人角色为销售总监
+				 if (examineUser.getString("departName").contains("渠道")) {
+					 cwjsPolicyInfo.setApprovedStatus(3);
+					 cwjsPolicyInfoService.updateById(cwjsPolicyInfo);
+
+					 /**
+					  * 终审通过后 添加 起始时间
+					  */
+					 reportSettlementService.cwjsPRofit(cwjsPolicyInfo);
+					 return Result.successMsg("审核通过", cwjsPolicyInfo);
+				 }
 
-					}
-				}
+				 if (examineUser.getString("departName").contains("销售")) {
+					 //华北 ---> 自动转老板
+					 if (cwjsPolicyInfo.getCompanyId().equals("d57fecdcf7a94d009736d9c850731582")) {
+						 //查询 是否符合条件
+						 List<JSONObject> autoConveryList = cwjsPolicyInfoMapper.selAutoConveryInfo(cwjsPolicyInfo.getAccountingPeriod(), cwjsPolicyInfo.getMediaType(),
+								 cwjsPolicyInfo.getAdvancePay(), cwjsPolicyInfo.getRebateType(), cwjsPolicyInfo.getRebateRate());
+						 if (!Check.isNull(autoConveryList)) {
+							 cwjsPolicyInfoService.automaticConveyBossExamine(cwjsPolicyInfo);
+							 cwjsPolicyInfoService.updateById(cwjsPolicyInfo);
+							 log.info("-----自动转老板");
+							 return Result.successMsg("审核通过", cwjsPolicyInfo);
+						 } else {
+							 //结束
+							 cwjsPolicyInfo.setApprovedStatus(3);
+							 cwjsPolicyInfoService.updateById(cwjsPolicyInfo);
+
+							 /**
+							  * 终审通过后 添加 起始时间
+							  */
+							 reportSettlementService.cwjsPRofit(cwjsPolicyInfo);
+							 return Result.successMsg("审核通过", cwjsPolicyInfo);
+
+						 }
+					 } else {
+						 // 下一步审核 分公司总经理
+						 cwjsPolicyInfo.setApprovedStatus(1);
+						 cwjsPolicyInfo.setApprovedProgress(examineUser.getString("directorId"));    //设置一下个审核人员  分公司总经理
+
+					 }
+				 }
 
-			}
+			 }
 
-		 	//第三个审核人- 分公司总经理
-			 if(approvalUser.equals(examineUser.getString("directorId"))){
+			 //第三个审核人- 分公司总经理
+			 if (approvalUser.equals(examineUser.getString("directorId"))) {
 				 cwjsPolicyInfo.setApprovedStatus(3);
 				 cwjsPolicyInfoService.updateById(cwjsPolicyInfo);
 
@@ -269,11 +283,11 @@ public class CwjsPolicyInfoController {
 				  * 终审通过后 添加 起始时间
 				  */
 				 reportSettlementService.cwjsPRofit(cwjsPolicyInfo);
-				 return Result.successMsg("审核通过",cwjsPolicyInfo);
+				 return Result.successMsg("审核通过", cwjsPolicyInfo);
 			 }
 
 			 //老板
-			 if (approvalUser.equals(userId) && userId.equals("80e747cdea6f41dbbc8cde23046fd4e0")){
+			 if (approvalUser.equals(userId) && userId.equals("80e747cdea6f41dbbc8cde23046fd4e0")) {
 				 cwjsPolicyInfo.setApprovedStatus(3);
 				 cwjsPolicyInfoService.updateById(cwjsPolicyInfo);
 
@@ -281,60 +295,54 @@ public class CwjsPolicyInfoController {
 				  * 终审通过后 添加 起始时间
 				  */
 				 reportSettlementService.cwjsPRofit(cwjsPolicyInfo);
-				 return Result.successMsg("审核通过",cwjsPolicyInfo);
+				 return Result.successMsg("审核通过", cwjsPolicyInfo);
 			 }
 
 
-
-
 			 JSONObject wChatIdByUserId = mailLogMapper.getWChatIdByUserId(cwjsPolicyInfo.getApprovedProgress());
 			 StringBuilder text = new StringBuilder();
 			 text.append("您有一条销售政策需要审核,该客户为:");
 			 text.append(cwjsPolicyInfo.getCompanyName());
 			 text.append(",请及时登录助手平台-销售政策页面进行审核,谢谢!");
-			 corpWexinUtils.sendMessageByWeChatId(wChatIdByUserId,text.toString());
+			 corpWexinUtils.sendMessageByWeChatId(wChatIdByUserId, text.toString());
 
-			CwjsPolicyApprovalLog policyApprovalLog = new CwjsPolicyApprovalLog();
-			policyApprovalLog.setPolicyId(id);
-			policyApprovalLog.setCreateUserId(userId);
-			policyApprovalLog.setApprovalStatus(0);
+			 CwjsPolicyApprovalLog policyApprovalLog = new CwjsPolicyApprovalLog();
+			 policyApprovalLog.setPolicyId(id);
+			 policyApprovalLog.setCreateUserId(userId);
+			 policyApprovalLog.setApprovalStatus(0);
 			 policyApprovalLog.setApprovalContent(Check.isNull(approvalContent) ? "审核通过" : approvalContent);
 			 policyApprovalLog.setCreateTime(new Date());
-			policyApprovalLogService.save(policyApprovalLog);
+			 policyApprovalLogService.save(policyApprovalLog);
 
-		}
-	 	if(type == 3){	//审核拒绝	给申请人发企业微信
-			cwjsPolicyInfo.setApprovedStatus(4);
+		 }
+		 if (type == 3) {    //审核拒绝	给申请人发企业微信
+			 cwjsPolicyInfo.setApprovedStatus(4);
 
-			CwjsPolicyApprovalLog policyApprovalLog = new CwjsPolicyApprovalLog();
-			policyApprovalLog.setApprovalStatus(1);
-			policyApprovalLog.setPolicyId(id);
-			policyApprovalLog.setCreateUserId(userId);
-			policyApprovalLog.setApprovalContent(Check.isNull(approvalContent) ? "审核拒绝" : approvalContent);
-			policyApprovalLog.setCreateTime(new Date());
-			policyApprovalLogService.save(policyApprovalLog);
+			 CwjsPolicyApprovalLog policyApprovalLog = new CwjsPolicyApprovalLog();
+			 policyApprovalLog.setApprovalStatus(1);
+			 policyApprovalLog.setPolicyId(id);
+			 policyApprovalLog.setCreateUserId(userId);
+			 policyApprovalLog.setApprovalContent(Check.isNull(approvalContent) ? "审核拒绝" : approvalContent);
+			 policyApprovalLog.setCreateTime(new Date());
+			 policyApprovalLogService.save(policyApprovalLog);
 
 
-			JSONObject wChatIdByUserId = mailLogMapper.getWChatIdByUserId(cwjsPolicyInfo.getCreateUserId());
-			StringBuilder text = new StringBuilder();
-			text.append("您有一条销售政策审核未通过,客户为:");
-			text.append(cwjsPolicyInfo.getCompanyName());
-			text.append(",请及时登录助手平台-销售政策页面进行政策修改,谢谢!");
-			corpWexinUtils.sendMessageByWeChatId(wChatIdByUserId,text.toString());
-		}
+			 JSONObject wChatIdByUserId = mailLogMapper.getWChatIdByUserId(cwjsPolicyInfo.getCreateUserId());
+			 StringBuilder text = new StringBuilder();
+			 text.append("您有一条销售政策审核未通过,客户为:");
+			 text.append(cwjsPolicyInfo.getCompanyName());
+			 text.append(",请及时登录助手平台-销售政策页面进行政策修改,谢谢!");
+			 corpWexinUtils.sendMessageByWeChatId(wChatIdByUserId, text.toString());
+		 }
 
-	 	//手动-转领导审批 只有审核人是最后一个人的时候 才可以转领导
-	 	if (type == 4){
-			// 最后一个审核人员
-			if (!approvalUser.equals(examineUser.getString("leaderId")) && !approvalUser.equals(examineUser.getString("directorId"))){
-				return Result.errorMsg("当前审核人不是最后一个审核人员,无法转领导审批。");
-			}
+		 //手动-转领导审批 只有审核人是最后一个人的时候 才可以转领导
+		 if (type == 4) {
+			 cwjsPolicyInfoService.automaticConveyBossExamine(cwjsPolicyInfo);
+		 }
 
-			cwjsPolicyInfoService.automaticConveyBossExamine(cwjsPolicyInfo);
-		}
+			 cwjsPolicyInfoService.updateById(cwjsPolicyInfo);
+			 return Result.successMsg(type == 3 ? "审核拒绝" : "审核通过", cwjsPolicyInfo);
 
-		cwjsPolicyInfoService.updateById(cwjsPolicyInfo);
-	 	return Result.successMsg(type ==  3 ? "审核拒绝" : "审核通过",cwjsPolicyInfo);
 	 }
 
 
@@ -428,16 +436,25 @@ public class CwjsPolicyInfoController {
 
 			JSONObject examineUser = new JSONObject();
 			String directorUserId = "";
+
+			//角色
+			String createRoleCode = roleService.getRoleCodeByUserId(cwjsPolicy.getCreateUserId());
+
 			//主体为1 为 华北
 			if (cwjsPolicy.getCompanyId().equals("d57fecdcf7a94d009736d9c850731582")){
 				//查询 该销售 所属的审核人员
 				//华北审核人员 - 法务==>销售总监(销售上级)==>手动转领导/自动转领导
-				examineUser = cwjsPolicyInfoMapper.getUserLeaderAndDirectorByRoleName(cwjsPolicy.getSaleId(),"法务");
-				directorUserId = examineUser.getString("leaderId");
+				examineUser = cwjsPolicyInfoMapper.getUserLeaderAndDirectorByRoleName(cwjsPolicy.getCreateUserId(),"法务");
+
+				if (StringUtils.equals("saleDirector",createRoleCode)){
+					directorUserId  = cwjsPolicy.getCreateUserId();
+				}else {
+					directorUserId = examineUser.getString("leaderId");
+				}
 			}else {
 				//查询 该销售 所属的审核人员
 				//华南审核人员 - 销售总监(销售上级) ==> 分公司经理 ==>转领导
-				examineUser = cwjsPolicyInfoMapper.getUserLeaderAndDirectorByRoleName(cwjsPolicy.getSaleId(),"分公司总经理");
+				examineUser = cwjsPolicyInfoMapper.getUserLeaderAndDirectorByRoleName(cwjsPolicy.getCreateUserId(),"分公司总经理");
 				directorUserId = examineUser.getString("directorId");
 
 			}
@@ -595,8 +612,8 @@ public class CwjsPolicyInfoController {
 			cwjsPolicyInfo.setCompanySubjectId(companySubjectId);
 
 
-			//查询销售角色
-			String roleCode = roleService.getRoleCodeByUserId(cwjsPolicyInfo.getSaleId());
+			//查询创建人角色
+			String roleCode = roleService.getRoleCodeByUserId(cwjsPolicyInfo.getCreateUserId());
 
 
 			//政策所属销售的部门 和 上级
@@ -611,10 +628,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");
@@ -957,7 +974,6 @@ public class CwjsPolicyInfoController {
 			 } else {
 				 cwjsPolicyInfo.setStatusList(Arrays.asList(cwjsPolicyInfo.getApprovedStatus()));
 			 }
-
 			 //查询政策
 			 List<CwjsPolicyInfo> cwjsPolicyInfoList = cwjsPolicyInfoService.queryPageList(cwjsPolicyInfo);
 			 if (Check.isNull(cwjsPolicyInfoList)) {
@@ -972,12 +988,19 @@ public class CwjsPolicyInfoController {
 				 exportCwjsPolicyPojo.setRebateType(ExportCwjsPolicyPojo.getRebateTypeStr(vo.getRebateType()));
 				 exportCwjsPolicyPojo.setRebateRate(vo.getRebateRate()+"%");
 				 exportCwjsPolicyPojo.setDianPayCompanyRebateRate(Check.isNull(vo.getDianPayCompanyRebateRate()) ? "" : vo.getDianPayCompanyRebateRate()+"%");
-				 exportCwjsPolicyPojo.setPromotionType(vo.getPromotionType() == 0 ? "自运营" : "代运营");
-				 exportCwjsPolicyPojo.setAdvancePay(vo.getAdvancePay() == 0 ?  "否" : "是");
-				 exportCwjsPolicyPojo.setIsDianPay(vo.getIsDianPay() == 0 ?  "否" : "是");
-				 exportCwjsPolicyPojo.setCustomerFlag(vo.getCustomerFlag() == 0 ?  "否" : "是");
+				 exportCwjsPolicyPojo.setPromotionType(Check.isNull(vo.getPromotionType()) ? "-" : vo.getPromotionType() == 0 ? "自运营" : "代运营");
+				 exportCwjsPolicyPojo.setAdvancePay(Check.isNull(vo.getAdvancePay()) ?  "-" : vo.getAdvancePay() == 0 ?  "否" : "是");
+				 exportCwjsPolicyPojo.setIsDianPay(Check.isNull(vo.getIsDianPay()) ?  "-" : vo.getIsDianPay() == 0 ?  "否" : "是");
+				 exportCwjsPolicyPojo.setCustomerFlag(Check.isNull(vo.getCustomerFlag()) ?  "-" : vo.getCustomerFlag() == 0 ?  "否" : "是");
 				 exportCwjsPolicyPojo.setCreateTime(DateUtils.dateToStringTime(vo.getCreateTime()));
-				 exportCwjsPolicyPojo.setProductName(StringUtils.strip(vo.getPolicyProductName().toString(),"[]"));
+				 exportCwjsPolicyPojo.setProductName(StringUtils.strip(vo.getPolicyProductName().toString(),"[]").replace("\"",""));
+
+				 CwjsPolicyApprovalLog bossContent = policyApprovalLogMapper.getBossOneByPolicyId(vo.getId());	// 查询 老板审核意见 最新的一条
+				 exportCwjsPolicyPojo.setBossContent(Check.isNull(bossContent) ?  "-" : StringUtils.equals("终审通过",bossContent.getApprovalContent()) ? "-" : bossContent.getApprovalContent());
+
+				 CwjsPolicyApprovalLog legalContent = policyApprovalLogMapper.getOneByPolicyLegalInfo(vo.getId());	// 查询 法务 审核意见 最新的一条
+				 exportCwjsPolicyPojo.setLegalAffairsContent(Check.isNull(legalContent) ? "-" : legalContent.getApprovalContent());
+
 				 resultList.add(exportCwjsPolicyPojo);
 			 }
 			 Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams("政策内容", "销售政策"), ExportCwjsPolicyPojo.class, resultList);

+ 6 - 0
jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/policy/entity/ExportCwjsPolicyPojo.java

@@ -109,6 +109,9 @@ public class ExportCwjsPolicyPojo implements Serializable{
 	@Excel(name = "法务审核意见", width = 15)
 	private String legalAffairsContent;
 
+	@Excel(name = "老板审核意见", width = 15)
+	private String bossContent;
+
 
 
 
@@ -168,6 +171,9 @@ public class ExportCwjsPolicyPojo implements Serializable{
 			case 4:
 				statusStr = "审核拒绝";
 				break;
+			case 5:
+				statusStr = "已作废";
+				break;
 		}
 		return statusStr;
 	}

+ 5 - 2
jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/policy/mapper/xml/CwjsPolicyInfoMapper.xml

@@ -388,9 +388,12 @@
                         WHEN 3 THEN
                             '审核完成'
                         WHEN 4 THEN
-                            '待提交' ELSE '-'
+                            '待提交'
+                        WHEN 5 THEN
+                            '作废'
+                        ELSE '-'
                         END AS approvalContent,
-                    IF(p.approved_status = 4 , p.create_user_id, p.approved_progress ) userId,
+                    IF(p.approved_status = 4 or p.approved_status= 5, p.create_user_id, p.approved_progress ) userId,
                     p.create_user_name,
                     '' createTime
                 FROM

+ 1 - 1
jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/policy/service/impl/CwjsPolicyInfoServiceImpl.java

@@ -252,7 +252,7 @@ public class CwjsPolicyInfoServiceImpl extends ServiceImpl<CwjsPolicyInfoMapper,
         //修改政策状态及作废原因
         policyInfoMapper.updatePolicyToVOidById(policyId,delReason);
         //删除政策关联的产品信息
-        cwjsPolicyProductMapper.deleteProductsByPolicyId(Integer.valueOf(policyId));
+        //cwjsPolicyProductMapper.deleteProductsByPolicyId(Integer.valueOf(policyId));
         //删除该政策利润表记录
         cwjsProfitMapper.delSlettmentReportByPolicyId(policyId);