From 174c4a75e9dac46cf42399646bf49283583a43f5 Mon Sep 17 00:00:00 2001
From: huminmin <mac@MacBook-Pro.local>
Date: 星期二, 09 六月 2026 14:38:01 +0800
Subject: [PATCH] 增加废品库存列表和导出接口,以及修改发货逻辑
---
src/main/java/com/ruoyi/stock/service/impl/StockInventoryServiceImpl.java | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 50 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..dd0bcc2 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,12 @@
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());
+ stockInRecordDto.setDifferenceNum(stockInventoryDto.getDifferenceNum());
stockInRecordService.add(stockInRecordDto);
return true;
}
@@ -439,6 +464,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