From 66b478d3bcd5fd02f4976d642ec694bbc4515560 Mon Sep 17 00:00:00 2001 From: luozukai Date: Fri, 18 Jan 2019 15:39:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=AE=A1=E6=89=B9=E6=B5=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/WxFlowServiceImpl.java | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) 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 e4618c3bd..1af1d755f 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java @@ -1,6 +1,7 @@ package com.iformall.service.impl; import com.github.pagehelper.PageInfo; +import com.iformall.common.ErrorCode; import com.iformall.common.Result; import com.iformall.common.ResultData; import com.iformall.domain.po.MallUserInfo; @@ -12,6 +13,7 @@ import com.iformall.enums.EnumFlowRecordStatus; import com.iformall.enums.EnumMsgModelType; import com.iformall.enums.EnumRentContractAppStatus; import com.iformall.exception.MallinkException; +import com.iformall.mapper.WxRentContractMapper; import com.iformall.service.*; import com.iformall.utils.Constant; import org.apache.commons.collections.CollectionUtils; @@ -58,6 +60,8 @@ public class WxFlowServiceImpl implements WxFlowService { private MallUserInfoService mallUserInfoService; @Autowired private WxMsgValidationcodeService wxMsgValidationcodeService; + @Autowired + private WxRentContractMapper wxRentContractMapper; /** * 获取流程key,1合同 2账单 @@ -81,6 +85,12 @@ public class WxFlowServiceImpl implements WxFlowService { Integer flowType = (Integer)params.get("businessType"); List> taskAssignee = (List)params.get("taskAssignee"); + // 查询合同信息 + WxRentContract wxRentContract = wxRentContractMapper.selectByPrimaryKey(businessId); + if (wxRentContract == null) { + return new ResultData(ErrorCode.RENT_CONTRACT_IS_NOT_FOUND); + } + // 设置节点处理人 HashMap map = new HashMap<>(); for (Map taskAssigneeMap : taskAssignee) { @@ -93,15 +103,16 @@ public class WxFlowServiceImpl implements WxFlowService { map.put("businessId",businessId); map.put("flowType",flowType); map.put("taskAssignee",taskAssignee); + map.put("contractNumber",wxRentContract.getContractNumber()); ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(getFlowKeyByType(flowType), map); logger.debug("流程启动,流程id:{}",processInstance.getId()); // 合同审核状态改为审核中 - WxRentContract wxRentContract = new WxRentContract(); - wxRentContract.setId(businessId); - wxRentContract.setApplyStatus(EnumRentContractAppStatus.APPLYING.getCode()); - wxRentContractService.updateApplyStatus(wxRentContract); + WxRentContract rent = new WxRentContract(); + rent.setId(businessId); + rent.setApplyStatus(EnumRentContractAppStatus.APPLYING.getCode()); + wxRentContractService.updateApplyStatus(rent); // 保存wx_flow_record表审批记录 WxFlowRecord wxFlowRecord = new WxFlowRecord(); @@ -149,6 +160,7 @@ public class WxFlowServiceImpl implements WxFlowService { taskInfoMap.put("processInstanceId",task.getProcessInstanceId()); taskInfoMap.put("taskId",task.getId()); taskInfoMap.put("businessId",mapInfo.get("businessId")); + taskInfoMap.put("contractNumber",mapInfo.get("contractNumber")); result.add(taskInfoMap); } PageInfo> pageInfo = new PageInfo<>(result,pageSize);