diff --git a/mallinkService/src/main/java/com/iformall/service/WxFlowService.java b/mallinkService/src/main/java/com/iformall/service/WxFlowService.java index dc003f0d8..70a31ebee 100644 --- a/mallinkService/src/main/java/com/iformall/service/WxFlowService.java +++ b/mallinkService/src/main/java/com/iformall/service/WxFlowService.java @@ -16,7 +16,7 @@ public interface WxFlowService { * @param businessId * @param flowType */ - void updateBusinessStatus(Long businessId,Integer flowType,Integer contractType,Integer applyStatus); + void updateBusinessStatus(Long businessId,Integer flowType,Integer contractType,Integer applyStatus,Boolean supplement); ResultData getTaskStatusList(Long businessId,String tenantId); 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 d165bdbde..5a3c82c95 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java @@ -86,7 +86,7 @@ public class WxFlowServiceImpl implements WxFlowService { * @param flowType */ @Override - public void updateBusinessStatus(Long businessId,Integer flowType,Integer contractType,Integer applyStatus){ + public void updateBusinessStatus(Long businessId,Integer flowType,Integer contractType,Integer applyStatus,Boolean supplement){ if(1 == flowType){ // 1租赁合同 2点位合同wx_rent_contract 3物业wx_property_contract 4点位物业合同 if(contractType.intValue() == 1 || contractType.intValue() == 2){ @@ -94,6 +94,11 @@ public class WxFlowServiceImpl implements WxFlowService { rent.setId(businessId); rent.setApplyStatus(applyStatus); wxRentContractService.updateApplyStatus(rent); + + // 如果审批完成,而且是补录,修改状态 + if(supplement!=null && supplement && EnumRentContractAppStatus.FINISH.getCode().intValue() == applyStatus.intValue()) { + wxRentContractService.updateRentContractStatus(businessId); + } }else if(contractType.intValue() == 3 || contractType.intValue() == 4){ WxPropertyContract wxPropertyContract = new WxPropertyContract(); wxPropertyContract.setId(businessId); @@ -116,6 +121,7 @@ public class WxFlowServiceImpl implements WxFlowService { Integer flowType = (Integer)params.get("businessType"); List> taskAssignee = (List)params.get("taskAssignee"); List> variables = (List)params.get("variables"); + Boolean supplement = (Boolean)params.get("supplement"); // 设置节点处理人 HashMap map = new HashMap<>(); @@ -130,6 +136,7 @@ public class WxFlowServiceImpl implements WxFlowService { map.put("flowType",flowType); map.put("taskAssignee",taskAssignee); map.put("variables",variables); + map.put("supplement",supplement); ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(getFlowKeyByType(flowType), map); logger.debug("流程启动,流程id:{}",processInstance.getId()); @@ -140,7 +147,7 @@ public class WxFlowServiceImpl implements WxFlowService { if(StringUtils.isNotBlank(str)){ contractType = Integer.parseInt(str); } - updateBusinessStatus(businessId,flowType,contractType,EnumRentContractAppStatus.APPLYING.getCode()); + updateBusinessStatus(businessId,flowType,contractType,EnumRentContractAppStatus.APPLYING.getCode(),supplement); // 保存wx_flow_record表审批记录 WxFlowRecord wxFlowRecord = new WxFlowRecord(); @@ -359,6 +366,7 @@ public class WxFlowServiceImpl implements WxFlowService { MallUserInfo starter = (MallUserInfo)mapInfo.get("starter"); List> taskAssigneeList = (List)mapInfo.get("taskAssignee"); Long businessId = (Long)mapInfo.get("businessId"); + Boolean supplement = (Boolean)mapInfo.get("supplement"); // 判断下个节点是否有设置审批人,没有,直接通过,有,发短信通知 if(!isEnded(processInstanceId)){ @@ -405,7 +413,7 @@ public class WxFlowServiceImpl implements WxFlowService { wxPropertyContractService.updatePropertyContractStatus(businessId); } } - updateBusinessStatus(businessId,flowType,contractType,EnumRentContractAppStatus.FINISH.getCode()); + updateBusinessStatus(businessId,flowType,contractType,EnumRentContractAppStatus.FINISH.getCode(),supplement); // 给发起人发送审批通过消息 msgReplaceMap = new HashedMap(); @@ -455,6 +463,7 @@ public class WxFlowServiceImpl implements WxFlowService { Integer flowType = (Integer)mapInfo.get("flowType"); MallUserInfo starter = (MallUserInfo)mapInfo.get("starter"); List> variables = (List)mapInfo.get("variables"); + Boolean supplement = (Boolean)mapInfo.get("supplement"); String taskName; String taskKey; @@ -473,7 +482,7 @@ public class WxFlowServiceImpl implements WxFlowService { if(StringUtils.isNotBlank(str)){ contractType = Integer.parseInt(str); } - updateBusinessStatus(businessId,flowType,contractType,EnumRentContractAppStatus.REJECT.getCode()); + updateBusinessStatus(businessId,flowType,contractType,EnumRentContractAppStatus.REJECT.getCode(),supplement); //保存wx_flow_record表审批记录 WxFlowRecord wxFlowRecord = new WxFlowRecord(); diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java index 404a5cd95..821a9adfa 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java @@ -193,7 +193,8 @@ public class WxRentContractServiceImpl implements WxRentContractService { try { // 如果是补录,启动审批流 if(record.getMerchantId() != null && record.getFlowParams() != null){ - record.getFlowParams().put("businessId",record.getId()); + record.getFlowParams().put("businessId",record.getId().toString()); + record.getFlowParams().put("supplement",true); wxFlowService.start(record.getFlowParams(),userId,userName,record.getTenantId()); } } catch (Exception e) {