package com.yuanchu.limslaboratory.service.impl;
|
|
import com.yuanchu.limslaboratory.mapper.InspectionMaterialListMapper;
|
import com.yuanchu.limslaboratory.mapper.InspectionProductListMapper;
|
import com.yuanchu.limslaboratory.pojo.InspectionMaterialList;
|
import com.yuanchu.limslaboratory.pojo.InspectionProductList;
|
import com.yuanchu.limslaboratory.pojo.Plan;
|
import com.yuanchu.limslaboratory.mapper.PlanMapper;
|
import com.yuanchu.limslaboratory.pojo.dto.PlanDto;
|
import com.yuanchu.limslaboratory.service.PlanService;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import org.springframework.stereotype.Service;
|
|
import javax.annotation.Resource;
|
import java.util.List;
|
|
/**
|
* <p>
|
* 服务实现类
|
* </p>
|
*
|
* @author 江苏鵷雏网络科技有限公司
|
* @since 2023-07-17
|
*/
|
@Service
|
public class PlanServiceImpl extends ServiceImpl<PlanMapper, Plan> implements PlanService {
|
|
@Resource
|
PlanMapper planMapper;
|
|
@Resource
|
InspectionMaterialListMapper inspectionMaterialListMapper;
|
|
@Resource
|
InspectionProductListMapper inspectionProductListMapper;
|
|
//查询所有检验计划
|
@Override
|
public List<PlanDto> selectAllPlan(int pageSize, int countSize, Integer state) {
|
return planMapper.selectAllPlan((pageSize - 1) * countSize,pageSize * countSize, state);
|
}
|
|
//作废检验计划
|
@Override
|
public boolean delPlan(Integer id) {
|
Plan plan = planMapper.selectById(id);
|
//状态改为作废0
|
plan.setState(0);
|
int judge = planMapper.updateById(plan);
|
return judge>0;
|
}
|
|
//查询检验计划里面的分配信息
|
@Override
|
public List<InspectionProductList> selectById(Integer id) {
|
return inspectionProductListMapper.selectByMaterId(id);
|
}
|
}
|