标准征求意见流程-转办

This commit is contained in:
wangzhijiang
2024-01-31 11:51:22 +08:00
parent 703ddd4a19
commit 1636746bb6
3 changed files with 34 additions and 0 deletions
@@ -428,6 +428,8 @@ public class TodoTaskController extends BaseAction {
} else if (StringUtils.equals(one.getPrcType(), FlowTypeEnum.ZCHGXXMSCLC.getValue())) {
this.changeZchgxxmscFlowAssignee(assignee, userId, pId, str);
}
this.busProcessHistoryService.changeUserIdByTaskId(str,assignee,userId);
}
}
@@ -30,4 +30,7 @@ public interface IBusProcessHistoryService extends IService<BusProcessHistory> {
void updateOrderNum(String actiProcInstId, int orderNum,int dataNum);
List<Map<String,Object>> getImgDataList(BusProcessHistory busProcessHistory);
// 根据taskId修改用户id
void changeUserIdByTaskId(String taskId,String afterUserId,String frontUserId);
}
@@ -277,6 +277,20 @@ public class IBusProcessHistoryServiceImpl extends ServiceImpl<BusProcessHistory
return result;
}
@Override
public void changeUserIdByTaskId(String taskId,String afterUserId,String frontUserId) {
if (StringUtils.isNotEmpty(taskId) && StringUtils.isNotEmpty(afterUserId) && StringUtils.isNotEmpty(frontUserId)) {
QueryWrapper<BusProcessHistory> bphQueryWrap = new QueryWrapper<>();
bphQueryWrap.lambda().eq(BusProcessHistory::getTaskId, taskId);
bphQueryWrap.lambda().eq(BusProcessHistory::getUserId,frontUserId);
BusProcessHistory bph = this.getOne(bphQueryWrap);
if (ObjectUtils.isNotEmpty(bph)) {
bph.setUserId(afterUserId);
this.updateById(bph);
}
}
}
/**
* 获取标准征求意见流程图数据
* @param bphList
@@ -320,6 +334,21 @@ public class IBusProcessHistoryServiceImpl extends ServiceImpl<BusProcessHistory
}).map(BusProcessHistory::getUserName).distinct().collect(Collectors.joining(","));
taskStatus = TaskStatusEnum.DONE.getValue();
for (BusProcessHistory busProcessHistory : bphListByTaskKey) {
if (StringUtils.equals(busProcessHistory.getIsMany(),"1")) {
List<BusProcessHistory> childList = bphList.stream().filter(bph -> StringUtils.equals(busProcessHistory.getId(), bph.getManyPId())).distinct().collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(childList)) {
for (BusProcessHistory history : childList) {
busProcessHistory.setTaskId(busProcessHistory.getId());
busProcessHistory.setTaskStatus(TaskStatusEnum.DONE.getValue());
if (StringUtils.equals(history.getTaskStatus(),TaskStatusEnum.TODO.getValue()) || StringUtils.equals(history.getTaskStatus(),TaskStatusEnum.RECEIVED.getValue())) {
busProcessHistory.setTaskStatus(TaskStatusEnum.TODO.getValue());
busProcessHistory.setTaskId(null);
break;
}
}
}
}
if (StringUtils.isEmpty(busProcessHistory.getTaskId())
|| StringUtils.equals(busProcessHistory.getTaskStatus(), TaskStatusEnum.TODO.getValue())
|| StringUtils.equals(busProcessHistory.getTaskStatus(), TaskStatusEnum.RECEIVED.getValue())) {