浏览代码

生成报告代码开发

lixing 3 年之前
父节点
当前提交
77efff97ae

+ 2 - 3
src/main/java/com/persagy/apm/energy/report/monthly/outline/service/impl/BusinessReportCostInfoServiceImpl.java

@@ -61,10 +61,9 @@ public class BusinessReportCostInfoServiceImpl implements com.persagy.apm.energy
 
         List<String> projectIds = reportOutlineService.queryRelatedProjects(reportOutline);
 
-        // TODO: 2021/5/30 过滤出去年一月份之前创建的项目
-        List<String> filteredProjectIds = new ArrayList<>();
+        List<String> comparableProjects = saasWebService.getComparableProjects(projectIds, reportMonth);
 
-        return getCostInfoByProjectIds(groupIdList, functionIdList, reportMonth, filteredProjectIds);
+        return getCostInfoByProjectIds(groupIdList, functionIdList, reportMonth, comparableProjects);
     }
 
     /**

+ 2 - 6
src/main/java/com/persagy/apm/energy/report/monthly/outline/service/impl/BusinessReportPowerInfoServiceImpl.java

@@ -58,13 +58,9 @@ public class BusinessReportPowerInfoServiceImpl implements com.persagy.apm.energ
 
         List<String> projectIds = reportOutlineService.queryRelatedProjects(reportOutline);
 
-        // TODO: 2021/5/30 过滤出去年一月份之前创建的项目
-        if (CollectionUtils.isEmpty(projectIds)) {
-            return null;
-        }
-        List<String> filteredProjectIds = new ArrayList<>();
+        List<String> comparableProjects = saasWebService.getComparableProjects(projectIds, reportMonth);
 
-        return getPowerInfoByProjectIds(groupIdList, functionIdList, reportMonth, filteredProjectIds);
+        return getPowerInfoByProjectIds(groupIdList, functionIdList, reportMonth, comparableProjects);
     }
 
     /**

+ 9 - 0
src/main/java/com/persagy/apm/energy/report/saasweb/service/ISaasWebService.java

@@ -83,5 +83,14 @@ public interface ISaasWebService {
      */
     List<PartitionVO> getAvailableAreas(String buildingType);
 
+    /**
+     * 获取可同比项目(开业时间在指定月份的上一年1月1日之前)
+     *
+     * @param projectIds 要筛选的项目集
+     * @param month 月份
+     * @return 可同比项目id列表
+     * @author lixing
+     * @version V1.0 2021/5/31 10:49 上午
+     */
     List<String> getComparableProjects(List<String> projectIds, Date month);
 }