| @@ -1,6 +1,7 @@ | |||||
| package com.iformall.service.impl; | package com.iformall.service.impl; | ||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.iformall.common.ErrorCode; | |||||
| import com.iformall.common.Result; | import com.iformall.common.Result; | ||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.domain.po.MallUserInfo; | import com.iformall.domain.po.MallUserInfo; | ||||
| @@ -12,6 +13,7 @@ import com.iformall.enums.EnumFlowRecordStatus; | |||||
| import com.iformall.enums.EnumMsgModelType; | import com.iformall.enums.EnumMsgModelType; | ||||
| import com.iformall.enums.EnumRentContractAppStatus; | import com.iformall.enums.EnumRentContractAppStatus; | ||||
| import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
| import com.iformall.mapper.WxRentContractMapper; | |||||
| import com.iformall.service.*; | import com.iformall.service.*; | ||||
| import com.iformall.utils.Constant; | import com.iformall.utils.Constant; | ||||
| import org.apache.commons.collections.CollectionUtils; | import org.apache.commons.collections.CollectionUtils; | ||||
| @@ -58,6 +60,8 @@ public class WxFlowServiceImpl implements WxFlowService { | |||||
| private MallUserInfoService mallUserInfoService; | private MallUserInfoService mallUserInfoService; | ||||
| @Autowired | @Autowired | ||||
| private WxMsgValidationcodeService wxMsgValidationcodeService; | private WxMsgValidationcodeService wxMsgValidationcodeService; | ||||
| @Autowired | |||||
| private WxRentContractMapper wxRentContractMapper; | |||||
| /** | /** | ||||
| * 获取流程key,1合同 2账单 | * 获取流程key,1合同 2账单 | ||||
| @@ -81,6 +85,12 @@ public class WxFlowServiceImpl implements WxFlowService { | |||||
| Integer flowType = (Integer)params.get("businessType"); | Integer flowType = (Integer)params.get("businessType"); | ||||
| List<Map<String,String>> taskAssignee = (List)params.get("taskAssignee"); | 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<>(); | HashMap<String, Object> map = new HashMap<>(); | ||||
| for (Map<String,String> taskAssigneeMap : taskAssignee) { | for (Map<String,String> taskAssigneeMap : taskAssignee) { | ||||
| @@ -93,15 +103,16 @@ public class WxFlowServiceImpl implements WxFlowService { | |||||
| map.put("businessId",businessId); | map.put("businessId",businessId); | ||||
| map.put("flowType",flowType); | map.put("flowType",flowType); | ||||
| map.put("taskAssignee",taskAssignee); | map.put("taskAssignee",taskAssignee); | ||||
| map.put("contractNumber",wxRentContract.getContractNumber()); | |||||
| ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(getFlowKeyByType(flowType), map); | ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(getFlowKeyByType(flowType), map); | ||||
| logger.debug("流程启动,流程id:{}",processInstance.getId()); | 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表审批记录 | // 保存wx_flow_record表审批记录 | ||||
| WxFlowRecord wxFlowRecord = new WxFlowRecord(); | WxFlowRecord wxFlowRecord = new WxFlowRecord(); | ||||
| @@ -149,6 +160,7 @@ public class WxFlowServiceImpl implements WxFlowService { | |||||
| taskInfoMap.put("processInstanceId",task.getProcessInstanceId()); | taskInfoMap.put("processInstanceId",task.getProcessInstanceId()); | ||||
| taskInfoMap.put("taskId",task.getId()); | taskInfoMap.put("taskId",task.getId()); | ||||
| taskInfoMap.put("businessId",mapInfo.get("businessId")); | taskInfoMap.put("businessId",mapInfo.get("businessId")); | ||||
| taskInfoMap.put("contractNumber",mapInfo.get("contractNumber")); | |||||
| result.add(taskInfoMap); | result.add(taskInfoMap); | ||||
| } | } | ||||
| PageInfo<Map<String,Object>> pageInfo = new PageInfo<>(result,pageSize); | PageInfo<Map<String,Object>> pageInfo = new PageInfo<>(result,pageSize); | ||||