|
|
|
@@ -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<Map<String,String>> taskAssignee = (List)params.get("taskAssignee"); |
|
|
|
List<Map<String,String>> variables = (List)params.get("variables"); |
|
|
|
Boolean supplement = (Boolean)params.get("supplement"); |
|
|
|
|
|
|
|
// 设置节点处理人 |
|
|
|
HashMap<String, Object> 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<Map<String,String>> 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<Map<String,String>> 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(); |
|
|
|
|