|
|
|
@@ -172,7 +172,7 @@ public class WxFlowServiceImpl implements WxFlowService { |
|
|
|
Integer operateType = getIngeter(getVariableByKey(variables,"approvalType")); |
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
|
|
|
|
|
|
|
if(EnumFlowKey.CONTRACT.getCode().equals(flowType) || EnumFlowKey.NEW_RENT_CONTRACT.getCode().equals(flowType)){ |
|
|
|
if(/*EnumFlowKey.CONTRACT.getCode().equals(flowType) || */EnumFlowKey.NEW_RENT_CONTRACT.getCode().equals(flowType)){ |
|
|
|
// 1租赁合同 2点位合同 3物业 4点位物业合同 5 合并合同-店铺 6 合并合同-多经点位 |
|
|
|
WxRentContract rent = new WxRentContract(); |
|
|
|
//租金+合同的bussinessId 特殊 |
|
|
|
@@ -198,7 +198,7 @@ public class WxFlowServiceImpl implements WxFlowService { |
|
|
|
rent.setStatus(EnumRentContractStatus.DRAFT.getCode()); |
|
|
|
} |
|
|
|
wxRentContractService.updateApplyStatus(rent); |
|
|
|
}else if(EnumFlowKey.END_CONTRACT.getCode().equals(flowType) || EnumFlowKey.NEW_RENT_END_CONTRACT.getCode().equals(flowType)){ |
|
|
|
}else if(/*EnumFlowKey.END_CONTRACT.getCode().equals(flowType) ||*/ EnumFlowKey.NEW_RENT_END_CONTRACT.getCode().equals(flowType)){ |
|
|
|
WxRentContract rent = new WxRentContract(); |
|
|
|
//租金+合同的bussinessId 特殊 |
|
|
|
Long bsId = Long.parseLong(businessId); |
|
|
|
@@ -211,7 +211,7 @@ public class WxFlowServiceImpl implements WxFlowService { |
|
|
|
wxRentContractService.endContract(rent,null); |
|
|
|
} |
|
|
|
wxRentContractService.updateApplyStatus(rent); |
|
|
|
} else if (EnumFlowKey.BILL.getCode().equals(flowType) || EnumFlowKey.NEW_BILL_CHANGE.getCode().equals(flowType) |
|
|
|
} else if (/*EnumFlowKey.BILL.getCode().equals(flowType) ||*/ EnumFlowKey.NEW_BILL_CHANGE.getCode().equals(flowType) |
|
|
|
|| EnumFlowKey.BILL_FINISH.getCode().equals(flowType)) { |
|
|
|
Integer billType = getIngeter(getVariableByKey(variables, "billType")); |
|
|
|
if(EnumRentContractAppStatus.FINISH.getCode().intValue() == applyStatus.intValue()) { |
|
|
|
@@ -639,9 +639,8 @@ public class WxFlowServiceImpl implements WxFlowService { |
|
|
|
} |
|
|
|
|
|
|
|
public boolean isContract(Integer flowType){ |
|
|
|
if(EnumFlowKey.CONTRACT.getCode().equals(flowType) |
|
|
|
||EnumFlowKey.END_CONTRACT.getCode().equals(flowType) |
|
|
|
|| EnumFlowKey.NEW_RENT_CONTRACT.getCode().equals(flowType) |
|
|
|
if(/*EnumFlowKey.CONTRACT.getCode().equals(flowType)||EnumFlowKey.END_CONTRACT.getCode().equals(flowType) ||*/ |
|
|
|
EnumFlowKey.NEW_RENT_CONTRACT.getCode().equals(flowType) |
|
|
|
|| EnumFlowKey.NEW_RENT_END_CONTRACT.getCode().equals(flowType) |
|
|
|
){ |
|
|
|
return true; |
|
|
|
@@ -650,8 +649,7 @@ public class WxFlowServiceImpl implements WxFlowService { |
|
|
|
} |
|
|
|
|
|
|
|
public boolean isBill(Integer flowType){ |
|
|
|
if(EnumFlowKey.BILL.getCode().equals(flowType) |
|
|
|
||EnumFlowKey.NEW_BILL_CHANGE.getCode().equals(flowType)){ |
|
|
|
if(/*EnumFlowKey.BILL.getCode().equals(flowType)||*/ EnumFlowKey.NEW_BILL_CHANGE.getCode().equals(flowType)){ |
|
|
|
return true; |
|
|
|
} |
|
|
|
return false; |
|
|
|
@@ -808,58 +806,58 @@ public class WxFlowServiceImpl implements WxFlowService { |
|
|
|
return new ResultData(ErrorCode.FLOW_INST_NOT_EXIST.getCode(), "任务不存在"); |
|
|
|
} |
|
|
|
|
|
|
|
if(flowType.intValue() <= EnumFlowKey.END_CONTRACT.getCode().intValue()){ |
|
|
|
//老数据 |
|
|
|
Task task = taskService.createTaskQuery().processInstanceId(pi.getId()).singleResult(); |
|
|
|
Map<String,Object> mapInfo = taskService.getVariables(task.getId()); |
|
|
|
List<Map<String,String>> taskAssigneeList = (List)mapInfo.get("taskAssignee"); |
|
|
|
for (int i = 0; i < taskAssigneeList.size(); i++) { |
|
|
|
Map<String,String> assignee = taskAssigneeList.get(i); |
|
|
|
if(task.getTaskDefinitionKey().equals(assignee.get("taskKey"))){ |
|
|
|
//设置当前节点代办人信息 |
|
|
|
String[] assigneeArray = assignee.get("assignee").split(","); |
|
|
|
String userName = ""; |
|
|
|
for (int j = 0; j < assigneeArray.length; j++) { |
|
|
|
String userid = assigneeArray[j]; |
|
|
|
MallUserInfo mallUserInfo = this.mallUserInfoService.getById(Long.parseLong(userid)); |
|
|
|
if(j != assigneeArray.length-1){ |
|
|
|
userName += mallUserInfo.getName()+","; |
|
|
|
}else{ |
|
|
|
userName += mallUserInfo.getName()+""; |
|
|
|
} |
|
|
|
} |
|
|
|
WxFlowRecord wxFlowRecord = new WxFlowRecord(); |
|
|
|
wxFlowRecord.setUserName(userName.trim()); |
|
|
|
wxFlowRecord.setStatus(EnumFlowRecordStatus.ASSIGNEE.getCode()); |
|
|
|
wxFlowRecord.setTaskKey(task.getTaskDefinitionKey()); |
|
|
|
resultList.add(0,wxFlowRecord); |
|
|
|
|
|
|
|
//不是最后一个节点,设置下一个待审批节点代办人 |
|
|
|
if(i != taskAssigneeList.size()-1){ |
|
|
|
assignee = taskAssigneeList.get(i+1); |
|
|
|
// 下一个节点没设置代办人 |
|
|
|
if(StringUtils.isBlank(assignee.get("assignee"))){ |
|
|
|
continue; |
|
|
|
} |
|
|
|
assigneeArray = assignee.get("assignee").split(","); |
|
|
|
userName = ""; |
|
|
|
for (String userid:assigneeArray) { |
|
|
|
MallUserInfo mallUserInfo = this.mallUserInfoService.getById(Long.parseLong(userid)); |
|
|
|
userName += mallUserInfo.getName()+" "; |
|
|
|
} |
|
|
|
|
|
|
|
wxFlowRecord = new WxFlowRecord(); |
|
|
|
wxFlowRecord.setUserName(userName.trim()); |
|
|
|
wxFlowRecord.setStatus(EnumFlowRecordStatus.ASSIGNEE.getCode()); |
|
|
|
wxFlowRecord.setTaskKey(UUID.randomUUID().toString()); |
|
|
|
resultList.add(0,wxFlowRecord); |
|
|
|
break; |
|
|
|
} |
|
|
|
}else{ |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
}else{ |
|
|
|
// if(flowType.intValue() <= EnumFlowKey.END_CONTRACT.getCode().intValue()){ |
|
|
|
// //老数据 |
|
|
|
// Task task = taskService.createTaskQuery().processInstanceId(pi.getId()).singleResult(); |
|
|
|
// Map<String,Object> mapInfo = taskService.getVariables(task.getId()); |
|
|
|
// List<Map<String,String>> taskAssigneeList = (List)mapInfo.get("taskAssignee"); |
|
|
|
// for (int i = 0; i < taskAssigneeList.size(); i++) { |
|
|
|
// Map<String,String> assignee = taskAssigneeList.get(i); |
|
|
|
// if(task.getTaskDefinitionKey().equals(assignee.get("taskKey"))){ |
|
|
|
// //设置当前节点代办人信息 |
|
|
|
// String[] assigneeArray = assignee.get("assignee").split(","); |
|
|
|
// String userName = ""; |
|
|
|
// for (int j = 0; j < assigneeArray.length; j++) { |
|
|
|
// String userid = assigneeArray[j]; |
|
|
|
// MallUserInfo mallUserInfo = this.mallUserInfoService.getById(Long.parseLong(userid)); |
|
|
|
// if(j != assigneeArray.length-1){ |
|
|
|
// userName += mallUserInfo.getName()+","; |
|
|
|
// }else{ |
|
|
|
// userName += mallUserInfo.getName()+""; |
|
|
|
// } |
|
|
|
// } |
|
|
|
// WxFlowRecord wxFlowRecord = new WxFlowRecord(); |
|
|
|
// wxFlowRecord.setUserName(userName.trim()); |
|
|
|
// wxFlowRecord.setStatus(EnumFlowRecordStatus.ASSIGNEE.getCode()); |
|
|
|
// wxFlowRecord.setTaskKey(task.getTaskDefinitionKey()); |
|
|
|
// resultList.add(0,wxFlowRecord); |
|
|
|
// |
|
|
|
// //不是最后一个节点,设置下一个待审批节点代办人 |
|
|
|
// if(i != taskAssigneeList.size()-1){ |
|
|
|
// assignee = taskAssigneeList.get(i+1); |
|
|
|
// // 下一个节点没设置代办人 |
|
|
|
// if(StringUtils.isBlank(assignee.get("assignee"))){ |
|
|
|
// continue; |
|
|
|
// } |
|
|
|
// assigneeArray = assignee.get("assignee").split(","); |
|
|
|
// userName = ""; |
|
|
|
// for (String userid:assigneeArray) { |
|
|
|
// MallUserInfo mallUserInfo = this.mallUserInfoService.getById(Long.parseLong(userid)); |
|
|
|
// userName += mallUserInfo.getName()+" "; |
|
|
|
// } |
|
|
|
// |
|
|
|
// wxFlowRecord = new WxFlowRecord(); |
|
|
|
// wxFlowRecord.setUserName(userName.trim()); |
|
|
|
// wxFlowRecord.setStatus(EnumFlowRecordStatus.ASSIGNEE.getCode()); |
|
|
|
// wxFlowRecord.setTaskKey(UUID.randomUUID().toString()); |
|
|
|
// resultList.add(0,wxFlowRecord); |
|
|
|
// break; |
|
|
|
// } |
|
|
|
// }else{ |
|
|
|
// continue; |
|
|
|
// } |
|
|
|
// } |
|
|
|
// }else{ |
|
|
|
List<Task> taskList = taskService.createTaskQuery().processInstanceId(pi.getId()).list(); |
|
|
|
Map<String,Object> mapInfo = taskService.getVariables(taskList.get(0).getId()); |
|
|
|
//WxFlowModel flowModelDb = getModelByType(flowType,tenantId); |
|
|
|
@@ -915,7 +913,7 @@ public class WxFlowServiceImpl implements WxFlowService { |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
// } |
|
|
|
// 只展示最后一次发起,设置最后一个发起节点 |
|
|
|
if(CollectionUtils.isNotEmpty(resultList)){ |
|
|
|
for (int i = 0; i < resultList.size() ; i++) { |
|
|
|
@@ -1038,15 +1036,15 @@ public class WxFlowServiceImpl implements WxFlowService { |
|
|
|
// 判断下个节点是否有设置审批人,没有,直接通过,有,发短信通知 |
|
|
|
if(!isEnded(processInstanceId)){ |
|
|
|
boolean hasAssignee; |
|
|
|
if(flowType.intValue() <= EnumFlowKey.END_CONTRACT.getCode().intValue()) { |
|
|
|
//老数据 |
|
|
|
List<Map<String, String>> taskAssigneeList = (List) mapInfo.get("taskAssignee"); |
|
|
|
hasAssignee = hasAssignee(taskAssigneeList,taskKey,processInstanceId); |
|
|
|
}else{ |
|
|
|
// if(flowType.intValue() <= EnumFlowKey.END_CONTRACT.getCode().intValue()) { |
|
|
|
// //老数据 |
|
|
|
// List<Map<String, String>> taskAssigneeList = (List) mapInfo.get("taskAssignee"); |
|
|
|
// hasAssignee = hasAssignee(taskAssigneeList,taskKey,processInstanceId); |
|
|
|
// }else{ |
|
|
|
WxFlowModel flowModel = (WxFlowModel)JsonUtil.readValue((String)mapInfo.get("taskAssignee"),WxFlowModel.class); |
|
|
|
List<UserTaskVo> taskAssigneeList = flowModel.getLists(); |
|
|
|
hasAssignee = hasAssigneeForNew(taskAssigneeList,taskKey,processInstanceId); |
|
|
|
} |
|
|
|
// } |
|
|
|
|
|
|
|
if(hasAssignee){ |
|
|
|
// 给代办人发送通知短信 |
|
|
|
|