fix(标准解读流程): 解读人分发逻辑修改
This commit is contained in:
+50
-45
@@ -348,55 +348,56 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe
|
||||
queryWrapper.in(ProcessStandardInterpretClause::getId,
|
||||
Arrays.asList(distributeIdList.split(",")));
|
||||
}
|
||||
List<ProcessStandardInterpretClause> processStandardInterpretClauseList =
|
||||
processStandardInterpretClauseService.list(queryWrapper);
|
||||
for (ProcessStandardInterpretClause processStandardInterpretClause :
|
||||
processStandardInterpretClauseList) {
|
||||
LambdaQueryWrapper<ProcessStandardInterpretClauseSublist> queryWrapper1 =
|
||||
new LambdaQueryWrapper<>();
|
||||
queryWrapper1.eq(ProcessStandardInterpretClauseSublist::getStandardInterpretClauseId,
|
||||
processStandardInterpretClause.getId());
|
||||
if (StringUtils.isNotBlank(distributeIdSubList)){
|
||||
queryWrapper1.in(ProcessStandardInterpretClauseSublist::getId,
|
||||
Arrays.asList(distributeIdSubList.split(",")));
|
||||
}
|
||||
List<ProcessStandardInterpretClauseSublist> list =
|
||||
processStandardInterpretClauseSublistService.list(queryWrapper1);
|
||||
for (ProcessStandardInterpretClauseSublist processStandardInterpretClauseSublist : list) {
|
||||
// 解读人
|
||||
String interpretPersonId = processStandardInterpretClauseSublist.getInterpretPersonId();
|
||||
variables.put(StandardInterpretCommon.INTERPRETING_PEOPLE, interpretPersonId);
|
||||
StandardInterpretFlowDTO standardInterpretFlowDTO = new StandardInterpretFlowDTO();
|
||||
// 流程信息
|
||||
ProcessAll processAll = new ProcessAll();
|
||||
processAll.setProjectId(processAlls.getProjectId());
|
||||
standardInterpretFlowDTO.setProcessAll(processAll);
|
||||
ProcessApprovalRecord processApprovalRecord = new ProcessApprovalRecord();
|
||||
processApprovalRecord.setParentTaskId(taskId);
|
||||
processApprovalRecord.setUserId(interpretPersonId);
|
||||
processApprovalRecord.setFinishFlag(FinishFlagEnum.INCOMPLETE.getValue());
|
||||
standardInterpretFlowDTO.setProcessApprovalRecord(processApprovalRecord);
|
||||
standardInterpretFlowDTO.setMap(variables);
|
||||
// 添加唯一标识,用于数据权限
|
||||
String snowFlake = String.valueOf(SnowflakeUtils.snowflake());
|
||||
variables.put(StandardInterpretCommon.SNOWFLAKE, snowFlake);
|
||||
// 发起子流程
|
||||
childrenFlowStart(standardInterpretFlowDTO);
|
||||
|
||||
processStandardInterpretClauseService.update(
|
||||
new LambdaUpdateWrapper<ProcessStandardInterpretClause>()
|
||||
.eq(ProcessStandardInterpretClause::getId,
|
||||
processStandardInterpretClause.getId())
|
||||
.set(ProcessStandardInterpretClause::getIsDistribute,
|
||||
YesOrNoEnum.YES.getValue()));
|
||||
// 根据解读人分组
|
||||
Map<String, List<ProcessStandardInterpretClauseSublist>> mapList = list.stream()
|
||||
.collect(Collectors.groupingBy(ProcessStandardInterpretClauseSublist::getInterpretPersonId));
|
||||
mapList.forEach((k, v) -> {
|
||||
|
||||
processStandardInterpretClauseSublistService.update(
|
||||
new LambdaUpdateWrapper<ProcessStandardInterpretClauseSublist>()
|
||||
.eq(ProcessStandardInterpretClauseSublist::getId,
|
||||
processStandardInterpretClauseSublist.getId())
|
||||
.set(ProcessStandardInterpretClauseSublist::getSnowFlake, snowFlake));
|
||||
}
|
||||
}
|
||||
// 解读人
|
||||
String interpretPersonId = k;
|
||||
variables.put(StandardInterpretCommon.INTERPRETING_PEOPLE, interpretPersonId);
|
||||
StandardInterpretFlowDTO standardInterpretFlowDTO = new StandardInterpretFlowDTO();
|
||||
// 流程信息
|
||||
ProcessAll processAll = new ProcessAll();
|
||||
processAll.setProjectId(processAlls.getProjectId());
|
||||
standardInterpretFlowDTO.setProcessAll(processAll);
|
||||
ProcessApprovalRecord processApprovalRecord = new ProcessApprovalRecord();
|
||||
processApprovalRecord.setParentTaskId(taskId);
|
||||
processApprovalRecord.setUserId(interpretPersonId);
|
||||
processApprovalRecord.setFinishFlag(FinishFlagEnum.INCOMPLETE.getValue());
|
||||
standardInterpretFlowDTO.setProcessApprovalRecord(processApprovalRecord);
|
||||
standardInterpretFlowDTO.setMap(variables);
|
||||
// 添加唯一标识,用于数据权限
|
||||
String snowFlake = String.valueOf(SnowflakeUtils.snowflake());
|
||||
variables.put(StandardInterpretCommon.SNOWFLAKE, snowFlake);
|
||||
// 发起子流程
|
||||
childrenFlowStart(standardInterpretFlowDTO);
|
||||
|
||||
processStandardInterpretClauseService.update(
|
||||
new LambdaUpdateWrapper<ProcessStandardInterpretClause>()
|
||||
.in(ProcessStandardInterpretClause::getId,
|
||||
v.stream().map(ProcessStandardInterpretClauseSublist
|
||||
::getStandardInterpretClauseId)
|
||||
.collect(Collectors.toList()))
|
||||
.set(ProcessStandardInterpretClause::getIsDistribute,
|
||||
YesOrNoEnum.YES.getValue()));
|
||||
|
||||
processStandardInterpretClauseSublistService.update(
|
||||
new LambdaUpdateWrapper<ProcessStandardInterpretClauseSublist>()
|
||||
.in(ProcessStandardInterpretClauseSublist::getId,
|
||||
v.stream().map(ProcessStandardInterpretClauseSublist::getId)
|
||||
.collect(Collectors.toList()))
|
||||
.set(ProcessStandardInterpretClauseSublist::getSnowFlake, snowFlake));
|
||||
});
|
||||
|
||||
}
|
||||
}else if (StandardInterpretCommon.AUTO_TASK_2.equals(taskDefinitionKey)){
|
||||
@@ -414,23 +415,27 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe
|
||||
childrenFlowStart2(standardInterpretFlowDTO);
|
||||
|
||||
// 处理数据
|
||||
ProcessStandardInterpretClauseSublist processStandardInterpretClauseSublist =
|
||||
processStandardInterpretClauseSublistService.getOne(
|
||||
List<ProcessStandardInterpretClauseSublist> processStandardInterpretClauseSublistList =
|
||||
processStandardInterpretClauseSublistService.list(
|
||||
new LambdaQueryWrapper<ProcessStandardInterpretClauseSublist>()
|
||||
.eq(ProcessStandardInterpretClauseSublist::getSnowFlake, snowflake));
|
||||
// 清除中间表解读人,设置驳回标识
|
||||
processStandardInterpretClauseService.update(
|
||||
new LambdaUpdateWrapper<ProcessStandardInterpretClause>()
|
||||
.eq(ProcessStandardInterpretClause::getId,
|
||||
processStandardInterpretClauseSublist.getStandardInterpretClauseId())
|
||||
.in(ProcessStandardInterpretClause::getId,
|
||||
processStandardInterpretClauseSublistList.stream()
|
||||
.map(ProcessStandardInterpretClauseSublist::getStandardInterpretClauseId)
|
||||
.collect(Collectors.toList()))
|
||||
.set(ProcessStandardInterpretClause::getIsReject, YesOrNoEnum.YES.getValue())
|
||||
.set(ProcessStandardInterpretClause::getInterpretPersonIds, null));
|
||||
|
||||
// 删除旧分发数据
|
||||
processStandardInterpretClauseSublistService.remove(
|
||||
new LambdaQueryWrapper<ProcessStandardInterpretClauseSublist>()
|
||||
.eq(ProcessStandardInterpretClauseSublist::getStandardInterpretClauseId,
|
||||
processStandardInterpretClauseSublist.getStandardInterpretClauseId())
|
||||
.in(ProcessStandardInterpretClauseSublist::getStandardInterpretClauseId,
|
||||
processStandardInterpretClauseSublistList.stream()
|
||||
.map(ProcessStandardInterpretClauseSublist::getStandardInterpretClauseId)
|
||||
.collect(Collectors.toList()))
|
||||
.eq(ProcessStandardInterpretClauseSublist::getSnowFlake, snowflake));
|
||||
}else if (StandardInterpretCommon.MASTER_INTERPRET_SUMMARY.equals(taskDefinitionKey)){
|
||||
// 标准主解读汇总 合并条款
|
||||
|
||||
Reference in New Issue
Block a user