fix(标准解读流程): 基础性调整

This commit is contained in:
yjz
2024-07-04 15:50:01 +08:00
parent 1dd0eff573
commit e098d5f414
11 changed files with 141 additions and 21 deletions
@@ -188,4 +188,9 @@ public class ProcessAll {
@TableField(exist = false)
@ApiModelProperty(value = "超期标识(0:未超期 1:已超期)")
private String overDue;
}
/**父任务id*/
@ApiModelProperty(value = "父任务id")
@TableField(exist = false)
private String parentTaskId;
}
@@ -34,6 +34,7 @@
par.task_name,
par.node_id,
par.over_due,
par.parent_task_id,
pa.id,
pa.prc_name,
pa.process_definition_id,
@@ -112,4 +113,4 @@
${ew.customSqlSegment}
<include refid="order"/>
</select>
</mapper>
</mapper>
@@ -95,6 +95,10 @@ public class StandardInterpretCommon {
* 解读人
*/
public static final String INTERPRETING_PEOPLE = "interpretingPeople";
/**
* 会签
*/
public static final String JOINTLY_SIGN_LIST = "jointlySignList";
/**
* 部门科室经理
*/
@@ -116,4 +120,13 @@ public class StandardInterpretCommon {
* 主解读重新分发 自动任务
*/
public static final String AUTO_TASK_3 = "autoTask_3";
/**
* 标准主解读人 网关节点
*/
public static final String PASS_FIRST = "passFirst";
/**
* 标准主解读人 未分发数量 网关节点
*/
public static final String UNALLOCATED_QUANTITY = "unallocatedQuantity";
}
@@ -67,8 +67,8 @@ public class StandardInterpretFlowController {
* @param standardInterpretFlowDTO 标准解读流程对象
* @return 结果对象
*/
@AutoLog(value = "企标稽查整改-流程审批", operateType = CommonConstant.OPERATE_TYPE_3)
@ApiOperation(value="企标稽查整改-流程审批", notes="企标稽查整改-流程审批")
@AutoLog(value = "标准解读流程-流程审批", operateType = CommonConstant.OPERATE_TYPE_3)
@ApiOperation(value="标准解读流程-流程审批", notes="标准解读流程-流程审批")
@PostMapping(value = "/flowApproval")
public Result<T> flowApproval(@RequestBody StandardInterpretFlowDTO standardInterpretFlowDTO) {
standardInterpretFlowService.flowApproval(standardInterpretFlowDTO);
@@ -80,8 +80,8 @@ public class StandardInterpretFlowController {
* @param projectId 项目id
* @return 结果对象
*/
@AutoLog(value = "企标稽查计划流程-办理详情", operateType = CommonConstant.OPERATE_TYPE_1)
@ApiOperation(value="企标稽查计划流程-办理详情", notes="企标稽查计划流程-办理详情")
@AutoLog(value = "标准解读流程-办理详情", operateType = CommonConstant.OPERATE_TYPE_1)
@ApiOperation(value="标准解读流程-办理详情", notes="标准解读流程-办理详情")
@GetMapping(value = "/queryDetail")
@Translation
public Result<StandardInterpretFlowVO> queryDetail(@ApiParam("项目id") String projectId,
@@ -26,7 +26,7 @@ public class StandardInterpretDTO implements Serializable {
@ApiModelProperty(value = "标准解读流程_条款中间表")
private List<ProcessStandardInterpretClause> processStandardInterpretClauseList;
/**标准解读流程_条款中间表*/
/**标准解读流程_条款中间表_子表*/
@ApiModelProperty(value = "标准解读流程_条款中间表_子表")
private List<ProcessStandardInterpretClauseSublist> processStandardInterpretClauseSublistList;
}
@@ -58,7 +58,7 @@ public class ProcessStandardInterpret extends BaseEntity {
private String projectId;
/**分解单来源(字典)*/
@ApiModelProperty(value = "分解单来源(字典)")
@Dict(dicCode = "")
@Dict(dicCode = "process_manuscript")
private String decompositionSource;
/**是否下发(字典:1:是,2:否)*/
@ApiModelProperty(value = "是否下发(字典:1:是,2:否)")
@@ -2,6 +2,7 @@ package com.jero.modules.activiti.process.standardinterpret.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.jero.common.aspect.annotation.Dict;
import com.jero.modules.laws.documenttool.entity.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@@ -39,6 +40,7 @@ public class ProcessStandardInterpretClause extends BaseEntity {
private String interpretPersonIds;
/**分解单来源(字典)*/
@ApiModelProperty(value = "分解单来源(字典)")
@Dict(dicCode = "process_manuscript")
private String decompositionSource;
}
@@ -20,6 +20,9 @@ public class ProcessStandardInterpretClauseSublist extends BaseEntity {
/**条款id/标准id*/
@ApiModelProperty(value = "条款id/标准id")
private String clauseId;
/**父任务id*/
@ApiModelProperty(value = "父任务id")
private String parentTaskId;
/**条款号/标准编号*/
@ApiModelProperty(value = "条款号/标准编号")
@TableField(exist = false)
@@ -53,6 +53,7 @@
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) psic2
on psics.standard_interpret_clause_id = psic2.id
${ew.customSqlSegment}
</select>
</mapper>
@@ -42,6 +42,9 @@ public class ProcessStandardInterpretClauseSublistServiceImpl
queryWrapper.eq(StringUtils.isNotBlank(processStandardInterpretClauseSublist.getInterpretPersonId()),
"interpret_person_id",
processStandardInterpretClauseSublist.getInterpretPersonId());
queryWrapper.eq(StringUtils.isNotBlank(processStandardInterpretClauseSublist.getParentTaskId()),
"psics.parent_task_id",
processStandardInterpretClauseSublist.getParentTaskId());
queryWrapper.eq("psics.del_flag", CommonConstant.DEL_FLAG_0);
queryWrapper.orderByAsc("psics.id");
return processStandardInterpretClauseSublistMapper.queryList(queryWrapper);
@@ -17,6 +17,7 @@ import com.jero.modules.activiti.enums.ProcessStatusEnum;
import com.jero.modules.activiti.process.common.enums.ProcessType;
import com.jero.modules.activiti.process.common.utility.FlowUtility;
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;
@@ -30,6 +31,8 @@ import com.jero.modules.activiti.process.standardinterpret.vo.StandardInterpretF
import com.jero.modules.activiti.service.ProcessAllService;
import com.jero.modules.activiti.service.ProcessApprovalRecordService;
import com.jero.modules.activiti.service.ProcessNodeLinkService;
import com.jero.modules.laws.standard.entity.LawsDomesticStandard;
import com.jero.modules.laws.standard.service.ILawsDomesticStandardService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.activiti.engine.ProcessEngines;
@@ -68,6 +71,8 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe
private final ProcessStandardInterpretService processStandardInterpretService;
private final ProcessStandardInterpretClauseService processStandardInterpretClauseService;
private final ProcessStandardInterpretClauseSublistService processStandardInterpretClauseSublistService;
private final ILawsDomesticStandardService lawsDomesticStandardService;
private final ProcessStandardInterpretClauseSublistController processStandardInterpretClauseSublist;
@Override
public void flowStart(StandardInterpretFlowDTO standardInterpretFlowDTO) {
@@ -75,11 +80,21 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe
ProcessAll processAll = standardInterpretFlowDTO.getProcessAll();
// 流程审批信息
ProcessApprovalRecord processApprovalRecord = standardInterpretFlowDTO.getProcessApprovalRecord();
// 业务信息
StandardInterpretDTO data = standardInterpretFlowDTO.getData();
// map(参数)
Map<String, Object> map = standardInterpretFlowDTO.getMap();
// 生成流程名称
String standardId = data.getProcessStandardInterpret().getStandardId();
LawsDomesticStandard lawsDomesticStandard = lawsDomesticStandardService.getById(standardId);
String prcName = lawsDomesticStandard.getStandardNumber() + "-"
+ lawsDomesticStandard.getStandardName() + "-解读";
processAll.setPrcName(prcName);
// 根据流程key启动流程,设置流程变量,更新流程总表信息,更新流程审批信息,返回任务信息
Task task = startProcessInstanceByKey(StandardInterpretCommon.KEY_1, map, processAll, processApprovalRecord);
Task task = startProcessInstanceByKey(StandardInterpretCommon.KEY_1, map,
processAll, processApprovalRecord, data);
// 处理业务信息
handleBusinessData(standardInterpretFlowDTO);
@@ -94,11 +109,13 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe
ProcessAll processAll = standardInterpretFlowDTO.getProcessAll();
// 流程审批信息
ProcessApprovalRecord processApprovalRecord = standardInterpretFlowDTO.getProcessApprovalRecord();
// 业务信息
StandardInterpretDTO data = standardInterpretFlowDTO.getData();
// map(参数)
Map<String, Object> map = standardInterpretFlowDTO.getMap();
// 根据流程key启动流程,设置流程变量,更新流程总表信息,更新流程审批信息,返回任务信息
startProcessInstanceByKey(StandardInterpretCommon.KEY_2, map, processAll, processApprovalRecord);
startProcessInstanceByKey(StandardInterpretCommon.KEY_2, map, processAll, processApprovalRecord, data);
}
@Override
@@ -109,9 +126,10 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe
ProcessApprovalRecord processApprovalRecord = standardInterpretFlowDTO.getProcessApprovalRecord();
// map(参数)
Map<String, Object> map = standardInterpretFlowDTO.getMap();
// 业务信息
StandardInterpretDTO data = standardInterpretFlowDTO.getData();
// 根据流程key启动流程,设置流程变量,更新流程总表信息,更新流程审批信息,返回任务信息
startProcessInstanceByKey(StandardInterpretCommon.KEY_3, map, processAll, processApprovalRecord);
startProcessInstanceByKey(StandardInterpretCommon.KEY_3, map, processAll, processApprovalRecord, data);
}
@@ -127,6 +145,9 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe
// 更新流程总表信息,更新流程审批信息
flowUtility.flowApprovalUpdate(processAll, processApprovalRecord);
// 更新业务表
handleBusinessData(standardInterpretFlowDTO);
// 完成任务
taskService.complete(processAll.getTaskId(), map);
@@ -165,8 +186,34 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe
standardInterpretFlowDTO.setProcessAll(processAll);
ProcessApprovalRecord processApprovalRecord = new ProcessApprovalRecord();
processApprovalRecord.setParentTaskId(taskId);
processApprovalRecord.setUserId(interpretingPeople);
processApprovalRecord.setFinishFlag(FinishFlagEnum.INCOMPLETE.getValue());
standardInterpretFlowDTO.setProcessApprovalRecord(processApprovalRecord);
standardInterpretFlowDTO.setMap(variables);
// 更新 标准解读流程_条款中间表_子表 parentId
ProcessStandardInterpret processStandardInterpret = processStandardInterpretService.getOne(
new LambdaQueryWrapper<ProcessStandardInterpret>()
.eq(ProcessStandardInterpret::getProjectId, processAlls.getProjectId()));
if (!Objects.isNull(processStandardInterpret)){
String id = processStandardInterpret.getId();
List<ProcessStandardInterpretClause> processStandardInterpretClauseList =
processStandardInterpretClauseService.list(
new LambdaQueryWrapper<ProcessStandardInterpretClause>()
.eq(ProcessStandardInterpretClause::getStandardInterpretId, id));
if (!processStandardInterpretClauseList.isEmpty()){
List<String> standardInterpretClauseIdList = processStandardInterpretClauseList.stream()
.map(ProcessStandardInterpretClause::getId).collect(Collectors.toList());
processStandardInterpretClauseSublistService.update(
new LambdaUpdateWrapper<ProcessStandardInterpretClauseSublist>()
.in(ProcessStandardInterpretClauseSublist::getStandardInterpretClauseId
, standardInterpretClauseIdList)
.eq(ProcessStandardInterpretClauseSublist::getInterpretPersonId,
interpretingPeople)
.set(ProcessStandardInterpretClauseSublist::getParentTaskId, taskId));
}
}
childrenFlowStart(standardInterpretFlowDTO);
log.info("循环发起 标准解读流程(主解读人重新分发子流程)");
}
@@ -247,6 +294,10 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe
if (StandardInterpretCommon.INTERPRETING_PEOPLE_FILLOUT.equals(node)){
processStandardInterpretClauseSublist.setInterpretPersonId(loginUser.getId());
}
// 标准主解读人审核(分发)
if (StandardInterpretCommon.MASTER_INTERPRET_APPROVE.equals(node)){
processStandardInterpretClauseSublist.setParentTaskId(processApprovalRecord.getParentTaskId());
}
processStandardInterpretClauseSublistList =
processStandardInterpretClauseSublistService.queryList(processStandardInterpretClauseSublist);
}
@@ -273,10 +324,13 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe
}
private void handleBusinessData(StandardInterpretFlowDTO standardInterpretFlowDTO) {
// map(参数)
Map<String, Object> map = standardInterpretFlowDTO.getMap();
StandardInterpretDTO data = standardInterpretFlowDTO.getData();
// 标准解读流程
ProcessStandardInterpret processStandardInterpret = data.getProcessStandardInterpret();
String standardInterpretId = processStandardInterpret.getId();
String standardInterpretId = StringUtils.isBlank(processStandardInterpret.getId()) ?
String.valueOf(SnowflakeUtils.snowflake()) : processStandardInterpret.getId();
// 标准解读流程_条款中间表
List<ProcessStandardInterpretClause> processStandardInterpretClauseList =
data.getProcessStandardInterpretClauseList();
@@ -284,7 +338,9 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe
List<ProcessStandardInterpretClauseSublist> processStandardInterpretClauseSublistList =
data.getProcessStandardInterpretClauseSublistList();
// 当前任务节点
String node = standardInterpretFlowDTO.getProcessApprovalRecord().getNodeId();
String node = StringUtils.isBlank(standardInterpretFlowDTO.getProcessApprovalRecord().getNodeId()) ?
StandardInterpretCommon.REGULATORY_ENGINEER_START
: standardInterpretFlowDTO.getProcessApprovalRecord().getNodeId();
switch (node){
// 法规工程师发起
@@ -299,12 +355,18 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe
break;
// 主控部门联络人分发
case StandardInterpretCommon.CONTACT_PERSON_DISTRIBUTE:
// 保存主解读人
processStandardInterpret.setMasterInterpretId(
String.valueOf(map.get(StandardInterpretCommon.MASTER_INTERPRET)));
processStandardInterpretService.updateById(processStandardInterpret);
List<String> clauseIdList = processStandardInterpretClauseList.stream()
.map(ProcessStandardInterpretClause::getId)
.collect(Collectors.toList());
// 删除旧数据
LambdaQueryWrapper<ProcessStandardInterpretClause> removeQueryWrapper = new LambdaQueryWrapper<>();
removeQueryWrapper.notIn(ProcessStandardInterpretClause::getStandardInterpretId, clauseIdList);
removeQueryWrapper.notIn(ProcessStandardInterpretClause::getId, clauseIdList);
removeQueryWrapper.eq(ProcessStandardInterpretClause::getStandardInterpretId, standardInterpretId);
processStandardInterpretClauseService.remove(removeQueryWrapper);
break;
@@ -317,10 +379,19 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe
// 生成 标准解读流程_条款中间表_子表 数据
List<ProcessStandardInterpretClauseSublist> processStandardInterpretClauseSublists =
new ArrayList<>();
// 未分配数量
int unallocatedQuantity = 0;
// 子解读人
List<String> interpretPersonIdList = new ArrayList<>();
for (ProcessStandardInterpretClause StandardInterpretClause : processStandardInterpretClauseList) {
if (StringUtils.isBlank(StandardInterpretClause.getInterpretPersonIds())){
++ unallocatedQuantity;
continue;
}
// 子解读人
String[] interpretPersonIds = StandardInterpretClause.getInterpretPersonIds().split(",");
for (String interpretPersonId : interpretPersonIds) {
interpretPersonIdList = Arrays.asList(
StandardInterpretClause.getInterpretPersonIds().split(","));
for (String interpretPersonId : interpretPersonIdList) {
ProcessStandardInterpretClauseSublist clauseSublist =
new ProcessStandardInterpretClauseSublist();
clauseSublist.setStandardInterpretClauseId(StandardInterpretClause.getId());
@@ -329,12 +400,32 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe
processStandardInterpretClauseSublists.add(clauseSublist);
}
}
// 设置未分配数量
map.put(StandardInterpretCommon.UNALLOCATED_QUANTITY, unallocatedQuantity);
// 设置子解读人
map.put(StandardInterpretCommon.INTERPRETING_PEOPLE, interpretPersonIdList);
processStandardInterpretClauseSublistService.saveBatch(processStandardInterpretClauseSublists);
}else {
// 不分发
processStandardInterpretClauseSublistService
.saveOrUpdateBatch(processStandardInterpretClauseSublistList);
}
map.put(StandardInterpretCommon.PASS_FIRST,
Integer.parseInt(processStandardInterpret.getIsDistribute()));
processStandardInterpretService.updateById(processStandardInterpret);
break;
// 标准主解读汇总(分发)
case StandardInterpretCommon.MASTER_INTERPRET_SUMMARY:
// 保存会签人员、审核人员、批准人员
processStandardInterpretService.updateById(processStandardInterpret);
map.put(StandardInterpretCommon.JOINTLY_SIGN_LIST, processStandardInterpret.getCountersignPersonIds());
map.put(StandardInterpretCommon.DEPARTMENT_MANAGER,
Arrays.asList(processStandardInterpret.getUploader().split(",")));
map.put(StandardInterpretCommon.TECHNICAL_OFFICER,
processStandardInterpret.getApprovePersonId());
processStandardInterpretClauseSublistService
.saveOrUpdateBatch(processStandardInterpretClauseSublistList);
break;
default:
processStandardInterpretClauseSublistService
@@ -345,7 +436,7 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe
}
private Task startProcessInstanceByKey(String key, Map<String, Object> map, ProcessAll processAll,
ProcessApprovalRecord processApprovalRecord) {
ProcessApprovalRecord processApprovalRecord, StandardInterpretDTO data) {
// 启动流程
ProcessInstance processInstance = runtimeService
.startProcessInstanceByKey(key, map);
@@ -373,10 +464,11 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe
// 更新流程审批信息
LambdaUpdateWrapper<ProcessApprovalRecord> processApprovalRecordUpdate = new LambdaUpdateWrapper<>();
processApprovalRecordUpdate.eq(StringUtils.isNotBlank(task.getId()),
ProcessApprovalRecord::getTaskId, task.getId());
if (!Objects.isNull(task)){
processApprovalRecordUpdate.eq(ProcessApprovalRecord::getTaskId, task.getId());
}
processApprovalRecordUpdate.eq(StringUtils.isNotBlank(processApprovalRecord.getParentTaskId()),
ProcessApprovalRecord::getParentTaskId, task.getParentTaskId());
ProcessApprovalRecord::getParentTaskId, processApprovalRecord.getParentTaskId());
processApprovalRecordUpdate.set(ProcessApprovalRecord::getUserId, loginUser.getId());
processApprovalRecordUpdate.set(ProcessApprovalRecord::getProjectId, processAll.getProjectId());
processApprovalRecordUpdate.set(ProcessApprovalRecord::getFinishFlag, FinishFlagEnum.COMPLETE.getValue());