From f57064d2fa563ee4cfeeccd715850ba8b8aa4f60 Mon Sep 17 00:00:00 2001
From: liyong <18434998025@163.com>
Date: 星期一, 18 五月 2026 09:44:33 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev_New_pro' into dev_宁夏_英泽防锈
---
src/main/java/com/ruoyi/procurementrecord/utils/StockUtils.java | 32 ++++++++++++++------------------
1 files changed, 14 insertions(+), 18 deletions(-)
diff --git a/src/main/java/com/ruoyi/procurementrecord/utils/StockUtils.java b/src/main/java/com/ruoyi/procurementrecord/utils/StockUtils.java
index 8a6925e..0beecd2 100644
--- a/src/main/java/com/ruoyi/procurementrecord/utils/StockUtils.java
+++ b/src/main/java/com/ruoyi/procurementrecord/utils/StockUtils.java
@@ -3,11 +3,11 @@
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
+import com.ruoyi.common.enums.ReviewStatusEnum;
import com.ruoyi.procurementrecord.mapper.ProcurementRecordMapper;
import com.ruoyi.procurementrecord.mapper.ProcurementRecordOutMapper;
import com.ruoyi.stock.dto.StockInventoryDto;
import com.ruoyi.stock.dto.StockUninventoryDto;
-import com.ruoyi.stock.mapper.StockInventoryMapper;
import com.ruoyi.stock.pojo.StockInRecord;
import com.ruoyi.stock.pojo.StockOutRecord;
import com.ruoyi.stock.service.StockInRecordService;
@@ -29,7 +29,6 @@
private final StockInventoryService stockInventoryService;
private final StockInRecordService stockInRecordService;
private final StockOutRecordService stockOutRecordService;
- private final StockInventoryMapper stockInventoryMapper;
/**
* 涓嶅悎鏍煎叆搴�
@@ -150,31 +149,28 @@
public void deleteStockInRecord(Long recordId, String recordType) {
StockInRecord one = stockInRecordService.getOne(new QueryWrapper<StockInRecord>()
.lambda().eq(StockInRecord::getRecordId, recordId)
- .eq(StockInRecord::getRecordType, recordType));
+ .eq(StockInRecord::getRecordType, recordType), false);
if (ObjectUtils.isNotEmpty(one)) {
- stockInRecordService.batchDelete(Collections.singletonList(one.getId()));
- //灏嗗簱瀛樺噺鍥炴潵
- StockInventoryDto stockInventoryDto = new StockInventoryDto();
- stockInventoryDto.setRecordId(recordId);
- stockInventoryDto.setRecordType(recordType);
- stockInventoryDto.setQualitity(one.getStockInNum());
- stockInventoryMapper.updateSubtractStockInventory((stockInventoryDto));
+ if (ReviewStatusEnum.APPROVED.getCode().equals(one.getApprovalStatus())) {
+ stockInRecordService.batchDelete(Collections.singletonList(one.getId()));
+ } else {
+ stockInRecordService.removeById(one.getId());
+ }
}
}
+ //鍒犻櫎鍑哄簱璁板綍
public void deleteStockOutRecord(Long recordId, String recordType) {
StockOutRecord one = stockOutRecordService.getOne(new QueryWrapper<StockOutRecord>()
.lambda().eq(StockOutRecord::getRecordId, recordId)
- .eq(StockOutRecord::getRecordType, recordType));
+ .eq(StockOutRecord::getRecordType, recordType), false);
if (ObjectUtils.isNotEmpty(one)) {
- stockOutRecordService.batchDelete(Collections.singletonList(one.getId()));
- //灏嗗簱瀛樺姞鍥炴潵
- StockInventoryDto stockInventoryDto = new StockInventoryDto();
- stockInventoryDto.setRecordId(recordId);
- stockInventoryDto.setRecordType(recordType);
- stockInventoryDto.setQualitity(one.getStockOutNum());
- stockInventoryMapper.updateAddStockInventory((stockInventoryDto));
+ if (ReviewStatusEnum.APPROVED.getCode().equals(one.getApprovalStatus())) {
+ stockOutRecordService.batchDelete(Collections.singletonList(one.getId()));
+ } else {
+ stockOutRecordService.removeById(one.getId());
+ }
}
}
--
Gitblit v1.9.3