baichengfei 5 vuotta sitten
vanhempi
commit
47f6fc50bf

+ 46 - 0
src/main/java/com/common/workflow/service/activiti/supplierListener/PreStorageAuditService.java

@@ -0,0 +1,46 @@
+package com.common.workflow.service.activiti.supplierListener;
+
+import com.common.workflow.service.client.FeignClient;
+import com.common.workflow.service.dto.ApproveInfoDTO;
+import com.common.workflow.service.dto.ApproveParamsDTO;
+import feign.Feign;
+import feign.jackson.JacksonDecoder;
+import feign.jackson.JacksonEncoder;
+import org.activiti.engine.ActivitiException;
+import org.activiti.engine.delegate.DelegateTask;
+import org.activiti.engine.delegate.TaskListener;
+import org.springframework.stereotype.Component;
+
+import java.util.Arrays;
+
+@Component("preStorageAuditService")
+public class PreStorageAuditService implements TaskListener {
+    // 企业法规处入库审核
+    @Override
+    public void notify(DelegateTask delegateTask) {
+        String callbackUrl = delegateTask.getVariable("callbackUrl").toString();
+        String businessKey = delegateTask.getVariable("businessKey").toString();
+        ApproveParamsDTO approveParams = new ApproveParamsDTO();
+        approveParams.setBusinessKey(businessKey);
+        ApproveInfoDTO approveInfo = null;
+        String approveInfoJson = "";
+        if (callbackUrl.length() > 0) {
+            FeignClient client = Feign.builder()
+                .decoder(new JacksonDecoder())
+                .encoder(new JacksonEncoder())
+                .target(FeignClient.class, callbackUrl);
+            approveInfo = client.getPreStorageAuditors(approveParams);
+            // approveInfoJson = HttpRequest.sendGet(approveUrl, "businessKey=" + businessKey);
+            // approveInfo = (ApproveInfoDTO) JSONObject.parse(approveInfoJson);
+        } else {
+            throw new ActivitiException("无回调地址,请联系管理员!");
+        }
+        if (approveInfo.getUsers().length() <= 0) {
+            throw new ActivitiException("未找到审核用户,请联系管理员!");
+        }
+
+        delegateTask.setVariable("users", approveInfo.getUsers());
+        delegateTask.setVariableLocal("users", approveInfo.getUsers());
+        delegateTask.addCandidateUsers(Arrays.asList(approveInfo.getUsers().split(",")));
+    }
+}

+ 32 - 0
src/main/java/com/common/workflow/service/activiti/supplierListener/WorkflowEndService.java

@@ -0,0 +1,32 @@
+package com.common.workflow.service.activiti.supplierListener;
+
+import com.common.workflow.service.util.HttpRequest;
+import org.activiti.engine.ActivitiException;
+import org.activiti.engine.delegate.DelegateTask;
+import org.activiti.engine.delegate.TaskListener;
+import org.springframework.stereotype.Component;
+
+import java.util.Arrays;
+
+@Component("workflowEndService")
+public class WorkflowEndService implements TaskListener {
+    // 企业法规处审批入库完成
+    @Override
+    public void notify(DelegateTask delegateTask) {
+        String callbackUrl = delegateTask.getVariable("callbackUrl").toString();
+        // String processKey = delegateTask.getVariable("processKey").toString();
+        String businessKey = delegateTask.getVariable("businessKey").toString();
+
+        String approveUrl = callbackUrl + "/suppliercert-listener/workflow-end";
+
+        String res = "0";
+        if (callbackUrl.length() > 0) {
+            res = HttpRequest.sendGet(approveUrl, "businessKey=" + businessKey);
+        } else {
+            throw new ActivitiException("无回调地址,请联系管理员!");
+        }
+        if (res.equals("0")) {
+            throw new ActivitiException("审核入库失败!请联系管理员!");
+        }
+    }
+}

+ 4 - 0
src/main/java/com/common/workflow/service/client/FeignClient.java

@@ -27,4 +27,8 @@ public interface FeignClient {
     @Headers({"Content-Type: application/json","Accept: application/json"})
     @RequestLine("POST /suppliercert-listener/pre-concentrate-audit")
     ApproveInfoDTO getPreConcentrateAuditors(@RequestBody ApproveParamsDTO approveParamsDTO);
+
+    @Headers({"Content-Type: application/json","Accept: application/json"})
+    @RequestLine("POST /suppliercert-listener/pre-storage-audit")
+    ApproveInfoDTO getPreStorageAuditors(@RequestBody ApproveParamsDTO approveParamsDTO);
 }

