Просмотр исходного кода

优化审批流&开发车辆显示

release_toaliyun_real
luozukai 7 лет назад
Родитель
Сommit
b26ed9f9b2
3 измененных файлов: 36 добавлений и 11 удалений
  1. +18
    -10
      mallinkAdmin/src/main/java/com/iformall/flowable/ContractTaskFinishHandler.java
  2. +2
    -0
      mallinkAdmin/src/main/resources/processes/contractflow.bpmn20.xml
  3. +16
    -1
      mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java

+ 18
- 10
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<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());
}

}

+ 2
- 0
mallinkAdmin/src/main/resources/processes/contractflow.bpmn20.xml Просмотреть файл

@@ -12,9 +12,11 @@
<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>
<!--
<extensionElements>
<flowable:taskListener event="complete" delegateExpression="${contractTaskFinishListener}"></flowable:taskListener>
</extensionElements>
-->
</userTask>
</process>
<bpmndi:BPMNDiagram id="BPMNDiagram_contract_flow">


+ 16
- 1
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<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.put("modelName","通过审批通知");
msgReplaceMap.put("contract",businessId+"");
msgReplaceMap.put("page",Constant.adminPage);

wxMsgValidationcode = new WxMsgValidationcode();
wxMsgValidationcode.setPhone(starter.getPhone());
wxMsgValidationcodeService.sendWorkFlowNodify(wxMsgValidationcode,msgReplaceMap);


Загрузка…
Отмена
Сохранить