| | |
| | | import com.ruoyi.production.service.ProductProcessService; |
| | | import com.ruoyi.production.service.ProductWorkOrderService; |
| | | import com.ruoyi.production.service.ProductionPrintOrderService; |
| | | import com.ruoyi.production.service.ProductionProductMainService; |
| | | import com.ruoyi.quality.mapper.QualityInspectMapper; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | private SalesLedgerProductionAccountingMapper salesLedgerProductionAccountingMapper; |
| | | @Autowired |
| | | private StockUtils stockUtils; |
| | | @Autowired |
| | | private ProductionProductMainService productionProductMainService; |
| | | |
| | | @Override |
| | | public IPage<ProductOrderDto> pageProductOrder(Page page, ProductOrderDto productOrder) { |
| | |
| | | productProcessRouteItem.setProductOrderId(productOrder.getId()); |
| | | productProcessRouteItem.setProductRouteId(productProcessRoute.getId()); |
| | | productProcessRouteItem.setDragSort(processRouteItem.getDragSort()); |
| | | productProcessRouteItem.setIsQuality(processRouteItem.getIsQuality()); |
| | | int insert = productProcessRouteItemMapper.insert(productProcessRouteItem); |
| | | if (insert > 0) { |
| | | |
| | |
| | | productWorkOrderMapper.insert(productWorkOrder); |
| | | } |
| | | } |
| | | // 排产下达后自动触发第一道需质检工序的过程检验 |
| | | productionProductMainService.preGenerateQualityInspectForOrder(productOrder.getId()); |
| | | return productOrderMapper.updateById(productOrder); |
| | | } |
| | | |
| | |
| | | if (productionProductMains.size() > 0) { |
| | | throw new RuntimeException("生产订单已经开始生产,不能删除"); |
| | | } |
| | | // 清理排产预生成的质检单 |
| | | productionProductMainService.cleanPreGeneratedQualityInspects( |
| | | productWorkOrders.stream().map(ProductWorkOrder::getId).collect(Collectors.toList())); |
| | | //删除工单 |
| | | productWorkOrderMapper.delete(Wrappers.<ProductWorkOrder>lambdaQuery().in(ProductWorkOrder::getProductOrderId, ids)); |
| | | } |