From b26ed9f9b2ff5c118dc86c0e3388dfc43c949094 Mon Sep 17 00:00:00 2001 From: luozukai Date: Sat, 19 Jan 2019 17:22:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=AE=A1=E6=89=B9=E6=B5=81&?= =?UTF-8?q?=E5=BC=80=E5=8F=91=E8=BD=A6=E8=BE=86=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../flowable/ContractTaskFinishHandler.java | 28 ++++++++++++------- .../processes/contractflow.bpmn20.xml | 2 ++ .../service/impl/WxFlowServiceImpl.java | 17 ++++++++++- 3 files changed, 36 insertions(+), 11 deletions(-) diff --git a/mallinkAdmin/src/main/java/com/iformall/flowable/ContractTaskFinishHandler.java b/mallinkAdmin/src/main/java/com/iformall/flowable/ContractTaskFinishHandler.java index 1c89b771e..39982396e 100644 --- a/mallinkAdmin/src/main/java/com/iformall/flowable/ContractTaskFinishHandler.java +++ b/mallinkAdmin/src/main/java/com/iformall/flowable/ContractTaskFinishHandler.java @@ -2,6 +2,7 @@ package com.iformall.flowable; import com.iformall.enums.EnumRentContractAppStatus; import com.iformall.service.WxFlowService; +import com.iformall.service.WxPropertyContractService; import com.iformall.service.impl.WxFlowServiceImpl; import org.apache.commons.lang3.StringUtils; import org.flowable.engine.delegate.TaskListener; @@ -13,24 +14,31 @@ import java.util.Map; /** * 合同审批完成,修改状态 + * */ @Component(value="contractTaskFinishListener") public class ContractTaskFinishHandler implements TaskListener { @Autowired private WxFlowService wxFlowService; + @Autowired + private WxPropertyContractService wxPropertyContractService; @Override public void notify(DelegateTask delegateTask) { - Long businessId = (Long)delegateTask.getVariable("businessId"); - List> variables = (List)delegateTask.getVariable("variables"); - Integer flowType = (Integer)delegateTask.getVariable("flowType"); - - Integer contractType = 0; - String str = WxFlowServiceImpl.getVariableByKey(variables,"contractType"); - if(StringUtils.isNotBlank(str)){ - contractType = Integer.parseInt(str); - } - wxFlowService.updateBusinessStatus(businessId,flowType,contractType,EnumRentContractAppStatus.FINISH.getCode()); +// Long businessId = (Long)delegateTask.getVariable("businessId"); +// List> variables = (List)delegateTask.getVariable("variables"); +// Integer flowType = (Integer)delegateTask.getVariable("flowType"); +// +// Integer contractType = 0; +// String str = WxFlowServiceImpl.getVariableByKey(variables,"contractType"); +// if(StringUtils.isNotBlank(str)){ +// contractType = Integer.parseInt(str); +// +// if(3==contractType){ +// wxPropertyContractService.updatePropertyContractStatus(businessId); +// } +// } +// wxFlowService.updateBusinessStatus(businessId,flowType,contractType,EnumRentContractAppStatus.FINISH.getCode()); } } diff --git a/mallinkAdmin/src/main/resources/processes/contractflow.bpmn20.xml b/mallinkAdmin/src/main/resources/processes/contractflow.bpmn20.xml index 35207bf97..fb90dd9d6 100644 --- a/mallinkAdmin/src/main/resources/processes/contractflow.bpmn20.xml +++ b/mallinkAdmin/src/main/resources/processes/contractflow.bpmn20.xml @@ -12,9 +12,11 @@ 复审 + 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 3ab9e884e..5a1d534c4 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java @@ -61,6 +61,8 @@ public class WxFlowServiceImpl implements WxFlowService { private WxRentContractMapper wxRentContractMapper; @Autowired private WxPropertyContractMapper wxPropertyContractMapper; + @Autowired + private WxPropertyContractService wxPropertyContractService; /** * 获取流程key,1合同 2账单 @@ -359,12 +361,25 @@ public class WxFlowServiceImpl implements WxFlowService { isEndAndSendMsg(mapInfo,taskKey,processInstanceId,tenantId,userName); } }else{ + // 完成,修改业务状态 + Integer flowType = (Integer)mapInfo.get("flowType"); + List> variables = (List)mapInfo.get("variables"); + Integer contractType = 0; + String str = getVariableByKey(variables,"contractType"); + if(StringUtils.isNotBlank(str)){ + contractType = Integer.parseInt(str); + + if(3 == contractType){ //物业合同 + wxPropertyContractService.updatePropertyContractStatus(businessId); + } + } + updateBusinessStatus(businessId,flowType,contractType,EnumRentContractAppStatus.FINISH.getCode()); + // 给发起人发送审批通过消息 msgReplaceMap = new HashedMap(); msgReplaceMap.put("modelName","通过审批通知"); msgReplaceMap.put("contract",businessId+""); msgReplaceMap.put("page",Constant.adminPage); - wxMsgValidationcode = new WxMsgValidationcode(); wxMsgValidationcode.setPhone(starter.getPhone()); wxMsgValidationcodeService.sendWorkFlowNodify(wxMsgValidationcode,msgReplaceMap);