update 标准征求意见流程

This commit is contained in:
liao
2023-11-24 09:42:50 +08:00
parent 47fc961e45
commit 5fed9211fd
7 changed files with 122 additions and 65 deletions
+5
View File
@@ -0,0 +1,5 @@
ALTER TABLE laws_replaced_standard
MODIFY COLUMN replaced VARCHAR(200);
ALTER TABLE laws_replaced_standard
MODIFY COLUMN replaced_by VARCHAR(200);
@@ -752,7 +752,8 @@ public class LawsAsmsOpenApiServiceImpl extends ServiceImpl<LawsAsmsOpenApiMappe
updateBatchById(lawsAsmsOpenApiList);
}
private void upload(String url, String fileName, String fileType, String id, String code) {
@Transactional
public void upload(String url, String fileName, String fileType, String id, String code) {
InputStream inputStream = asmsPostUtil.getFileByteArray(url);
try {
MinioUtil.upload(inputStream, filePath + url);
@@ -510,7 +510,8 @@ public class SynchronizationAsmsService {
log.info("=====================定时任务同步结束=====================");
}
private void upload(String url, String fileName, String fileType, String id, String code) {
@Transactional
public void upload(String url, String fileName, String fileType, String id, String code) {
InputStream inputStream = asmsPostUtil.getFileByteArray(url);
try {
MinioUtil.upload(inputStream, filePath + url);
@@ -45,4 +45,6 @@ public class ConsultationTaskKey {
public static final String SUB_PROCESS_3 = "sub_process_3"; // 子流程
public static final String SUB_PROCESS_FINISH = "sub_process_finish"; // 一级子流程结束
}
@@ -79,4 +79,8 @@ public class ProcessFbConsultationList implements Serializable {
@Excel(name = "依据材料", width = 15)
@ApiModelProperty(value = "依据材料")
private java.lang.String basisFile;
/**设计工程师名称*/
@Excel(name = "设计工程师名称", width = 15)
@ApiModelProperty(value = "设计工程师名称")
private java.lang.String designEngineerName;
}
@@ -222,13 +222,7 @@ public class ProcessFbStandardConsultationServiceImpl extends ServiceImpl<Proces
taskService.complete(taskId);
// 如果流程已经结束
if (processHandleService.isProcessFinish(processInstanceId)) {
log.info("流程 {} 已经结束", processInstanceId);
} else {
List<Task> taskList = taskService.createTaskQuery().processInstanceId(processInstanceId).list();
log.info("还剩 {} 个任务待完成", taskList.size());
taskList.forEach(lastTask -> log.info("任务id: {}", lastTask.getId()));
}
endProcess(processInstanceId);
}
/**
@@ -313,7 +307,8 @@ public class ProcessFbStandardConsultationServiceImpl extends ServiceImpl<Proces
log.info("TaskDefinitionKey: {}", task.getTaskDefinitionKey());
log.info("任务Name: {}", task.getName());
log.info("任务FormKey: {}", task.getFormKey());
log.info("任务ProcessInstanceId: {}", task.getProcessInstanceId());
String processInstanceId = task.getProcessInstanceId();
log.info("任务ProcessInstanceId: {}", processInstanceId);
log.info("任务ExecutionId: {}", task.getExecutionId());
log.info("任务父ExecutionId: {}", execution.getParentId());
log.info("=======================================================================");
@@ -332,11 +327,19 @@ public class ProcessFbStandardConsultationServiceImpl extends ServiceImpl<Proces
case ConsultationTaskKey.MODULE_OWNER_END_1: // 模块负责人汇总填写意见(可跳过)
case ConsultationTaskKey.MODULE_OWNER_END_2: // 模块负责人汇总填写意见(主管级领导驳回后)
case ConsultationTaskKey.MODULE_OWNER_END_3: // 法规工程师审批驳回后的子流程中的模块负责人汇总
case ConsultationTaskKey.DEPART_LEADER_COLLECT_2: // 各部所主管级领导汇总(不分发给模块负责人)
case ConsultationTaskKey.DEPART_LEADER_COLLECT_3: // 法规工程师审批驳回后的子流程中的各部所主管级领导汇总
log.info("{} 汇总", realName);
collect(processInfoVO);
break;
case ConsultationTaskKey.DEPART_LEADER_COLLECT_2: // 各部所主管级领导汇总(不分发给模块负责人)
log.info("{} 汇总", realName);
collect(processInfoVO);
Task subTask = taskService.createTaskQuery()
.taskAssignee(CurrentUserUtil.getId())
.taskDefinitionKey(ConsultationTaskKey.SUB_PROCESS_FINISH).singleResult();
taskService.complete(subTask.getId());
log.info("一级子流程最后一个任务id: {}, name: {}", subTask.getId(), subTask.getName());
break;
case ConsultationTaskKey.MODULE_OWNER_START: // 模块负责人分发
log.info("模块负责人 {} 分发", realName);
moduleOwnerStart(processInfoVO);
@@ -344,6 +347,27 @@ public class ProcessFbStandardConsultationServiceImpl extends ServiceImpl<Proces
default:
throw new JeroBootException("目前还未开发,请联系管理员");
}
// 如果流程已经结束
endProcess(processInstanceId);
}
/**
* @Author: liao
* @Date: 2023/11/23 13:43
* @Description: 流程结束
**/
private void endProcess(String processInstanceId) {
if (processHandleService.isProcessFinish(processInstanceId)) {
log.info("流程 {} 已经结束", processInstanceId);
} else {
List<Task> taskList = taskService.createTaskQuery().processInstanceId(processInstanceId).list();
List<Execution> executionList = runtimeService.createExecutionQuery().processInstanceId(processInstanceId).list();
log.info("还剩 {} 个任务待完成", taskList.size());
log.info("还剩 {} 个执行实例待完成", executionList.size());
taskList.forEach(lastTask -> log.info("任务id: {}", lastTask.getId()));
executionList.forEach(lastExecution -> log.info("执行实例id: {}", lastExecution.getId()));
}
}
/**
@@ -401,11 +425,13 @@ public class ProcessFbStandardConsultationServiceImpl extends ServiceImpl<Proces
List<ProcessFbConsultationList> processFbConsultationLists = businessInfoDTO.getProcessFbConsultationLists();
String taskId = processInfoVO.getBasicTaskInfoDTO().getTaskId();
Task task = taskService.createTaskQuery().taskId(taskId).singleResult();
if (CollectionUtils.isNotEmpty(processFbConsultationLists)) {
processFbConsultationListService.updateBatchById(processFbConsultationLists); // 更新业务信息
}
runtimeService.setVariableLocal(task.getProcessInstanceId(), "passSecond", true);
// 完成任务
taskService.complete(taskId);
}
@@ -431,11 +457,13 @@ public class ProcessFbStandardConsultationServiceImpl extends ServiceImpl<Proces
removeWrapper.eq(ProcessFbConsultationList::getUserLinkId, userLinkId);
processFbConsultationListService.remove(removeWrapper);
String designEngineerName = CurrentUserUtil.getRealName() + "(" + CurrentUserUtil.getUsername() + ")";
// 保存业务信息
if (CollectionUtils.isNotEmpty(processFbConsultationLists)) {
processFbConsultationLists.forEach(consultation -> {
consultation.setUserLinkId(userLinkId);
consultation.setBusinessId(businessId);
consultation.setDesignEngineerName(designEngineerName);
});
processFbConsultationListService.saveBatch(processFbConsultationLists, processFbConsultationLists.size());
}
@@ -104,17 +104,10 @@
<bpmn:sequenceFlow id="Flow_0oc8671" sourceRef="sub_process_2" targetRef="depart_leader_end_1" />
<bpmn:exclusiveGateway id="Gateway_1xd2kp3">
<bpmn:incoming>Flow_18olfei</bpmn:incoming>
<bpmn:outgoing>Flow_1t037bu</bpmn:outgoing>
<bpmn:outgoing>Flow_0f48izh</bpmn:outgoing>
<bpmn:outgoing>Flow_065o52n</bpmn:outgoing>
</bpmn:exclusiveGateway>
<bpmn:sequenceFlow id="Flow_18olfei" sourceRef="depart_leader_end_1" targetRef="Gateway_1xd2kp3" />
<bpmn:endEvent id="Event_0r7jsfk">
<bpmn:incoming>Flow_1t037bu</bpmn:incoming>
<bpmn:incoming>Flow_0qai32h</bpmn:incoming>
</bpmn:endEvent>
<bpmn:sequenceFlow id="Flow_1t037bu" name="通过" sourceRef="Gateway_1xd2kp3" targetRef="Event_0r7jsfk">
<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${passSecond}</bpmn:conditionExpression>
</bpmn:sequenceFlow>
<bpmn:sequenceFlow id="Flow_0f48izh" name="驳回" sourceRef="Gateway_1xd2kp3" targetRef="module_owner_end_2">
<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${!passSecond}</bpmn:conditionExpression>
</bpmn:sequenceFlow>
@@ -125,7 +118,7 @@
<bpmn:incoming>Flow_09jjte7</bpmn:incoming>
<bpmn:outgoing>Flow_0qai32h</bpmn:outgoing>
</bpmn:userTask>
<bpmn:sequenceFlow id="Flow_0qai32h" sourceRef="depart_leader_collect_2" targetRef="Event_0r7jsfk" />
<bpmn:sequenceFlow id="Flow_0qai32h" sourceRef="depart_leader_collect_2" targetRef="sub_process_finish" />
<bpmn:userTask id="module_owner_end_2" name="模块负责人汇总填写意见(可跳过)" activiti:assignee="${moduleOwner}">
<bpmn:extensionElements>
<activiti:taskListener class="com.jero.modules.activiti.process.fb.listener.BusinessKeyListener" event="create" />
@@ -137,6 +130,21 @@
</bpmn:multiInstanceLoopCharacteristics>
</bpmn:userTask>
<bpmn:sequenceFlow id="Flow_14aeapm" sourceRef="module_owner_end_2" targetRef="depart_leader_end_1" />
<bpmn:userTask id="sub_process_finish" name="一级子流程结束" activiti:assignee="${departLeader}">
<bpmn:extensionElements>
<activiti:taskListener class="com.jero.modules.activiti.process.fb.listener.BusinessKeyListener" event="create" />
</bpmn:extensionElements>
<bpmn:incoming>Flow_065o52n</bpmn:incoming>
<bpmn:incoming>Flow_0qai32h</bpmn:incoming>
<bpmn:outgoing>Flow_0mtwkua</bpmn:outgoing>
</bpmn:userTask>
<bpmn:sequenceFlow id="Flow_065o52n" name="通过" sourceRef="Gateway_1xd2kp3" targetRef="sub_process_finish">
<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${passSecond}</bpmn:conditionExpression>
</bpmn:sequenceFlow>
<bpmn:endEvent id="Event_0w3bhnu">
<bpmn:incoming>Flow_0mtwkua</bpmn:incoming>
</bpmn:endEvent>
<bpmn:sequenceFlow id="Flow_0mtwkua" sourceRef="sub_process_finish" targetRef="Event_0w3bhnu" />
</bpmn:subProcess>
<bpmn:sequenceFlow id="Flow_0azsibi" sourceRef="engineer_start" targetRef="sub_process_1" />
<bpmn:userTask id="engineer_start_end" name="法规工程师审批" activiti:assignee="${engineer}">
@@ -190,13 +198,13 @@
<bpmn:sequenceFlow id="Flow_0mdmcs5" sourceRef="module_owner_end_3" targetRef="depart_leader_end_4" />
<bpmn:exclusiveGateway id="Gateway_1pq4fen">
<bpmn:incoming>Flow_0flbibd</bpmn:incoming>
<bpmn:incoming>Flow_132k5wt</bpmn:incoming>
<bpmn:outgoing>Flow_1ta4894</bpmn:outgoing>
<bpmn:outgoing>Flow_1ft2poj</bpmn:outgoing>
</bpmn:exclusiveGateway>
<bpmn:sequenceFlow id="Flow_0flbibd" sourceRef="depart_leader_end_4" targetRef="Gateway_1pq4fen" />
<bpmn:endEvent id="Event_07vxc54">
<bpmn:incoming>Flow_1ta4894</bpmn:incoming>
<bpmn:incoming>Flow_132k5wt</bpmn:incoming>
</bpmn:endEvent>
<bpmn:sequenceFlow id="Flow_1ta4894" name="通过" sourceRef="Gateway_1pq4fen" targetRef="Event_07vxc54">
<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${passSecond}</bpmn:conditionExpression>
@@ -231,7 +239,7 @@
<bpmn:sequenceFlow id="Flow_1tg5cq9" name="不分发" sourceRef="Gateway_0vnihbs" targetRef="depart_leader_collect_3">
<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${!passFourth}</bpmn:conditionExpression>
</bpmn:sequenceFlow>
<bpmn:sequenceFlow id="Flow_132k5wt" sourceRef="depart_leader_collect_3" targetRef="Event_07vxc54" />
<bpmn:sequenceFlow id="Flow_132k5wt" sourceRef="depart_leader_collect_3" targetRef="Gateway_1pq4fen" />
</bpmn:subProcess>
<bpmn:sequenceFlow id="Flow_0jjkrst" name="驳回" sourceRef="Gateway_0pd0196" targetRef="sub_process_3">
<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${!passThird}</bpmn:conditionExpression>
@@ -264,13 +272,31 @@
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_10kxnw6_di" bpmnElement="design_engineer_2">
<dc:Bounds x="730" y="360" width="100" height="80" />
<dc:Bounds x="560" y="580" width="100" height="80" />
<bpmndi:BPMNLabel />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="BPMNShape_1qjvmbo" bpmnElement="depart_leader_collect_2">
<dc:Bounds x="790" y="580" width="100" height="80" />
<bpmndi:BPMNLabel />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_0gcol5c_di" bpmnElement="depart_leader_end_1">
<dc:Bounds x="890" y="420" width="100" height="80" />
<dc:Bounds x="710" y="340" width="100" height="80" />
<bpmndi:BPMNLabel />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="BPMNShape_18s4mik" bpmnElement="module_owner_end_2">
<dc:Bounds x="910" y="341" width="100" height="80" />
<bpmndi:BPMNLabel />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Gateway_1xd2kp3_di" bpmnElement="Gateway_1xd2kp3" isMarkerVisible="true">
<dc:Bounds x="935" y="475" width="50" height="50" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_0zan5e4_di" bpmnElement="sub_process_finish">
<dc:Bounds x="1050" y="460" width="100" height="80" />
<bpmndi:BPMNLabel />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Event_0w3bhnu_di" bpmnElement="Event_0w3bhnu">
<dc:Bounds x="1222" y="482" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_1pip97n_di" bpmnElement="sub_process_2" isExpanded="true">
<dc:Bounds x="680" y="100" width="660" height="210" />
</bpmndi:BPMNShape>
@@ -308,20 +334,6 @@
<di:waypoint x="1220" y="210" />
<di:waypoint x="1282" y="210" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="Gateway_1xd2kp3_di" bpmnElement="Gateway_1xd2kp3" isMarkerVisible="true">
<dc:Bounds x="1245" y="435" width="50" height="50" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Event_0r7jsfk_di" bpmnElement="Event_0r7jsfk">
<dc:Bounds x="1252" y="552" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="BPMNShape_1qjvmbo" bpmnElement="depart_leader_collect_2">
<dc:Bounds x="730" y="530" width="100" height="80" />
<bpmndi:BPMNLabel />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="BPMNShape_18s4mik" bpmnElement="module_owner_end_2">
<dc:Bounds x="1060" y="340" width="100" height="80" />
<bpmndi:BPMNLabel />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="Flow_1gv6jmb_di" bpmnElement="Flow_1gv6jmb">
<di:waypoint x="378" y="400" />
<di:waypoint x="430" y="400" />
@@ -331,15 +343,15 @@
<di:waypoint x="585" y="400" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_05oz1ja_di" bpmnElement="Flow_05oz1ja">
<di:waypoint x="635" y="400" />
<di:waypoint x="730" y="400" />
<di:waypoint x="610" y="425" />
<di:waypoint x="610" y="580" />
<bpmndi:BPMNLabel>
<dc:Bounds x="681" y="377" width="12" height="14" />
<dc:Bounds x="620" y="502" width="12" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_09jjte7_di" bpmnElement="Flow_09jjte7">
<di:waypoint x="780" y="440" />
<di:waypoint x="780" y="530" />
<di:waypoint x="660" y="620" />
<di:waypoint x="790" y="620" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_1ezcutn_di" bpmnElement="Flow_1ezcutn">
<di:waypoint x="610" y="375" />
@@ -350,36 +362,40 @@
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_0oc8671_di" bpmnElement="Flow_0oc8671">
<di:waypoint x="920" y="310" />
<di:waypoint x="920" y="420" />
<di:waypoint x="760" y="310" />
<di:waypoint x="760" y="340" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_18olfei_di" bpmnElement="Flow_18olfei">
<di:waypoint x="990" y="460" />
<di:waypoint x="1245" y="460" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_1t037bu_di" bpmnElement="Flow_1t037bu">
<di:waypoint x="1270" y="485" />
<di:waypoint x="1270" y="552" />
<bpmndi:BPMNLabel>
<dc:Bounds x="1270" y="512" width="23" height="14" />
</bpmndi:BPMNLabel>
<di:waypoint x="760" y="420" />
<di:waypoint x="760" y="500" />
<di:waypoint x="935" y="500" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_0f48izh_di" bpmnElement="Flow_0f48izh">
<di:waypoint x="1270" y="435" />
<di:waypoint x="1270" y="380" />
<di:waypoint x="1160" y="380" />
<di:waypoint x="960" y="475" />
<di:waypoint x="960" y="421" />
<bpmndi:BPMNLabel>
<dc:Bounds x="1276" y="401" width="22" height="14" />
<dc:Bounds x="963" y="446" width="22" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_0qai32h_di" bpmnElement="Flow_0qai32h">
<di:waypoint x="830" y="570" />
<di:waypoint x="1252" y="570" />
<di:waypoint x="890" y="620" />
<di:waypoint x="1100" y="620" />
<di:waypoint x="1100" y="540" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_14aeapm_di" bpmnElement="Flow_14aeapm">
<di:waypoint x="1060" y="379" />
<di:waypoint x="960" y="379" />
<di:waypoint x="960" y="420" />
<di:waypoint x="910" y="380" />
<di:waypoint x="810" y="380" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_065o52n_di" bpmnElement="Flow_065o52n">
<di:waypoint x="985" y="500" />
<di:waypoint x="1050" y="500" />
<bpmndi:BPMNLabel>
<dc:Bounds x="1007" y="482" width="22" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_0mtwkua_di" bpmnElement="Flow_0mtwkua">
<di:waypoint x="1150" y="500" />
<di:waypoint x="1222" y="500" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="Activity_1th4kyn_di" bpmnElement="engineer_start_end">
<dc:Bounds x="1560" y="360" width="100" height="80" />
@@ -471,8 +487,8 @@
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_132k5wt_di" bpmnElement="Flow_132k5wt">
<di:waypoint x="1928" y="700" />
<di:waypoint x="2278" y="700" />
<di:waypoint x="2278" y="618" />
<di:waypoint x="2188" y="700" />
<di:waypoint x="2188" y="625" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_1d5objw_di" bpmnElement="Flow_1d5objw">
<di:waypoint x="210" y="318" />