From 7df0337148d9d6d6158ad93564aa2a3c827265cc Mon Sep 17 00:00:00 2001
From: liujie <1793218484@qq.com>
Date: 星期三, 22 十月 2025 15:17:15 +0800
Subject: [PATCH] Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/haizhentong

---
 ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TErpMaintenanceReminderServiceImpl.java |   67 ++++++++++++++++++++++++---------
 1 files changed, 48 insertions(+), 19 deletions(-)

diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TErpMaintenanceReminderServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TErpMaintenanceReminderServiceImpl.java
index f055b0c..3037abb 100644
--- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TErpMaintenanceReminderServiceImpl.java
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TErpMaintenanceReminderServiceImpl.java
@@ -46,10 +46,18 @@
     private TErpSupplierWarehousingBatchMapper erpSupplierWarehousingBatchMapper;
 
     @Resource
+    private TErpClinicWarehousingBatchMapper erpClinicWarehousingBatchMapper;
+
+    @Resource
     private TErpSupplierWarehousingMapper erpSupplierWarehousingMapper;
 
     @Resource
+    private TErpClinicOutboundGoodsMapper erpClinicOutboundGoodsMapper;
+
+    @Resource
     private TErpSupplierOutboundGoodsMapper erpSupplierOutboundGoodsMapper;
+
+
 
     @Resource
     private  TCrmClinicMapper crmClinicMapper;
@@ -101,7 +109,7 @@
         if(!personIds.isEmpty()){
             List<SysUser> userList = sysUserMapper.selectBatchIds(personIds);
             for (TErpMaintenanceReminderListVo tErpMaintenanceReminderListVo : list) {
-                userList.stream().filter(t ->tErpMaintenanceReminderListVo.getMaintenancePersonId()!=null &&  t.getUserId().toString().equals(tErpMaintenanceReminderListVo.getMaintenancePersonId().toString())).findFirst().ifPresent(t -> tErpMaintenanceReminderListVo.setMaintenancePersonName(t.getUserName()));
+                userList.stream().filter(t ->tErpMaintenanceReminderListVo.getMaintenancePersonId()!=null &&  t.getUserId().toString().equals(tErpMaintenanceReminderListVo.getMaintenancePersonId().toString())).findFirst().ifPresent(t -> tErpMaintenanceReminderListVo.setMaintenancePersonName(t.getNickName()));
             }
         }
         page.setRecords( list);
