diff --git a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/common/StandardInterpretCommon.java b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/common/StandardInterpretCommon.java index 98f8d8bd..24fb37a5 100644 --- a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/common/StandardInterpretCommon.java +++ b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/common/StandardInterpretCommon.java @@ -37,6 +37,10 @@ public class StandardInterpretCommon { * 标准主解读人分发 */ public static final String MASTER_INTERPRET_DISTRIBUTE = "master_interpret_distribute"; + /** + * 标准主解读人重新分发(分发) + */ + public static final String MASTER_INTERPRET_AGAIN_DISTRIBUTE = "master_interpret_again_distribute"; /** * 解读人填写信息(分发) */ @@ -134,4 +138,9 @@ public class StandardInterpretCommon { * 唯一标识 */ public static final String SNOWFLAKE = "snowflake"; + + /** + * 唯一标识 + */ + public static final String PROJECT_ID = "projectId"; } diff --git a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/dto/StandardInterpretFlowDTO.java b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/dto/StandardInterpretFlowDTO.java index b518e6c7..ee01c202 100644 --- a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/dto/StandardInterpretFlowDTO.java +++ b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/dto/StandardInterpretFlowDTO.java @@ -5,6 +5,7 @@ import com.jero.modules.activiti.entity.ProcessApprovalRecord; import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import java.util.List; import java.util.Map; /** @@ -35,4 +36,8 @@ public class StandardInterpretFlowDTO { /**草稿信息json字符串*/ @ApiModelProperty(value = "草稿信息json字符串") private String infoJsonStr; + + /**流程全局删除ids*/ + @ApiModelProperty(value="流程全局删除ids") + private List processAllDelIds; } diff --git a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/entity/ProcessStandardInterpretClause.java b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/entity/ProcessStandardInterpretClause.java index 7eea27ad..7fa939fb 100644 --- a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/entity/ProcessStandardInterpretClause.java +++ b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/entity/ProcessStandardInterpretClause.java @@ -47,5 +47,8 @@ public class ProcessStandardInterpretClause extends BaseEntity { @ApiModelProperty(value = "分解单来源(字典)") @Dict(dicCode = "process_manuscript") private String decompositionSource; + /**是否驳回过(1:是 0:否)*/ + @ApiModelProperty(value = "是否驳回过(1:是 0:否)") + private String isReject; } diff --git a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/mapper/xml/ProcessStandardInterpretClauseMapper.xml b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/mapper/xml/ProcessStandardInterpretClauseMapper.xml index 2b881774..5cb07a1d 100644 --- a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/mapper/xml/ProcessStandardInterpretClauseMapper.xml +++ b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/mapper/xml/ProcessStandardInterpretClauseMapper.xml @@ -10,7 +10,8 @@ IF(lds.id is not null, null, lds2.item_content) itemContent, standard_interpret_id, psic.clause_id, - interpret_person_ids + interpret_person_ids, + is_reject from laws_chery_dev.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_document_split lds2 on psic.clause_id = lds2.id and lds2.del_flag = 0 diff --git a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/service/impl/ProcessStandardInterpretClauseServiceImpl.java b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/service/impl/ProcessStandardInterpretClauseServiceImpl.java index 738d7fb6..8f0c9a70 100644 --- a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/service/impl/ProcessStandardInterpretClauseServiceImpl.java +++ b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/service/impl/ProcessStandardInterpretClauseServiceImpl.java @@ -39,6 +39,9 @@ public class ProcessStandardInterpretClauseServiceImpl // 标准主解读人分发 节点查询未分发数据 queryWrapper.isNull("null".equals(processStandardInterpretClause.getInterpretPersonIds()), "interpret_person_ids"); + // 标准主解读人重新分发 节点查询驳回数据 + queryWrapper.eq(StringUtils.isNotBlank(processStandardInterpretClause.getIsReject()), + "is_reject", processStandardInterpretClause.getIsReject()); queryWrapper.orderByAsc("id"); return processStandardInterpretClauseMapper.queryList(queryWrapper); } diff --git a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/service/impl/StandardInterpretFlowServiceImpl.java b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/service/impl/StandardInterpretFlowServiceImpl.java index 62189f64..9af2f60b 100644 --- a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/service/impl/StandardInterpretFlowServiceImpl.java +++ b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/service/impl/StandardInterpretFlowServiceImpl.java @@ -200,6 +200,8 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe processNodeLinkService.saveNodeUserLink(processAll.getProcessDefinitionId(), processAll.getProcessInstanceId(), flowUtility.listToString(map)); + map.put(StandardInterpretCommon.PROJECT_ID, processAll.getProjectId()); + // 完成任务 taskService.complete(processAll.getTaskId(), map); @@ -239,8 +241,10 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe String taskDefinitionKey = delegateTask.getTaskDefinitionKey(); String processInstanceId = delegateTask.getProcessInstanceId(); + String projectId =(String) delegateTask.getVariable(StandardInterpretCommon.PROJECT_ID); + String snowflake =(String) delegateTask.getVariable(StandardInterpretCommon.SNOWFLAKE); ProcessAll processAlls = processAllService.getOne(new LambdaQueryWrapper() - .eq(ProcessAll::getProcessInstanceId, processInstanceId)); + .eq(ProcessAll::getProjectId, projectId)); String mainInstanceId =(String) delegateTask.getVariable(ActivitiCommon.MAIN_INSTANCE_ID); String masterInterpret =(String) delegateTask.getVariable(StandardInterpretCommon.MASTER_INTERPRET); @@ -305,8 +309,30 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe processAll.setProjectId(processAlls.getProjectId()); standardInterpretFlowDTO.setProcessAll(processAll); standardInterpretFlowDTO.setMap(variables); + ProcessApprovalRecord processApprovalRecord = new ProcessApprovalRecord(); + processApprovalRecord.setParentTaskId(taskId); +// processApprovalRecord.setUserId(interpretPersonId); + processApprovalRecord.setFinishFlag(FinishFlagEnum.INCOMPLETE.getValue()); + standardInterpretFlowDTO.setProcessApprovalRecord(processApprovalRecord); childrenFlowStart2(standardInterpretFlowDTO); - log.info("发起 标准解读流程(子解读人流程)"); + + // 处理数据 + ProcessStandardInterpretClauseSublist processStandardInterpretClauseSublist = + processStandardInterpretClauseSublistService.getOne( + new LambdaQueryWrapper() + .eq(ProcessStandardInterpretClauseSublist::getSnowFlake, snowflake)); + // 清除中间表解读人 + processStandardInterpretClauseService.update( + new LambdaUpdateWrapper() + .eq(ProcessStandardInterpretClause::getId, + processStandardInterpretClauseSublist.getStandardInterpretClauseId()) + .set(ProcessStandardInterpretClause::getInterpretPersonIds, null)); + + // 删除旧分发数据 + processStandardInterpretClauseSublistService.remove( + new LambdaQueryWrapper() + .eq(ProcessStandardInterpretClauseSublist::getStandardInterpretClauseId, + processStandardInterpretClauseSublist.getStandardInterpretClauseId())); }else if (StandardInterpretCommon.MASTER_INTERPRET_SUMMARY.equals(taskDefinitionKey)){ // 标准主解读汇总 合并条款 ProcessStandardInterpret processStandardInterpret = processStandardInterpretService.getOne( @@ -490,6 +516,10 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe if (StandardInterpretCommon.MASTER_INTERPRET_DISTRIBUTE.equals(node)){ processStandardInterpretClause.setInterpretPersonIds("null"); } + // 标准主解读人重新分发(分发) + if (StandardInterpretCommon.MASTER_INTERPRET_AGAIN_DISTRIBUTE.equals(node)){ + processStandardInterpretClause.setIsReject(YesOrNoEnum.YES.getValue()); + } processStandardInterpretClauseList = processStandardInterpretClauseService.queryList(processStandardInterpretClause); } @@ -1065,6 +1095,8 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe private void handleBusinessData(StandardInterpretFlowDTO standardInterpretFlowDTO) { // map(参数) Map map = standardInterpretFlowDTO.getMap(); + // 流程全局删除ids + List processAllDelIds = standardInterpretFlowDTO.getProcessAllDelIds(); StandardInterpretDTO data = standardInterpretFlowDTO.getData(); // 标准解读流程 ProcessStandardInterpret processStandardInterpret = data.getProcessStandardInterpret(); @@ -1122,18 +1154,20 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe // 标准主解读人 map.put(StandardInterpretCommon.MASTER_INTERPRET, processStandardInterpret.getMasterInterpretId()); break; - // 标准主解读人分发 + // 标准主解读人分发 case StandardInterpretCommon.MASTER_INTERPRET_DISTRIBUTE: + // 标准主解读人重新分发(分发) + case StandardInterpretCommon.MASTER_INTERPRET_AGAIN_DISTRIBUTE: if (YesOrNoEnum.YES.getValue().equals(processStandardInterpret.getIsDistribute())){ // 分发 // 删除旧数据 - List clauseIdList2 = processStandardInterpretClauseList.stream() - .map(ProcessStandardInterpretClause::getId) - .collect(Collectors.toList()); - LambdaQueryWrapper removeQueryWrapper2 = new LambdaQueryWrapper<>(); - removeQueryWrapper2.notIn(ProcessStandardInterpretClause::getId, clauseIdList2); - removeQueryWrapper2.eq(ProcessStandardInterpretClause::getStandardInterpretId, standardInterpretId); - processStandardInterpretClauseService.remove(removeQueryWrapper2); +// List clauseIdList2 = processStandardInterpretClauseList.stream() +// .map(ProcessStandardInterpretClause::getId) +// .collect(Collectors.toList()); +// LambdaQueryWrapper removeQueryWrapper2 = new LambdaQueryWrapper<>(); +// removeQueryWrapper2.notIn(ProcessStandardInterpretClause::getId, clauseIdList2); +// removeQueryWrapper2.eq(ProcessStandardInterpretClause::getStandardInterpretId, standardInterpretId); + processStandardInterpretClauseService.removeByIds(processAllDelIds); // 更新 标准解读流程_条款中间表 processStandardInterpretClauseService.saveOrUpdateBatch(processStandardInterpretClauseList);