| | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDate; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Boolean delete(Long[] ids) { |
| | | public Boolean delete(Long[] idList) { |
| | | //批量查询productOrder |
| | | List<ProductOrder> productOrders = productOrderMapper.selectList( |
| | | new LambdaQueryWrapper<ProductOrder>() |
| | | .in(ProductOrder::getId, ids) |
| | | .in(ProductOrder::getId, Arrays.asList(idList)) |
| | | ); |
| | | if (!org.springframework.util.CollectionUtils.isEmpty(productOrders)) { |
| | | |
| | | List<Long> ids = productOrders.stream().map(ProductOrder::getId).collect(Collectors.toList()); |
| | | |
| | | // 批量查询processRouteItems |
| | | List<ProductProcessRouteItem> allRouteItems = productProcessRouteItemMapper.selectList( |
| | |
| | | |
| | | // 删除产出表、投入表数据 |
| | | if (!com.baomidou.mybatisplus.core.toolkit.CollectionUtils.isEmpty(productMainIds)) { |
| | | productionProductOutputMapper.deleteByProductMainIds(productMainIds); |
| | | productionProductInputMapper.deleteByProductMainIds(productMainIds); |
| | | productionProductOutputMapper.deleteByProductMainIds(ids); |
| | | productionProductInputMapper.deleteByProductMainIds(ids); |
| | | List<QualityInspect> qualityInspects = qualityInspectMapper.selectList( |
| | | new LambdaQueryWrapper<QualityInspect>() |
| | | .in(QualityInspect::getProductMainId, productMainIds) |
| | |
| | | productOrderMapper.delete(new LambdaQueryWrapper<ProductOrder>() |
| | | .in(ProductOrder::getId, ids)); |
| | | // 删除附件 |
| | | commonFileService.deleteByBusinessIds(Arrays.asList(ids), FileNameType.PRODUCT_ORDER.getValue()); |
| | | commonFileService.deleteByBusinessIds(ids, FileNameType.PRODUCT_ORDER.getValue()); |
| | | // 删除生产订单-物料清单 |
| | | productStructureRecordMapper.delete(new LambdaQueryWrapper<ProductStructureRecord>() |
| | | .in(ProductStructureRecord::getProductOrderId, ids)); |