| | |
| | | private CommonService commonService; |
| | | |
| | | |
| | | @Override |
| | | @Override |
| | | public ResultVO queryAll(PageQuery<ExamineMngQueryCriteria> pageQuery) { |
| | | Long pageIndex = pageQuery.getPageIndex(); |
| | | Long pageSize = pageQuery.getPageSize(); |
| | |
| | | // --------------------------- 获取部门信息----------------------- |
| | | //收集所用到的部门ID |
| | | Set<Long> collectDepIdSet = new HashSet(); |
| | | respList.forEach(f -> { |
| | | respList.forEach(f->{ |
| | | collectDepIdSet.add(f.getExamineDepartmentId()); |
| | | collectDepIdSet.add(f.getBeExaminedDepartmentId()); |
| | | }); |
| | | //获取部门名集合 |
| | | Map<Long, String> depNameMap = commonService.getDepName(collectDepIdSet); |
| | | Map<Long,String> depNameMap = commonService.getDepName(collectDepIdSet); |
| | | |
| | | respList.forEach(f -> { |
| | | respList.forEach(f->{ |
| | | f.setExamineDepartmentName(depNameMap.get(f.getExamineDepartmentId())); |
| | | f.setBeExaminedDepartmentName(depNameMap.get(f.getBeExaminedDepartmentId())); |
| | | }); |
| | | |
| | | //获取打分明细 |
| | | respList.forEach(dto -> { |
| | | List<CurrentExamineDto> list = JSONObject.parseArray(dto.getNumberDetailJson(), CurrentExamineDto.class); |
| | | respList.forEach(dto->{ |
| | | List<CurrentExamineDto> list = JSONObject.parseArray( dto.getNumberDetailJson(), CurrentExamineDto.class); |
| | | List<Long> idList = list.stream().map(CurrentExamineDto::getId).collect(Collectors.toList()); |
| | | |
| | | if (!idList.isEmpty()) { |
| | | if(!idList.isEmpty()){ |
| | | List<ExamineItem> itemList = examineItemRepository.selectBatchIds(idList); |
| | | Map<Long, ExamineItem> itemMap = itemList.stream().collect( |
| | | Collectors.toMap(ExamineItem::getId, Function.identity(), (k1, k2) -> k1)); |
| | | Map<Long,ExamineItem> itemMap = itemList.stream().collect( |
| | | Collectors.toMap(ExamineItem::getId, Function.identity(),(k1, k2)->k1)); |
| | | |
| | | if (itemMap != null) { |
| | | list.forEach(f -> { |
| | | if(itemMap != null){ |
| | | list.forEach(f->{ |
| | | ExamineItem item = itemMap.get(f.getId()); |
| | | if (item != null) { |
| | | if(item != null){ |
| | | f.setItemDetail(item.getItemDetail()); |
| | | f.setContent(item.getContent()); |
| | | f.setJudgeStandard(item.getJudgeStandard()); |
| | |
| | | return new SearchResultVO<>( |
| | | true, |
| | | pageIndex, |
| | | pageSize, page.getPages(), |
| | | pageSize,page.getPages(), |
| | | page.getTotal(), |
| | | respList, |
| | | ResultCodes.OK |
| | |
| | | @Override |
| | | public ExamineMngDto selectOne(Serializable id) { |
| | | ExamineMng examineMng = this.getById(id); |
| | | if (examineMng == null) { |
| | | if(examineMng == null){ |
| | | return null; |
| | | } |
| | | |
| | | ExamineMngDto dto = BeanCopyUtils.copyBean(examineMng, ExamineMngDto.class); |
| | | if (!StringUtils.hasText(examineMng.getNumberDetailJson())) { |
| | | if(!StringUtils.hasText(examineMng.getNumberDetailJson())){ |
| | | return dto; |
| | | } |
| | | |
| | | //获取打分明细 |
| | | List<CurrentExamineDto> list = JSONObject.parseArray(examineMng.getNumberDetailJson(), CurrentExamineDto.class); |
| | | List<CurrentExamineDto> list = JSONObject.parseArray( examineMng.getNumberDetailJson(), CurrentExamineDto.class); |
| | | List<Long> idList = list.stream().map(CurrentExamineDto::getId).collect(Collectors.toList()); |
| | | |
| | | |
| | | if (!idList.isEmpty()) { |
| | | if (idList.isEmpty()){ |
| | | List<ExamineItem> itemList = examineItemRepository.selectBatchIds(idList); |
| | | Map<Long, ExamineItem> itemMap = itemList.stream().collect( |
| | | Collectors.toMap(ExamineItem::getId, Function.identity(), (k1, k2) -> k1)); |
| | | Map<Long,ExamineItem> itemMap = itemList.stream().collect( |
| | | Collectors.toMap(ExamineItem::getId, Function.identity(),(k1, k2)->k1)); |
| | | |
| | | if (itemMap != null) { |
| | | list.forEach(f -> { |
| | | if(itemMap != null){ |
| | | list.forEach(f->{ |
| | | ExamineItem item = itemMap.get(f.getId()); |
| | | if (item != null) { |
| | | if(item != null){ |
| | | f.setItemDetail(item.getItemDetail()); |
| | | f.setContent(item.getContent()); |
| | | f.setJudgeStandard(item.getJudgeStandard()); |
| | |
| | | dto.setCurrentExamineDtoList(list); |
| | | |
| | | //获取合格分数 |
| | | ExamineTemplate examineTemplate = examineTemplateRepository.selectOne(new QueryWrapper<ExamineTemplate>().eq("id", examineMng.getExamineTemplateId())); |
| | | if (examineTemplate != null) { |
| | | ExamineTemplate examineTemplate = examineTemplateRepository.selectOne(new QueryWrapper<ExamineTemplate>().eq("id",examineMng.getExamineTemplateId())); |
| | | if(examineTemplate != null){ |
| | | dto.setAcceptanceNumber(examineTemplate.getAcceptanceNumber()); |
| | | dto.setExamineTemplateName(examineTemplate.getTitle()); |
| | | } |