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/stock/service/impl/StockInventoryServiceImpl.java |   21 +++++++++++++++++----
 1 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/src/main/java/com/ruoyi/stock/service/impl/StockInventoryServiceImpl.java b/src/main/java/com/ruoyi/stock/service/impl/StockInventoryServiceImpl.java
index 97354b1..db3e2b3 100644
--- a/src/main/java/com/ruoyi/stock/service/impl/StockInventoryServiceImpl.java
+++ b/src/main/java/com/ruoyi/stock/service/impl/StockInventoryServiceImpl.java
@@ -34,6 +34,8 @@
 
 import javax.servlet.http.HttpServletResponse;
 import java.math.BigDecimal;
+import java.time.LocalDate;
+import java.time.format.DateTimeFormatter;
 import java.util.*;
 
 /**
@@ -59,6 +61,7 @@
     private ProductMapper productMapper;
     @Autowired
     private ProductModelMapper productModelMapper;
+    private static final DateTimeFormatter YYYYMMDD_FORMAT = DateTimeFormatter.ofPattern("yyyyMMdd");
 
 
     @Override
@@ -99,6 +102,7 @@
             newStockInventory.setWarnNum(stockInventoryDto.getWarnNum());
             newStockInventory.setBatchNo(stockInventoryDto.getBatchNo());
             newStockInventory.setCustomer(stockInventoryDto.getCustomer());
+            newStockInventory.setProductionDate(stockInventoryDto.getProductionDate());
             stockInventoryMapper.insert(newStockInventory);
         }else {
              stockInventoryMapper.updateAddStockInventory(stockInventoryDto);
@@ -148,7 +152,7 @@
             // 鏌ヨ鎵�鏈夌殑浜у搧
             List<SalesLedgerProduct> salesLedgerProducts = salesLedgerProductMapper.selectProduct();
 
-            ExcelUtil<StockInventoryExportData> util = new ExcelUtil<StockInventoryExportData>(StockInventoryExportData.class);
+            ExcelUtil<StockInventoryExportData> util = new ExcelUtil<>(StockInventoryExportData.class);
             List<StockInventoryExportData> list = util.importExcel(file.getInputStream());
 
             // 璁板綍鏈壘鍒板尮閰嶉」鐨勬暟鎹�
@@ -158,7 +162,8 @@
                 boolean matched = false;
                 for (SalesLedgerProduct item : salesLedgerProducts) {
                     if (item.getProductCategory().equals(dto.getProductName()) &&
-                            item.getSpecificationModel().equals(dto.getModel())) {
+                            item.getSpecificationModel().equals(dto.getModel()) &&
+                            item.getUidNo().equals(dto.getUidNo())) {
                         StockInventoryDto stockInventoryDto = new StockInventoryDto();
                         stockInventoryDto.setRecordId(0L);
                         stockInventoryDto.setRecordType(StockInQualifiedRecordTypeEnum.CUSTOMIZATION_STOCK_IN.getCode());
@@ -170,6 +175,14 @@
                         }
                         stockInventoryDto.setLockedQuantity(dto.getLockedQuantity());
                         stockInventoryDto.setProductModelId(item.getProductModelId());
+                        stockInventoryDto.setBatchNo(dto.getBatchNo());
+                        stockInventoryDto.setCustomer(dto.getCustomer());
+                        String productionDate = dto.getProductionDate();
+                        if (productionDate != null && productionDate.length() == 8) {
+                            stockInventoryDto.setProductionDate(LocalDate.parse(productionDate, YYYYMMDD_FORMAT));
+                        } else {
+                            stockInventoryDto.setProductionDate(null);
+                        }
                         this.addstockInventory(stockInventoryDto);
                         matched = true;
                         break; // 鎵惧埌鍖归厤椤瑰悗璺冲嚭寰幆
@@ -177,8 +190,8 @@
                 }
                 if (!matched) {
                     // 璁板綍鏈尮閰嶇殑鏁版嵁
-                    String unmatchedInfo = String.format("浜у搧鍚嶇О锛�%s锛岃鏍煎瀷鍙凤細%s",
-                            dto.getProductName(), dto.getModel());
+                    String unmatchedInfo = String.format("浜у搧鍚嶇О锛�%s锛岃鏍煎瀷鍙凤細%s锛孶ID鐮侊細%s",
+                            dto.getProductName(), dto.getModel(),dto.getUidNo());
                     unmatchedRecords.add(unmatchedInfo);
                 }
             });

--
Gitblit v1.9.3