| | |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.yuanchu.limslaboratory.pojo.Material; |
| | | import com.yuanchu.limslaboratory.mapper.MaterialMapper; |
| | | import com.yuanchu.limslaboratory.pojo.Specifications; |
| | | import com.yuanchu.limslaboratory.service.MaterialService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.yuanchu.limslaboratory.service.ProductService; |
| | | import com.yuanchu.limslaboratory.utils.MyUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.ObjectUtils; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | |
| | | return materialMapper.selectMaterialById(materialId); |
| | | } |
| | | |
| | | @Override |
| | | public Material ListIdMaterialInformation(String materialId) { |
| | | LambdaQueryWrapper<Material> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(Material::getId, materialId); |
| | | wrapper.select(Material::getId, Material::getName, Material::getSupplier, Material::getLocation, Material::getNum, Material::getBatch, |
| | | Material::getReelNumber); |
| | | return materialMapper.selectOne(wrapper); |
| | | } |
| | | |
| | | @Autowired |
| | | private ProductService productService; |
| | | |
| | | @Override |
| | | public Integer addMaterialInformation(Material material) { |
| | | return materialMapper.insert(material); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> getListMaterialInformation(String specificationsId) { |
| | | LambdaQueryWrapper<Material> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(Material::getSpecificationsId, specificationsId); |
| | | wrapper.select(Material::getId, Material::getName); |
| | | return materialMapper.selectMaps(wrapper); |
| | | } |
| | | |
| | | @Override |
| | | public Integer deleteMaterialInformation(String materialId) { |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Integer updateMaterialInformation(Material material) { |
| | | LambdaUpdateWrapper<Material> updateWrapper = new LambdaUpdateWrapper<>(); |
| | | updateWrapper.eq(Material::getId, material.getId()); |
| | | materialMapper.updateById(material); |
| | | return materialMapper.update(material, updateWrapper); |
| | | } |
| | | |
| | | @Override |
| | | public List<String> specificationsIdDeleteMaterial(List<Integer> deleteSpecificationsId) { |
| | | List<String> list = new ArrayList<>(); |
| | | for (Integer serialNumberId:deleteSpecificationsId){ |
| | | LambdaQueryWrapper<Material> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(Material::getSpecificationsId, serialNumberId); |
| | | wrapper.select(Material::getId); |
| | | List<Material> maps1 = materialMapper.selectList(wrapper); |
| | | for (Material material:maps1){ |