| | |
| | | } |
| | | break; |
| | | } |
| | | case "P2"://当前节点为过程2-管理审核 |
| | | case "P2"://当前节点为过程2-管理专责审核 |
| | | { |
| | | link.setDealUserId(userId); |
| | | if(link.getStatus() == WorkflowEnum.STATUS_REJECT.getValue().intValue()){ //驳回 |
| | |
| | | return statistics; |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * 二次核容和隐患故障的统计 |
| | | * |
| | | * 增加了全部 0 |
| | | * 0:全部 |
| | | * 1:审批中 |
| | | * 2:通过 |
| | | * 3:驳回 |
| | | * |
| | | * status含义:1-待接单,6-待审核,58-已审核 |
| | | * @param type |
| | | * @param user |
| | | * @return |
| | | */ |
| | | public Response getReceivedStatistics2(int type, UserInf user) { |
| | | Map<Integer,Integer> statistics = new HashMap<>(); |
| | | statistics.put(0,0); |
| | | statistics.put(1,0); |
| | | statistics.put(2,0); |
| | | statistics.put(3,0); |
| | | List<WorkflowLink> links = mapper.getReceivedList2(type,user); |
| | | Map<Integer, List<WorkflowLink>> receivedListMap = links.stream().collect(Collectors.groupingBy(WorkflowLink::getStatus)); |
| | | Set<Integer> statusSet = receivedListMap.keySet(); |
| | | int sum = 0; |
| | | for (Integer status : statusSet) { |
| | | int size = receivedListMap.get(status).size(); |
| | | if (status == 1 || status == 6) { //审批中 |
| | | statistics.put(1, statistics.get(1) + size); |
| | | } else if(status == 5){ //通过 |
| | | statistics.put(2, size); |
| | | }else if(status == 8){ //驳回 |
| | | statistics.put(3,size); |
| | | } |
| | | sum+=size; |
| | | } |
| | | statistics.put(0,sum); |
| | | return new Response().set(1,statistics); |
| | | } |
| | | |
| | | |
| | | public void add(WorkflowLink link) { |
| | | mapper.insert(link); |
| | | } |
| | |
| | | WorkflowLink linkNew = new WorkflowLink(); |
| | | linkNew.setMainId(link.getMainId()); |
| | | linkNew.setProcessLevel("P3"); |
| | | linkNew.setProcessLevelName("领导审批"); |
| | | linkNew.setParentId(link.getId()); |
| | | linkNew.setCreateTime(now); |
| | | linkNew.setDealRoleId(RoleEnum.LEADER.getId()); |
| | |
| | | linkNew.setDealDesc("领导层处理中"); |
| | | linkNew.setStatus(WorkflowEnum.STATUS_TAKING.getValue()); |
| | | mapper.insert(linkNew); |
| | | //修改主表的流程 |
| | | mainService.updateProcessLevel("P3", link.getMainId()); |
| | | } |
| | | break; |
| | | } |
| | |
| | | PageHelper.startPage(pageNum, pageSize); |
| | | List<WorkflowLink> list = mapper.searchTmp(uId, uRole, type, status); |
| | | PageInfo pageInfo = new PageInfo(list); |
| | | //追加机房信息 |
| | | if(type !=1) { //1为查询放电计划,不追加机房信息 |
| | | List<Integer> mainIdList = list.stream().map(WorkflowLink::getMainId).collect(Collectors.toList()); |
| | | //从二次核容查询 |
| | | List<StationInf> stationInfList = tmpMapper.getStationInfWithSpecificMainId(mainIdList); |
| | | //从故障隐患查询 |
| | | List<StationInf> stationInfList2 = faultUploadApplicationService.getStationInfWithSpecificMainId(mainIdList); |
| | | |
| | | list.forEach(link -> { |
| | | if(link.getWorkflowMain().getType().intValue() == WorkflowEnum.MAIN_TYPE_DISCHARGE_DIST.getValue()){ |
| | | for (StationInf stationInf : stationInfList) { |
| | | if(stationInf.getTogetherFlag() == link.getMainId()){ |
| | | link.setStationInf(stationInf); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | else if(link.getWorkflowMain().getType().intValue() == WorkflowEnum.MAIN_TYPE_FAULT_UPLOAD.getValue()){ |
| | | for (StationInf stationInf : stationInfList2) { |
| | | if(stationInf.getTogetherFlag() == link.getMainId()){ |
| | | link.setStationInf(stationInf); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |
| | | |
| | | return new Response().setII(1, list == null ? false : true, pageInfo, "查询节点(除放电计划之外的)"); |
| | | } |
| | | |