From 7ab0221edafd81468b37935fd6e8a9f7cebd181f Mon Sep 17 00:00:00 2001
From: huminmin <mac@MacBook-Pro.local>
Date: 星期一, 08 六月 2026 15:14:41 +0800
Subject: [PATCH] 销售台账/采购台账,在新增产品数据的时候,增加一个运费单价(非必填),就像那个含税单价一样,当用户填完数量和运费单价之后,可以直接计算出这个产品的总运费
---
src/main/java/com/ruoyi/stock/service/impl/StockInventoryServiceImpl.java | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 52 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..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;
}
//鍏ュ簱璋冪敤
@@ -168,6 +187,14 @@
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());
+ stockInRecordDto.setDifferenceNum(stockInventoryDto.getDifferenceNum());
stockInRecordService.add(stockInRecordDto);
return true;
}
@@ -437,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