From 1d2d3760bef94013f80cae555bdcbfb2268929a2 Mon Sep 17 00:00:00 2001
From: liding <756868258@qq.com>
Date: 星期三, 15 四月 2026 11:22:17 +0800
Subject: [PATCH] fix:生产-质量-仓储(合格,不合格),批号,供应商
---
src/main/java/com/ruoyi/stock/service/impl/StockInRecordServiceImpl.java | 16 ++++++++++------
1 files changed, 10 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 ce6241a..ce332c3 100644
--- a/src/main/java/com/ruoyi/stock/service/impl/StockInRecordServiceImpl.java
+++ b/src/main/java/com/ruoyi/stock/service/impl/StockInRecordServiceImpl.java
@@ -4,8 +4,8 @@
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.ruoyi.common.enums.StockQualifiedRecordTypeEnum;
-import com.ruoyi.common.enums.StockUnQualifiedRecordTypeEnum;
+import com.ruoyi.common.enums.StockInUnQualifiedRecordTypeEnum;
+import com.ruoyi.common.enums.StockOutQualifiedRecordTypeEnum;
import com.ruoyi.common.exception.base.BaseException;
import com.ruoyi.common.utils.EnumUtil;
import com.ruoyi.common.utils.OrderUtils;
@@ -73,7 +73,9 @@
for (Long id : ids) {
StockInRecord stockInRecord = stockInRecordMapper.selectById(id);
if (stockInRecord.getType().equals("0")) {
- StockInventory stockInventory = stockInventoryMapper.selectOne(new LambdaQueryWrapper<StockInventory>().eq(StockInventory::getProductModelId, stockInRecord.getProductModelId()));
+ StockInventory stockInventory = stockInventoryMapper.selectOne(new LambdaQueryWrapper<StockInventory>().eq(StockInventory::getProductModelId, stockInRecord.getProductModelId())
+ .eq(StockInventory::getBatchNo, stockInRecord.getBatchNo())
+ .eq(StockInventory::getCustomer, stockInRecord.getCustomer()));
if (stockInventory == null) {
throw new BaseException("搴撳瓨璁板綍涓病鏈夊搴旂殑浜у搧,鏃犳硶鍒犻櫎!!!");
}else {
@@ -83,7 +85,9 @@
stockInventoryMapper.updateSubtractStockInventory(stockInRecordDto);
}
}else if (stockInRecord.getType().equals("1")) {
- StockUninventory stockUninventory = stockUninventoryMapper.selectOne(new LambdaQueryWrapper<StockUninventory>().eq(StockUninventory::getProductModelId, stockInRecord.getProductModelId()));
+ StockUninventory stockUninventory = stockUninventoryMapper.selectOne(new LambdaQueryWrapper<StockUninventory>().eq(StockUninventory::getProductModelId, stockInRecord.getProductModelId())
+ .eq(StockUninventory::getBatchNo, stockInRecord.getBatchNo())
+ .eq(StockUninventory::getCustomer, stockInRecord.getCustomer()));
if (stockUninventory == null) {
throw new BaseException("搴撳瓨璁板綍涓病鏈夊搴旂殑浜у搧,鏃犳硶鍒犻櫎!!!");
}else {
@@ -102,9 +106,9 @@
List<StockInRecordExportData> list = stockInRecordMapper.listStockInRecordExportData(stockInRecordDto);
for (StockInRecordExportData stockInRecordExportData : list) {
if (stockInRecordExportData.getType().equals("0")) {
- stockInRecordExportData.setRecordType(EnumUtil.fromCode(StockQualifiedRecordTypeEnum.class, Integer.parseInt(stockInRecordExportData.getRecordType())).getValue());
+ stockInRecordExportData.setRecordType(EnumUtil.fromCode(StockOutQualifiedRecordTypeEnum.class, Integer.parseInt(stockInRecordExportData.getRecordType())).getValue());
}else {
- stockInRecordExportData.setRecordType(EnumUtil.fromCode(StockUnQualifiedRecordTypeEnum.class, Integer.parseInt(stockInRecordExportData.getRecordType())).getValue());
+ stockInRecordExportData.setRecordType(EnumUtil.fromCode(StockInUnQualifiedRecordTypeEnum.class, Integer.parseInt(stockInRecordExportData.getRecordType())).getValue());
}
}
ExcelUtil<StockInRecordExportData> util = new ExcelUtil<>(StockInRecordExportData.class);
--
Gitblit v1.9.3