From 95d8e5f4348497b1eee5884086534c86b1661b4f Mon Sep 17 00:00:00 2001
From: mitao <2763622819@qq.com>
Date: 星期一, 27 十月 2025 19:56:03 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

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

diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/AssetTypeServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/AssetTypeServiceImpl.java
index 0df58f2..f45f5fa 100644
--- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/AssetTypeServiceImpl.java
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/AssetTypeServiceImpl.java
@@ -348,7 +348,7 @@
                         idleCount += assetMain.getQuantity();
                     }else if (assetMain.getAssetStatus().contains("使用中")){
                         useCount += assetMain.getQuantity();
-                    }else if (assetMain.getAssetStatus().contains("损坏") || assetMain.getAssetStatus().contains("报废")){
+                    }else if (assetMain.getAssetStatus().contains("损") || assetMain.getAssetStatus().contains("废")){
                         disposeCount += assetMain.getQuantity();
                     }else{
                         otherCount += assetMain.getQuantity();
@@ -486,7 +486,15 @@
         PageInfo<AssetStatisticsDetailVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize());
         List<AssetStatisticsDetailVO> list = this.baseMapper.pageListInventoryDetail(query,pageInfo);
         List<AssetType> assetTypes = assetTypeService.list();
+        Map<Integer, AssetType> typeMap = assetTypes.stream().collect(Collectors.toMap(AssetType::getId, e -> e));
         for (AssetStatisticsDetailVO assetStatisticsDetailVO : list) {
+            AssetType child = typeMap.get(assetStatisticsDetailVO.getAssetTypeId());
+            if (child!=null){
+                AssetType parent = typeMap.get(child.getParentId());
+                if (parent!=null){
+                    assetStatisticsDetailVO.setAssetTypeName(parent.getTypeName()+">"+child.getTypeName());
+                }
+            }
             Integer type = assetStatisticsDetailVO.getType();
             if (type==0){
                 String typeName = "入库";
@@ -536,4 +544,14 @@
         return list;
     }
 
+    @Override
+    public String getAssetTypeNameById(Integer assetTypeId) {
+        if (assetTypeId != null) {
+            AssetType assetType = this.getById(assetTypeId);
+            if (assetType != null) {
+                return assetType.getTypeName();
+            }
+        }
+        return null;
+    }
 }

--
Gitblit v1.7.1