diff --git a/mallinkAdmin/src/main/resources/processes/endContractflow.bpmn20.xml b/mallinkAdmin/src/main/resources/processes/endContractflow.bpmn20.xml new file mode 100644 index 000000000..9fe8beae0 --- /dev/null +++ b/mallinkAdmin/src/main/resources/processes/endContractflow.bpmn20.xml @@ -0,0 +1,45 @@ + + + + 终止合同审批流程 + + + 初审 + + + + + + + 复审 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/mallinkService/src/main/java/com/iformall/enums/EnumFlowKey.java b/mallinkService/src/main/java/com/iformall/enums/EnumFlowKey.java index bd4f6ce47..ea0ffe236 100644 --- a/mallinkService/src/main/java/com/iformall/enums/EnumFlowKey.java +++ b/mallinkService/src/main/java/com/iformall/enums/EnumFlowKey.java @@ -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) { diff --git a/mallinkService/src/main/java/com/iformall/enums/EnumFlowRecordStatus.java b/mallinkService/src/main/java/com/iformall/enums/EnumFlowRecordStatus.java index 9a4e2addd..5641827fa 100644 --- a/mallinkService/src/main/java/com/iformall/enums/EnumFlowRecordStatus.java +++ b/mallinkService/src/main/java/com/iformall/enums/EnumFlowRecordStatus.java @@ -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) { diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java index 8b57f88c9..b29046864 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java @@ -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); }