| | |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.yuanchu.limslaboratory.pojo.Specifications; |
| | | import com.yuanchu.limslaboratory.mapper.SpecificationsMapper; |
| | | import com.yuanchu.limslaboratory.pojo.dto.AddSpecifications; |
| | | import com.yuanchu.limslaboratory.pojo.dto.AddStandardDto; |
| | | import com.yuanchu.limslaboratory.service.*; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.ObjectUtils; |
| | | |
| | |
| | | private SpecificationsMapper specificationsMapper; |
| | | |
| | | @Autowired |
| | | private MaterialService materialService; |
| | | |
| | | @Autowired |
| | | private ProductService productService; |
| | | |
| | | @Override |
| | |
| | | list.add(specificationsId); |
| | | int isDeleteSuccess = specificationsMapper.update(new Specifications(), updateWrapper); |
| | | if (isDeleteSuccess == 1){ |
| | | List<String> deleteMaterialId = materialService.specificationsIdDeleteMaterial(list); |
| | | if (!ObjectUtils.isEmpty(deleteMaterialId)){ |
| | | productService.MaterialIdDeleteProduct(deleteMaterialId); |
| | | } |
| | | productService.deleteProductInformation(list); |
| | | return 1; |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | @Override |
| | | public List<Integer> SerialNumberIdDeleteSpecifications(List<String> deleteSerialNumberId) { |
| | | public List<Integer> StandardIdDeleteSpecifications(List<Integer> deleteStandard) { |
| | | List<Integer> list = new ArrayList<>(); |
| | | for (String serialNumberId:deleteSerialNumberId){ |
| | | for (Integer standard : deleteStandard){ |
| | | LambdaQueryWrapper<Specifications> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(Specifications::getId, serialNumberId); |
| | | wrapper.eq(Specifications::getStandardId, standard); |
| | | wrapper.select(Specifications::getId); |
| | | List<Specifications> maps1 = specificationsMapper.selectList(wrapper); |
| | | for (Specifications specifications:maps1){ |
| | |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | @Override |
| | | public Integer addSpecificationsInformation(AddSpecifications addStandardDto) { |
| | | Specifications specifications = new Specifications() |
| | | .setName(addStandardDto.getSpecificationsName()) |
| | | .setStandardId(addStandardDto.getStandardId()); |
| | | return specificationsMapper.insert(specifications); |
| | | } |
| | | } |