From 5c891d8d2c206dfd2aa6daf59579eb2b6843dcc0 Mon Sep 17 00:00:00 2001
From: liding <756868258@qq.com>
Date: 星期三, 01 四月 2026 18:00:37 +0800
Subject: [PATCH] fix:1.采购/销售入库去掉审批 2.返工下载附件内容变更 3.生产/库存入库生产日期添加 4.仓库导入导出字段优化

---
 src/main/java/com/ruoyi/procurementrecord/utils/StockUtils.java |   23 ++++++++++++++++++-----
 1 files changed, 18 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..81125ad 100644
--- a/src/main/java/com/ruoyi/procurementrecord/utils/StockUtils.java
+++ b/src/main/java/com/ruoyi/procurementrecord/utils/StockUtils.java
@@ -16,6 +16,7 @@
 import org.springframework.stereotype.Component;
 
 import java.math.BigDecimal;
+import java.time.LocalDate;
 import java.util.Collections;
 
 @Component
@@ -35,7 +36,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 +52,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 +68,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, LocalDate productionDate) {
         StockInventoryDto stockInventoryDto = new StockInventoryDto();
         stockInventoryDto.setRecordId(recordId);
         if (recordType != null) {
@@ -75,6 +76,13 @@
         }
         stockInventoryDto.setQualitity(quantity);
         stockInventoryDto.setProductModelId(productModelId);
+        stockInventoryDto.setBatchNo(batchNo);
+        stockInventoryDto.setCustomer(customer);
+        if (stockInventoryDto.getProductionDate() == null) {
+            stockInventoryDto.setProductionDate(LocalDate.now());
+        }else {
+            stockInventoryDto.setProductionDate(productionDate);
+        }
         stockInventoryService.addstockInventory(stockInventoryDto);
     }
 
@@ -85,12 +93,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 +115,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