From 13afb7eafeffac6ecccc7c66d36974c54c5172d4 Mon Sep 17 00:00:00 2001
From: huminmin <mac@MacBook-Pro.local>
Date: 星期四, 28 五月 2026 15:13:37 +0800
Subject: [PATCH] 库存管理增加库存类型,并返回相关数据显示
---
src/main/java/com/ruoyi/stock/service/impl/StockInventoryServiceImpl.java | 47 +++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 45 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 1cbdc47..687837e 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;
}
//鍏ュ簱璋冪敤
@@ -170,6 +189,7 @@
stockInRecordDto.setRemark(stockInventoryDto.getRemark());
stockInRecordDto.setWarnNum(stockInventoryDto.getWarnNum());
stockInRecordDto.setManufacturerId(stockInventoryDto.getManufacturerId());
+ stockInRecordDto.setSource(stockInventoryDto.getSource());
stockInRecordService.add(stockInRecordDto);
return true;
}
@@ -439,6 +459,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