From 41d1a9ee507de566401afc7f513bbbcc07a55cd2 Mon Sep 17 00:00:00 2001
From: huminmin <mac@MacBook-Pro.local>
Date: 星期二, 28 四月 2026 18:00:20 +0800
Subject: [PATCH] 重构客户档案

---
 src/main/java/com/ruoyi/procurementrecord/utils/StockUtils.java |   33 ++++++++++++++-------------------
 1 files changed, 14 insertions(+), 19 deletions(-)

diff --git a/src/main/java/com/ruoyi/procurementrecord/utils/StockUtils.java b/src/main/java/com/ruoyi/procurementrecord/utils/StockUtils.java
index 6768d17..189e18f 100644
--- a/src/main/java/com/ruoyi/procurementrecord/utils/StockUtils.java
+++ b/src/main/java/com/ruoyi/procurementrecord/utils/StockUtils.java
@@ -4,7 +4,6 @@
 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.ruoyi.procurementrecord.mapper.ProcurementRecordMapper;
 import com.ruoyi.procurementrecord.mapper.ProcurementRecordOutMapper;
-import com.ruoyi.stock.dto.StockInRecordDto;
 import com.ruoyi.stock.dto.StockInventoryDto;
 import com.ruoyi.stock.dto.StockUninventoryDto;
 import com.ruoyi.stock.mapper.StockInventoryMapper;
@@ -14,21 +13,15 @@
 import com.ruoyi.stock.service.StockInventoryService;
 import com.ruoyi.stock.service.StockOutRecordService;
 import com.ruoyi.stock.service.StockUninventoryService;
-import com.ruoyi.stock.service.impl.StockInRecordServiceImpl;
-import com.ruoyi.stock.service.impl.StockOutRecordServiceImpl;
 import lombok.RequiredArgsConstructor;
 import org.springframework.stereotype.Component;
 
 import java.math.BigDecimal;
 import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
 
 @Component
 @RequiredArgsConstructor
 public class StockUtils {
-    private final ProcurementRecordOutMapper procurementRecordOutMapper;
-    private final ProcurementRecordMapper procurementRecordMapper;
     private final StockUninventoryService stockUninventoryService;
     private final StockInventoryService stockInventoryService;
     private final StockInRecordService stockInRecordService;
@@ -106,13 +99,14 @@
                 .eq(StockInRecord::getRecordType, recordType));
         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));
         }
-        //灏嗗簱瀛樺噺鍥炴潵
-        StockInventoryDto stockInventoryDto = new StockInventoryDto();
-        stockInventoryDto.setRecordId(recordId);
-        stockInventoryDto.setRecordType(recordType);
-        stockInventoryDto.setQualitity(one.getStockInNum());
-        stockInventoryMapper.updateSubtractStockInventory((stockInventoryDto));
+
     }
     public void deleteStockOutRecord(Long recordId, String recordType) {
         StockOutRecord one = stockOutRecordService.getOne(new QueryWrapper<StockOutRecord>()
@@ -120,12 +114,13 @@
                 .eq(StockOutRecord::getRecordType, recordType));
         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));
         }
-        //灏嗗簱瀛樺姞鍥炴潵
-        StockInventoryDto stockInventoryDto = new StockInventoryDto();
-        stockInventoryDto.setRecordId(recordId);
-        stockInventoryDto.setRecordType(recordType);
-        stockInventoryDto.setQualitity(one.getStockOutNum());
-        stockInventoryMapper.updateAddStockInventory((stockInventoryDto));
+
     }
 }

--
Gitblit v1.9.3