From 6ff4a76f832db086690cdc4348f192d96aa9c9b6 Mon Sep 17 00:00:00 2001
From: liyong <18434998025@163.com>
Date: 星期一, 19 一月 2026 16:35:34 +0800
Subject: [PATCH] feat(procurement): 添加质检关联入库

---
 src/main/java/com/ruoyi/sales/controller/ShipmentApprovalController.java |   25 ++++++++++++++-----------
 1 files changed, 14 insertions(+), 11 deletions(-)

diff --git a/src/main/java/com/ruoyi/sales/controller/ShipmentApprovalController.java b/src/main/java/com/ruoyi/sales/controller/ShipmentApprovalController.java
index a34f809..63f417b 100644
--- a/src/main/java/com/ruoyi/sales/controller/ShipmentApprovalController.java
+++ b/src/main/java/com/ruoyi/sales/controller/ShipmentApprovalController.java
@@ -3,6 +3,7 @@
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.google.common.math.LongMath;
 import com.ruoyi.common.exception.ServiceException;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.framework.web.controller.BaseController;
@@ -88,20 +89,22 @@
 
         //  瀹℃壒閫氳繃
         if (req.getApproveStatus() == 3) {
-            // 鏌ヨ閲囪喘鍏ュ簱璁板綍
-            LambdaQueryWrapper<ProcurementRecordStorage> lambdaQueryWrapper = new LambdaQueryWrapper<ProcurementRecordStorage>()
-                    .eq(ProcurementRecordStorage::getSalesLedgerProductId, req.getSalesLedgerProductId());
-            ProcurementRecordStorage procurementRecordStorage = procurementRecordStorageService.getOne(lambdaQueryWrapper);
-
-            if (procurementRecordStorage == null) {
-                // 淇濊瘉鍓嶉潰鐨勪慨鏀瑰叏閮ㄥ洖婊�
-                throw new ServiceException("閲囪喘璁板綍涓嶅瓨鍦紝瀹℃壒鍥炴粴");
-            }
+//            // 鏌ヨ閲囪喘鍏ュ簱璁板綍
+//            LambdaQueryWrapper<ProcurementRecordStorage> lambdaQueryWrapper = new LambdaQueryWrapper<ProcurementRecordStorage>()
+//                    .eq(ProcurementRecordStorage::getSalesLedgerProductId, req.getSalesLedgerProductId());
+//            ProcurementRecordStorage procurementRecordStorage = procurementRecordStorageService.getOne(lambdaQueryWrapper);
+//
+//            if (procurementRecordStorage == null) {
+//                // 淇濊瘉鍓嶉潰鐨勪慨鏀瑰叏閮ㄥ洖婊�
+//                throw new ServiceException("閲囪喘璁板綍涓嶅瓨鍦紝瀹℃壒鍥炴粴");
+//            }
 
             //  鐢熸垚鍑哄簱璁板綍
             ProcurementRecordOutAdd procurementRecordOutAdd = new ProcurementRecordOutAdd();
-            procurementRecordOutAdd.setId(procurementRecordStorage.getId());
-            procurementRecordOutAdd.setSalesLedgerProductId(Math.toIntExact(salesLedgerProduct.getId()));
+//            procurementRecordOutAdd.setId(procurementRecordStorage.getId());
+            procurementRecordOutAdd.setId(0);
+            procurementRecordOutAdd.setProductModelId(salesLedgerProduct.getProductModelId());
+            procurementRecordOutAdd.setSalesLedgerProductId((long) Math.toIntExact(salesLedgerProduct.getId()));
             procurementRecordOutAdd.setType(2);
             procurementRecordOutAdd.setUserId(Math.toIntExact(getUserId()));
             procurementRecordOutAdd.setQuantity(salesLedgerProduct.getQuantity().toPlainString());

--
Gitblit v1.9.3