feat(标准解读流程): 子解读人分发调整

This commit is contained in:
yjz
2024-07-09 18:48:47 +08:00
parent 8d366d20d0
commit 27e44eef03
5 changed files with 39 additions and 9 deletions
@@ -74,7 +74,7 @@ public class StandardInterpretFlowController {
@AutoLog(value = "标准解读流程-查询条款列表", operateType = CommonConstant.OPERATE_TYPE_1)
@ApiOperation(value="标准解读流程-查询条款列表", notes="标准解读流程-查询条款列表")
@GetMapping(value = "/getClauseList")
public Result<List<ProcessStandardInterpretClause>> getClauseList(String standardId,String fileType) {
public Result<List<ProcessStandardInterpretClause>> getClauseList(String standardId, String fileType) {
return Result.OK(standardInterpretFlowService.getClauseList(standardId, fileType));
}
@@ -31,4 +31,8 @@ public class StandardInterpretFlowDTO {
/**map(参数)*/
@ApiModelProperty(value = "map(参数)")
private Map<String, Object> map;
/**草稿信息json字符串*/
@ApiModelProperty(value = "草稿信息json字符串")
private String infoJsonStr;
}
@@ -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 = "新认证车实施日期")
@@ -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,
@@ -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<String> clauseIdList2 = processStandardInterpretClauseList.stream()
.map(ProcessStandardInterpretClause::getId)
.collect(Collectors.toList());
LambdaQueryWrapper<ProcessStandardInterpretClause> removeQueryWrapper2 = new LambdaQueryWrapper<>();
removeQueryWrapper2.notIn(ProcessStandardInterpretClause::getId, clauseIdList2);
removeQueryWrapper2.eq(ProcessStandardInterpretClause::getStandardInterpretId, standardInterpretId);
processStandardInterpretClauseService.remove(removeQueryWrapper2);
// 更新 标准解读流程_条款中间表
processStandardInterpretClauseService.saveOrUpdateBatch(processStandardInterpretClauseList);
// 生成 标准解读流程_条款中间表_子表 数据
List<ProcessStandardInterpretClauseSublist> 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<String, Object> 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);
// 新增流程实例节点关联用户表信息