“djh”
2 天以前 97cd53a574602b3eb4320a6e63105f604eb03f85
multi-system/src/main/java/com/gkhy/exam/system/service/impl/ItemReviewServiceImpl.java
@@ -6,14 +6,14 @@
import com.gkhy.exam.common.utils.PageUtils;
import com.gkhy.exam.common.utils.SecurityUtils;
import com.gkhy.exam.common.utils.StringUtils;
import com.gkhy.exam.system.domain.ItemReview;
import com.gkhy.exam.system.domain.ItemReviewUser;
import com.gkhy.exam.system.domain.ProductItem;
import com.gkhy.exam.system.domain.*;
import com.gkhy.exam.system.domain.vo.ItemReviewUserVo;
import com.gkhy.exam.system.mapper.ItemReviewMapper;
import com.gkhy.exam.system.mapper.ItemReviewUserMapper;
import com.gkhy.exam.system.mapper.ProductItemMapper;
import com.gkhy.exam.system.service.ItemReviewService;
import com.gkhy.exam.system.service.ProcessInspectionService;
import com.gkhy.exam.system.service.ProjectDocumentService;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -36,6 +36,12 @@
    @Autowired
    private ProductItemMapper productItemMapper;
    @Autowired
    private ProjectDocumentService projectDocumentService;
    @Autowired
    private ProcessInspectionService processInspectionService;
    @Override
    public CommonPage selectItemList(ItemReview itemReview) {
@@ -51,9 +57,16 @@
                List<ItemReviewUser> itemReviewUsers = itemReviewUserMapper.selectByReviewId(review.getId());
                review.setReviewUsers(itemReviewUsers);
            }
            List<String> list = Arrays.asList(review.getProductItemIds().split(","));
            List<ProductItem> productItems = productItemMapper.selectBatchIds(list);
            review.setProductItems(productItems);
            if (!StringUtils.isEmpty(review.getProductItemIds())){
                List<String> list = Arrays.asList(review.getProductItemIds().split(","));
                List<ProjectDocument> projectDocuments = projectDocumentService.listByIds(list);
                review.setProjectDocuments(projectDocuments);
            }
            if (StringUtils.isNotBlank(review.getProcessItemIds())){
                List<String> list2 = Arrays.asList(review.getProcessItemIds().split(","));
                List<ProcessInspection> processInspections = processInspectionService.listByIds(list2);
                review.setProcessInspections(processInspections);
            }
        }
        return CommonPage.restPage(itemReviews);
    }
@@ -127,9 +140,16 @@
    public CommonResult approvalList(Integer userId) {
        List<ItemReviewUserVo> itemReviewUserVos = itemReviewUserMapper.selectByUserId(userId);
        for (ItemReviewUserVo itemReviewUserVo : itemReviewUserVos) {
            List<String> list = Arrays.asList(itemReviewUserVo.getProductItemIds().split(","));
            List<ProductItem> productItems = productItemMapper.selectBatchIds(list);
            itemReviewUserVo.setProductItems(productItems);
            if (!StringUtils.isEmpty(itemReviewUserVo.getProductItemIds())){
                List<String> list = Arrays.asList(itemReviewUserVo.getProductItemIds().split(","));
                List<ProjectDocument> projectDocuments = projectDocumentService.listByIds(list);
                itemReviewUserVo.setProjectDocuments(projectDocuments);
            }
            if (StringUtils.isNotBlank(itemReviewUserVo.getProcessItemIds())){
                List<String> list2 = Arrays.asList(itemReviewUserVo.getProcessItemIds().split(","));
                List<ProcessInspection> processInspections = processInspectionService.listByIds(list2);
                itemReviewUserVo.setProcessInspections(processInspections);
            }
        }
        return CommonResult.success(itemReviewUserVos);
    }