+ 41 - 33
src/main/resources/processes/oil_enuser_supplier_apply.bpmn20.xml

@@ -10,7 +10,7 @@
         </userTask>
         <userTask id="sid-A6FC1B75-D365-4060-8F2D-797DAD1399EF" name="业务处室专业审批" activiti:candidateUsers="${users}">
             <extensionElements>
-                <activiti:taskListener event="create" delegateExpression="preProfAuditService"></activiti:taskListener>
+                <activiti:taskListener event="create" delegateExpression="${preProfAuditService}"></activiti:taskListener>
             </extensionElements>
         </userTask>
         <exclusiveGateway id="sid-A41AC05B-4D7E-4159-80B2-CE3B0B60AF23"></exclusiveGateway>
@@ -31,7 +31,11 @@
                 <activiti:taskListener event="create" delegateExpression="${preConcentrateAuditService}"></activiti:taskListener>
             </extensionElements>
         </userTask>
-        <endEvent id="sid-2AC44FDA-FEF7-4D32-A690-54A5C6AAF46D"></endEvent>
+        <endEvent id="sid-2AC44FDA-FEF7-4D32-A690-54A5C6AAF46D">
+            <extensionElements>
+                <activiti:executionListener event="start" delegateExpression="${workflowEndService}"></activiti:executionListener>
+            </extensionElements>
+        </endEvent>
         <sequenceFlow id="sid-8CFFAD62-3714-4072-BB0E-847F0F1CED8D" sourceRef="sid-8F39C647-A0E2-46F8-B184-51BF40E93546" targetRef="sid-E178BD57-68C0-4C23-8952-143905257209"></sequenceFlow>
         <userTask id="sid-C18EB968-3E14-4BAF-9DEF-D767CA546066" name="业务处室接收" activiti:candidateUsers="${users}">
             <extensionElements>
@@ -47,13 +51,16 @@
         <sequenceFlow id="sid-C8320F28-BF8F-4B0D-AAB8-5D32DBAA3413" sourceRef="sid-9A4918D7-8376-4A00-928A-6415D92565EC" targetRef="sid-F49D476A-2CDD-4A35-8212-D88BA71F604E"></sequenceFlow>
         <exclusiveGateway id="sid-643A5BA6-748C-4D18-96A0-EE1D2C03DEFE"></exclusiveGateway>
         <sequenceFlow id="sid-F5AEDECD-FD07-4C0B-85F9-EA3650C05E7D" sourceRef="sid-F49D476A-2CDD-4A35-8212-D88BA71F604E" targetRef="sid-643A5BA6-748C-4D18-96A0-EE1D2C03DEFE"></sequenceFlow>
-        <sequenceFlow id="sid-22C499F4-7179-4558-BC4C-77EF7453FA56" sourceRef="sid-C18EB968-3E14-4BAF-9DEF-D767CA546066" targetRef="sid-A6FC1B75-D365-4060-8F2D-797DAD1399EF"></sequenceFlow>
         <userTask id="sid-7D60C5CA-F630-4C5D-A20F-2DE15307AA6D" name="交费" activiti:candidateUsers="${users}">
             <extensionElements>
                 <activiti:taskListener event="create" delegateExpression="${prePayerService}"></activiti:taskListener>
             </extensionElements>
         </userTask>
-        <userTask id="sid-FA63BEF0-2F3E-4A13-BEB8-286C4AA9F600" name="企管法规处编号、入库" activiti:candidateUsers="${users}"></userTask>
+        <userTask id="sid-FA63BEF0-2F3E-4A13-BEB8-286C4AA9F600" name="企管法规处编号、入库" activiti:candidateUsers="${users}">
+            <extensionElements>
+                <activiti:taskListener event="create" delegateExpression="${preStorageAuditService}"></activiti:taskListener>
+            </extensionElements>
+        </userTask>
         <sequenceFlow id="sid-22A32961-337F-4185-8E96-CF46812C6A5A" sourceRef="sid-7D60C5CA-F630-4C5D-A20F-2DE15307AA6D" targetRef="sid-FA63BEF0-2F3E-4A13-BEB8-286C4AA9F600"></sequenceFlow>
         <sequenceFlow id="sid-6A7B4FFF-D815-4522-93E3-ACA3E92104EE" sourceRef="sid-FA63BEF0-2F3E-4A13-BEB8-286C4AA9F600" targetRef="sid-2AC44FDA-FEF7-4D32-A690-54A5C6AAF46D"></sequenceFlow>
         <exclusiveGateway id="sid-025875DE-EAC2-4FBC-B4A4-91377D669895"></exclusiveGateway>
