mitao
9 小时以前 95d8e5f4348497b1eee5884086534c86b1661b4f
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;
    }
}