From 0d83a54d5f3ae08fe0ee4b3cd3fd72e94e2767e1 Mon Sep 17 00:00:00 2001
From: xuhy <3313886187@qq.com>
Date: 星期二, 14 十月 2025 09:32:13 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TErpSupplierWarehousingServiceImpl.java |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TErpSupplierWarehousingServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TErpSupplierWarehousingServiceImpl.java
index d7da666..1ee8e03 100644
--- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TErpSupplierWarehousingServiceImpl.java
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TErpSupplierWarehousingServiceImpl.java
@@ -297,7 +297,7 @@
                 tErpSupplierWarehousingBatch.setExpiryDate(warehousingGoodsNextDto.getExpiryDate().atStartOfDay());
                 erpSupplierWarehousingBatchMapper.insert(tErpSupplierWarehousingBatch);
 
-                if(goods.getMaintenanceInterval()!=null){
+                if(goods.getMaintenanceInterval()!=null && !goods.getMaintenanceInterval().isEmpty()){
                     TErpMaintenanceReminder tErpMaintenanceReminder = new TErpMaintenanceReminder();
                     tErpMaintenanceReminder.setClinicSupplierId(supplierClinicId);
                     tErpMaintenanceReminder.setMaintenanceType(1);
@@ -396,9 +396,9 @@
 //                        List<TErpSupplierWarehousingBatch> tErpSupplierWarehousingBatches = erpSupplierWarehousingBatchMapper.selectList(new LambdaQueryWrapper<TErpSupplierWarehousingBatch>().eq(TErpSupplierWarehousingBatch::getWarehousingId, tErpSupplierWarehousing.getId()));
 //                        int sum = tErpSupplierWarehousingBatches.stream().mapToInt(TErpSupplierWarehousingBatch::getWarehousingNumber).sum();
                         String goodsId = tErpSupplierWarehousing.getGoodsId();
-                        TErpGoods goods = erpGoodsMapper.selectById(goodsId);
+//                        TErpGoods goods = erpGoodsMapper.selectById(goodsId);
                         int count = tErpSupplierInventoryGoods1.getInventoryCount() - tErpSupplierInventoryGoods1.getDamagedCount();
-                        BigDecimal multiply = goods.getSalesAmount().multiply(new BigDecimal(count));
+                        BigDecimal multiply = tErpSupplierWarehousing.getUnitAmount().multiply(new BigDecimal(count));
                         add = add.add(multiply);
                     }else {
                         // 盘亏 查出库
@@ -408,9 +408,9 @@
                         for (TErpSupplierOutboundGoods tErpSupplierOutboundGood : tErpSupplierOutboundGoods) {
                             TErpSupplierWarehousing tErpSupplierWarehousing = erpSupplierWarehousingMapper.selectById(tErpSupplierOutboundGood.getWarehousingId());
                             String goodsId = tErpSupplierWarehousing.getGoodsId();
-                            TErpGoods goods = erpGoodsMapper.selectById(goodsId);
+//                            TErpGoods goods = erpGoodsMapper.selectById(goodsId);
                             int count = tErpSupplierInventoryGoods1.getInventoryCount() - tErpSupplierInventoryGoods1.getDamagedCount();
-                            BigDecimal multiply = goods.getSalesAmount().multiply(new BigDecimal(count));
+                            BigDecimal multiply = tErpSupplierWarehousing.getUnitAmount().multiply(new BigDecimal(count));
                             add = add.add(multiply);
                         }
 //                        int sum = tErpSupplierOutboundGoods.stream().mapToInt(TErpSupplierOutboundGoods::getOutboundCount).sum();
@@ -483,11 +483,11 @@
                         inventoryDetailVo.setBatchNumber(tErpSupplierWarehousingBatch.getBatchNumber());
 
 
-                        List<TErpSupplierWarehousingBatch> tErpSupplierWarehousingBatches = erpSupplierWarehousingBatchMapper.selectList(new LambdaQueryWrapper<TErpSupplierWarehousingBatch>().eq(TErpSupplierWarehousingBatch::getBatchNumber, tErpSupplierWarehousingBatch.getBatchNumber()));
+                        List<TErpSupplierWarehousingBatch> tErpSupplierWarehousingBatches = erpSupplierWarehousingBatchMapper.selectList(new LambdaQueryWrapper<TErpSupplierWarehousingBatch>().eq(TErpSupplierWarehousingBatch::getId, tErpSupplierOutboundGoods2.getWarehousingBatchId()));
                         int sum = tErpSupplierWarehousingBatches.stream().mapToInt(TErpSupplierWarehousingBatch::getWarehousingNumber).sum();
                         List<String> collect = tErpSupplierWarehousingBatches.stream().map(TErpSupplierWarehousingBatch::getId).collect(Collectors.toList());
                         if(!collect.isEmpty()){
-                            List<TErpSupplierOutboundGoods> tErpSupplierOutboundGoods1 = erpSupplierOutboundGoodsMapper.selectList(new LambdaQueryWrapper<TErpSupplierOutboundGoods>().eq(TErpSupplierOutboundGoods::getWarehousingBatchId, collect));
+                            List<TErpSupplierOutboundGoods> tErpSupplierOutboundGoods1 = erpSupplierOutboundGoodsMapper.selectList(new LambdaQueryWrapper<TErpSupplierOutboundGoods>().in(TErpSupplierOutboundGoods::getWarehousingBatchId, collect));
                             int sum1 = tErpSupplierOutboundGoods1.stream().mapToInt(TErpSupplierOutboundGoods::getOutboundCount).sum();
                             sum = sum-sum1;
                         }

--
Gitblit v1.7.1