From 5b13db7e2c95385d69b8bdb449560bbbfe359146 Mon Sep 17 00:00:00 2001
From: mitao <2763622819@qq.com>
Date: 星期四, 23 十月 2025 17:16:47 +0800
Subject: [PATCH] 广告物料零星结算接口

---
 ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/AssetStatisticsController.java |   25 ++++++++++++++++++-------
 1 files changed, 18 insertions(+), 7 deletions(-)

diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/AssetStatisticsController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/AssetStatisticsController.java
index e5f61c6..b35f66e 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/AssetStatisticsController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/AssetStatisticsController.java
@@ -138,10 +138,10 @@
                 query.setDeptIds(deptIds);
             }
         }
-        String[] dateList = query.getDate().split(",");
+        String[] dateList = query.getDate().split("-");
         String month = dateList[1];
         int monthValue = Integer.parseInt(month);
-        int year = LocalDateTime.now().getYear();
+        int year = Integer.parseInt(dateList[0]);
         LocalDateTime firstDay = LocalDateTime.of(year, monthValue, 1, 0, 0, 0);
         LocalDateTime lastDay = LocalDateTime.of(year, monthValue,
                 YearMonth.of(year, monthValue).lengthOfMonth(), 23, 59, 59);
@@ -192,10 +192,10 @@
                 query.setDeptIds(deptIds);
             }
         }
-        String[] dateList = query.getDate().split(",");
+        String[] dateList = query.getDate().split("-");
         String month = dateList[1];
         int monthValue = Integer.parseInt(month);
-        int year = LocalDateTime.now().getYear();
+        int year = Integer.parseInt(dateList[0]);
         LocalDateTime firstDay = LocalDateTime.of(year, monthValue, 1, 0, 0, 0);
         LocalDateTime lastDay = LocalDateTime.of(year, monthValue,
                 YearMonth.of(year, monthValue).lengthOfMonth(), 23, 59, 59);
@@ -241,12 +241,25 @@
         if (StringUtils.hasLength(query.getNameOrCode())){
             // 查询出资产名称或者资产编号符合条件的code
             List<Integer> assetMainIds = assetMainService.lambdaQuery()
+                    .eq(AssetMain::getAssetTypeId,8)
                     .and(wrapper -> wrapper.like(AssetMain::getAssetName, query.getNameOrCode())
                             .or()
                             .like(AssetMain::getAssetCode, query.getNameOrCode()))
                     .list()
                     .stream()
-                    .map(AssetMain::getAssetTypeId)
+                    .map(AssetMain::getId)
+                    .collect(Collectors.toList());
+            query.setAssetMainIds(assetMainIds);
+            if (assetMainIds.isEmpty()){
+                res.setPageList(new PageInfo<>());
+                return R.ok(res);
+            }
+        }else{
+            List<Integer> assetMainIds = assetMainService.lambdaQuery()
+                    .eq(AssetMain::getAssetTypeId,8)
+                    .list()
+                    .stream()
+                    .map(AssetMain::getId)
                     .collect(Collectors.toList());
             query.setAssetMainIds(assetMainIds);
             if (assetMainIds.isEmpty()){
@@ -267,7 +280,5 @@
         res.setPageList(pageList);
         return R.ok(res);
     }
-
-    
 }
 

--
Gitblit v1.7.1