songhuangfeng123
2022-09-01 b854d8d7604329dcf99584d15f83ff02076d9e07
goal-manage/goal-manage-service/src/main/java/com/gkhy/safePlatform/targetDuty/service/impl/ExamineMngServiceImpl.java
@@ -57,7 +57,7 @@
    private CommonService commonService;
    @Override
   @Override
    public ResultVO queryAll(PageQuery<ExamineMngQueryCriteria> pageQuery) {
        Long pageIndex = pageQuery.getPageIndex();
        Long pageSize = pageQuery.getPageSize();
@@ -70,32 +70,32 @@
        // --------------------------- 获取部门信息-----------------------
        //收集所用到的部门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());
@@ -109,7 +109,7 @@
        return new SearchResultVO<>(
                true,
                pageIndex,
                pageSize, page.getPages(),
                pageSize,page.getPages(),
                page.getTotal(),
                respList,
                ResultCodes.OK
@@ -125,29 +125,27 @@
    @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());
@@ -158,8 +156,8 @@
        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());
        }