| | |
| | | page = baseMapper.selectPage(page, |
| | | QueryHelpPlus.getPredicate(TargetMng.class, pageQuery.getSearchParams())); |
| | | List<TargetMngDto> respList = BeanCopyUtils.copyBeanList(page.getRecords(), TargetMngDto.class); |
| | | respList.forEach(dto->{ |
| | | respList.forEach(dto -> { |
| | | // --------------------------- 获取部门信息----------------------- |
| | | dto.setMakerDepartmentName(commonService.getDepName(dto.getMakerDepartmentId())); |
| | | |
| | |
| | | // --------------------------- 获取部门信息----------------------- |
| | | //收集所用到的部门ID |
| | | Set<Long> collectDepIdSet = new HashSet(); |
| | | respList1.forEach(f->{ |
| | | respList1.forEach(f -> { |
| | | collectDepIdSet.add(f.getDutyDepartmentId()); |
| | | collectDepIdSet.add(f.getMakerDepartmentId()); |
| | | }); |
| | | //获取部门名集合 |
| | | Map<Long, String> depNameMap = commonService.getDepName(collectDepIdSet); |
| | | |
| | | respList1.forEach(f->{ |
| | | respList1.forEach(f -> { |
| | | f.setDutyDepartmentName(depNameMap.get(f.getDutyDepartmentId())); |
| | | f.setMakerDepartmentName(depNameMap.get(f.getMakerDepartmentId())); |
| | | }); |
| | |
| | | // --------------------------- 获取目标分类名称----------------------- |
| | | //收集所用到的目标分类ID |
| | | Set<Long> collectTypeSet = new HashSet(); |
| | | respList1.forEach(f->{ |
| | | respList1.forEach(f -> { |
| | | collectTypeSet.add(f.getTargetTypeId()); |
| | | }); |
| | | //获取目标分类名集合 |
| | | if(!collectTypeSet.isEmpty()){ |
| | | if (!collectTypeSet.isEmpty()) { |
| | | List<TargetType> typeList = targetTypeRepository.selectBatchIds(collectTypeSet); // TODO |
| | | Map<Long, String> typeNameMap = typeList.stream() |
| | | .collect(Collectors.toMap(TargetType::getId, TargetType::getTypeName,(k1, k2)->k1)); |
| | | .collect(Collectors.toMap(TargetType::getId, TargetType::getTypeName, (k1, k2) -> k1)); |
| | | |
| | | respList1.forEach(f->{ |
| | | respList1.forEach(f -> { |
| | | f.setTargetTypeName(typeNameMap.get(f.getDutyDepartmentId())); |
| | | }); |
| | | } |
| | |
| | | return new SearchResultVO<>( |
| | | true, |
| | | pageIndex, |
| | | pageSize,page.getPages(), |
| | | pageSize, page.getPages(), |
| | | page.getTotal(), |
| | | respList, |
| | | ResultCodes.OK |
| | |
| | | @Override |
| | | public Object selectOne(Serializable id) { |
| | | TargetMng targetMng = baseMapper.selectById(id); |
| | | if(targetMng == null){ |
| | | if (targetMng == null) { |
| | | return null; |
| | | } |
| | | TargetMngDto targetMngDto = BeanCopyUtils.copyBean(targetMng, TargetMngDto.class); |
| | |
| | | // --------------------------- 获取部门信息----------------------- |
| | | //收集所用到的部门ID |
| | | Set<Long> collectDepIdSet = new HashSet(); |
| | | respList.forEach(f->{ |
| | | respList.forEach(f -> { |
| | | collectDepIdSet.add(f.getDutyDepartmentId()); |
| | | collectDepIdSet.add(f.getMakerDepartmentId()); |
| | | }); |
| | | //获取部门名集合 |
| | | Map<Long, String> depNameMap = commonService.getDepName(collectDepIdSet); |
| | | |
| | | respList.forEach(f->{ |
| | | respList.forEach(f -> { |
| | | f.setDutyDepartmentName(depNameMap.get(f.getDutyDepartmentId())); |
| | | f.setMakerDepartmentName(depNameMap.get(f.getMakerDepartmentId())); |
| | | }); |
| | | |
| | | |
| | | |
| | | |
| | | // --------------------------- 获取考核结果----------------------- |
| | | //收集所用到的分解详情ID |
| | | Set<Long> collectExamResultSet = new HashSet(); |
| | | respList.forEach(f->{ |
| | | respList.forEach(f -> { |
| | | collectExamResultSet.add(f.getId()); |
| | | }); |
| | | //获取核结果集合 |
| | | if(!collectExamResultSet.isEmpty()){ |
| | | List<TargetExamine> typeList = targetExamineRepository.selectList(new QueryWrapper<TargetExamine>().in("target_divide_detail_id",collectExamResultSet)); |
| | | if (!collectExamResultSet.isEmpty()) { |
| | | List<TargetExamine> typeList = targetExamineRepository.selectList(new QueryWrapper<TargetExamine>().in("target_divide_detail_id", collectExamResultSet)); |
| | | Map<Long, TargetExamine> examResultMap = typeList.stream() |
| | | .collect(Collectors.toMap(TargetExamine::getTargetDivideDetailId, Function.identity(),(k1, k2)->k1)); |
| | | .collect(Collectors.toMap(TargetExamine::getTargetDivideDetailId, Function.identity(), (k1, k2) -> k1)); |
| | | |
| | | respList.forEach(f->{ |
| | | respList.forEach(f -> { |
| | | TargetExamine targetExamine = examResultMap.get(f.getId()); |
| | | if(targetExamine != null){ |
| | | if (targetExamine != null) { |
| | | f.setExamineResult(targetExamine.getExamineResult()); |
| | | f.setExamineDate(targetExamine.getExamineDate()); |
| | | f.setExaminePersonId(targetExamine.getExaminePersonId()); |
| | |
| | | List<TargetCheckAndSubmitDto> respList = BeanCopyUtils.copyBeanList(page.getRecords(), TargetCheckAndSubmitDto.class); |
| | | |
| | | // 判断审批人 |
| | | respList.forEach(dto->{ |
| | | respList.forEach(dto -> { |
| | | List<TargetDutyWorkApprove> list = targetDutyWorkApproveRepository.selectList( |
| | | new QueryWrapper<TargetDutyWorkApprove>().eq("del_flag",0) |
| | | .eq("relate_type",pageQuery.getSearchParams().getRelateType()) |
| | | .eq("relate_id",dto.getId()) |
| | | new QueryWrapper<TargetDutyWorkApprove>().eq("del_flag", 0) |
| | | .eq("relate_type", pageQuery.getSearchParams().getRelateType()) |
| | | .eq("relate_id", dto.getId()) |
| | | .orderByDesc("sort")); |
| | | |
| | | if (!CollectionUtils.isEmpty(list)) { |
| | |
| | | dto.setApproveStatus(list.get(0).getApproveStatus()); |
| | | dto.setApprovePersonId(list.get(0).getApprovePersonId()); |
| | | // 审批中 判断审批人是否人与当前登录人 |
| | | if (dto.getApproveStatus()!=null && dto.getApproveStatus()==2){ |
| | | if (dto.getApproveStatus() != null && dto.getApproveStatus() == 2) { |
| | | dto.setCheckApprove(dto.getApprovePersonId().equals(uid)); |
| | | } |
| | | } |
| | |
| | | return new SearchResultVO<>( |
| | | true, |
| | | pageIndex, |
| | | pageSize,page.getPages(), |
| | | pageSize, page.getPages(), |
| | | page.getTotal(), |
| | | respList, |
| | | ResultCodes.OK |
| | |
| | | // 查询总数 |
| | | Integer total = 0; |
| | | // 完成数量 |
| | | Integer complete=0; |
| | | Integer complete = 0; |
| | | |
| | | // 查询目标已分解且事件类型对一个的目标 |
| | | List<TargetMng> targetMngList = targetMngRepository.selectList( |
| | | new QueryWrapper<TargetMng>() |
| | | .eq("target_type",criteria.getTargetType()) |
| | | .eq("divide_status",1) |
| | | .eq("del_flag", 0) |
| | | .eq("target_type", criteria.getTargetType()) |
| | | .eq("divide_status", 1) |
| | | ); |
| | | if (!targetMngList.isEmpty()){ |
| | | if (!targetMngList.isEmpty()) { |
| | | total = targetMngList.size(); |
| | | // 查询目标下的所有分解项 |
| | | for (TargetMng targetMng : targetMngList){ |
| | | for (TargetMng targetMng : targetMngList) { |
| | | Boolean completeFlag = true; |
| | | List<TargetDivideDetail> targetDivideDetailList = targetDivideDetailRepository.selectList( |
| | | new QueryWrapper<TargetDivideDetail>() |
| | | .eq("target_id",targetMng.getId()) |
| | | .eq("del_flag", 0) |
| | | .eq("target_id", targetMng.getId()) |
| | | ); |
| | | if (!targetDivideDetailList.isEmpty()){ |
| | | if (!targetDivideDetailList.isEmpty()) { |
| | | // 查询分解项 是否已经审核通过 |
| | | for (TargetDivideDetail targetDivideDetail :targetDivideDetailList){ |
| | | for (TargetDivideDetail targetDivideDetail : targetDivideDetailList) { |
| | | List<TargetExamine> targetExamineList = targetExamineRepository.selectList( |
| | | new QueryWrapper<TargetExamine>() |
| | | .eq("target_divide_detail_id",targetDivideDetail.getId()) |
| | | .eq("examine_result",1) |
| | | .eq("del_flag", 0) |
| | | .eq("target_divide_detail_id", targetDivideDetail.getId()) |
| | | .eq("examine_result", 1) |
| | | ); |
| | | if (targetExamineList.isEmpty()){ |
| | | completeFlag=false; |
| | | if (targetExamineList.isEmpty()) { |
| | | completeFlag = false; |
| | | } |
| | | } |
| | | } |
| | | // 该目标中有未评价的或者不合格的 |
| | | if (completeFlag){ |
| | | if (completeFlag) { |
| | | complete++; |
| | | } |
| | | } |
| | | } |
| | | //未完成数 |
| | | int noComplete = total-complete; |
| | | map.put("total",total+""); |
| | | map.put("noComplete",noComplete+""); |
| | | map.put("complete",complete+""); |
| | | int noComplete = total - complete; |
| | | map.put("total", total + ""); |
| | | map.put("noComplete", noComplete + ""); |
| | | map.put("complete", complete + ""); |
| | | return map; |
| | | } |
| | | |
| | | |
| | | |
| | | } |