| | |
| | | import com.ruoyi.production.service.ProductOrderService; |
| | | import com.ruoyi.quality.mapper.QualityInspectMapper; |
| | | import com.ruoyi.stock.mapper.StockInventoryMapper; |
| | | import com.ruoyi.stock.pojo.StockInventory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | |
| | | @Override |
| | | public List<SelectOptionDTO<String>> getProductOrderBatchNo() { |
| | | List<ProductOrder> productOrders = productOrderMapper.selectList(null); |
| | | return productOrders.stream().map(productOrder -> new SelectOptionDTO<>(productOrder.getBatchNo(), productOrder.getBatchNo())).collect(Collectors.toList()); |
| | | //查询库存批号 |
| | | List<StockInventory> stockInventoryList = stockInventoryMapper.selectList(null); |
| | | return stockInventoryList.stream().map(stockInventory -> new SelectOptionDTO<>(stockInventory.getBatchNo(), stockInventory.getBatchNo())).collect(Collectors.toList()); |
| | | } |
| | | |
| | | @Override |
| | |
| | | if (productOrder != null) { |
| | | List<DrawMaterialDto> materialDtoList = JSON.parseArray(productOrder.getDrawMaterials(), DrawMaterialDto.class); |
| | | for (DrawMaterialDto drawMaterialDto : materialDtoList) { |
| | | stockUtils.addStock(drawMaterialDto.getProductModelId(), drawMaterialDto.getRequisitionQty(), null, productOrderDto.getId()); |
| | | stockUtils.addStock(drawMaterialDto.getProductModelId(), drawMaterialDto.getRequisitionQty(), null, productOrderDto.getId(), |
| | | drawMaterialDto.getBatchNo(), drawMaterialDto.getCustomer() |
| | | ); |
| | | } |
| | | } |
| | | |
| | |
| | | if (drawMaterialDto.getProductModelId() == null) { |
| | | throw new RuntimeException("产品型号ID不能为空"); |
| | | } |
| | | stockUtils.substractStock(drawMaterialDto.getProductModelId(), drawMaterialDto.getRequisitionQty(), StockOutQualifiedRecordTypeEnum.DRAW_MATERIALS_STOCK_OUT.getCode(), productOrderDto.getId()); |
| | | stockUtils.substractStock(drawMaterialDto.getProductModelId(), drawMaterialDto.getRequisitionQty(), |
| | | StockOutQualifiedRecordTypeEnum.DRAW_MATERIALS_STOCK_OUT.getCode(), productOrderDto.getId(), |
| | | drawMaterialDto.getBatchNo(),drawMaterialDto.getCustomer()); |
| | | } |
| | | } catch (Exception e) { |
| | | throw new RuntimeException("领料失败:" + e.getMessage()); |