From 1342f568f4b6470efdfc69be7bb153e2b12762f9 Mon Sep 17 00:00:00 2001
From: liding <756868258@qq.com>
Date: 星期二, 31 三月 2026 17:00:57 +0800
Subject: [PATCH] feat:1.销售,采购,库存,质检模块产品添加批号,供应商 2.销售产品关联批号,供应商递归查询

---
 src/main/java/com/ruoyi/procurementrecord/utils/StockUtils.java |   17 ++++++++++++-----
 1 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/src/main/java/com/ruoyi/procurementrecord/utils/StockUtils.java b/src/main/java/com/ruoyi/procurementrecord/utils/StockUtils.java
index 26578a0..4f20fb0 100644
--- a/src/main/java/com/ruoyi/procurementrecord/utils/StockUtils.java
+++ b/src/main/java/com/ruoyi/procurementrecord/utils/StockUtils.java
@@ -35,7 +35,7 @@
      * @param recordType
      * @param recordId
      */
-    public void addUnStock(Long productModelId, BigDecimal quantity, String recordType,Long recordId) {
+    public void addUnStock(Long productModelId, BigDecimal quantity, String recordType, Long recordId) {
         StockUninventoryDto stockUninventoryDto = new StockUninventoryDto();
         stockUninventoryDto.setRecordId(recordId);
         stockUninventoryDto.setRecordType(String.valueOf(recordType));
@@ -51,7 +51,7 @@
      * @param recordType
      * @param recordId
      */
-    public void subtractUnStock(Long productModelId, BigDecimal quantity, Integer recordType,Long recordId) {
+    public void subtractUnStock(Long productModelId, BigDecimal quantity, Integer recordType, Long recordId) {
         StockUninventoryDto stockUninventoryDto = new StockUninventoryDto();
         stockUninventoryDto.setRecordId(recordId);
         stockUninventoryDto.setRecordType(String.valueOf(recordType));
@@ -67,7 +67,7 @@
      * @param recordType
      * @param recordId
      */
-    public void addStock(Long productModelId, BigDecimal quantity, String recordType,Long recordId) {
+    public void addStock(Long productModelId, BigDecimal quantity, String recordType, Long recordId,String batchNo,String customer) {
         StockInventoryDto stockInventoryDto = new StockInventoryDto();
         stockInventoryDto.setRecordId(recordId);
         if (recordType != null) {
@@ -75,6 +75,8 @@
         }
         stockInventoryDto.setQualitity(quantity);
         stockInventoryDto.setProductModelId(productModelId);
+        stockInventoryDto.setBatchNo(batchNo);
+        stockInventoryDto.setCustomer(customer);
         stockInventoryService.addstockInventory(stockInventoryDto);
     }
 
@@ -85,12 +87,16 @@
      * @param recordType
      * @param recordId
      */
-    public void substractStock(Long productModelId, BigDecimal quantity, String recordType,Long recordId) {
+    public void substractStock(Long productModelId, BigDecimal quantity, String recordType, Long recordId,String batchNo,String customer) {
         StockInventoryDto stockInventoryDto = new StockInventoryDto();
         stockInventoryDto.setRecordId(recordId);
-        stockInventoryDto.setRecordType(String.valueOf(recordType));
+        if (recordType != null) {
+            stockInventoryDto.setRecordType(recordType);
+        }
         stockInventoryDto.setQualitity(quantity);
         stockInventoryDto.setProductModelId(productModelId);
+        stockInventoryDto.setBatchNo(batchNo);
+        stockInventoryDto.setCustomer(customer);
         stockInventoryService.subtractStockInventory(stockInventoryDto);
     }
 
@@ -103,6 +109,7 @@
             stockInRecordService.batchDelete(Collections.singletonList(one.getId()));
         }
     }
+
     public void deleteStockOutRecord(Long recordId, String recordType) {
         StockOutRecord one = stockOutRecordService.getOne(new QueryWrapper<StockOutRecord>()
                 .lambda().eq(StockOutRecord::getRecordId, recordId)

--
Gitblit v1.9.3