| | |
| | | package com.yuanchu.limslaboratory.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | 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.dto.InspectionDto; |
| | | 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.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | @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; |
| | | } |
| | | |
| | |
| | | public List<InspectionDto> selectAllInspection(int pageSize, int countSize, Integer state) { |
| | | return inspectionMapper.selectAllInspection((pageSize - 1) * countSize,pageSize * countSize, state); |
| | | } |
| | | |
| | | @Override |
| | | public boolean delInspectionByInsId(String inspectionId) { |
| | | Inspection inspection = new Inspection(); |
| | | inspection.setState(0); |
| | | inspection.setId(inspectionId); |
| | | int judge = inspectionMapper.updateById(inspection); |
| | | return judge>0; |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public boolean subInspectionByInsId(String inspectionId) { |
| | | Inspection inspection = new Inspection(); |
| | | inspection.setState(2); |
| | | inspection.setId(inspectionId); |
| | | inspection.setInspectStartTime(LocalDateTime.now()); |
| | | int judge = inspectionMapper.updateById(inspection); |
| | | return judge>0; |
| | | } |
| | | } |