修复抄送bug

master
chen 4 years ago
parent ccf3f6b3ed
commit 600ae2b7d1
  1. 9
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgCopyUserController.java
  2. 13
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgEfficiencyController.java
  3. 3
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/NumResponse.java
  4. 17
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgCopyForServiceImpl.java
  5. 54
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgEfficiencyServiceImpl.java

@ -5,6 +5,7 @@ import com.daqing.financial.guarantee.model.request.CopyForMeRequest;
import com.daqing.financial.guarantee.model.response.CopyForMeResponse;
import com.daqing.financial.guarantee.service.IDgCopyUserService;
import com.daqing.financial.guarantee.util.R;
import com.daqing.financial.guarantee.util.TaskNodeUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
@ -37,6 +38,14 @@ public class DgCopyUserController {
@PostMapping("/queryCopyForMe")
public R queryCopyForMe(@RequestBody CopyForMeRequest copyForMeRequest){
List<CopyForMeResponse> copyForMeList = copyUserService.queryCopyForMe(copyForMeRequest);
//转换任务节点
copyForMeList.forEach(copyForMeResponse -> {
String taskNode = copyForMeResponse.getTaskNode();
if (taskNode != null) {
String converter = TaskNodeUtil.converter(taskNode);
copyForMeResponse.setTaskNode(converter);
}
});
return R.ok().data("copyForMeList",copyForMeList);
}

@ -2,10 +2,13 @@ package com.daqing.financial.guarantee.controller;
import com.alibaba.fastjson.JSONObject;
import com.daqing.financial.guarantee.feign.HrmsFeignService;
import com.daqing.financial.guarantee.model.request.CopyForMeRequest;
import com.daqing.financial.guarantee.model.request.DgEfficiencyTeamRequest;
import com.daqing.financial.guarantee.model.request.PersonalEfficiencyListRequest;
import com.daqing.financial.guarantee.model.response.CopyForMeResponse;
import com.daqing.financial.guarantee.model.response.NumResponse;
import com.daqing.financial.guarantee.model.response.PersonalEfficiencyListResponse;
import com.daqing.financial.guarantee.service.IDgCopyUserService;
import com.daqing.financial.guarantee.service.IDgEfficiencyService;
import com.daqing.financial.guarantee.util.DateUtils;
import com.daqing.financial.guarantee.util.R;
@ -45,6 +48,9 @@ public class DgEfficiencyController {
@Autowired
private HrmsFeignService hrmsFeignService;
@Autowired
private IDgCopyUserService copyUserService;
/**
* 团队效率
*/
@ -133,8 +139,13 @@ public class DgEfficiencyController {
}
}
}
String userId = DgApplyAmountInfoController.getUserId();
CopyForMeRequest copyForMeRequest = new CopyForMeRequest();
copyForMeRequest.setUserId(Integer.parseInt(userId));
List<CopyForMeResponse> copyForMeList = copyUserService.queryCopyForMe(copyForMeRequest);
int size = copyForMeList.size();
NumResponse numResponse = new NumResponse();
numResponse.setCopySendNum(size);
//转换任务节点,并统计操作状态个数
responseList.forEach(personalEfficiencyListResponse -> {
String taskNode = personalEfficiencyListResponse.getTaskNode();

@ -19,4 +19,7 @@ public class NumResponse {
@ApiModelProperty("已处理数 ")
private Integer processedNum = 0;
@ApiModelProperty("已发起数 ")
private Integer copySendNum = 0;
}

@ -48,8 +48,8 @@ public class DgCopyForServiceImpl extends ServiceImpl<DgCopyForMapper, DgCopyFor
//新文件名:雪花算法.文件扩展名
String newName = snowflakeId + ext;
//指定存放目录
// String directory = PromptSuccess.UPLOAD_FILE_PATH;
String directory = "D:/img/";
String directory = PromptSuccess.UPLOAD_FILE_PATH;
// String directory = "D:/img/";
//图片完整路径
String imgPath = directory + newName;
@ -59,6 +59,8 @@ public class DgCopyForServiceImpl extends ServiceImpl<DgCopyForMapper, DgCopyFor
String serverPrefix = PromptSuccess.IMAGE_URL_PATH;
//访问路径
String accessPath = serverPrefix + newName;
//取出抄送详情id
Integer copyForId = 0;
//添加之前判断是否抄送详情存在,如果存在则更新这条数据
QueryWrapper<DgCopyFor> wrapperOne = new QueryWrapper<>();
wrapperOne.eq("business_id",businessId).eq("process_id",processId);
@ -70,6 +72,7 @@ public class DgCopyForServiceImpl extends ServiceImpl<DgCopyForMapper, DgCopyFor
UpdateWrapper<DgCopyFor> updateWrapper = new UpdateWrapper<>();
updateWrapper.eq("business_id",businessId).eq("process_id",processId);
baseMapper.update(copyForUpdate, updateWrapper);
copyForId = copyFor.getId();
}else {
DgCopyFor copyForAdd = new DgCopyFor();
copyForAdd.setBusinessId(businessId);
@ -77,24 +80,24 @@ public class DgCopyForServiceImpl extends ServiceImpl<DgCopyForMapper, DgCopyFor
copyForAdd.setPicUrl(accessPath);
//添加抄送详情
baseMapper.insert(copyForAdd);
copyFor.setId(copyForAdd.getId());
copyForId = copyForAdd.getId();
}
//取出抄送详情id
Integer copyForId = copyFor.getId();
//查询该模块下需要抄送的用户id
QueryWrapper<DgProcessUser> wrapper = new QueryWrapper<>();
wrapper.eq("process_id", processId).select("user_id");
List<DgProcessUser> list = processUserMapper.selectList(wrapper);
if (list != null && list.size() != 0) {
Integer finalCopyForId = copyForId;
list.forEach(dgProcessUser -> {
Integer userId = dgProcessUser.getUserId();
//已经抄送的用户无需再次抄送
QueryWrapper<DgCopyUser> wrapperCopyUser = new QueryWrapper<>();
wrapperCopyUser.eq("user_id",userId).eq("copy_id",copyForId);
wrapperCopyUser.eq("user_id",userId).eq("copy_id", finalCopyForId);
DgCopyUser dgCopyUser = copyUserMapper.selectOne(wrapperCopyUser);
if (ObjectUtil.isNull(dgCopyUser)){
DgCopyUser copyUser = new DgCopyUser();
copyUser.setCopyId(copyForId);
copyUser.setCopyId(finalCopyForId);
copyUser.setUserId(userId);
//添加抄送关系
copyUserMapper.insert(copyUser);

@ -335,12 +335,6 @@ public class DgEfficiencyServiceImpl extends ServiceImpl<DgEfficiencyMapper, DgA
statusPO.setProcessId(2);
statusPO.setName(name);
statusPO.setStatus(status);
//相同业务中,如果已经是待处理则数据不覆盖
// StatusPO po = (StatusPO) hashMap.get(businessId);
// if (po!=null){
// if (!po.getOperatingStatus().equals(StatusCode.CZ_ON_HAND)) {
// }
// }
hashMap.put(businessId, statusPO);
});
}
@ -363,12 +357,6 @@ public class DgEfficiencyServiceImpl extends ServiceImpl<DgEfficiencyMapper, DgA
statusPO.setProcessId(3);
statusPO.setName(name);
statusPO.setStatus(status);
//相同业务中,如果已经是待处理则数据不覆盖
// StatusPO po = (StatusPO) hashMap.get(businessId);
// if (po!=null){
// if (!po.getOperatingStatus().equals(StatusCode.CZ_ON_HAND)) {
// }
// }
hashMap.put(businessId, statusPO);
});
}
@ -391,12 +379,6 @@ public class DgEfficiencyServiceImpl extends ServiceImpl<DgEfficiencyMapper, DgA
statusPO.setProcessId(4);
statusPO.setName(name);
statusPO.setStatus(status);
//相同业务中,如果已经是待处理则数据不覆盖
// StatusPO po = (StatusPO) hashMap.get(businessId);
// if (po!=null){
// if (!po.getOperatingStatus().equals(StatusCode.CZ_ON_HAND)) {
// }
// }
hashMap.put(businessId, statusPO);
});
}
@ -420,12 +402,6 @@ public class DgEfficiencyServiceImpl extends ServiceImpl<DgEfficiencyMapper, DgA
statusPO.setProcessId(5);
statusPO.setName(name);
statusPO.setStatus(status);
//相同业务中,如果已经是待处理则数据不覆盖
// StatusPO po = (StatusPO) hashMap.get(businessId);
// if (po!=null){
// if (!po.getOperatingStatus().equals(StatusCode.CZ_ON_HAND)) {
// }
// }
hashMap.put(businessId, statusPO);
});
}
@ -447,12 +423,6 @@ public class DgEfficiencyServiceImpl extends ServiceImpl<DgEfficiencyMapper, DgA
statusPO.setProcessId(6);
statusPO.setName(name);
statusPO.setStatus(status);
//相同业务中,如果已经是待处理则数据不覆盖
// StatusPO po = (StatusPO) hashMap.get(businessId);
// if (po!=null){
// if (!po.getOperatingStatus().equals(StatusCode.CZ_ON_HAND)) {
// }
// }
hashMap.put(businessId, statusPO);
});
}
@ -474,12 +444,6 @@ public class DgEfficiencyServiceImpl extends ServiceImpl<DgEfficiencyMapper, DgA
statusPO.setProcessId(7);
statusPO.setName(name);
statusPO.setStatus(status);
//相同业务中,如果已经是待处理则数据不覆盖
// StatusPO po = (StatusPO) hashMap.get(businessId);
// if (po!=null){
// if (!po.getOperatingStatus().equals(StatusCode.CZ_ON_HAND)) {
// }
// }
hashMap.put(businessId, statusPO);
});
}
@ -502,12 +466,6 @@ public class DgEfficiencyServiceImpl extends ServiceImpl<DgEfficiencyMapper, DgA
statusPO.setProcessId(8);
statusPO.setName(name);
statusPO.setStatus(status);
//相同业务中,如果已经是待处理则数据不覆盖
// StatusPO po = (StatusPO) hashMap.get(businessId);
// if (po!=null){
// if (!po.getOperatingStatus().equals(StatusCode.CZ_ON_HAND)) {
// }
// }
hashMap.put(businessId, statusPO);
});
}
@ -530,12 +488,6 @@ public class DgEfficiencyServiceImpl extends ServiceImpl<DgEfficiencyMapper, DgA
statusPO.setProcessId(9);
statusPO.setName(name);
statusPO.setStatus(status);
//相同业务中,如果已经是待处理则数据不覆盖
// StatusPO po = (StatusPO) hashMap.get(businessId);
// if (po!=null){
// if (!po.getOperatingStatus().equals(StatusCode.CZ_ON_HAND)) {
// }
// }
hashMap.put(businessId, statusPO);
});
}
@ -558,12 +510,6 @@ public class DgEfficiencyServiceImpl extends ServiceImpl<DgEfficiencyMapper, DgA
statusPO.setProcessId(10);
statusPO.setName(name);
statusPO.setStatus(status);
//相同业务中,如果已经是待处理则数据不覆盖
// StatusPO po = (StatusPO) hashMap.get(businessId);
// if (po!=null){
// if (!po.getOperatingStatus().equals(StatusCode.CZ_ON_HAND)) {
// }
// }
hashMap.put(businessId, statusPO);
});
}

Loading…
Cancel
Save