|
|
|
@@ -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<Map<String,String>> taskAssignee = (List)params.get("taskAssignee"); |
|
|
|
|
|
|
|
// 查询合同信息 |
|
|
|
WxRentContract wxRentContract = wxRentContractMapper.selectByPrimaryKey(businessId); |
|
|
|
if (wxRentContract == null) { |
|
|
|
return new ResultData(ErrorCode.RENT_CONTRACT_IS_NOT_FOUND); |
|
|
|
} |
|
|
|
|
|
|
|
// 设置节点处理人 |
|
|
|
HashMap<String, Object> map = new HashMap<>(); |
|
|
|
for (Map<String,String> 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<Map<String,Object>> pageInfo = new PageInfo<>(result,pageSize); |
|
|
|
|