| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.enums.FileNameType; |
| | | import com.ruoyi.common.enums.StockOutQualifiedRecordTypeEnum; |
| | | import com.ruoyi.common.enums.StockInUnQualifiedRecordTypeEnum; |
| | | import com.ruoyi.framework.web.domain.R; |
| | |
| | | private SalesLedgerMapper salesLedgerMapper; |
| | | |
| | | private PurchaseLedgerMapper purchaseLedgerMapper; |
| | | private ProductStructureRecordMapper productStructureRecordMapper; |
| | | |
| | | private ProductOrderMapper productOrderMapper; |
| | | |
| | | private CommonFileServiceImpl commonFileService; |
| | | |
| | | private ProcessRouteItemMapper processRouteItemMapper; |
| | | |
| | |
| | | // 删除产出表、投入表数据 |
| | | if (!com.baomidou.mybatisplus.core.toolkit.CollectionUtils.isEmpty(productMainIds)) { |
| | | productionProductOutputMapper.deleteByProductMainIds(productMainIds); |
| | | productionProductInputMapper.deleteByProductMainIds(productMainIds); |
| | | productionProductInputMapper.deleteByProductMainIds(orderIds); |
| | | List<QualityInspect> qualityInspects = qualityInspectMapper.selectList( |
| | | new LambdaQueryWrapper<QualityInspect>() |
| | | .in(QualityInspect::getProductMainId, productMainIds) |
| | |
| | | // 批量删除productOrder |
| | | productOrderMapper.delete(new LambdaQueryWrapper<ProductOrder>() |
| | | .in(ProductOrder::getSaleLedgerProductId, productIds)); |
| | | // 删除附件 |
| | | commonFileService.deleteByBusinessIds(productIds, FileNameType.PRODUCT_ORDER.getValue()); |
| | | // 删除生产订单-物料清单 |
| | | productStructureRecordMapper.delete(new LambdaQueryWrapper<ProductStructureRecord>() |
| | | .in(ProductStructureRecord::getProductOrderId, productIds)); |
| | | } |
| | | } |
| | | |
| | |
| | | if (processRoute == null) { |
| | | return R.fail("请先设置工艺路线"); |
| | | } |
| | | List<ProductStructureDto> productStructureDtos = productStructureMapper.listBybomId(processRoute.getBomId()); |
| | | List<ProductStructureDto> productStructureDtos = productStructureMapper.listBybomId(processRoute.getBomId(),false); |
| | | if (productStructureDtos.isEmpty()) { |
| | | return R.fail("请先设置产品结构"); |
| | | } |