| | |
| | | import com.yuanchu.limslaboratory.service.InspectionService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.time.LocalDateTime; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | |
| | | @Resource |
| | | private InspectionMapper inspectionMapper; |
| | | |
| | | @Resource |
| | | private PlanMapper planMapper; |
| | | |
| | | @Resource |
| | | InspectionMaterialListMapper inspectionMaterialListMapper; |
| | | |
| | | //添加检验申请单 |
| | | @Override |
| | | public Inspection addInspection(String userName,int type) { |
| | | Inspection inspection = new Inspection(type, 0,1,1, userName); |
| | | System.out.println(inspection); |
| | | int judge = inspectionMapper.insert(inspection); |
| | | System.out.println(judge); |
| | | return judge>0?inspection:null; |
| | | } |
| | | |
| | | //查询所有检验单列表 |
| | | @Override |
| | | public Map selectAllInspection(int pageSize, int countSize, Integer state) { |
| | | Map map = new HashMap(); |
| | | map.put("data",inspectionMapper.selectAllInspection((pageSize - 1) * countSize,pageSize * countSize, state)); |
| | | map.put("count", inspectionMapper.selectInspectToCount(state)); |
| | | return map; |
| | | public List<InspectionDto> selectAllInspection(int pageSize, int countSize, Integer state) { |
| | | return inspectionMapper.selectAllInspection((pageSize - 1) * countSize,pageSize * countSize, state); |
| | | } |
| | | |
| | | //作废申请检验单 |
| | |
| | | Inspection inspection = inspectionMapper.selectById(inspectionId); |
| | | inspection.setState(0); |
| | | int judge1 = inspectionMapper.updateById(inspection); |
| | | //检验样品作废 |
| | | //检验样品作废(根据报检单id删除样品信息) |
| | | UpdateWrapper<InspectionMaterialList> wrapper = new UpdateWrapper<>(); |
| | | wrapper.eq("inspection_id", inspectionId).set("state", 0); |
| | | int judge2 = inspectionMaterialListMapper.update(new InspectionMaterialList(),wrapper); |