[修改] 转办审批历史

This commit is contained in:
bupengxiang
2023-05-11 15:33:21 +08:00
parent 54e6fa0c09
commit 2434692171
11 changed files with 19 additions and 12 deletions
@@ -92,7 +92,7 @@
<!-- 插入记录 -->
<insert id="insertBatch" parameterType="com.adc.da.sys.entity.UserOrgEO" >
insert into TR_USER_ORG(<include refid="Base_Column_List" />)values
<foreach collection="UserOrgEOList" item="ur" separator=",">
<foreach collection="userOrgEOList" item="ur" separator=",">
(#{ur.userId}, #{ur.orgId})
</foreach>
</insert>
@@ -131,6 +131,16 @@ public class TaskController {
LocalDateTime endDateTime = LocalDateTime.ofInstant(endTime.toInstant(), ZoneId.systemDefault());
long days = Duration.between(startDateTime.toLocalDate().atStartOfDay(), endDateTime.toLocalDate().atStartOfDay()).toDays() + 1;
historicTaskInstance.put("approvalTime",days + "");
}else {
QueryWrapper<BusProcessApprove> datasQueryWrapper = new QueryWrapper<>();
datasQueryWrapper.lambda().eq(BusProcessApprove::getTaskId,historicTaskInstance.get("id"));
List<BusProcessApprove> approveList = iBusProcessApproveService.list(datasQueryWrapper);
if(approveList.size()>0){
Map<String,String> formValsJsonMap = JSONObject.parseObject(approveList.get(0).getFromValsJson(),Map.class);
map.put("approvalOpinion",formValsJsonMap.get("approvalOpinion"));
map.put("approvalResult",formValsJsonMap.get("flag")!=null ? formValsJsonMap.get("flag"):"");
map.put("approvalFile",formValsJsonMap.get("approvalFile")!=null ? formValsJsonMap.get("approvalFile"):"");
}
}
relistMap.add(map);
}
@@ -676,7 +676,8 @@ public class TodoTaskController {
@ApiOperation(value = "批量保存任务第一步")
@PostMapping("/batchSaveTaskFirst")
public Wrapper<String> batchSaveTaskFirst(@RequestBody List<ApproveDataVO> approveDataVOList) {
StringBuilder saveIdList = new StringBuilder();
List<BusProcessName> reNameList = new ArrayList<>();
List<BusProcessApprove> reAplist = new ArrayList<>();
for (ApproveDataVO approveDataVO : approveDataVOList) {
String dataJson = approveDataVO.getDataJson();
String submitJson = approveDataVO.getSubmitJson();
@@ -684,8 +685,6 @@ public class TodoTaskController {
String saveId = null;
String dataId = null;
if (approveDataVO.getId() != null && !approveDataVO.getId().equals("")) {
saveId = approveDataVO.getId();
saveIdList.append(","+saveId);
QueryWrapper<BusProcessName> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("CREAT_USER", approveDataVO.getCreateUser());
@@ -703,7 +702,7 @@ public class TodoTaskController {
null,reportId);
busProcessName.setDataId(dataId);
}
iBusProcessNameService.saveOrUpdate(busProcessName);
reNameList.add(busProcessName);
}
} else {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
@@ -721,15 +720,12 @@ public class TodoTaskController {
busProcessName.setCreatTime(time);
busProcessName.setCreatUserName(approveDataVO.getCreateUserName());
busProcessName.setSubmitStatus(SubmitStatusEnum.DRAFT.getValue());
iBusProcessNameService.save(busProcessName);
reNameList.add(busProcessName);
QueryWrapper<BusProcessName> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("CREAT_TIME", time);
queryWrapper.eq("CREATE_USER_NAME", approveDataVO.getCreateUserName());
queryWrapper.eq("PRC_TYPE", approveDataVO.getPrcType());
queryWrapper.eq("CREAT_USER", approveDataVO.getCreateUser());
// BusProcessName one = iBusProcessNameService.getOne(queryWrapper);
saveId = busProcessName.getId();
saveIdList.append(","+saveId);
}
//存储审批数据
if (StringUtils.isNotEmpty(submitJson)){
@@ -745,11 +741,12 @@ public class TodoTaskController {
busProcessApprove.setFromValsJson(submitJson);
busProcessApprove.setCreateUserId(approveDataVO.getCreateUser());
}
ibusProcessApproveService.saveOrUpdate(busProcessApprove);
reAplist.add(busProcessApprove);
}
}
String saveIdstring = saveIdList.substring(1, saveIdList.length());
return WrapMapper.ok(saveIdstring);
ibusProcessApproveService.saveOrUpdateBatch(reAplist);
iBusProcessNameService.saveOrUpdateBatch(reNameList);
return WrapMapper.ok();
}
/**