diff --git a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/controller/StandardInterpretFlowController.java b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/controller/StandardInterpretFlowController.java index ae94139e..dd5b739a 100644 --- a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/controller/StandardInterpretFlowController.java +++ b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/controller/StandardInterpretFlowController.java @@ -74,7 +74,7 @@ public class StandardInterpretFlowController { @AutoLog(value = "标准解读流程-查询条款列表", operateType = CommonConstant.OPERATE_TYPE_1) @ApiOperation(value="标准解读流程-查询条款列表", notes="标准解读流程-查询条款列表") @GetMapping(value = "/getClauseList") - public Result> getClauseList(String standardId,String fileType) { + public Result> getClauseList(String standardId, String fileType) { return Result.OK(standardInterpretFlowService.getClauseList(standardId, fileType)); } 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 93ef8123..b518e6c7 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 @@ -31,4 +31,8 @@ public class StandardInterpretFlowDTO { /**map(参数)*/ @ApiModelProperty(value = "map(参数)") private Map map; + + /**草稿信息json字符串*/ + @ApiModelProperty(value = "草稿信息json字符串") + private String infoJsonStr; } diff --git a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/entity/ProcessStandardInterpret.java b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/entity/ProcessStandardInterpret.java index 5abe4a6e..6d5c695d 100644 --- a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/entity/ProcessStandardInterpret.java +++ b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/entity/ProcessStandardInterpret.java @@ -48,7 +48,13 @@ public class ProcessStandardInterpret extends BaseEntity { @ApiModelProperty(value = "实施日期") @TableField(exist = false) private java.util.Date implementationDate; - /**在产车实施日期*/ + /**新生产车实施日*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") + @DateTimeFormat(pattern="yyyy-MM-dd") + @ApiModelProperty(value = "新生产车实施日期") + @TableField(exist = false) + private java.lang.String newProductImplDate; + /**新认证车实施日期*/ @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") @DateTimeFormat(pattern="yyyy-MM-dd") @ApiModelProperty(value = "新认证车实施日期") diff --git a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/mapper/xml/ProcessStandardInterpretMapper.xml b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/mapper/xml/ProcessStandardInterpretMapper.xml index 5bc6a053..876f5813 100644 --- a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/mapper/xml/ProcessStandardInterpretMapper.xml +++ b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/mapper/xml/ProcessStandardInterpretMapper.xml @@ -10,6 +10,7 @@ lds.standard_state, lds.implementation_date, lds.new_auth_impl_date, + lds.new_product_impl_date, master_interpret_id, parent_id, standard_id, 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 8627099b..e50d646c 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 @@ -22,7 +22,6 @@ import com.jero.modules.activiti.process.common.enums.ProcessType; import com.jero.modules.activiti.process.common.utility.FlowUtility; import com.jero.modules.activiti.process.fb.service.IProcessHandleService; import com.jero.modules.activiti.process.standardinterpret.common.StandardInterpretCommon; -import com.jero.modules.activiti.process.standardinterpret.controller.ProcessStandardInterpretClauseSublistController; import com.jero.modules.activiti.process.standardinterpret.dto.StandardInterpretDTO; import com.jero.modules.activiti.process.standardinterpret.dto.StandardInterpretFlowDTO; import com.jero.modules.activiti.process.standardinterpret.entity.ProcessStandardInterpret; @@ -107,7 +106,6 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe private final ProcessStandardInterpretClauseService processStandardInterpretClauseService; private final ProcessStandardInterpretClauseSublistService processStandardInterpretClauseSublistService; private final ILawsDomesticStandardService lawsDomesticStandardService; - private final ProcessStandardInterpretClauseSublistController processStandardInterpretClauseSublist; private final IProcessHandleService processHandleService; private final ISarFileSplitInfoService sarFileSplitInfoService; private final DocumentSplitMapper documentSplitMapper; @@ -957,8 +955,15 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe // 法规工程师发起 case StandardInterpretCommon.REGULATORY_ENGINEER_START: processStandardInterpretService.saveOrUpdate(processStandardInterpret); + // 如果没选择条款 + if (CollectionUtils.isEmpty(processStandardInterpretClauseList)){ + // 自动保存所有条款 + processStandardInterpretClauseList = + getClauseList(processStandardInterpret.getStandardId(), + processStandardInterpret.getDecompositionSource()); + } + // 设置关联关系 for (ProcessStandardInterpretClause standardInterpretClause : processStandardInterpretClauseList) { -// standardInterpretClause.setId(String.valueOf(SnowflakeUtils.snowflake())); standardInterpretClause.setDecompositionSource(processStandardInterpret.getDecompositionSource()); standardInterpretClause.setStandardInterpretId(standardInterpretId); } @@ -984,8 +989,18 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe case StandardInterpretCommon.MASTER_INTERPRET_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); + // 更新 标准解读流程_条款中间表 processStandardInterpretClauseService.saveOrUpdateBatch(processStandardInterpretClauseList); + // 生成 标准解读流程_条款中间表_子表 数据 List processStandardInterpretClauseSublists = new ArrayList<>(); @@ -1015,7 +1030,7 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe // 设置子解读人 map.put(StandardInterpretCommon.INTERPRETING_PEOPLE, new ArrayList<>(interpretPersonIdList)); // 设置主流程实例id - map.put(ActivitiCommon.MAIN_INSTANCE_ID, String.valueOf(SnowflakeUtils.snowflake())); + map.put(ActivitiCommon.MAIN_INSTANCE_ID, standardInterpretFlowDTO.getProcessAll().getProcessInstanceId()); processStandardInterpretClauseSublistService.saveBatch(processStandardInterpretClauseSublists); }else { // 保存会签人员、审核人员、批准人员 @@ -1083,7 +1098,6 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe .saveOrUpdateBatch(processStandardInterpretClauseSublistList); break; } - } private Task startProcessInstanceByKey(String key, Map map, ProcessAll processAll, @@ -1118,12 +1132,17 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe if (!Objects.isNull(task)){ processApprovalRecordUpdate.eq(ProcessApprovalRecord::getTaskId, task.getId()); } - processApprovalRecordUpdate.eq(StringUtils.isNotBlank(processApprovalRecord.getParentTaskId()), - ProcessApprovalRecord::getParentTaskId, processApprovalRecord.getParentTaskId()); + processApprovalRecordUpdate.set(ProcessApprovalRecord::getUserId, loginUser.getId()); processApprovalRecordUpdate.set(ProcessApprovalRecord::getProjectId, processAll.getProjectId()); processApprovalRecordUpdate.set(ProcessApprovalRecord::getFinishFlag, FinishFlagEnum.COMPLETE.getValue()); processApprovalRecordUpdate.set(ProcessApprovalRecord::getEndTime, new Date()); + + if (StringUtils.isNotBlank(processApprovalRecord.getParentTaskId())){ + processApprovalRecordUpdate.eq( + ProcessApprovalRecord::getParentTaskId, processApprovalRecord.getParentTaskId()); + processApprovalRecordUpdate.set(ProcessApprovalRecord::getFinishFlag, FinishFlagEnum.INCOMPLETE.getValue()); + } processApprovalRecordService.update(processApprovalRecord, processApprovalRecordUpdate); // 新增流程实例节点关联用户表信息