@@ -119,32 +127,53 @@
         tErpMaintenanceReminderDetailVo.setMaintenanceRecord(tErpMaintenanceReminder.getMaintenanceRecord());
         tErpMaintenanceReminderDetailVo.setMaintenancePersonId(tErpMaintenanceReminder.getMaintenancePersonId());
         if(tErpMaintenanceReminder.getMaintenancePersonId()!=null){
-            tErpMaintenanceReminderDetailVo.setMaintenancePersonName(sysUserMapper.selectUserById(Long.valueOf(tErpMaintenanceReminder.getMaintenancePersonId())).getUserName());
+            tErpMaintenanceReminderDetailVo.setMaintenancePersonName(sysUserMapper.selectUserById(Long.valueOf(tErpMaintenanceReminder.getMaintenancePersonId())).getNickName());
         }
         tErpMaintenanceReminderDetailVo.setStatus(tErpMaintenanceReminder.getStatus());
 
         String warehousingBatchId = tErpMaintenanceReminder.getWarehousingBatchId();
         if(warehousingBatchId != null){
-            TErpSupplierWarehousingBatch tErpSupplierWarehousingBatch = erpSupplierWarehousingBatchMapper.selectById(warehousingBatchId);
-            tErpMaintenanceReminderDetailVo.setBatchNumber(tErpSupplierWarehousingBatch.getBatchNumber());
-            TErpSupplierWarehousing tErpSupplierWarehousing = erpSupplierWarehousingMapper.selectById(tErpSupplierWarehousingBatch.getWarehousingId());
-            if(tErpSupplierWarehousing!=null){
-                String goodsId = tErpSupplierWarehousing.getGoodsId();
-                if(goodsId != null){
-                    TErpGoods goods = erpGoodsMapper.selectById(goodsId);
-                    tErpMaintenanceReminderDetailVo.setGoodsName(goods.getGoodsName());
-                    tErpMaintenanceReminderDetailVo.setQuasiNumber(goods.getQuasiNumber());
-                    tErpMaintenanceReminderDetailVo.setGoodsIdCode(goods.getGoodsIdCode());
-                    String packingUnitId = goods.getPackingUnitId();
-                    if(packingUnitId != null){
-                        TErpGoodsUnit tErpGoodsUnit = erpGoodsUnitMapper.selectById(packingUnitId);
-                        tErpMaintenanceReminderDetailVo.setUnitName(tErpGoodsUnit.getUnitName());
+            if(tErpMaintenanceReminder.getMaintenanceType()==2){
+                TErpClinicWarehousingBatch tErpSupplierWarehousingBatch = erpClinicWarehousingBatchMapper.selectById(warehousingBatchId);
+                tErpMaintenanceReminderDetailVo.setBatchNumber(tErpSupplierWarehousingBatch.getBatchNumber());
+                    String goodsId = tErpSupplierWarehousingBatch.getGoodsId();
+                    if(goodsId != null){
+                        TErpGoods goods = erpGoodsMapper.selectById(goodsId);
+                        tErpMaintenanceReminderDetailVo.setGoodsName(goods.getGoodsName());
+                        tErpMaintenanceReminderDetailVo.setQuasiNumber(goods.getQuasiNumber());
+                        tErpMaintenanceReminderDetailVo.setGoodsIdCode(goods.getGoodsIdCode());
+                        String packingUnitId = goods.getPackingUnitId();
+                        if(packingUnitId != null){
+                            TErpGoodsUnit tErpGoodsUnit = erpGoodsUnitMapper.selectById(packingUnitId);
+                            tErpMaintenanceReminderDetailVo.setUnitName(tErpGoodsUnit.getUnitName());
+                        }
+                    }
+                List<TErpClinicOutboundGoods> tErpSupplierOutboundGoods = erpClinicOutboundGoodsMapper.selectList(new LambdaQueryWrapper<TErpClinicOutboundGoods>().eq(TErpClinicOutboundGoods::getWarehousingBatchId, warehousingBatchId));
+                int sum = tErpSupplierOutboundGoods.stream().mapToInt(TErpClinicOutboundGoods::getOutboundCount).sum();
+                tErpMaintenanceReminderDetailVo.setNumber(tErpSupplierWarehousingBatch.getWarehousingNumber()-sum);
+            }else {
+                TErpSupplierWarehousingBatch tErpSupplierWarehousingBatch = erpSupplierWarehousingBatchMapper.selectById(warehousingBatchId);
+                tErpMaintenanceReminderDetailVo.setBatchNumber(tErpSupplierWarehousingBatch.getBatchNumber());
+                TErpSupplierWarehousing tErpSupplierWarehousing = erpSupplierWarehousingMapper.selectById(tErpSupplierWarehousingBatch.getWarehousingId());
+                if(tErpSupplierWarehousing!=null){
+                    String goodsId = tErpSupplierWarehousing.getGoodsId();
+                    if(goodsId != null){
+                        TErpGoods goods = erpGoodsMapper.selectById(goodsId);
+                        tErpMaintenanceReminderDetailVo.setGoodsName(goods.getGoodsName());
+                        tErpMaintenanceReminderDetailVo.setQuasiNumber(goods.getQuasiNumber());
+                        tErpMaintenanceReminderDetailVo.setGoodsIdCode(goods.getGoodsIdCode());
+                        String packingUnitId = goods.getPackingUnitId();
+                        if(packingUnitId != null){
+                            TErpGoodsUnit tErpGoodsUnit = erpGoodsUnitMapper.selectById(packingUnitId);
+                            tErpMaintenanceReminderDetailVo.setUnitName(tErpGoodsUnit.getUnitName());
+                        }
                     }
                 }
+                List<TErpSupplierOutboundGoods> tErpSupplierOutboundGoods = erpSupplierOutboundGoodsMapper.selectList(new LambdaQueryWrapper<TErpSupplierOutboundGoods>().eq(TErpSupplierOutboundGoods::getWarehousingBatchId, warehousingBatchId));
+                int sum = tErpSupplierOutboundGoods.stream().mapToInt(TErpSupplierOutboundGoods::getOutboundCount).sum();
+                tErpMaintenanceReminderDetailVo.setNumber(tErpSupplierWarehousingBatch.getWarehousingNumber()-sum);
             }
-            List<TErpSupplierOutboundGoods> tErpSupplierOutboundGoods = erpSupplierOutboundGoodsMapper.selectList(new LambdaQueryWrapper<TErpSupplierOutboundGoods>().eq(TErpSupplierOutboundGoods::getWarehousingBatchId, warehousingBatchId));
-            int sum = tErpSupplierOutboundGoods.stream().mapToInt(TErpSupplierOutboundGoods::getOutboundCount).sum();
-            tErpMaintenanceReminderDetailVo.setNumber(tErpSupplierWarehousingBatch.getWarehousingNumber()-sum);
+
 
         }
         return tErpMaintenanceReminderDetailVo;

--
Gitblit v1.7.1