@@ -70,26 +77,9 @@
         <sequenceFlow id="sid-45DED472-AC98-4ED3-B1EE-3EE6305F1413" name="二级单位申请" sourceRef="sid-643A5BA6-748C-4D18-96A0-EE1D2C03DEFE" targetRef="sid-8C5C2380-44D8-4A61-A5C7-1DC85F57E3AF">
             <conditionExpression xsi:type="tFormalExpression"><![CDATA[${result==2}]]></conditionExpression>
         </sequenceFlow>
-        <sequenceFlow id="sid-E19E2941-6B2A-4114-B292-5D789BA0959A" name="通过" sourceRef="sid-A41AC05B-4D7E-4159-80B2-CE3B0B60AF23" targetRef="sid-7937AEA9-F0D6-4FF1-9E7F-23238B42D7A3">
-            <conditionExpression xsi:type="tFormalExpression"><![CDATA[${result==1}]]></conditionExpression>
-        </sequenceFlow>
         <sequenceFlow id="sid-16929529-744D-4509-923E-820FA2E3AEE3" name="通过并缴费" sourceRef="sid-025875DE-EAC2-4FBC-B4A4-91377D669895" targetRef="sid-7D60C5CA-F630-4C5D-A20F-2DE15307AA6D">
             <conditionExpression xsi:type="tFormalExpression"><![CDATA[${result==1}]]></conditionExpression>
         </sequenceFlow>
-        <sequenceFlow id="sid-D683E891-1671-40A6-9103-C03866D0640B" name="通过不缴费" sourceRef="sid-025875DE-EAC2-4FBC-B4A4-91377D669895" targetRef="sid-FA63BEF0-2F3E-4A13-BEB8-286C4AA9F600">
-            <conditionExpression xsi:type="tFormalExpression"><![CDATA[${result==2}]]></conditionExpression>
-        </sequenceFlow>
-        <sequenceFlow id="sid-89ED731E-278D-4033-8445-73676D8B5F0A" name="审批" sourceRef="sid-A6FC1B75-D365-4060-8F2D-797DAD1399EF" targetRef="sid-A41AC05B-4D7E-4159-80B2-CE3B0B60AF23">
-            <extensionElements>
-                <activiti:executionListener event="start" delegateExpression="checkNeedConcentrateAuditService"></activiti:executionListener>
-            </extensionElements>
-        </sequenceFlow>
-        <sequenceFlow id="sid-D6C377D7-98CC-4D68-B577-22E60AD1578A" name="不集中评审" sourceRef="sid-A41AC05B-4D7E-4159-80B2-CE3B0B60AF23" targetRef="sid-025875DE-EAC2-4FBC-B4A4-91377D669895">
-            <extensionElements>
-                <activiti:executionListener event="end" delegateExpression="${checkNeedPayService}"></activiti:executionListener>
-            </extensionElements>
-            <conditionExpression xsi:type="tFormalExpression"><![CDATA[${result==2}]]></conditionExpression>
-        </sequenceFlow>
         <sequenceFlow id="sid-7B00C50E-3979-4923-B9D9-0FC3F918ADE4" sourceRef="sid-7937AEA9-F0D6-4FF1-9E7F-23238B42D7A3" targetRef="sid-025875DE-EAC2-4FBC-B4A4-91377D669895">
             <extensionElements>
                 <activiti:executionListener event="end" delegateExpression="${checkNeedPayService}"></activiti:executionListener>
@@ -107,18 +97,36 @@
             </extensionElements>
             <conditionExpression xsi:type="tFormalExpression"><![CDATA[${result==0}]]></conditionExpression>
         </sequenceFlow>
-        <sequenceFlow id="sid-FCCDF8E6-9500-4D5F-A79C-CE674F870F6C" name="审核不通过" sourceRef="sid-A41AC05B-4D7E-4159-80B2-CE3B0B60AF23" targetRef="sid-F49D476A-2CDD-4A35-8212-D88BA71F604E">
+        <sequenceFlow id="sid-FD0572E4-B0BC-49D2-9F15-C38057F3D170" name="不通过" sourceRef="sid-025875DE-EAC2-4FBC-B4A4-91377D669895" targetRef="sid-F49D476A-2CDD-4A35-8212-D88BA71F604E">
             <extensionElements>
                 <activiti:executionListener event="start" delegateExpression="${approvalRefuseService}"></activiti:executionListener>
             </extensionElements>
             <conditionExpression xsi:type="tFormalExpression"><![CDATA[${result==0}]]></conditionExpression>
         </sequenceFlow>
