| @@ -0,0 +1,45 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | |||
| <definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" 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="end_contract_flow" name="endContractflow" isExecutable="true"> | |||
| <documentation>终止合同审批流程</documentation> | |||
| <startEvent id="startEvent1"></startEvent> | |||
| <userTask id="firstTaskUser" name="初审" flowable:candidateUsers="${firstTaskUser}"> | |||
| <documentation>初审</documentation> | |||
| </userTask> | |||
| <endEvent id="sid-9692A856-E39A-4B8C-95C2-7C04A3646D6F"></endEvent> | |||
| <sequenceFlow id="sid-AA24EF6A-4416-4FAF-9FF5-E15E46D87BD9" sourceRef="startEvent1" targetRef="firstTaskUser"></sequenceFlow> | |||
| <sequenceFlow id="sid-C4925653-8894-42FF-81F4-412B3D11A3C9" sourceRef="firstTaskUser" targetRef="secondTaskUser"></sequenceFlow> | |||
| <sequenceFlow id="sid-9FCAF465-99E7-4EFE-BEEA-7D59481E684C" sourceRef="secondTaskUser" targetRef="sid-9692A856-E39A-4B8C-95C2-7C04A3646D6F"></sequenceFlow> | |||
| <userTask id="secondTaskUser" name="复审" flowable:candidateUsers="${secondTaskUser}"> | |||
| <documentation>复审</documentation> | |||
| </userTask> | |||
| </process> | |||
| <bpmndi:BPMNDiagram id="BPMNDiagram_end_contract_flow"> | |||
| <bpmndi:BPMNPlane bpmnElement="end_contract_flow" id="BPMNPlane_end_contract_flow"> | |||
| <bpmndi:BPMNShape bpmnElement="startEvent1" id="BPMNShape_startEvent1"> | |||
| <omgdc:Bounds height="30.0" width="30.0" x="100.0" y="157.0"></omgdc:Bounds> | |||
| </bpmndi:BPMNShape> | |||
| <bpmndi:BPMNShape bpmnElement="firstTaskUser" id="BPMNShape_firstTask"> | |||
| <omgdc:Bounds height="80.0" width="100.0" x="285.0" y="132.0"></omgdc:Bounds> | |||
| </bpmndi:BPMNShape> | |||
| <bpmndi:BPMNShape bpmnElement="sid-9692A856-E39A-4B8C-95C2-7C04A3646D6F" id="BPMNShape_sid-9692A856-E39A-4B8C-95C2-7C04A3646D6F"> | |||
| <omgdc:Bounds height="28.0" width="28.0" x="835.0" y="158.0"></omgdc:Bounds> | |||
| </bpmndi:BPMNShape> | |||
| <bpmndi:BPMNShape bpmnElement="secondTaskUser" id="BPMNShape_secondTask"> | |||
| <omgdc:Bounds height="80.0" width="100.0" x="554.0" y="132.0"></omgdc:Bounds> | |||
| </bpmndi:BPMNShape> | |||
| <bpmndi:BPMNEdge bpmnElement="sid-C4925653-8894-42FF-81F4-412B3D11A3C9" id="BPMNEdge_sid-C4925653-8894-42FF-81F4-412B3D11A3C9"> | |||
| <omgdi:waypoint x="384.94999999987203" y="172.0"></omgdi:waypoint> | |||
| <omgdi:waypoint x="553.9999999998877" y="172.0"></omgdi:waypoint> | |||
| </bpmndi:BPMNEdge> | |||
| <bpmndi:BPMNEdge bpmnElement="sid-9FCAF465-99E7-4EFE-BEEA-7D59481E684C" id="BPMNEdge_sid-9FCAF465-99E7-4EFE-BEEA-7D59481E684C"> | |||
| <omgdi:waypoint x="653.9499999999999" y="172.0"></omgdi:waypoint> | |||
| <omgdi:waypoint x="835.0" y="172.0"></omgdi:waypoint> | |||
| </bpmndi:BPMNEdge> | |||
| <bpmndi:BPMNEdge bpmnElement="sid-AA24EF6A-4416-4FAF-9FF5-E15E46D87BD9" id="BPMNEdge_sid-AA24EF6A-4416-4FAF-9FF5-E15E46D87BD9"> | |||
| <omgdi:waypoint x="129.9499996223143" y="172.0"></omgdi:waypoint> | |||
| <omgdi:waypoint x="284.9999999998994" y="172.0"></omgdi:waypoint> | |||
| </bpmndi:BPMNEdge> | |||
| </bpmndi:BPMNPlane> | |||
| </bpmndi:BPMNDiagram> | |||
| </definitions> | |||
| @@ -6,8 +6,9 @@ package com.iformall.enums; | |||
| */ | |||
| public enum EnumFlowKey { | |||
| CONTRACT("contract_flow", "合同审批流程key"), | |||
| BILL("bill_flow", "账单审批流程key") | |||
| CONTRACT("contract_flow", "合同审批流程"), | |||
| BILL("bill_flow", "账单审批流程"), | |||
| END_CONTRACT("end_contract_flow", "终止合同审批流程"), | |||
| ; | |||
| public static EnumFlowKey getEnum(Integer code) { | |||
| @@ -5,12 +5,13 @@ package com.iformall.enums; | |||
| */ | |||
| public enum EnumFlowRecordStatus { | |||
| // 1发起申请2审批通过3审批驳回 | |||
| NEW(1, "发起申请"), | |||
| APPLY(2, "审批通过"), | |||
| REJECT(3, "审批驳回"), | |||
| ASSIGNEE(4, "待审批"), | |||
| CANCLE(5, "合同作废") | |||
| CANCLE(5, "合同作废"), | |||
| //ADVANCE_END(6, "提前终止"), | |||
| //ADVANCE_END(7, "审批完成"), | |||
| ; | |||
| public static EnumFlowRecordStatus getEnum(Integer code) { | |||
| @@ -73,20 +73,24 @@ public class WxFlowServiceImpl implements WxFlowService { | |||
| return EnumFlowKey.CONTRACT.getCode(); | |||
| }else if(2 == flowType){ | |||
| return EnumFlowKey.BILL.getCode(); | |||
| }else if(3 == flowType){ | |||
| return EnumFlowKey.END_CONTRACT.getCode(); | |||
| } | |||
| return null; | |||
| } | |||
| /** | |||
| * 更新业务数据状态 | |||
| * @param businessId | |||
| * @param flowType | |||
| * @param businessId 业务id | |||
| * @param flowType 1合同审批流 2账单审批流 3终止合同 | |||
| * @param contractType 1租赁合同 2点位合同wx_rent_contract 3物业wx_property_contract 4点位物业合同 | |||
| * @param applyStatus 状态 | |||
| * @param supplement 是否补录 | |||
| */ | |||
| @Override | |||
| public void updateBusinessStatus(Long businessId,Integer flowType,Integer contractType,Integer applyStatus,Boolean supplement){ | |||
| logger.info("businessId:{},supplement:{}",businessId.toString(),supplement); | |||
| if(1 == flowType){ | |||
| // 1租赁合同 2点位合同wx_rent_contract 3物业wx_property_contract 4点位物业合同 | |||
| if(contractType.intValue() == 1 || contractType.intValue() == 2){ | |||
| WxRentContract rent = new WxRentContract(); | |||
| rent.setId(businessId); | |||
| @@ -108,6 +112,33 @@ public class WxFlowServiceImpl implements WxFlowService { | |||
| wxPropertyContractService.updatePropertyContractStatus(businessId); | |||
| } | |||
| } | |||
| }else if(3 == flowType){ | |||
| if(contractType.intValue() == 1 || contractType.intValue() == 2){ | |||
| WxRentContract rent = new WxRentContract(); | |||
| rent.setId(businessId); | |||
| rent.setApplyStatus(applyStatus); | |||
| wxRentContractService.updateApplyStatus(rent); | |||
| //合同状态改成提前终止 | |||
| if(EnumRentContractAppStatus.FINISH.getCode().intValue() == applyStatus.intValue()) { | |||
| WxRentContract updateRentContract = new WxRentContract(); | |||
| updateRentContract.setId(businessId); | |||
| updateRentContract.setStatus(EnumRentContractStatus.CONTRACT_TERMINATE.getCode()); | |||
| wxRentContractMapper.updateStatus(updateRentContract); | |||
| } | |||
| }else if(contractType.intValue() == 3 || contractType.intValue() == 4){ | |||
| WxPropertyContract wxPropertyContract = new WxPropertyContract(); | |||
| wxPropertyContract.setId(businessId); | |||
| wxPropertyContract.setApplyStatus(applyStatus); | |||
| wxPropertyContractMapper.updateApplyStatus(wxPropertyContract); | |||
| if(EnumRentContractAppStatus.FINISH.getCode().intValue() == applyStatus.intValue()) { | |||
| WxPropertyContract updateRentContract = new WxPropertyContract(); | |||
| updateRentContract.setId(businessId); | |||
| updateRentContract.setStatus(EnumRentContractStatus.CONTRACT_TERMINATE.getCode()); | |||
| wxPropertyContractMapper.updateStatus(updateRentContract); | |||
| } | |||
| } | |||
| } | |||
| } | |||
| @@ -240,8 +271,6 @@ public class WxFlowServiceImpl implements WxFlowService { | |||
| result.add(0,wxFlowRecord); | |||
| } | |||
| } | |||
| return new ResultData(result); | |||
| } | |||