From de7af74a86374d4bcb58df42316f52c3a8add3ce Mon Sep 17 00:00:00 2001
From: liding <756868258@qq.com>
Date: 星期二, 07 四月 2026 15:50:04 +0800
Subject: [PATCH] fix: 生产工单-领料优化

---
 src/main/java/com/ruoyi/production/service/impl/ProductOrderServiceImpl.java |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/src/main/java/com/ruoyi/production/service/impl/ProductOrderServiceImpl.java b/src/main/java/com/ruoyi/production/service/impl/ProductOrderServiceImpl.java
index 711fb1c..5b3df50 100644
--- a/src/main/java/com/ruoyi/production/service/impl/ProductOrderServiceImpl.java
+++ b/src/main/java/com/ruoyi/production/service/impl/ProductOrderServiceImpl.java
@@ -281,7 +281,7 @@
             List<DrawMaterialDto> materialDtoList = JSON.parseArray(productOrder.getDrawMaterials(), DrawMaterialDto.class);
             for (DrawMaterialDto drawMaterialDto : materialDtoList) {
                 stockUtils.addStock(drawMaterialDto.getProductModelId(), drawMaterialDto.getRequisitionQty(), null, productOrderDto.getId(),
-                        drawMaterialDto.getBatchNo(), drawMaterialDto.getCustomer()
+                        drawMaterialDto.getBatchNo(), drawMaterialDto.getCustomer(),drawMaterialDto.getProductionDate()
                 );
             }
         }
@@ -292,6 +292,10 @@
                 if (drawMaterialDto.getProductModelId() == null) {
                     throw new RuntimeException("浜у搧鍨嬪彿ID涓嶈兘涓虹┖");
                 }
+                if (drawMaterialDto.getQualitity() == null  || drawMaterialDto.getQualitity().compareTo(BigDecimal.ZERO) == 0) {
+                    throw new RuntimeException("浜у搧" + drawMaterialDto.getProductName() + "鍨嬪彿" + drawMaterialDto.getModel()
+                     + "鎵瑰彿" + drawMaterialDto.getBatchNo() + "搴撳瓨涓嶈冻锛�");
+                }
                 stockUtils.substractStock(drawMaterialDto.getProductModelId(), drawMaterialDto.getRequisitionQty(),
                         StockOutQualifiedRecordTypeEnum.DRAW_MATERIALS_STOCK_OUT.getCode(), productOrderDto.getId(),
                         drawMaterialDto.getBatchNo(),drawMaterialDto.getCustomer());

--
Gitblit v1.9.3