-        <sequenceFlow id="sid-FD0572E4-B0BC-49D2-9F15-C38057F3D170" name="不通过" sourceRef="sid-025875DE-EAC2-4FBC-B4A4-91377D669895" targetRef="sid-F49D476A-2CDD-4A35-8212-D88BA71F604E">
+        <sequenceFlow id="sid-22C499F4-7179-4558-BC4C-77EF7453FA56" sourceRef="sid-C18EB968-3E14-4BAF-9DEF-D767CA546066" targetRef="sid-A6FC1B75-D365-4060-8F2D-797DAD1399EF"></sequenceFlow>
+        <sequenceFlow id="sid-89ED731E-278D-4033-8445-73676D8B5F0A" name="审批" sourceRef="sid-A6FC1B75-D365-4060-8F2D-797DAD1399EF" targetRef="sid-A41AC05B-4D7E-4159-80B2-CE3B0B60AF23">
+            <extensionElements>
+                <activiti:executionListener event="start" delegateExpression="${checkNeedConcentrateAuditService}"></activiti:executionListener>
+            </extensionElements>
+        </sequenceFlow>
+        <sequenceFlow id="sid-D6C377D7-98CC-4D68-B577-22E60AD1578A" name="不集中评审" sourceRef="sid-A41AC05B-4D7E-4159-80B2-CE3B0B60AF23" targetRef="sid-025875DE-EAC2-4FBC-B4A4-91377D669895">
+            <extensionElements>
+                <activiti:executionListener event="end" delegateExpression="${checkNeedPayService}"></activiti:executionListener>
+            </extensionElements>
+            <conditionExpression xsi:type="tFormalExpression"><![CDATA[${result==2}]]></conditionExpression>
+        </sequenceFlow>
+        <sequenceFlow id="sid-E19E2941-6B2A-4114-B292-5D789BA0959A" name="通过" sourceRef="sid-A41AC05B-4D7E-4159-80B2-CE3B0B60AF23" targetRef="sid-7937AEA9-F0D6-4FF1-9E7F-23238B42D7A3">
+            <conditionExpression xsi:type="tFormalExpression"><![CDATA[${result==1}]]></conditionExpression>
+        </sequenceFlow>
+        <sequenceFlow id="sid-FCCDF8E6-9500-4D5F-A79C-CE674F870F6C" name="审核不通过" sourceRef="sid-A41AC05B-4D7E-4159-80B2-CE3B0B60AF23" targetRef="sid-F49D476A-2CDD-4A35-8212-D88BA71F604E">
             <extensionElements>
                 <activiti:executionListener event="start" delegateExpression="${approvalRefuseService}"></activiti:executionListener>
             </extensionElements>
             <conditionExpression xsi:type="tFormalExpression"><![CDATA[${result==0}]]></conditionExpression>
         </sequenceFlow>
+        <sequenceFlow id="sid-D683E891-1671-40A6-9103-C03866D0640B" name="通过不缴费" sourceRef="sid-025875DE-EAC2-4FBC-B4A4-91377D669895" targetRef="sid-FA63BEF0-2F3E-4A13-BEB8-286C4AA9F600">
+            <conditionExpression xsi:type="tFormalExpression"><![CDATA[${result==2}]]></conditionExpression>
+        </sequenceFlow>
     </process>
     <bpmndi:BPMNDiagram id="BPMNDiagram_oil_enuser_supplier_apply">
         <bpmndi:BPMNPlane bpmnElement="oil_enuser_supplier_apply" id="BPMNPlane_oil_enuser_supplier_apply">
@@ -174,18 +182,18 @@
                 <omgdi:waypoint x="1100.0" y="299.9999973509049"></omgdi:waypoint>
                 <omgdi:waypoint x="1135.0" y="299.9999973509048"></omgdi:waypoint>
             </bpmndi:BPMNEdge>
