From 32e4f30a848e159081986f93d189f0e80fa56a77 Mon Sep 17 00:00:00 2001
From: huminmin <mac@MacBook-Pro.local>
Date: 星期五, 29 五月 2026 18:03:52 +0800
Subject: [PATCH] 采购手动入库

---
 src/main/java/com/ruoyi/stock/service/impl/StockInventoryServiceImpl.java |   53 +++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 51 insertions(+), 2 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 24605ba..44302ec 100644
--- a/src/main/java/com/ruoyi/stock/service/impl/StockInventoryServiceImpl.java
+++ b/src/main/java/com/ruoyi/stock/service/impl/StockInventoryServiceImpl.java
@@ -11,6 +11,7 @@
 import com.ruoyi.basic.pojo.ProductModel;
 import com.ruoyi.common.enums.StockInQualifiedRecordTypeEnum;
 import com.ruoyi.common.exception.ServiceException;
+import com.ruoyi.stock.enums.StockInventorySourceEnum;
 import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.framework.web.domain.R;
@@ -68,7 +69,25 @@
 
     @Override
     public IPage<StockInventoryDto> pageListCombinedStockInventory(Page page, StockInventoryDto stockInventoryDto) {
-        return stockInventoryMapper.pageListCombinedStockInventory(page, stockInventoryDto);
+        IPage<StockInventoryDto> result = stockInventoryMapper.pageListCombinedStockInventory(page, stockInventoryDto);
+        // 杞崲鏉ユ簮缂栫爜涓烘潵婧愬悕绉�
+        for (StockInventoryDto dto : result.getRecords()) {
+            // 鍚堟牸搴撳瓨鏉ユ簮
+            if (StringUtils.isNotBlank(dto.getQualifiedSource())) {
+                StockInventorySourceEnum qualifiedSourceEnum = StockInventorySourceEnum.fromCode(dto.getQualifiedSource());
+                if (qualifiedSourceEnum != null) {
+                    dto.setQualifiedSourceText(qualifiedSourceEnum.getValue());
+                }
+            }
+            // 涓嶅悎鏍煎簱瀛樻潵婧�
+            if (StringUtils.isNotBlank(dto.getUnQualifiedSource())) {
+                StockInventorySourceEnum unQualifiedSourceEnum = StockInventorySourceEnum.fromCode(dto.getUnQualifiedSource());
+                if (unQualifiedSourceEnum != null) {
+                    dto.setUnQualifiedSourceText(unQualifiedSourceEnum.getValue());
+                }
+            }
+        }
+        return result;
     }
 
     //鍏ュ簱璋冪敤
@@ -168,6 +187,13 @@
         stockInRecordDto.setProductModelId(stockInventoryDto.getProductModelId());
         stockInRecordDto.setType("0");
         stockInRecordDto.setRemark(stockInventoryDto.getRemark());
+        stockInRecordDto.setWarnNum(stockInventoryDto.getWarnNum());
+        stockInRecordDto.setManufacturerId(stockInventoryDto.getManufacturerId());
+        stockInRecordDto.setSource(stockInventoryDto.getSource());
+        // 璁剧疆鍚按閲忕浉鍏充俊鎭�
+        stockInRecordDto.setIsContainsWater(stockInventoryDto.getIsContainsWater());
+        stockInRecordDto.setWaterContent(stockInventoryDto.getWaterContent());
+        stockInRecordDto.setTheoryStockInNum(stockInventoryDto.getTheoryStockInNum());
         stockInRecordService.add(stockInRecordDto);
         return true;
     }
@@ -437,6 +463,29 @@
 
     @Override
     public IPage<StockInventoryDto> getBatchNoQty(Page page, StockInventoryDto stockInventoryDto) {
-        return stockInventoryMapper.getBatchNoQty(page, stockInventoryDto);
+        IPage<StockInventoryDto> resultPage = stockInventoryMapper.getBatchNoQty(page, stockInventoryDto);
+
+        // 閬嶅巻缁撴灉锛岃缃潵婧愪腑鏂囧悕
+        resultPage.getRecords().forEach(dto -> {
+            // 璁剧疆鍚堟牸搴撳瓨鏉ユ簮涓枃鍚�
+            if (StringUtils.isNotEmpty(dto.getQualifiedSource())) {
+                System.out.println("鍚堟牸搴撳瓨鏉ユ簮锛�" + dto.getQualifiedSource());
+                StockInventorySourceEnum qualifiedSourceEnum = StockInventorySourceEnum.fromCode(dto.getQualifiedSource());
+                if (qualifiedSourceEnum != null) {
+                    dto.setQualifiedSourceText(qualifiedSourceEnum.getValue());
+                    System.out.println("鍚堟牸搴撳瓨鏉ユ簮鍊硷細" + qualifiedSourceEnum.getValue());
+                }
+            }
+
+            // 璁剧疆涓嶅悎鏍煎簱瀛樻潵婧愪腑鏂囧悕
+            if (StringUtils.isNotEmpty(dto.getUnQualifiedSource())) {
+                StockInventorySourceEnum unQualifiedSourceEnum = StockInventorySourceEnum.fromCode(dto.getUnQualifiedSource());
+                if (unQualifiedSourceEnum != null) {
+                    dto.setUnQualifiedSourceText(unQualifiedSourceEnum.getValue());
+                }
+            }
+        });
+
+        return resultPage;
     }
 }

--
Gitblit v1.9.3