ÎļþÃû´Ó basic-server/src/main/java/com/ruoyi/inspect/service/impl/CapacityScopeServiceImpl.java ÐÞ¸Ä |
| | |
| | | package com.ruoyi.inspect.service.impl; |
| | | package com.ruoyi.basic.service.impl; |
| | | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.basic.dto.PageTestObjectDto; |
| | | import com.ruoyi.basic.dto.TestItemDto; |
| | | import com.ruoyi.basic.mapper.*; |
| | | import com.ruoyi.basic.pojo.*; |
| | | import com.ruoyi.basic.service.CapacityScopeService; |
| | | import com.ruoyi.common.exception.base.BaseException; |
| | | import com.ruoyi.common.utils.QueryWrappers; |
| | | import com.ruoyi.inspect.dto.PageTestObjectDto; |
| | | import com.ruoyi.inspect.dto.TestItemDto; |
| | | import com.ruoyi.inspect.mapper.*; |
| | | import com.ruoyi.inspect.pojo.*; |
| | | import com.ruoyi.inspect.service.CapacityScopeService; |
| | | import com.ruoyi.inspect.service.StandardProductListService; |
| | | import com.ruoyi.inspect.service.StructureItemParameterService; |
| | | import com.ruoyi.basic.service.StandardProductListService; |
| | | import com.ruoyi.basic.service.StructureItemParameterService; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | private StructureTestObjectMapper structureTestObjectMapper; |
| | | |
| | | private ProductMapper productMapper; |
| | | |
| | | private StructureTestObjectPartMapper structureTestObjectPartMapper; |
| | | |
| | | private ProductPartMapper productPartMapper; |
| | | |
| | | private StandardProductListService standardProductListService; |
| | | |
| | |
| | | |
| | | @Override |
| | | public IPage<PageTestObjectDto> selectTestObjectList(Page page, PageTestObjectDto pageTestObjectDto) { |
| | | String partNo = pageTestObjectDto.getPartNo(); |
| | | pageTestObjectDto.setPartNo(null); |
| | | return structureTestObjectMapper.selectTestObjectList(page, QueryWrappers.queryWrappers(pageTestObjectDto),partNo); |
| | | return structureTestObjectMapper.selectTestObjectList(page, QueryWrappers.queryWrappers(pageTestObjectDto)); |
| | | } |
| | | |
| | | @Override |
| | |
| | | |
| | | @Override |
| | | public int delTestObject(Integer id) { |
| | | // äº§åºæ£éªå¯¹è±¡äº§åç»´æ¤ |
| | | structureTestObjectPartMapper.delete(Wrappers.<StructureTestObjectPart>lambdaQuery() |
| | | .eq(StructureTestObjectPart::getTestObjectId, id)); |
| | | |
| | | // å é¤äº§åç»´æ¤çé¶ä»¶ç»å® |
| | | List<Product> products = productMapper.selectList(Wrappers.<Product>lambdaQuery() |
| | | .eq(Product::getObjectId, id)); |
| | | List<Integer> productIds = products.stream().map(Product::getId).collect(Collectors.toList()); |
| | | productPartMapper.delete(Wrappers.<ProductPart>lambdaQuery() |
| | | .in(ProductPart::getProductId, productIds)); |
| | | |
| | | // å é¤äº§åç»´æ¤ |
| | | productMapper.delete(Wrappers.<Product>lambdaQuery() |
| | | .in(Product::getId, productIds)); |