-            <bpmndi:BPMNEdge bpmnElement="sid-FCCDF8E6-9500-4D5F-A79C-CE674F870F6C" id="BPMNEdge_sid-FCCDF8E6-9500-4D5F-A79C-CE674F870F6C">
-                <omgdi:waypoint x="1155.0837462142554" y="319.91625113664924"></omgdi:waypoint>
-                <omgdi:waypoint x="1155.3154296875" y="375.01446533203125"></omgdi:waypoint>
-                <omgdi:waypoint x="135.31541442871094" y="372.01446533203125"></omgdi:waypoint>
-                <omgdi:waypoint x="135.16382087565034" y="335.0"></omgdi:waypoint>
-            </bpmndi:BPMNEdge>
             <bpmndi:BPMNEdge bpmnElement="sid-FD0572E4-B0BC-49D2-9F15-C38057F3D170" id="BPMNEdge_sid-FD0572E4-B0BC-49D2-9F15-C38057F3D170">
                 <omgdi:waypoint x="1365.5" y="319.49999735090523"></omgdi:waypoint>
                 <omgdi:waypoint x="1365.5" y="375.01446533203125"></omgdi:waypoint>
                 <omgdi:waypoint x="135.0" y="373.01446533203125"></omgdi:waypoint>
                 <omgdi:waypoint x="135.0" y="335.0"></omgdi:waypoint>
             </bpmndi:BPMNEdge>
+            <bpmndi:BPMNEdge bpmnElement="sid-FCCDF8E6-9500-4D5F-A79C-CE674F870F6C" id="BPMNEdge_sid-FCCDF8E6-9500-4D5F-A79C-CE674F870F6C">
+                <omgdi:waypoint x="1155.0837462142554" y="319.91625113664924"></omgdi:waypoint>
+                <omgdi:waypoint x="1155.3154296875" y="375.01446533203125"></omgdi:waypoint>
+                <omgdi:waypoint x="135.31541442871094" y="372.01446533203125"></omgdi:waypoint>
+                <omgdi:waypoint x="135.16382087565034" y="335.0"></omgdi:waypoint>
+            </bpmndi:BPMNEdge>
             <bpmndi:BPMNEdge bpmnElement="sid-6A7B4FFF-D815-4522-93E3-ACA3E92104EE" id="BPMNEdge_sid-6A7B4FFF-D815-4522-93E3-ACA3E92104EE">
                 <omgdi:waypoint x="1743.0" y="300.2490071485306"></omgdi:waypoint>
                 <omgdi:waypoint x="1795.0000996389547" y="300.05281932225176"></omgdi:waypoint>
@@ -256,16 +264,16 @@
                 <omgdi:waypoint x="769.9999999999999" y="299.99999735090495"></omgdi:waypoint>
                 <omgdi:waypoint x="789.9999999999999" y="299.99999735090483"></omgdi:waypoint>
             </bpmndi:BPMNEdge>
-            <bpmndi:BPMNEdge bpmnElement="sid-E19E2941-6B2A-4114-B292-5D789BA0959A" id="BPMNEdge_sid-E19E2941-6B2A-4114-B292-5D789BA0959A">
-                <omgdi:waypoint x="1174.5913461538462" y="300.4086511970586"></omgdi:waypoint>
-                <omgdi:waypoint x="1210.0" y="300.2392318006655"></omgdi:waypoint>
-            </bpmndi:BPMNEdge>
             <bpmndi:BPMNEdge bpmnElement="sid-EE3F6C40-10E4-45A9-AD18-A407C3DAED32" id="BPMNEdge_sid-EE3F6C40-10E4-45A9-AD18-A407C3DAED32">
                 <omgdi:waypoint x="810.3492450483038" y="319.6507523026009"></omgdi:waypoint>
                 <omgdi:waypoint x="811.3154296875" y="374.01446533203125"></omgdi:waypoint>
                 <omgdi:waypoint x="135.31541442871094" y="373.01446533203125"></omgdi:waypoint>
                 <omgdi:waypoint x="136.31579509534333" y="335.0"></omgdi:waypoint>
             </bpmndi:BPMNEdge>
+            <bpmndi:BPMNEdge bpmnElement="sid-E19E2941-6B2A-4114-B292-5D789BA0959A" id="BPMNEdge_sid-E19E2941-6B2A-4114-B292-5D789BA0959A">
+                <omgdi:waypoint x="1174.5913461538462" y="300.4086511970586"></omgdi:waypoint>
+                <omgdi:waypoint x="1210.0" y="300.2392318006655"></omgdi:waypoint>
+            </bpmndi:BPMNEdge>
             <bpmndi:BPMNEdge bpmnElement="sid-D6C377D7-98CC-4D68-B577-22E60AD1578A" id="BPMNEdge_sid-D6C377D7-98CC-4D68-B577-22E60AD1578A">
                 <omgdi:waypoint x="1155.5" y="280.4999973509047"></omgdi:waypoint>
                 <omgdi:waypoint x="1155.5" y="230.0162811279297"></omgdi:waypoint>