haungxing
11 months ago
13 changed files with 448 additions and 32 deletions
@ -0,0 +1,24 @@ |
|||||||
|
package com.hnac.hzims.ticket.ticketprocess.feign; |
||||||
|
|
||||||
|
import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse; |
||||||
|
import com.hnac.hzims.ticket.constants.TicketConstants; |
||||||
|
import org.springblade.core.tool.api.R; |
||||||
|
import org.springframework.cloud.openfeign.FeignClient; |
||||||
|
import org.springframework.web.bind.annotation.PostMapping; |
||||||
|
import org.springframework.web.bind.annotation.RequestBody; |
||||||
|
|
||||||
|
@FeignClient(value = TicketConstants.APP_NAME,fallback = OfflineTicketProcessClientFallback.class) |
||||||
|
public interface IOfflineTicketProcessClient { |
||||||
|
|
||||||
|
String API = "/offlineTicket"; |
||||||
|
String FIND_PENDING = API + "/findPending"; |
||||||
|
|
||||||
|
/** |
||||||
|
* 线下工作票处理 |
||||||
|
* @param response 流程信息 |
||||||
|
* @return 处理结果 |
||||||
|
*/ |
||||||
|
@PostMapping(FIND_PENDING) |
||||||
|
R findPending(@RequestBody ProcessWorkFlowResponse response); |
||||||
|
|
||||||
|
} |
@ -0,0 +1,15 @@ |
|||||||
|
package com.hnac.hzims.ticket.ticketprocess.feign; |
||||||
|
|
||||||
|
import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse; |
||||||
|
import org.springblade.core.tool.api.R; |
||||||
|
import org.springframework.stereotype.Component; |
||||||
|
|
||||||
|
@Component |
||||||
|
public class OfflineTicketProcessClientFallback implements IOfflineTicketProcessClient { |
||||||
|
|
||||||
|
@Override |
||||||
|
public R findPending(ProcessWorkFlowResponse response) { |
||||||
|
return R.fail("工作票处理流程失败!"); |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -0,0 +1,41 @@ |
|||||||
|
package com.hnac.hzims.middle.processflow.strategy.serviceimpl; |
||||||
|
|
||||||
|
|
||||||
|
import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse; |
||||||
|
import com.hnac.hzims.middle.processflow.service.ProcessDictService; |
||||||
|
import com.hnac.hzims.middle.processflow.strategy.abstracts.ProcessAbstractService; |
||||||
|
import com.hnac.hzims.middle.processflow.strategy.entity.WorkflowQueue; |
||||||
|
import com.hnac.hzims.ticket.ticketprocess.feign.IOfflineTicketProcessClient; |
||||||
|
import lombok.AllArgsConstructor; |
||||||
|
import lombok.extern.slf4j.Slf4j; |
||||||
|
import org.springblade.core.log.exception.ServiceException; |
||||||
|
import org.springblade.core.tool.api.R; |
||||||
|
import org.springframework.stereotype.Service; |
||||||
|
import org.springframework.util.Assert; |
||||||
|
|
||||||
|
import static com.hnac.hzims.middle.process.constant.TicketProcessConstant.OFFLINE_WORK_TICKET; |
||||||
|
|
||||||
|
@Slf4j |
||||||
|
@Service |
||||||
|
@AllArgsConstructor |
||||||
|
public class OfflineTicketProcessImpl extends ProcessAbstractService { |
||||||
|
|
||||||
|
private final ProcessDictService processDictService; |
||||||
|
private final IOfflineTicketProcessClient offlineTicketProcessClient; |
||||||
|
|
||||||
|
@Override |
||||||
|
public Boolean isWorkflowProcess(WorkflowQueue flowQueue) { |
||||||
|
String dictValue = processDictService.selectDictValueByKey(OFFLINE_WORK_TICKET); |
||||||
|
return dictValue.equals(flowQueue.getProcessDefinitionKey()); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public void calculate(ProcessWorkFlowResponse response) { |
||||||
|
log.info("线下工作票调用fein接口消费开始---param",response); |
||||||
|
R result = offlineTicketProcessClient.findPending(response); |
||||||
|
Assert.isTrue(result.isSuccess(),() -> { |
||||||
|
throw new ServiceException("线下工作票处理失败!"); |
||||||
|
}); |
||||||
|
log.info("线下工作票调用fein接口消费结束---"); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1 @@ |
|||||||
|
INSERT INTO `process_dict` (`dict_code`, `dict_sort`, `dict_key`, `dict_value`, `dict_label`, `dict_type`, `is_default`, `status`, `create_dept`, `create_time`, `update_time`, `remark`) VALUES (9, 9, 'offlineWorkTicket', 'offlineWorkTicket', '线下工作票', '线下工作票', 'Y', 0, NULL, '2023-12-28 16:35:10', '2023-12-28 16:35:14', '线下工作票流程'); |
@ -0,0 +1,26 @@ |
|||||||
|
package com.hnac.hzims.ticket.redisConsume.feign; |
||||||
|
|
||||||
|
|
||||||
|
import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse; |
||||||
|
import com.hnac.hzims.ticket.ticketprocess.feign.IOfflineTicketProcessClient; |
||||||
|
import com.hnac.hzims.ticket.twoTicket.service.TicketProcessService; |
||||||
|
import lombok.AllArgsConstructor; |
||||||
|
import lombok.extern.slf4j.Slf4j; |
||||||
|
import org.springblade.core.tool.api.R; |
||||||
|
import org.springframework.web.bind.annotation.PostMapping; |
||||||
|
import org.springframework.web.bind.annotation.RequestBody; |
||||||
|
import org.springframework.web.bind.annotation.RestController; |
||||||
|
|
||||||
|
@RestController |
||||||
|
@AllArgsConstructor |
||||||
|
@Slf4j |
||||||
|
public class OfflineTicketProcessClient implements IOfflineTicketProcessClient { |
||||||
|
|
||||||
|
private final TicketProcessService processService; |
||||||
|
|
||||||
|
@Override |
||||||
|
@PostMapping(FIND_PENDING) |
||||||
|
public R findPending(@RequestBody ProcessWorkFlowResponse response) { |
||||||
|
return R.status(processService.offlineTicketFindPending(response)); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,129 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:flowable="http://flowable.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.flowable.org/processdef"> |
||||||
|
<process id="offlineWorkTicket" name="线下工作票审批流程" isExecutable="true"> |
||||||
|
<startEvent id="startEvent1"></startEvent> |
||||||
|
<userTask id="sid-194BD702-29AE-4DA6-A343-05464D12BB83" name="签发人签发" flowable:candidateGroups="signer"> |
||||||
|
<extensionElements> |
||||||
|
<flowable:taskListener event="create" class="org.springblade.flow.engine.listener.DynamicTaskUserListener"></flowable:taskListener> |
||||||
|
</extensionElements> |
||||||
|
</userTask> |
||||||
|
<sequenceFlow id="sid-EB9D9A51-ACB2-47FA-98CF-042CF7AF19FA" sourceRef="startEvent1" targetRef="sid-194BD702-29AE-4DA6-A343-05464D12BB83"></sequenceFlow> |
||||||
|
<exclusiveGateway id="sid-C055B0CF-183B-4BFF-B9CA-D5C420311421"></exclusiveGateway> |
||||||
|
<userTask id="sid-2CCB5862-1AB2-4327-9FBE-A11DC613B258" name="运行人员接收" flowable:candidateGroups="operatingCrew"> |
||||||
|
<extensionElements> |
||||||
|
<flowable:taskListener event="create" class="org.springblade.flow.engine.listener.DynamicTaskUserListener"></flowable:taskListener> |
||||||
|
</extensionElements> |
||||||
|
</userTask> |
||||||
|
<exclusiveGateway id="sid-24261C82-08E4-4F0A-B069-5F2BB1E1ECEF"></exclusiveGateway> |
||||||
|
<sequenceFlow id="sid-2BD654BF-BFE4-481D-A710-185D10F7C413" sourceRef="sid-2CCB5862-1AB2-4327-9FBE-A11DC613B258" targetRef="sid-24261C82-08E4-4F0A-B069-5F2BB1E1ECEF"></sequenceFlow> |
||||||
|
<userTask id="sid-33C2D3CB-1B69-4234-9AE9-3747F37BE8C5" name="许可人许可" flowable:candidateGroups="licensor"> |
||||||
|
<extensionElements> |
||||||
|
<flowable:taskListener event="create" class="org.springblade.flow.engine.listener.DynamicTaskUserListener"></flowable:taskListener> |
||||||
|
</extensionElements> |
||||||
|
</userTask> |
||||||
|
<userTask id="sid-1D70C4B2-A79B-4C02-AA30-9D755484C4B6" name="工作结束"> |
||||||
|
<extensionElements> |
||||||
|
<flowable:taskListener event="create" class="org.springblade.flow.engine.listener.DynamicTaskUserListener"></flowable:taskListener> |
||||||
|
</extensionElements> |
||||||
|
</userTask> |
||||||
|
<sequenceFlow id="sid-9FDA7FDD-A163-4496-B850-77C7A44C3F1F" sourceRef="sid-33C2D3CB-1B69-4234-9AE9-3747F37BE8C5" targetRef="sid-1D70C4B2-A79B-4C02-AA30-9D755484C4B6"></sequenceFlow> |
||||||
|
<userTask id="sid-7A6326EA-6129-47EF-88D1-0FC14033B25A" name="工作票终结"> |
||||||
|
<extensionElements> |
||||||
|
<flowable:taskListener event="create" class="org.springblade.flow.engine.listener.DynamicTaskUserListener"></flowable:taskListener> |
||||||
|
</extensionElements> |
||||||
|
</userTask> |
||||||
|
<sequenceFlow id="sid-BE7A2AB4-4D34-43F6-BDDC-C2CB53F964B7" sourceRef="sid-1D70C4B2-A79B-4C02-AA30-9D755484C4B6" targetRef="sid-7A6326EA-6129-47EF-88D1-0FC14033B25A"></sequenceFlow> |
||||||
|
<endEvent id="sid-6C4B76B7-BADC-4BE8-B1D2-2AF12FF547EC"></endEvent> |
||||||
|
<sequenceFlow id="sid-EF45DC9B-AEAF-4609-8367-E8522F3CCA1C" sourceRef="sid-7A6326EA-6129-47EF-88D1-0FC14033B25A" targetRef="sid-6C4B76B7-BADC-4BE8-B1D2-2AF12FF547EC"></sequenceFlow> |
||||||
|
<endEvent id="sid-766AC388-0E41-4887-A1D7-6146841CAACC"></endEvent> |
||||||
|
<sequenceFlow id="sid-E08A5631-D8B8-4B09-85F0-4BF865E4C2A8" sourceRef="sid-194BD702-29AE-4DA6-A343-05464D12BB83" targetRef="sid-C055B0CF-183B-4BFF-B9CA-D5C420311421"></sequenceFlow> |
||||||
|
<sequenceFlow id="sid-734786FF-1E1B-41E0-BACC-C2D3AF52082A" sourceRef="sid-24261C82-08E4-4F0A-B069-5F2BB1E1ECEF" targetRef="sid-33C2D3CB-1B69-4234-9AE9-3747F37BE8C5"> |
||||||
|
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${recieveFlag==true}]]></conditionExpression> |
||||||
|
</sequenceFlow> |
||||||
|
<sequenceFlow id="sid-6B609D97-1BF7-44BC-9B53-898C6D2762EE" name="作废" sourceRef="sid-24261C82-08E4-4F0A-B069-5F2BB1E1ECEF" targetRef="sid-766AC388-0E41-4887-A1D7-6146841CAACC"> |
||||||
|
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${recieveFlag==false}]]></conditionExpression> |
||||||
|
</sequenceFlow> |
||||||
|
<sequenceFlow id="sid-44C46EFD-79F0-499E-AF70-9346E510A717" name="作废" sourceRef="sid-C055B0CF-183B-4BFF-B9CA-D5C420311421" targetRef="sid-766AC388-0E41-4887-A1D7-6146841CAACC"> |
||||||
|
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${signFlag==false}]]></conditionExpression> |
||||||
|
</sequenceFlow> |
||||||
|
<sequenceFlow id="sid-34DE7872-57AB-43B6-8166-09D1FA2D5ADF" sourceRef="sid-C055B0CF-183B-4BFF-B9CA-D5C420311421" targetRef="sid-2CCB5862-1AB2-4327-9FBE-A11DC613B258"> |
||||||
|
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${signFlag==true}]]></conditionExpression> |
||||||
|
</sequenceFlow> |
||||||
|
</process> |
||||||
|
<bpmndi:BPMNDiagram id="BPMNDiagram_offlineWorkTicket"> |
||||||
|
<bpmndi:BPMNPlane bpmnElement="offlineWorkTicket" id="BPMNPlane_offlineWorkTicket"> |
||||||
|
<bpmndi:BPMNShape bpmnElement="startEvent1" id="BPMNShape_startEvent1"> |
||||||
|
<omgdc:Bounds height="30.0" width="30.0" x="74.99999888241292" y="359.999994635582"></omgdc:Bounds> |
||||||
|
</bpmndi:BPMNShape> |
||||||
|
<bpmndi:BPMNShape bpmnElement="sid-194BD702-29AE-4DA6-A343-05464D12BB83" id="BPMNShape_sid-194BD702-29AE-4DA6-A343-05464D12BB83"> |
||||||
|
<omgdc:Bounds height="80.0" width="100.0" x="149.9999988824129" y="334.999994635582"></omgdc:Bounds> |
||||||
|
</bpmndi:BPMNShape> |
||||||
|
<bpmndi:BPMNShape bpmnElement="sid-C055B0CF-183B-4BFF-B9CA-D5C420311421" id="BPMNShape_sid-C055B0CF-183B-4BFF-B9CA-D5C420311421"> |
||||||
|
<omgdc:Bounds height="40.0" width="40.0" x="294.9999988824129" y="354.999994635582"></omgdc:Bounds> |
||||||
|
</bpmndi:BPMNShape> |
||||||
|
<bpmndi:BPMNShape bpmnElement="sid-2CCB5862-1AB2-4327-9FBE-A11DC613B258" id="BPMNShape_sid-2CCB5862-1AB2-4327-9FBE-A11DC613B258"> |
||||||
|
<omgdc:Bounds height="80.0" width="100.0" x="379.9999988824129" y="334.999994635582"></omgdc:Bounds> |
||||||
|
</bpmndi:BPMNShape> |
||||||
|
<bpmndi:BPMNShape bpmnElement="sid-24261C82-08E4-4F0A-B069-5F2BB1E1ECEF" id="BPMNShape_sid-24261C82-08E4-4F0A-B069-5F2BB1E1ECEF"> |
||||||
|
<omgdc:Bounds height="40.0" width="40.0" x="524.9999988824129" y="354.999994635582"></omgdc:Bounds> |
||||||
|
</bpmndi:BPMNShape> |
||||||
|
<bpmndi:BPMNShape bpmnElement="sid-33C2D3CB-1B69-4234-9AE9-3747F37BE8C5" id="BPMNShape_sid-33C2D3CB-1B69-4234-9AE9-3747F37BE8C5"> |
||||||
|
<omgdc:Bounds height="80.0" width="100.0" x="609.9999988824129" y="334.999994635582"></omgdc:Bounds> |
||||||
|
</bpmndi:BPMNShape> |
||||||
|
<bpmndi:BPMNShape bpmnElement="sid-1D70C4B2-A79B-4C02-AA30-9D755484C4B6" id="BPMNShape_sid-1D70C4B2-A79B-4C02-AA30-9D755484C4B6"> |
||||||
|
<omgdc:Bounds height="80.0" width="100.0" x="754.9999988824129" y="334.999994635582"></omgdc:Bounds> |
||||||
|
</bpmndi:BPMNShape> |
||||||
|
<bpmndi:BPMNShape bpmnElement="sid-7A6326EA-6129-47EF-88D1-0FC14033B25A" id="BPMNShape_sid-7A6326EA-6129-47EF-88D1-0FC14033B25A"> |
||||||
|
<omgdc:Bounds height="80.0" width="100.0" x="899.9999988824129" y="334.999994635582"></omgdc:Bounds> |
||||||
|
</bpmndi:BPMNShape> |
||||||
|
<bpmndi:BPMNShape bpmnElement="sid-6C4B76B7-BADC-4BE8-B1D2-2AF12FF547EC" id="BPMNShape_sid-6C4B76B7-BADC-4BE8-B1D2-2AF12FF547EC"> |
||||||
|
<omgdc:Bounds height="28.0" width="28.0" x="1044.999998882413" y="360.999994635582"></omgdc:Bounds> |
||||||
|
</bpmndi:BPMNShape> |
||||||
|
<bpmndi:BPMNShape bpmnElement="sid-766AC388-0E41-4887-A1D7-6146841CAACC" id="BPMNShape_sid-766AC388-0E41-4887-A1D7-6146841CAACC"> |
||||||
|
<omgdc:Bounds height="28.0" width="28.0" x="415.99999268352997" y="284.9999957531691"></omgdc:Bounds> |
||||||
|
</bpmndi:BPMNShape> |
||||||
|
<bpmndi:BPMNEdge bpmnElement="sid-E08A5631-D8B8-4B09-85F0-4BF865E4C2A8" id="BPMNEdge_sid-E08A5631-D8B8-4B09-85F0-4BF865E4C2A8"> |
||||||
|
<omgdi:waypoint x="249.9499988823975" y="375.2162284018157"></omgdi:waypoint> |
||||||
|
<omgdi:waypoint x="295.4130423606618" y="375.41303811384284"></omgdi:waypoint> |
||||||
|
</bpmndi:BPMNEdge> |
||||||
|
<bpmndi:BPMNEdge bpmnElement="sid-44C46EFD-79F0-499E-AF70-9346E510A717" id="BPMNEdge_sid-44C46EFD-79F0-499E-AF70-9346E510A717"> |
||||||
|
<omgdi:waypoint x="315.4999988824129" y="355.499994635582"></omgdi:waypoint> |
||||||
|
<omgdi:waypoint x="315.4999988824129" y="298.9999957531691"></omgdi:waypoint> |
||||||
|
<omgdi:waypoint x="415.99999268352997" y="298.9999957531691"></omgdi:waypoint> |
||||||
|
</bpmndi:BPMNEdge> |
||||||
|
<bpmndi:BPMNEdge bpmnElement="sid-BE7A2AB4-4D34-43F6-BDDC-C2CB53F964B7" id="BPMNEdge_sid-BE7A2AB4-4D34-43F6-BDDC-C2CB53F964B7"> |
||||||
|
<omgdi:waypoint x="854.9499988824128" y="374.999994635582"></omgdi:waypoint> |
||||||
|
<omgdi:waypoint x="899.9999988823936" y="374.999994635582"></omgdi:waypoint> |
||||||
|
</bpmndi:BPMNEdge> |
||||||
|
<bpmndi:BPMNEdge bpmnElement="sid-2BD654BF-BFE4-481D-A710-185D10F7C413" id="BPMNEdge_sid-2BD654BF-BFE4-481D-A710-185D10F7C413"> |
||||||
|
<omgdi:waypoint x="479.9499988824106" y="375.2162284018158"></omgdi:waypoint> |
||||||
|
<omgdi:waypoint x="525.4130423606738" y="375.4130381138429"></omgdi:waypoint> |
||||||
|
</bpmndi:BPMNEdge> |
||||||
|
<bpmndi:BPMNEdge bpmnElement="sid-6B609D97-1BF7-44BC-9B53-898C6D2762EE" id="BPMNEdge_sid-6B609D97-1BF7-44BC-9B53-898C6D2762EE"> |
||||||
|
<omgdi:waypoint x="545.4999988824129" y="355.499994635582"></omgdi:waypoint> |
||||||
|
<omgdi:waypoint x="545.4999988824129" y="298.9999957531691"></omgdi:waypoint> |
||||||
|
<omgdi:waypoint x="443.9499235883342" y="298.9999957531691"></omgdi:waypoint> |
||||||
|
</bpmndi:BPMNEdge> |
||||||
|
<bpmndi:BPMNEdge bpmnElement="sid-9FDA7FDD-A163-4496-B850-77C7A44C3F1F" id="BPMNEdge_sid-9FDA7FDD-A163-4496-B850-77C7A44C3F1F"> |
||||||
|
<omgdi:waypoint x="709.9499988824128" y="374.999994635582"></omgdi:waypoint> |
||||||
|
<omgdi:waypoint x="754.9999988823936" y="374.999994635582"></omgdi:waypoint> |
||||||
|
</bpmndi:BPMNEdge> |
||||||
|
<bpmndi:BPMNEdge bpmnElement="sid-EF45DC9B-AEAF-4609-8367-E8522F3CCA1C" id="BPMNEdge_sid-EF45DC9B-AEAF-4609-8367-E8522F3CCA1C"> |
||||||
|
<omgdi:waypoint x="999.9499988823469" y="374.999994635582"></omgdi:waypoint> |
||||||
|
<omgdi:waypoint x="1044.999998882413" y="374.999994635582"></omgdi:waypoint> |
||||||
|
</bpmndi:BPMNEdge> |
||||||
|
<bpmndi:BPMNEdge bpmnElement="sid-EB9D9A51-ACB2-47FA-98CF-042CF7AF19FA" id="BPMNEdge_sid-EB9D9A51-ACB2-47FA-98CF-042CF7AF19FA"> |
||||||
|
<omgdi:waypoint x="104.94999737237052" y="374.999994635582"></omgdi:waypoint> |
||||||
|
<omgdi:waypoint x="149.9999988824046" y="374.999994635582"></omgdi:waypoint> |
||||||
|
</bpmndi:BPMNEdge> |
||||||
|
<bpmndi:BPMNEdge bpmnElement="sid-34DE7872-57AB-43B6-8166-09D1FA2D5ADF" id="BPMNEdge_sid-34DE7872-57AB-43B6-8166-09D1FA2D5ADF"> |
||||||
|
<omgdi:waypoint x="334.52473595515613" y="375.4166613022487"></omgdi:waypoint> |
||||||
|
<omgdi:waypoint x="379.999998882401" y="375.2181169063244"></omgdi:waypoint> |
||||||
|
</bpmndi:BPMNEdge> |
||||||
|
<bpmndi:BPMNEdge bpmnElement="sid-734786FF-1E1B-41E0-BACC-C2D3AF52082A" id="BPMNEdge_sid-734786FF-1E1B-41E0-BACC-C2D3AF52082A"> |
||||||
|
<omgdi:waypoint x="564.5247359551561" y="375.4166613022487"></omgdi:waypoint> |
||||||
|
<omgdi:waypoint x="609.9999988824129" y="375.2181169063244"></omgdi:waypoint> |
||||||
|
</bpmndi:BPMNEdge> |
||||||
|
</bpmndi:BPMNPlane> |
||||||
|
</bpmndi:BPMNDiagram> |
||||||
|
</definitions> |
Loading…
Reference in new issue