From e0cfecb2b11b3d6ac91394e71c689a30356ead28 Mon Sep 17 00:00:00 2001
From: liding <756868258@qq.com>
Date: 星期三, 20 五月 2026 09:29:28 +0800
Subject: [PATCH] fix:1.生产按照特定工序更改 2.库存按照型号,工序类别,电压进行筛选 3.销售页面展示电压,类别 4.生产入库按照电压入库
---
src/main/java/com/ruoyi/procurementrecord/utils/StockUtils.java | 33 +++++++++++++++++++++++++++++++--
1 files changed, 31 insertions(+), 2 deletions(-)
diff --git a/src/main/java/com/ruoyi/procurementrecord/utils/StockUtils.java b/src/main/java/com/ruoyi/procurementrecord/utils/StockUtils.java
index 119f5fc..288f721 100644
--- a/src/main/java/com/ruoyi/procurementrecord/utils/StockUtils.java
+++ b/src/main/java/com/ruoyi/procurementrecord/utils/StockUtils.java
@@ -17,6 +17,8 @@
import java.math.BigDecimal;
import java.util.Collections;
+import java.util.List;
+import java.util.stream.Collectors;
@Component
public class StockUtils {
@@ -101,6 +103,18 @@
stockInventoryService.addstockInventory(stockInventoryDto);
}
+ public void addStock(Long productModelId, BigDecimal quantity, String recordType, Long recordId,
+ String processCategory, String voltage) {
+ StockInventoryDto stockInventoryDto = new StockInventoryDto();
+ stockInventoryDto.setRecordId(recordId);
+ stockInventoryDto.setRecordType(String.valueOf(recordType));
+ stockInventoryDto.setQualitity(quantity);
+ stockInventoryDto.setProductModelId(productModelId);
+ stockInventoryDto.setProcessCategory(processCategory);
+ stockInventoryDto.setVoltage(voltage);
+ stockInventoryService.addstockInventory(stockInventoryDto);
+ }
+
/**
* 鍚堟牸鍏ュ簱锛堜笉瀹℃牳锛�
*
@@ -115,6 +129,18 @@
stockInventoryDto.setRecordType(String.valueOf(recordType));
stockInventoryDto.setQualitity(quantity);
stockInventoryDto.setProductModelId(productModelId);
+ stockInventoryService.addstockInventoryNoReview(stockInventoryDto);
+ }
+
+ public void addStockNoReview(Long productModelId, BigDecimal quantity, String recordType, Long recordId,
+ String processCategory, String voltage) {
+ StockInventoryDto stockInventoryDto = new StockInventoryDto();
+ stockInventoryDto.setRecordId(recordId);
+ stockInventoryDto.setRecordType(String.valueOf(recordType));
+ stockInventoryDto.setQualitity(quantity);
+ stockInventoryDto.setProductModelId(productModelId);
+ stockInventoryDto.setProcessCategory(processCategory);
+ stockInventoryDto.setVoltage(voltage);
stockInventoryService.addstockInventoryNoReview(stockInventoryDto);
}
@@ -149,11 +175,14 @@
}
public void deleteStockOutRecord(Long recordId, String recordType) {
- StockOutRecord one = stockOutRecordService.getOne(new QueryWrapper<StockOutRecord>()
+ List<StockOutRecord> one = stockOutRecordService.list(new QueryWrapper<StockOutRecord>()
.lambda().eq(StockOutRecord::getRecordId, recordId)
.eq(StockOutRecord::getRecordType, recordType));
if (ObjectUtils.isNotEmpty(one)) {
- stockOutRecordService.batchDelete(Collections.singletonList(one.getId()));
+ List<Long> idList = one.stream()
+ .map(StockOutRecord::getId)
+ .collect(Collectors.toList());
+ stockOutRecordService.batchDelete(idList);
}
}
}
--
Gitblit v1.9.3