fix(89311): 解读人驳回后,主解读人列表数据逻辑调整
This commit is contained in:
+12
-14
@@ -430,12 +430,8 @@ public class MyGlobalEventListener implements ActivitiEventListener {
|
|||||||
StandardInterpretCommon.KEY_3.equals(processDefinition)) {
|
StandardInterpretCommon.KEY_3.equals(processDefinition)) {
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
TaskService taskService = SpringContextUtil.getBean(TaskService.class);
|
TaskService taskService = SpringContextUtil.getBean(TaskService.class);
|
||||||
if (StandardInterpretCommon.KEY_1.equals(processDefinition)) {
|
boolean b = isChildrenNodeAllComplete(processInstanceId, parentTaskId);
|
||||||
boolean b = isChildrenNodeAllComplete(processInstanceId, parentTaskId);
|
if (b) {
|
||||||
if (b) {
|
|
||||||
taskService.complete(parentTaskId);
|
|
||||||
}
|
|
||||||
}else {
|
|
||||||
taskService.complete(parentTaskId);
|
taskService.complete(parentTaskId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -518,23 +514,25 @@ public class MyGlobalEventListener implements ActivitiEventListener {
|
|||||||
* @return true:都完成 false:未都完成
|
* @return true:都完成 false:未都完成
|
||||||
*/
|
*/
|
||||||
private boolean isChildrenNodeAllComplete(String processInstanceId, String parentTaskId) {
|
private boolean isChildrenNodeAllComplete(String processInstanceId, String parentTaskId) {
|
||||||
|
ProcessApprovalRecordService processApprovalRecordService =
|
||||||
|
SpringContextUtil.getBean(ProcessApprovalRecordService.class);
|
||||||
// 判断当前parentTaskId是否是第一个自动处理任务节点
|
// 判断当前parentTaskId是否是第一个自动处理任务节点
|
||||||
ProcessApprovalRecordService processApprovalRecordService = SpringContextUtil.getBean(ProcessApprovalRecordService.class);
|
ProcessApprovalRecord firstNodeTask = processApprovalRecordService.getOne(
|
||||||
int count = processApprovalRecordService.count(
|
|
||||||
new LambdaQueryWrapper<ProcessApprovalRecord>()
|
new LambdaQueryWrapper<ProcessApprovalRecord>()
|
||||||
.eq(ProcessApprovalRecord::getProcessInstanceId, processInstanceId)
|
.eq(ProcessApprovalRecord::getProcessInstanceId, processInstanceId)
|
||||||
.eq(ProcessApprovalRecord::getNodeId, StandardInterpretCommon.INTERPRETING_PEOPLE_FILLOUT)
|
.eq(ProcessApprovalRecord::getNodeId, StandardInterpretCommon.INTERPRETING_PEOPLE_FILLOUT)
|
||||||
.eq(ProcessApprovalRecord::getParentTaskId, parentTaskId));
|
.orderByAsc(ProcessApprovalRecord::getCreateTime)
|
||||||
if (count > 0) {
|
.last("limit 1"), false);
|
||||||
// 判断子流程是否还有未完成的节点
|
if (firstNodeTask.getParentTaskId().equals(parentTaskId)){
|
||||||
int childCount = processApprovalRecordService.count(
|
// 判断所有子流程是否都完成
|
||||||
|
int count = processApprovalRecordService.count(
|
||||||
new LambdaQueryWrapper<ProcessApprovalRecord>()
|
new LambdaQueryWrapper<ProcessApprovalRecord>()
|
||||||
.eq(ProcessApprovalRecord::getProcessInstanceId, processInstanceId)
|
.eq(ProcessApprovalRecord::getProcessInstanceId, processInstanceId)
|
||||||
.isNotNull(ProcessApprovalRecord::getParentTaskId)
|
.isNotNull(ProcessApprovalRecord::getParentTaskId)
|
||||||
.eq(ProcessApprovalRecord::getFinishFlag, FinishFlagEnum.INCOMPLETE.getValue()));
|
.eq(ProcessApprovalRecord::getFinishFlag, FinishFlagEnum.INCOMPLETE.getValue()));
|
||||||
return childCount == 0;
|
return count == 0;
|
||||||
}
|
}
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+3
@@ -26,6 +26,9 @@ public class ProcessStandardInterpretClause extends BaseEntity {
|
|||||||
/**条款id/标准id*/
|
/**条款id/标准id*/
|
||||||
@ApiModelProperty(value = "条款id/标准id")
|
@ApiModelProperty(value = "条款id/标准id")
|
||||||
private String clauseId;
|
private String clauseId;
|
||||||
|
/**唯一标识*/
|
||||||
|
@ApiModelProperty(value = "唯一标识")
|
||||||
|
private String snowFlake;
|
||||||
/**条款号/标准编号*/
|
/**条款号/标准编号*/
|
||||||
@ApiModelProperty(value = "条款号/标准编号")
|
@ApiModelProperty(value = "条款号/标准编号")
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
|
|||||||
+2
-1
@@ -13,7 +13,8 @@
|
|||||||
psic.clause_id,
|
psic.clause_id,
|
||||||
interpret_person_ids,
|
interpret_person_ids,
|
||||||
is_reject,
|
is_reject,
|
||||||
is_distribute
|
is_distribute,
|
||||||
|
snow_flake
|
||||||
from process_standard_interpret_clause psic
|
from process_standard_interpret_clause psic
|
||||||
left join laws_domestic_standard lds on psic.clause_id = lds.id and lds.del_flag = 0
|
left join laws_domestic_standard lds on psic.clause_id = lds.id and lds.del_flag = 0
|
||||||
left join laws_document_split lds2 on psic.clause_id = lds2.id and lds2.del_flag = 0
|
left join laws_document_split lds2 on psic.clause_id = lds2.id and lds2.del_flag = 0
|
||||||
|
|||||||
+2
@@ -42,6 +42,8 @@ public class ProcessStandardInterpretClauseServiceImpl
|
|||||||
// 标准主解读人重新分发 节点查询驳回数据
|
// 标准主解读人重新分发 节点查询驳回数据
|
||||||
queryWrapper.eq(StringUtils.isNotBlank(processStandardInterpretClause.getIsReject()),
|
queryWrapper.eq(StringUtils.isNotBlank(processStandardInterpretClause.getIsReject()),
|
||||||
"is_reject", processStandardInterpretClause.getIsReject());
|
"is_reject", processStandardInterpretClause.getIsReject());
|
||||||
|
queryWrapper.like(StringUtils.isNotBlank(processStandardInterpretClause.getSnowFlake()),
|
||||||
|
"snow_flake", processStandardInterpretClause.getSnowFlake());
|
||||||
queryWrapper.orderByAsc("id");
|
queryWrapper.orderByAsc("id");
|
||||||
return processStandardInterpretClauseMapper.queryList(queryWrapper);
|
return processStandardInterpretClauseMapper.queryList(queryWrapper);
|
||||||
}
|
}
|
||||||
|
|||||||
+38
-12
@@ -445,6 +445,8 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe
|
|||||||
}else if (StandardInterpretCommon.AUTO_TASK_2.equals(taskDefinitionKey)){
|
}else if (StandardInterpretCommon.AUTO_TASK_2.equals(taskDefinitionKey)){
|
||||||
StandardInterpretFlowDTO standardInterpretFlowDTO = new StandardInterpretFlowDTO();
|
StandardInterpretFlowDTO standardInterpretFlowDTO = new StandardInterpretFlowDTO();
|
||||||
// 流程信息
|
// 流程信息
|
||||||
|
String newSnowFlake = String.valueOf(SnowflakeUtils.snowflake());
|
||||||
|
variables.put(StandardInterpretCommon.SNOWFLAKE, newSnowFlake);
|
||||||
ProcessAll processAll = new ProcessAll();
|
ProcessAll processAll = new ProcessAll();
|
||||||
processAll.setProjectId(processAlls.getProjectId());
|
processAll.setProjectId(processAlls.getProjectId());
|
||||||
standardInterpretFlowDTO.setProcessAll(processAll);
|
standardInterpretFlowDTO.setProcessAll(processAll);
|
||||||
@@ -461,15 +463,26 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe
|
|||||||
processStandardInterpretClauseSublistService.list(
|
processStandardInterpretClauseSublistService.list(
|
||||||
new LambdaQueryWrapper<ProcessStandardInterpretClauseSublist>()
|
new LambdaQueryWrapper<ProcessStandardInterpretClauseSublist>()
|
||||||
.eq(ProcessStandardInterpretClauseSublist::getSnowFlake, snowflake));
|
.eq(ProcessStandardInterpretClauseSublist::getSnowFlake, snowflake));
|
||||||
// 清除中间表解读人,设置驳回标识
|
// 清除中间表解读人,设置驳回标识,设置唯一标识
|
||||||
processStandardInterpretClauseService.update(
|
List<String> standardInterpretClauseIdList = processStandardInterpretClauseSublistList.stream()
|
||||||
new LambdaUpdateWrapper<ProcessStandardInterpretClause>()
|
.map(ProcessStandardInterpretClauseSublist::getStandardInterpretClauseId)
|
||||||
.in(ProcessStandardInterpretClause::getId,
|
.collect(Collectors.toList());
|
||||||
processStandardInterpretClauseSublistList.stream()
|
List<ProcessStandardInterpretClause> processStandardInterpretClauseList =
|
||||||
.map(ProcessStandardInterpretClauseSublist::getStandardInterpretClauseId)
|
processStandardInterpretClauseService.listByIds(standardInterpretClauseIdList);
|
||||||
.collect(Collectors.toList()))
|
|
||||||
.set(ProcessStandardInterpretClause::getIsReject, YesOrNoEnum.YES.getValue())
|
for (ProcessStandardInterpretClause processStandardInterpretClause : processStandardInterpretClauseList) {
|
||||||
.set(ProcessStandardInterpretClause::getInterpretPersonIds, null));
|
LambdaUpdateWrapper<ProcessStandardInterpretClause> qw = new LambdaUpdateWrapper<>();
|
||||||
|
qw.eq(ProcessStandardInterpretClause::getId, processStandardInterpretClause.getId());
|
||||||
|
qw.set(ProcessStandardInterpretClause::getIsReject, YesOrNoEnum.YES.getValue());
|
||||||
|
qw.set(ProcessStandardInterpretClause::getInterpretPersonIds, null);
|
||||||
|
String snowFlake = processStandardInterpretClause.getSnowFlake();
|
||||||
|
if (StringUtils.isNotBlank(snowFlake)){
|
||||||
|
qw.set(ProcessStandardInterpretClause::getSnowFlake, snowFlake + "," + newSnowFlake);
|
||||||
|
}else {
|
||||||
|
qw.set(ProcessStandardInterpretClause::getSnowFlake, newSnowFlake);
|
||||||
|
}
|
||||||
|
processStandardInterpretClauseService.update(qw);
|
||||||
|
}
|
||||||
|
|
||||||
// 删除旧分发数据
|
// 删除旧分发数据
|
||||||
processStandardInterpretClauseSublistService.remove(
|
processStandardInterpretClauseSublistService.remove(
|
||||||
@@ -706,7 +719,7 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe
|
|||||||
String node = StringUtils.isNotBlank(processApprovalRecord.getNodeId())
|
String node = StringUtils.isNotBlank(processApprovalRecord.getNodeId())
|
||||||
? processApprovalRecord.getNodeId() : StandardInterpretCommon.REGULATORY_ENGINEER_START;
|
? processApprovalRecord.getNodeId() : StandardInterpretCommon.REGULATORY_ENGINEER_START;
|
||||||
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||||
|
String taskId = processApprovalRecord.getTaskId();
|
||||||
// 通过 projectId 查询 标准解读流程
|
// 通过 projectId 查询 标准解读流程
|
||||||
processStandardInterpret.setProjectId(projectId);
|
processStandardInterpret.setProjectId(projectId);
|
||||||
processStandardInterpret = processStandardInterpretService.queryOne(processStandardInterpret);
|
processStandardInterpret = processStandardInterpretService.queryOne(processStandardInterpret);
|
||||||
@@ -723,7 +736,10 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe
|
|||||||
}
|
}
|
||||||
// 标准主解读人重新分发(分发)
|
// 标准主解读人重新分发(分发)
|
||||||
if (StandardInterpretCommon.MASTER_INTERPRET_AGAIN_DISTRIBUTE.equals(node)){
|
if (StandardInterpretCommon.MASTER_INTERPRET_AGAIN_DISTRIBUTE.equals(node)){
|
||||||
processStandardInterpretClause.setIsReject(YesOrNoEnum.YES.getValue());
|
Task task = taskService.createTaskQuery().taskId(taskId).singleResult();
|
||||||
|
Object variable = runtimeService.getVariable(task.getExecutionId(), StandardInterpretCommon.SNOWFLAKE);
|
||||||
|
processStandardInterpretClause.setSnowFlake(String.valueOf(variable));
|
||||||
|
// processStandardInterpretClause.setIsReject(YesOrNoEnum.YES.getValue());
|
||||||
}
|
}
|
||||||
processStandardInterpretClauseList =
|
processStandardInterpretClauseList =
|
||||||
processStandardInterpretClauseService.queryList(processStandardInterpretClause);
|
processStandardInterpretClauseService.queryList(processStandardInterpretClause);
|
||||||
@@ -749,7 +765,6 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe
|
|||||||
ProcessStandardInterpretClauseSublist processStandardInterpretClauseSublist =
|
ProcessStandardInterpretClauseSublist processStandardInterpretClauseSublist =
|
||||||
new ProcessStandardInterpretClauseSublist();
|
new ProcessStandardInterpretClauseSublist();
|
||||||
processStandardInterpretClauseSublist.setStandardInterpretId(processStandardInterpret.getId());
|
processStandardInterpretClauseSublist.setStandardInterpretId(processStandardInterpret.getId());
|
||||||
String taskId = processApprovalRecord.getTaskId();
|
|
||||||
// 解读人填写信息(分发)
|
// 解读人填写信息(分发)
|
||||||
if (StandardInterpretCommon.INTERPRETING_PEOPLE_FILLOUT.equals(node)){
|
if (StandardInterpretCommon.INTERPRETING_PEOPLE_FILLOUT.equals(node)){
|
||||||
Task task = taskService.createTaskQuery().taskId(taskId).singleResult();
|
Task task = taskService.createTaskQuery().taskId(taskId).singleResult();
|
||||||
@@ -1776,6 +1791,14 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe
|
|||||||
interpretPersonIdList.add(interpretPersonId);
|
interpretPersonIdList.add(interpretPersonId);
|
||||||
distributeIdSubList.add(id);
|
distributeIdSubList.add(id);
|
||||||
}
|
}
|
||||||
|
// 重新分发节点特殊处理
|
||||||
|
if (StandardInterpretCommon.MASTER_INTERPRET_AGAIN_DISTRIBUTE.equals(node)){
|
||||||
|
// 重置 各涉及部门解读人
|
||||||
|
processStandardInterpretClauseService.update(
|
||||||
|
new LambdaUpdateWrapper<ProcessStandardInterpretClause>()
|
||||||
|
.eq(ProcessStandardInterpretClause::getId, StandardInterpretClause.getId())
|
||||||
|
.set(ProcessStandardInterpretClause::getInterpretPersonIds, null));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// 设置未分配数量
|
// 设置未分配数量
|
||||||
map.put(StandardInterpretCommon.UNALLOCATED_QUANTITY, unallocatedQuantity);
|
map.put(StandardInterpretCommon.UNALLOCATED_QUANTITY, unallocatedQuantity);
|
||||||
@@ -1869,6 +1892,9 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe
|
|||||||
if (pass){
|
if (pass){
|
||||||
processStandardInterpretClauseSublistService
|
processStandardInterpretClauseSublistService
|
||||||
.saveOrUpdateBatch(processStandardInterpretClauseSublistList);
|
.saveOrUpdateBatch(processStandardInterpretClauseSublistList);
|
||||||
|
}else {
|
||||||
|
// 驳回
|
||||||
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
// 会签(分发)
|
// 会签(分发)
|
||||||
|
|||||||
Reference in New Issue
Block a user