标准征求意见流程-流程图、流程历史对接

This commit is contained in:
wangzhijiang
2024-01-30 10:24:51 +08:00
parent 5e97b14f62
commit 703ddd4a19
2 changed files with 36 additions and 4 deletions
@@ -95,4 +95,12 @@ public class BusProcessHistory {
private String taskStatusShow; private String taskStatusShow;
@TableField(exist = false) @TableField(exist = false)
private String taskKeyShow; private String taskKeyShow;
@TableField(exist = false)
private String bpnId;
@TableField(exist = false)
private String prcId;
@TableField(exist = false)
private String prcName;
@TableField(exist = false)
private String prcNum;
} }
@@ -8,6 +8,7 @@ import com.ydw.bat.wkflow.business_auth.LawsUserInfoService;
import com.ydw.bat.wkflow.business_main.datas.entity.*; import com.ydw.bat.wkflow.business_main.datas.entity.*;
import com.ydw.bat.wkflow.business_main.datas.mapper.BusProcessHistoryMapper; import com.ydw.bat.wkflow.business_main.datas.mapper.BusProcessHistoryMapper;
import com.ydw.bat.wkflow.business_main.datas.service.IBusProcessHistoryService; import com.ydw.bat.wkflow.business_main.datas.service.IBusProcessHistoryService;
import com.ydw.bat.wkflow.business_main.datas.service.IBusProcessNameService;
import com.ydw.bat.wkflow.util.enums.FlowTypeEnum; import com.ydw.bat.wkflow.util.enums.FlowTypeEnum;
import com.ydw.bat.wkflow.util.enums.StandardCommentNewProcessNodeKeyEnum; import com.ydw.bat.wkflow.util.enums.StandardCommentNewProcessNodeKeyEnum;
import com.ydw.bat.wkflow.util.enums.TaskStatusEnum; import com.ydw.bat.wkflow.util.enums.TaskStatusEnum;
@@ -28,6 +29,9 @@ public class IBusProcessHistoryServiceImpl extends ServiceImpl<BusProcessHistory
@Autowired @Autowired
LawsUserInfoService lawsUserInfoService; LawsUserInfoService lawsUserInfoService;
@Autowired
private IBusProcessNameService busProcessNameService;
@Override @Override
public List<BusProcessHistory> queryFlowHistoryList(BusProcessHistory busProcessHistory) { public List<BusProcessHistory> queryFlowHistoryList(BusProcessHistory busProcessHistory) {
QueryWrapper<BusProcessHistory> bphQueryWrap = new QueryWrapper<>(); QueryWrapper<BusProcessHistory> bphQueryWrap = new QueryWrapper<>();
@@ -38,7 +42,7 @@ public class IBusProcessHistoryServiceImpl extends ServiceImpl<BusProcessHistory
); );
// bphQueryWrap.isNotNull("task_id"); // bphQueryWrap.isNotNull("task_id");
List<BusProcessHistory> bphList = this.list(bphQueryWrap); List<BusProcessHistory> bphList = this.list(bphQueryWrap);
this.disposeData(bphList); this.disposeData(bphList,busProcessHistory.getActiProcInstId());
List<BusProcessHistory> firstBphList = bphList.stream().filter(bph -> StringUtils.isEmpty(bph.getManyPId())).distinct().collect(Collectors.toList()); List<BusProcessHistory> firstBphList = bphList.stream().filter(bph -> StringUtils.isEmpty(bph.getManyPId())).distinct().collect(Collectors.toList());
for (BusProcessHistory processHistory : firstBphList) { for (BusProcessHistory processHistory : firstBphList) {
if (StringUtils.equals(processHistory.getIsMany(),"1")) { if (StringUtils.equals(processHistory.getIsMany(),"1")) {
@@ -119,9 +123,16 @@ public class IBusProcessHistoryServiceImpl extends ServiceImpl<BusProcessHistory
* *
* @param datas * @param datas
*/ */
private List<BusProcessHistory> disposeData(List<BusProcessHistory> datas) { private List<BusProcessHistory> disposeData(List<BusProcessHistory> datas,String actiProcInstId) {
List<BusProcessHistory> results = new ArrayList<>(); List<BusProcessHistory> results = new ArrayList<>();
if (CollectionUtils.isNotEmpty(datas)) { if (CollectionUtils.isNotEmpty(datas)) {
BusProcessName bpn = null;
if (StringUtils.isNotEmpty(actiProcInstId)) {
QueryWrapper<BusProcessName> bpnQueryWrap = new QueryWrapper<>();
bpnQueryWrap.lambda().eq(BusProcessName::getPrcId,actiProcInstId);
bpn = this.busProcessNameService.getOne(bpnQueryWrap);
}
for (BusProcessHistory data : datas) { for (BusProcessHistory data : datas) {
if (StringUtils.isNotEmpty(data.getUserId())) { if (StringUtils.isNotEmpty(data.getUserId())) {
ResponseMessage<UserVO> assignee = lawsUserInfoService.getByIdFeignClientWithDisabled(data.getUserId()); ResponseMessage<UserVO> assignee = lawsUserInfoService.getByIdFeignClientWithDisabled(data.getUserId());
@@ -144,6 +155,13 @@ public class IBusProcessHistoryServiceImpl extends ServiceImpl<BusProcessHistory
taskKeyShow = StandardCommentNewProcessNodeKeyEnum.getLableByValue(data.getTaskKey()); taskKeyShow = StandardCommentNewProcessNodeKeyEnum.getLableByValue(data.getTaskKey());
} }
data.setTaskKeyShow(taskKeyShow); data.setTaskKeyShow(taskKeyShow);
if (ObjectUtils.isNotEmpty(bpn)) {
data.setPrcName(bpn.getPrcName());
data.setPrcId(bpn.getPrcId());
data.setPrcNum(bpn.getPrcNum());
data.setBpnId(bpn.getId());
}
} }
} }
return results; return results;
@@ -246,7 +264,7 @@ public class IBusProcessHistoryServiceImpl extends ServiceImpl<BusProcessHistory
this.setQueryCondition(busProcessHistory, bphQueryWrap); this.setQueryCondition(busProcessHistory, bphQueryWrap);
bphQueryWrap.orderByAsc("order_num", "create_time"); bphQueryWrap.orderByAsc("order_num", "create_time");
List<BusProcessHistory> bphList = this.list(bphQueryWrap); List<BusProcessHistory> bphList = this.list(bphQueryWrap);
this.disposeData(bphList); this.disposeData(bphList,busProcessHistory.getActiProcInstId());
FlowTypeEnum flowTypeEnum = FlowTypeEnum.getFlowTypeEnumByValue(busProcessHistory.getFlowType()); FlowTypeEnum flowTypeEnum = FlowTypeEnum.getFlowTypeEnumByValue(busProcessHistory.getFlowType());
switch (flowTypeEnum) { switch (flowTypeEnum) {
@@ -293,7 +311,13 @@ public class IBusProcessHistoryServiceImpl extends ServiceImpl<BusProcessHistory
String taskStatus = ""; String taskStatus = "";
String userNames = ""; String userNames = "";
if (CollectionUtils.isNotEmpty(bphListByTaskKey)) { if (CollectionUtils.isNotEmpty(bphListByTaskKey)) {
userNames = bphListByTaskKey.stream().filter(bph -> StringUtils.isNotEmpty(bph.getUserName())).map(BusProcessHistory::getUserName).distinct().collect(Collectors.joining(",")); userNames = bphListByTaskKey.stream().filter(bph -> {
boolean flag = false;
if (StringUtils.isNotEmpty(bph.getUserName())) {
flag = true;
}
return flag;
}).map(BusProcessHistory::getUserName).distinct().collect(Collectors.joining(","));
taskStatus = TaskStatusEnum.DONE.getValue(); taskStatus = TaskStatusEnum.DONE.getValue();
for (BusProcessHistory busProcessHistory : bphListByTaskKey) { for (BusProcessHistory busProcessHistory : bphListByTaskKey) {
if (StringUtils.isEmpty(busProcessHistory.getTaskId()) if (StringUtils.isEmpty(busProcessHistory.getTaskId())