diff --git a/mallinkService/src/main/java/com/iformall/enums/EnumFlowKey.java b/mallinkService/src/main/java/com/iformall/enums/EnumFlowKey.java index 69abe38a8..dc1543589 100644 --- a/mallinkService/src/main/java/com/iformall/enums/EnumFlowKey.java +++ b/mallinkService/src/main/java/com/iformall/enums/EnumFlowKey.java @@ -5,9 +5,9 @@ package com.iformall.enums; * 流程key */ public enum EnumFlowKey { - CONTRACT(1, "contract_flow"), //合同审批 - BILL(2, "end_bill_flow"),//账单审批 - END_CONTRACT(3, "end_contract_flow"),//终止合同审批 +// CONTRACT(1, "contract_flow"), //合同审批 +// BILL(2, "end_bill_flow"),//账单审批 +// END_CONTRACT(3, "end_contract_flow"),//终止合同审批 NEW_RENT_CONTRACT(4, "合同签约"), NEW_EDIT_VALID_CONTRACT(5, "履约中合同修改"), 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 a9333ced5..a1c074d77 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java @@ -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 mapInfo = taskService.getVariables(task.getId()); - List> taskAssigneeList = (List)mapInfo.get("taskAssignee"); - for (int i = 0; i < taskAssigneeList.size(); i++) { - Map 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 mapInfo = taskService.getVariables(task.getId()); +// List> taskAssigneeList = (List)mapInfo.get("taskAssignee"); +// for (int i = 0; i < taskAssigneeList.size(); i++) { +// Map 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 taskList = taskService.createTaskQuery().processInstanceId(pi.getId()).list(); Map 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> taskAssigneeList = (List) mapInfo.get("taskAssignee"); - hasAssignee = hasAssignee(taskAssigneeList,taskKey,processInstanceId); - }else{ +// if(flowType.intValue() <= EnumFlowKey.END_CONTRACT.getCode().intValue()) { +// //老数据 +// List> taskAssigneeList = (List) mapInfo.get("taskAssignee"); +// hasAssignee = hasAssignee(taskAssigneeList,taskKey,processInstanceId); +// }else{ WxFlowModel flowModel = (WxFlowModel)JsonUtil.readValue((String)mapInfo.get("taskAssignee"),WxFlowModel.class); List taskAssigneeList = flowModel.getLists(); hasAssignee = hasAssigneeForNew(taskAssigneeList,taskKey,processInstanceId); - } +// } if(hasAssignee){ // 给代办人发送通知短信