| @@ -2,6 +2,7 @@ package com.iformall.flowable; | |||||
| import com.iformall.enums.EnumRentContractAppStatus; | import com.iformall.enums.EnumRentContractAppStatus; | ||||
| import com.iformall.service.WxFlowService; | import com.iformall.service.WxFlowService; | ||||
| import com.iformall.service.WxPropertyContractService; | |||||
| import com.iformall.service.impl.WxFlowServiceImpl; | import com.iformall.service.impl.WxFlowServiceImpl; | ||||
| import org.apache.commons.lang3.StringUtils; | import org.apache.commons.lang3.StringUtils; | ||||
| import org.flowable.engine.delegate.TaskListener; | import org.flowable.engine.delegate.TaskListener; | ||||
| @@ -13,24 +14,31 @@ import java.util.Map; | |||||
| /** | /** | ||||
| * 合同审批完成,修改状态 | * 合同审批完成,修改状态 | ||||
| * | |||||
| */ | */ | ||||
| @Component(value="contractTaskFinishListener") | @Component(value="contractTaskFinishListener") | ||||
| public class ContractTaskFinishHandler implements TaskListener { | public class ContractTaskFinishHandler implements TaskListener { | ||||
| @Autowired | @Autowired | ||||
| private WxFlowService wxFlowService; | private WxFlowService wxFlowService; | ||||
| @Autowired | |||||
| private WxPropertyContractService wxPropertyContractService; | |||||
| @Override | @Override | ||||
| public void notify(DelegateTask delegateTask) { | public void notify(DelegateTask delegateTask) { | ||||
| Long businessId = (Long)delegateTask.getVariable("businessId"); | |||||
| List<Map<String,String>> 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<Map<String,String>> 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()); | |||||
| } | } | ||||
| } | } | ||||
| @@ -12,9 +12,11 @@ | |||||
| <sequenceFlow id="sid-9FCAF465-99E7-4EFE-BEEA-7D59481E684C" sourceRef="secondTaskUser" targetRef="sid-9692A856-E39A-4B8C-95C2-7C04A3646D6F"></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}"> | <userTask id="secondTaskUser" name="复审" flowable:candidateUsers="${secondTaskUser}"> | ||||
| <documentation>复审</documentation> | <documentation>复审</documentation> | ||||
| <!-- | |||||
| <extensionElements> | <extensionElements> | ||||
| <flowable:taskListener event="complete" delegateExpression="${contractTaskFinishListener}"></flowable:taskListener> | <flowable:taskListener event="complete" delegateExpression="${contractTaskFinishListener}"></flowable:taskListener> | ||||
| </extensionElements> | </extensionElements> | ||||
| --> | |||||
| </userTask> | </userTask> | ||||
| </process> | </process> | ||||
| <bpmndi:BPMNDiagram id="BPMNDiagram_contract_flow"> | <bpmndi:BPMNDiagram id="BPMNDiagram_contract_flow"> | ||||
| @@ -61,6 +61,8 @@ public class WxFlowServiceImpl implements WxFlowService { | |||||
| private WxRentContractMapper wxRentContractMapper; | private WxRentContractMapper wxRentContractMapper; | ||||
| @Autowired | @Autowired | ||||
| private WxPropertyContractMapper wxPropertyContractMapper; | private WxPropertyContractMapper wxPropertyContractMapper; | ||||
| @Autowired | |||||
| private WxPropertyContractService wxPropertyContractService; | |||||
| /** | /** | ||||
| * 获取流程key,1合同 2账单 | * 获取流程key,1合同 2账单 | ||||
| @@ -359,12 +361,25 @@ public class WxFlowServiceImpl implements WxFlowService { | |||||
| isEndAndSendMsg(mapInfo,taskKey,processInstanceId,tenantId,userName); | isEndAndSendMsg(mapInfo,taskKey,processInstanceId,tenantId,userName); | ||||
| } | } | ||||
| }else{ | }else{ | ||||
| // 完成,修改业务状态 | |||||
| Integer flowType = (Integer)mapInfo.get("flowType"); | |||||
| List<Map<String,String>> 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 = new HashedMap(); | ||||
| msgReplaceMap.put("modelName","通过审批通知"); | msgReplaceMap.put("modelName","通过审批通知"); | ||||
| msgReplaceMap.put("contract",businessId+""); | msgReplaceMap.put("contract",businessId+""); | ||||
| msgReplaceMap.put("page",Constant.adminPage); | msgReplaceMap.put("page",Constant.adminPage); | ||||
| wxMsgValidationcode = new WxMsgValidationcode(); | wxMsgValidationcode = new WxMsgValidationcode(); | ||||
| wxMsgValidationcode.setPhone(starter.getPhone()); | wxMsgValidationcode.setPhone(starter.getPhone()); | ||||
| wxMsgValidationcodeService.sendWorkFlowNodify(wxMsgValidationcode,msgReplaceMap); | wxMsgValidationcodeService.sendWorkFlowNodify(wxMsgValidationcode,msgReplaceMap); | ||||