From fe01e3b188e24a20b539f92e436d967aaf77ee1a Mon Sep 17 00:00:00 2001
From: huminmin <mac@MacBook-Pro.local>
Date: 星期三, 10 六月 2026 12:00:16 +0800
Subject: [PATCH] 创建库存增加来源
---
src/main/java/com/ruoyi/stock/service/impl/StockInRecordServiceImpl.java | 13 +++++++------
1 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/src/main/java/com/ruoyi/stock/service/impl/StockInRecordServiceImpl.java b/src/main/java/com/ruoyi/stock/service/impl/StockInRecordServiceImpl.java
index f86c0cb..b085676 100644
--- a/src/main/java/com/ruoyi/stock/service/impl/StockInRecordServiceImpl.java
+++ b/src/main/java/com/ruoyi/stock/service/impl/StockInRecordServiceImpl.java
@@ -104,8 +104,8 @@
stockInRecordDto.setQualitity(stockInRecord.getStockInNum());
stockInventoryMapper.updateSubtractStockInventory(stockInRecordDto);
}
- }else if (stockInRecord.getType().equals("1")) {
- String uninventoryType = resolveUninventoryTypeByInRecordType(stockInRecord.getRecordType());
+ }else if (stockInRecord.getType().equals("1") || stockInRecord.getType().equals("2")) {
+ String uninventoryType = resolveUninventoryTypeByInRecordType(stockInRecord.getType());
LambdaQueryWrapper<StockUninventory> eq = new LambdaQueryWrapper<StockUninventory>()
.eq(StockUninventory::getProductModelId, stockInRecord.getProductModelId())
.eq(StockUninventory::getType, uninventoryType);
@@ -278,9 +278,9 @@
} else {
stockInventoryMapper.updateAddStockInventory(stockInventoryDto);
}
- } else if ("1".equals(stockInRecord.getType())) {
+ } else if ("1".equals(stockInRecord.getType()) || "2".equals(stockInRecord.getType())) {
// 涓嶅悎鏍煎叆搴� -> 鍏堟煡搴撳瓨锛屽瓨鍦ㄥ垯鏇存柊锛屼笉瀛樺湪鍒欐柊澧�
- String uninventoryType = resolveUninventoryTypeByInRecordType(stockInRecord.getRecordType());
+ String uninventoryType = resolveUninventoryTypeByInRecordType(stockInRecord.getType());
StockUninventory stockUninventory = getStockUninventory(stockInRecord.getProductModelId(), stockInRecord.getBatchNo(), uninventoryType);
StockUninventoryDto stockUninventoryDto = new StockUninventoryDto();
stockUninventoryDto.setProductModelId(stockInRecord.getProductModelId());
@@ -290,6 +290,7 @@
stockUninventoryDto.setManufacturerId(stockInRecord.getManufacturerId());
stockUninventoryDto.setSource(stockInRecord.getSource());
stockUninventoryDto.setType(uninventoryType);
+ stockUninventoryDto.setSource(stockInRecord.getSource());
if (stockUninventory == null) {
stockUninventoryMapper.insert(new StockUninventory() {{
setProductModelId(stockInRecord.getProductModelId());
@@ -310,8 +311,8 @@
return items.size();
}
- private String resolveUninventoryTypeByInRecordType(String recordType) {
- if (StockInQualifiedRecordTypeEnum.PRODUCTION_SCRAP.getCode().equals(recordType)) {
+ private String resolveUninventoryTypeByInRecordType(String stockInType) {
+ if ("2".equals(stockInType)) {
return WASTE_TYPE;
}
return UNQUALIFIED_TYPE;
--
Gitblit v1.9.3