XiaoRuby
2023-07-26 30f6da8bf0143906b42fa600f6a604cea6c81f71
inspection-server/src/main/java/com/yuanchu/limslaboratory/service/impl/PlanServiceImpl.java
@@ -1,5 +1,7 @@
package com.yuanchu.limslaboratory.service.impl;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.yuanchu.limslaboratory.mapper.InspectionMaterialListMapper;
import com.yuanchu.limslaboratory.mapper.InspectionProductListMapper;
import com.yuanchu.limslaboratory.pojo.InspectionMaterialList;
@@ -13,6 +15,7 @@
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
/**
 * <p>
@@ -29,14 +32,14 @@
    PlanMapper planMapper;
    @Resource
    InspectionMaterialListMapper inspectionMaterialListMapper;
    @Resource
    InspectionProductListMapper inspectionProductListMapper;
    //查询所有检验计划
    //查询所有检验计划分配
    @Override
    public List<PlanDto> selectAllPlan(int pageSize, int countSize, Integer state) {
    public Map selectAllPlan(int pageSize, int countSize, Integer state) {
        if (state == null) {
            state = 2;
        }
        return planMapper.selectAllPlan((pageSize - 1) * countSize,pageSize * countSize, state);
    }
@@ -50,9 +53,24 @@
        return judge>0;
    }
    //查询检验计划里面的分配信息
    //根据样品id查询检验计划里面的检验项目
    @Override
    public List<InspectionProductList> selectById(Integer id) {
    public List<InspectionProductList> selectProductById(Integer id) {
       return inspectionProductListMapper.selectByMaterId(id);
    }
    //修改检验计划里分配计划的信息
    @Override
    public void upPlan(InspectionProductList inspectionProductList) {
        LambdaUpdateWrapper<InspectionProductList> updateWrapper = new LambdaUpdateWrapper<>();
        updateWrapper.eq(InspectionProductList::getInspectionMaterialListId, inspectionProductList.getInspectionMaterialListId())
                .eq(InspectionProductList::getMethod, inspectionProductList.getMethod());
        inspectionProductListMapper.update(inspectionProductList, updateWrapper);
    }
    //查询成品检验
    @Override
    public List<PlanDto> selectInspection(int pageSize, int countSize, Integer state) {
        return planMapper.selectInspection((pageSize - 1) * countSize, pageSize * countSize, state);
    }
}