|
@@ -128,14 +128,22 @@ public class CwjsPolicyInfoController {
|
|
|
* @param approvalContent 审核内容
|
|
|
* @return
|
|
|
*/
|
|
|
- @GetMapping(value = "/policyApproval")
|
|
|
- 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){
|
|
|
-
|
|
|
- CwjsPolicyInfo cwjsPolicyInfo = cwjsPolicyInfoService.getById(id);
|
|
|
- if(cwjsPolicyInfo==null) {
|
|
|
+ @PostMapping(value = "/policyApproval")
|
|
|
+ public Result policyApproval(@RequestBody JSONObject object
|
|
|
+ //@RequestParam(name="id") Integer id,
|
|
|
+ //@RequestParam(name="type") Integer type,
|
|
|
+ //@RequestParam(name="userId") String userId,
|
|
|
+ //@RequestParam(name="approvalContent",required=false) String approvalContent
|
|
|
+ ) {
|
|
|
+
|
|
|
+ Integer id = object.getInteger("id");
|
|
|
+ Integer type = object.getInteger("type");
|
|
|
+ String userId = object.getString("userId");
|
|
|
+ String approvalContent = object.getString("approvalContent");
|
|
|
+
|
|
|
+
|
|
|
+ CwjsPolicyInfo cwjsPolicyInfo = cwjsPolicyInfoService.getById(id);
|
|
|
+ if (cwjsPolicyInfo == null) {
|
|
|
return Result.error("政策不存在或已被删除,请重新选择要审核的政策。");
|
|
|
}
|
|
|
cwjsPolicyInfo.setLoginUserId(userId);
|
|
@@ -151,26 +159,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 +192,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 +200,7 @@ public class CwjsPolicyInfoController {
|
|
|
text.append("您有一条销售政策需要审核,该客户为:");
|
|
|
text.append(cwjsPolicyInfo.getCompanyName());
|
|
|
text.append(",请及时登录助手平台-销售政策页面进行审核,谢谢!");
|
|
|
- corpWexinUtils.sendMessageByWeChatId(wChatIdByUserId,text.toString());
|
|
|
+ corpWexinUtils.sendMessageByWeChatId(wChatIdByUserId, text.toString());
|
|
|
}
|
|
|
|
|
|
//添加记录
|
|
@@ -198,69 +212,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 +291,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 +303,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 +444,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 +620,8 @@ public class CwjsPolicyInfoController {
|
|
|
cwjsPolicyInfo.setCompanySubjectId(companySubjectId);
|
|
|
|
|
|
|
|
|
- //查询销售角色
|
|
|
- String roleCode = roleService.getRoleCodeByUserId(cwjsPolicyInfo.getSaleId());
|
|
|
+ //查询创建人角色
|
|
|
+ String roleCode = roleService.getRoleCodeByUserId(cwjsPolicyInfo.getCreateUserId());
|
|
|
|
|
|
|
|
|
//政策所属销售的部门 和 上级
|
|
@@ -611,10 +636,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 +982,6 @@ public class CwjsPolicyInfoController {
|
|
|
} else {
|
|
|
cwjsPolicyInfo.setStatusList(Arrays.asList(cwjsPolicyInfo.getApprovedStatus()));
|
|
|
}
|
|
|
-
|
|
|
//查询政策
|
|
|
List<CwjsPolicyInfo> cwjsPolicyInfoList = cwjsPolicyInfoService.queryPageList(cwjsPolicyInfo);
|
|
|
if (Check.isNull(cwjsPolicyInfoList)) {
|
|
@@ -972,12 +996,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);
|