| | |
| | | package com.yuanchu.limslaboratory.service.impl; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.yuanchu.limslaboratory.mapper.InspectionMaterialListMapper; |
| | | import com.yuanchu.limslaboratory.mapper.PlanMapper; |
| | | import com.yuanchu.limslaboratory.pojo.Inspection; |
| | | import com.yuanchu.limslaboratory.mapper.InspectionMapper; |
| | | import com.yuanchu.limslaboratory.pojo.InspectionMaterialList; |
| | | import com.yuanchu.limslaboratory.pojo.InspectionProductList; |
| | | import com.yuanchu.limslaboratory.pojo.Plan; |
| | | import com.yuanchu.limslaboratory.pojo.dto.InspectionDto; |
| | | import com.yuanchu.limslaboratory.service.InspectionService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | |
| | | |
| | | @Resource |
| | | private InspectionMapper inspectionMapper; |
| | | @Resource |
| | | private PlanMapper planMapper; |
| | | @Resource |
| | | InspectionMaterialListMapper inspectionMaterialListMapper; |
| | | |
| | | @Override |
| | | public Inspection addInspection(String userName,int type) { |
| | |
| | | return judge>0?inspection:null; |
| | | } |
| | | |
| | | //查询所有检验单列表 |
| | | @Override |
| | | public Map selectAllInspection(int pageSize, int countSize, Integer state) { |
| | | Map map = new HashMap(); |
| | |
| | | return map; |
| | | } |
| | | |
| | | //作废申请检验单 |
| | | @Override |
| | | public boolean delInspectionByInsId(String inspectionId) { |
| | | Inspection inspection = new Inspection(); |
| | | //检验单作废 |
| | | Inspection inspection = inspectionMapper.selectById(inspectionId); |
| | | inspection.setState(0); |
| | | inspection.setId(inspectionId); |
| | | int judge = inspectionMapper.updateById(inspection); |
| | | return judge>0; |
| | | |
| | | int judge1 = inspectionMapper.updateById(inspection); |
| | | //检验样品作废 |
| | | UpdateWrapper<InspectionMaterialList> wrapper = new UpdateWrapper<>(); |
| | | wrapper.eq("inspection_id", inspectionId).set("state", 0); |
| | | int judge2 = inspectionMaterialListMapper.update(new InspectionMaterialList(),wrapper); |
| | | return judge1>0&&judge2>0; |
| | | } |
| | | |
| | | //提交申请检验单 |
| | | @Override |
| | | public boolean subInspectionByInsId(String inspectionId) { |
| | | Inspection inspection = new Inspection(); |
| | | Inspection inspection = inspectionMapper.selectById(inspectionId); |
| | | //状态改为已提交2 |
| | | inspection.setState(2); |
| | | inspection.setId(inspectionId); |
| | | inspection.setInspectStartTime(LocalDateTime.now()); |
| | | int judge = inspectionMapper.updateById(inspection); |
| | | //计划表新增 |
| | | Plan plan = Plan.builder().inspectionId(inspectionId).state(1).build(); |
| | | planMapper.insert(plan); |
| | | return judge>0; |
| | | } |
| | | } |