Browse Source

修复第二轮测试bug

lixing 3 years ago
parent
commit
b214d1ce7a
50 changed files with 556 additions and 290 deletions
  1. 5 5
      src/main/java/com/persagy/apm/energy/report/common/service/impl/CommonServiceImpl.java
  2. 45 3
      src/main/java/com/persagy/apm/energy/report/common/utils/DataUtils.java
  3. 11 0
      src/main/java/com/persagy/apm/energy/report/common/utils/DateUtils.java
  4. 1 1
      src/main/java/com/persagy/apm/energy/report/environment/service/impl/IEnvironmentWebServiceImpl.java
  5. 6 6
      src/main/java/com/persagy/apm/energy/report/monthly/config/function/model/dto/AddFunctionDTO.java
  6. 7 7
      src/main/java/com/persagy/apm/energy/report/monthly/config/function/model/dto/UpdateFunctionDTO.java
  7. 7 7
      src/main/java/com/persagy/apm/energy/report/monthly/config/function/service/impl/FunctionServiceImpl.java
  8. 4 4
      src/main/java/com/persagy/apm/energy/report/monthly/config/functiongroup/model/dto/AddFunctionGroupDTO.java
  9. 5 5
      src/main/java/com/persagy/apm/energy/report/monthly/config/functiongroup/model/dto/UpdateFunctionGroupDTO.java
  10. 7 7
      src/main/java/com/persagy/apm/energy/report/monthly/config/functiongroup/service/impl/FunctionGroupServiceImpl.java
  11. 6 6
      src/main/java/com/persagy/apm/energy/report/monthly/config/rel/detailstatisticsitem/model/dto/UpdateReportDetailStatisticsItemRelDTO.java
  12. 11 11
      src/main/java/com/persagy/apm/energy/report/monthly/config/rel/detailstatisticsitem/service/impl/ReportDetailStatisticsItemRelServiceImpl.java
  13. 3 3
      src/main/java/com/persagy/apm/energy/report/monthly/config/rel/typefunction/model/dto/AddReportTypeFunctionRelDTO.java
  14. 4 4
      src/main/java/com/persagy/apm/energy/report/monthly/config/rel/typefunction/model/dto/UpdateReportTypeFunctionRelDTO.java
  15. 7 7
      src/main/java/com/persagy/apm/energy/report/monthly/config/rel/typefunction/service/impl/ReportTypeFunctionRelServiceImpl.java
  16. 3 3
      src/main/java/com/persagy/apm/energy/report/monthly/config/rel/typefunctiongroup/model/dto/AddReportTypeFunctionGroupRelDTO.java
  17. 4 4
      src/main/java/com/persagy/apm/energy/report/monthly/config/rel/typefunctiongroup/model/dto/UpdateReportTypeFunctionGroupRelDTO.java
  18. 4 4
      src/main/java/com/persagy/apm/energy/report/monthly/config/rel/typefunctiongroup/service/impl/ReportTypeFunctionGroupRelServiceImpl.java
  19. 2 2
      src/main/java/com/persagy/apm/energy/report/monthly/config/rel/typestatisticsitem/model/dto/AddReportTypeStatisticsItemRelDTO.java
  20. 3 3
      src/main/java/com/persagy/apm/energy/report/monthly/config/rel/typestatisticsitem/model/dto/UpdateReportTypeStatisticsItemRelDTO.java
  21. 5 5
      src/main/java/com/persagy/apm/energy/report/monthly/config/rel/typestatisticsitem/service/impl/ReportTypeStatisticsItemRelServiceImpl.java
  22. 4 4
      src/main/java/com/persagy/apm/energy/report/monthly/config/statisticsitems/model/dto/AddStatisticItemsDTO.java
  23. 5 5
      src/main/java/com/persagy/apm/energy/report/monthly/config/statisticsitems/model/dto/UpdateStatisticItemsDTO.java
  24. 5 5
      src/main/java/com/persagy/apm/energy/report/monthly/config/statisticsitems/service/impl/StatisticItemsServiceImpl.java
  25. 3 3
      src/main/java/com/persagy/apm/energy/report/monthly/config/type/model/dto/AddReportTypeDTO.java
  26. 5 5
      src/main/java/com/persagy/apm/energy/report/monthly/config/type/model/dto/QueryReportTypeDTO.java
  27. 4 4
      src/main/java/com/persagy/apm/energy/report/monthly/config/type/model/dto/UpdateReportTypeDTO.java
  28. 7 0
      src/main/java/com/persagy/apm/energy/report/monthly/config/type/model/vo/ResponseReportTypeListItemVO.java
  29. 47 23
      src/main/java/com/persagy/apm/energy/report/monthly/config/type/service/impl/ReportTypeServiceImpl.java
  30. 13 13
      src/main/java/com/persagy/apm/energy/report/monthly/detail/business/service/impl/ReportBusinessDetailServiceImpl.java
  31. 6 0
      src/main/java/com/persagy/apm/energy/report/monthly/detail/common/model/vo/CostItemVO.java
  32. 4 4
      src/main/java/com/persagy/apm/energy/report/monthly/detail/common/model/vo/HotelRankVO.java
  33. 49 12
      src/main/java/com/persagy/apm/energy/report/monthly/detail/common/service/impl/ReportCostInfoServiceImpl.java
  34. 28 1
      src/main/java/com/persagy/apm/energy/report/monthly/detail/common/service/impl/ReportPowerInfoServiceImpl.java
  35. 9 9
      src/main/java/com/persagy/apm/energy/report/monthly/detail/hotel/area/service/impl/ReportHotelAreaDetailServiceImpl.java
  36. 1 1
      src/main/java/com/persagy/apm/energy/report/monthly/detail/hotel/project/service/impl/HotelProjectReportCostServiceImpl.java
  37. 2 2
      src/main/java/com/persagy/apm/energy/report/monthly/detail/hotel/project/service/impl/HotelProjectReportPublicPowerInfoServiceImpl.java
  38. 15 15
      src/main/java/com/persagy/apm/energy/report/monthly/detail/hotel/project/service/impl/ReportHotelProjectDetailServiceImpl.java
  39. 4 4
      src/main/java/com/persagy/apm/energy/report/monthly/functionvalue/model/dto/AddFunctionValueDTO.java
  40. 5 5
      src/main/java/com/persagy/apm/energy/report/monthly/functionvalue/model/dto/UpdateFunctionValueDTO.java
  41. 4 4
      src/main/java/com/persagy/apm/energy/report/monthly/functionvalue/service/impl/FunctionValueServiceImpl.java
  42. 9 2
      src/main/java/com/persagy/apm/energy/report/monthly/outline/controller/ReportOutlineController.java
  43. 1 1
      src/main/java/com/persagy/apm/energy/report/monthly/outline/model/ReportOutline.java
  44. 3 1
      src/main/java/com/persagy/apm/energy/report/monthly/outline/service/builder/hotel/impl/HotelAreaReportBuilder.java
  45. 24 6
      src/main/java/com/persagy/apm/energy/report/monthly/outline/service/builder/hotel/impl/HotelProjectReportBuilder.java
  46. 31 3
      src/main/java/com/persagy/apm/energy/report/monthly/outline/service/impl/ReportOutlineServiceImpl.java
  47. 35 0
      src/main/java/com/persagy/apm/energy/report/saasweb/constants/enums/AreaTypeEnum.java
  48. 10 0
      src/main/java/com/persagy/apm/energy/report/saasweb/service/ISaasWebService.java
  49. 70 60
      src/main/java/com/persagy/apm/energy/report/saasweb/service/impl/SaasWebServiceImpl.java
  50. 3 1
      src/main/resources/bootstrap.yml

+ 5 - 5
src/main/java/com/persagy/apm/energy/report/common/service/impl/CommonServiceImpl.java

@@ -200,7 +200,7 @@ public class CommonServiceImpl implements CommonService {
                     continue;
                 }
                 if (hotelProjectKpiItem.getControlRates() != null) {
-                    hotelProjectKpiItem.setRankWithinClimateZone(i + 1);
+                    hotelProjectKpiItem.setRank(i + 1);
                 }
                 hotelProjectKpiItem.setName(function.getName());
                 return hotelProjectKpiItem;
@@ -288,11 +288,11 @@ public class CommonServiceImpl implements CommonService {
             hotelProjectMaintenanceInfo.setBreakCount(vo.getAlarmCount());
             hotelProjectMaintenanceInfo.setBreakLostTime(vo.getTotalDuration());
             if (vo.getAlarmCount() != null) {
-                hotelProjectMaintenanceInfo.setRankWithinClimateZone(i + 1);
+                hotelProjectMaintenanceInfo.setRank(i + 1);
             }
             break;
         }
-        hotelProjectMaintenanceInfo.setProjectNumWithinClimateZone(projectIdList.size());
+        hotelProjectMaintenanceInfo.setProjectTotalCount(projectIdList.size());
         hotelProjectMaintenanceInfo.setGraphs(hotelProjectMaintenanceGraphList);
         return hotelProjectMaintenanceInfo;
     }
@@ -429,11 +429,11 @@ public class CommonServiceImpl implements CommonService {
             DataUtils.sort(vo.getEerDetailInfo(), sortMap);
             hotelProjectChillerPlantEfficiency.setEerDetailInfo(vo.getEerDetailInfo());
             if (vo.getEer() != null) {
-                hotelProjectChillerPlantEfficiency.setRankWithinClimateZone(i + 1);
+                hotelProjectChillerPlantEfficiency.setRank(i + 1);
             }
             break;
         }
-        hotelProjectChillerPlantEfficiency.setProjectNumWithinClimateZone(pjIdList.size());
+        hotelProjectChillerPlantEfficiency.setProjectTotalCount(pjIdList.size());
         List<String> currentProjectIdList = new ArrayList<>();
         currentProjectIdList.add(projectId);
         List<ProjectEERDataVo> currentPjLastYearEERDataVoList = iCenterMiddlewareWebService.getProjectEERDataList(currentProjectIdList, groupCode, DateUtils.getYearOff(reportDate, -1));

+ 45 - 3
src/main/java/com/persagy/apm/energy/report/common/utils/DataUtils.java

@@ -1,5 +1,6 @@
 package com.persagy.apm.energy.report.common.utils;
 
+import org.apache.commons.lang3.StringUtils;
 import org.nfunk.jep.JEP;
 import org.springframework.util.CollectionUtils;
 
@@ -98,7 +99,7 @@ public class DataUtils {
                     declaredField.set(result, notNullList.stream().map(
                             obj -> {
                                 try {
-                                    return new BigDecimal(declaredField.get(obj).toString()) ;
+                                    return new BigDecimal(declaredField.get(obj).toString());
                                 } catch (IllegalAccessException e) {
                                     e.printStackTrace();
                                     return new BigDecimal("0");
@@ -162,7 +163,6 @@ public class DataUtils {
 
             @Override
             public int compare(Object o1, Object o2) {
-                // TODO Auto-generated method stub
                 for (Map.Entry<String, Integer> entry : comparatorMap.entrySet()) {
                     int sort = 0;
                     try {
@@ -211,7 +211,6 @@ public class DataUtils {
                             }
                         }
                     } catch (Exception e) {
-                        // TODO Auto-generated catch block
                         throw new RuntimeException(e);
                     }
                     if (sort != 0) {
@@ -226,4 +225,47 @@ public class DataUtils {
         Collections.sort(list, comparator);
     }
 
+    /**
+     * 计算一组数据的和,入参和出参均未字符串格式
+     *
+     * @param dataList 要计算的数据
+     * @return 计算结果
+     * @author lixing
+     * @version V1.0 2021/6/23 2:42 下午
+     */
+    public static String getSum(List<String> dataList) {
+        if (CollectionUtils.isEmpty(dataList)) {
+            return null;
+        }
+        BigDecimal result = null;
+        for (String data : dataList) {
+            if (StringUtils.isBlank(data)) {
+                continue;
+            }
+            if (result == null) {
+                result = new BigDecimal(data);
+            } else {
+                result = result.add(new BigDecimal(data));
+            }
+        }
+        return result == null ? null : result.toString();
+    }
+
+    /**
+     * 判断一组double值是否都不为空
+     *
+     * @param doubles 一组double值
+     * @return 判断结果
+     * @author lixing
+     * @version V1.0 2021/6/23 3:27 下午
+     */
+    public static boolean isNotNull(Double... doubles) {
+        for (Double value : doubles) {
+            if (value == null) {
+                return false;
+            }
+        }
+        return true;
+    }
+
 }

+ 11 - 0
src/main/java/com/persagy/apm/energy/report/common/utils/DateUtils.java

@@ -391,4 +391,15 @@ public class DateUtils {
         System.out.println(getSameMonthFirstDayOfLastYear(startDate));
     }
 
+    /**
+     * 打印当前时间距离开始时间的毫秒数
+     *
+     * @param startDate 开始时间
+     * @author lixing
+     * @version V1.0 2021/6/23 7:01 下午
+     */
+    public static void printDuration(Date startDate) {
+        Date now = new Date();
+        System.out.println("用时:" + (now.getTime() - startDate.getTime()));
+    }
 }

+ 1 - 1
src/main/java/com/persagy/apm/energy/report/environment/service/impl/IEnvironmentWebServiceImpl.java

@@ -112,7 +112,7 @@ public class IEnvironmentWebServiceImpl implements IEnvironmentWebService {
                     List<DateGraphItemVO> detailInfo = new ArrayList<>();
                     hotelProjectKpiItem.setDetailInfo(detailInfo);
                     hotelProjectKpiItem.setProjectId(vo.getProjectId());
-                    hotelProjectKpiItem.setProjectNumWithinClimateZone(batchQueryEnvListByParamDTO.getProjectIdList().size());
+                    hotelProjectKpiItem.setProjectTotalCount(batchQueryEnvListByParamDTO.getProjectIdList().size());
                     Map dataInfoMap = vo.getDayDataList();
                     if(null == dataInfoMap){
                         dataInfoMap = new HashMap();

+ 6 - 6
src/main/java/com/persagy/apm/energy/report/monthly/config/function/model/dto/AddFunctionDTO.java

@@ -17,27 +17,27 @@ import java.util.Date;
 @ApiModel(value = "创建能耗报告信息点入参")
 public class AddFunctionDTO {
     @ApiModelProperty(value = "集团编码", required = true)
-    @NotNull(message = "集团编码不能为空") // todo 更新校验规则
+    @NotNull(message = "集团编码不能为空")
     private String groupCode;
 
     @ApiModelProperty(value = "能耗类型", required = true)
-    @NotNull(message = "能耗类型不能为空") // todo 更新校验规则
+    @NotNull(message = "能耗类型不能为空")
     private String energyType;
 
     @ApiModelProperty(value = "建筑类型(业态)", required = true)
-    @NotNull(message = "建筑类型(业态)不能为空") // todo 更新校验规则
+    @NotNull(message = "建筑类型(业态)不能为空")
     private String buildingType;
 
     @ApiModelProperty(value = "信息点类型(0-能耗,1-费用 ,2-能耗预算,3-费用预算)", required = true)
-    @NotNull(message = "信息点类型(0-能耗,1-费用 ,2-能耗预算,3-费用预算)不能为空") // todo 更新校验规则
+    @NotNull(message = "信息点类型(0-能耗,1-费用 ,2-能耗预算,3-费用预算)不能为空")
     private String functionType;
 
     @ApiModelProperty(value = "能耗模型编码", required = true)
-    @NotNull(message = "能耗模型编码不能为空") // todo 更新校验规则
+    @NotNull(message = "能耗模型编码不能为空")
     private String modelCode;
 
     @ApiModelProperty(value = "分项id", required = true)
-    @NotNull(message = "分项id不能为空") // todo 更新校验规则
+    @NotNull(message = "分项id不能为空")
     private String itemId;
 
 }

+ 7 - 7
src/main/java/com/persagy/apm/energy/report/monthly/config/function/model/dto/UpdateFunctionDTO.java

@@ -17,31 +17,31 @@ import java.util.Date;
 @ApiModel(value = "更新能耗报告信息点入参")
 public class UpdateFunctionDTO {
     @ApiModelProperty(value = "主键", required = true)
-    @NotNull(message = "主键不能为空") // todo 更新校验规则
+    @NotNull(message = "主键不能为空")
     private String id;
 
     @ApiModelProperty(value = "集团编码", required = true)
-    @NotNull(message = "集团编码不能为空") // todo 更新校验规则
+    @NotNull(message = "集团编码不能为空")
     private String groupCode;
 
     @ApiModelProperty(value = "能耗类型", required = true)
-    @NotNull(message = "能耗类型不能为空") // todo 更新校验规则
+    @NotNull(message = "能耗类型不能为空")
     private String energyType;
 
     @ApiModelProperty(value = "建筑类型(业态)", required = true)
-    @NotNull(message = "建筑类型(业态)不能为空") // todo 更新校验规则
+    @NotNull(message = "建筑类型(业态)不能为空")
     private String buildingType;
 
     @ApiModelProperty(value = "信息点类型(0-能耗,1-费用 ,2-能耗预算,3-费用预算)", required = true)
-    @NotNull(message = "信息点类型(0-能耗,1-费用 ,2-能耗预算,3-费用预算)不能为空") // todo 更新校验规则
+    @NotNull(message = "信息点类型(0-能耗,1-费用 ,2-能耗预算,3-费用预算)不能为空")
     private String functionType;
 
     @ApiModelProperty(value = "能耗模型编码", required = true)
-    @NotNull(message = "能耗模型编码不能为空") // todo 更新校验规则
+    @NotNull(message = "能耗模型编码不能为空")
     private String modelCode;
 
     @ApiModelProperty(value = "分项id", required = true)
-    @NotNull(message = "分项id不能为空") // todo 更新校验规则
+    @NotNull(message = "分项id不能为空")
     private String itemId;
 
 }

+ 7 - 7
src/main/java/com/persagy/apm/energy/report/monthly/config/function/service/impl/FunctionServiceImpl.java

@@ -70,7 +70,7 @@ public class FunctionServiceImpl extends ServiceImpl<FunctionMapper, Function>
      */
     private void setDefaultValue(Function function) {
         function.setCreator(AppContext.getContext().getAccountId());
-        // todo 其他默认的属性
+        
 
     }
 
@@ -216,32 +216,32 @@ public class FunctionServiceImpl extends ServiceImpl<FunctionMapper, Function>
             }
         }
 
-        // todo 需判断使用like还是eq
+        
         if (StringUtils.isNotEmpty(pageQueryFunctionDTO.getGroupCode())) {
             queryWrapper.like(Function.PROP_GROUP_CODE, pageQueryFunctionDTO.getGroupCode());
         }
 
-        // todo 需判断使用like还是eq
+        
         if (StringUtils.isNotEmpty(pageQueryFunctionDTO.getEnergyType())) {
             queryWrapper.like(Function.PROP_ENERGY_TYPE, pageQueryFunctionDTO.getEnergyType());
         }
 
-        // todo 需判断使用like还是eq
+        
         if (StringUtils.isNotEmpty(pageQueryFunctionDTO.getBuildingType())) {
             queryWrapper.like(Function.PROP_BUILDING_TYPE, pageQueryFunctionDTO.getBuildingType());
         }
 
-        // todo 需判断使用like还是eq
+        
         if (StringUtils.isNotEmpty(pageQueryFunctionDTO.getFunctionType())) {
             queryWrapper.like(Function.PROP_FUNCTION_TYPE, pageQueryFunctionDTO.getFunctionType());
         }
 
-        // todo 需判断使用like还是eq
+        
         if (StringUtils.isNotEmpty(pageQueryFunctionDTO.getModelCode())) {
             queryWrapper.like(Function.PROP_MODEL_CODE, pageQueryFunctionDTO.getModelCode());
         }
 
-        // todo 需判断使用like还是eq
+        
         if (StringUtils.isNotEmpty(pageQueryFunctionDTO.getItemId())) {
             queryWrapper.like(Function.PROP_ITEM_ID, pageQueryFunctionDTO.getItemId());
         }

+ 4 - 4
src/main/java/com/persagy/apm/energy/report/monthly/config/functiongroup/model/dto/AddFunctionGroupDTO.java

@@ -17,19 +17,19 @@ import java.util.Date;
 @ApiModel(value = "创建信息点分组入参")
 public class AddFunctionGroupDTO {
     @ApiModelProperty(value = "分组名称", required = true)
-    @NotNull(message = "分组名称不能为空") // todo 更新校验规则
+    @NotNull(message = "分组名称不能为空") 
     private String name;
 
     @ApiModelProperty(value = "包含的分组id(预留字段)", required = true)
-    @NotNull(message = "包含的分组id(预留字段)不能为空") // todo 更新校验规则
+    @NotNull(message = "包含的分组id(预留字段)不能为空") 
     private String groupIds;
 
     @ApiModelProperty(value = "包含的信息点id", required = true)
-    @NotNull(message = "包含的信息点id不能为空") // todo 更新校验规则
+    @NotNull(message = "包含的信息点id不能为空") 
     private String functionIds;
 
     @ApiModelProperty(value = "所属段落(如果不直属段落,这里不填)", required = true)
-    @NotNull(message = "所属段落(如果不直属段落,这里不填)不能为空") // todo 更新校验规则
+    @NotNull(message = "所属段落(如果不直属段落,这里不填)不能为空") 
     private String belongParagraph;
 
 }

+ 5 - 5
src/main/java/com/persagy/apm/energy/report/monthly/config/functiongroup/model/dto/UpdateFunctionGroupDTO.java

@@ -17,23 +17,23 @@ import java.util.Date;
 @ApiModel(value = "更新信息点分组入参")
 public class UpdateFunctionGroupDTO {
     @ApiModelProperty(value = "主键", required = true)
-    @NotNull(message = "主键不能为空") // todo 更新校验规则
+    @NotNull(message = "主键不能为空") 
     private String id;
 
     @ApiModelProperty(value = "分组名称", required = true)
-    @NotNull(message = "分组名称不能为空") // todo 更新校验规则
+    @NotNull(message = "分组名称不能为空") 
     private String name;
 
     @ApiModelProperty(value = "包含的分组id(预留字段)", required = true)
-    @NotNull(message = "包含的分组id(预留字段)不能为空") // todo 更新校验规则
+    @NotNull(message = "包含的分组id(预留字段)不能为空") 
     private String groupIds;
 
     @ApiModelProperty(value = "包含的信息点id", required = true)
-    @NotNull(message = "包含的信息点id不能为空") // todo 更新校验规则
+    @NotNull(message = "包含的信息点id不能为空") 
     private String functionIds;
 
     @ApiModelProperty(value = "所属段落(如果不直属段落,这里不填)", required = true)
-    @NotNull(message = "所属段落(如果不直属段落,这里不填)不能为空") // todo 更新校验规则
+    @NotNull(message = "所属段落(如果不直属段落,这里不填)不能为空") 
     private String belongParagraph;
 
 }

+ 7 - 7
src/main/java/com/persagy/apm/energy/report/monthly/config/functiongroup/service/impl/FunctionGroupServiceImpl.java

@@ -54,7 +54,7 @@ public class FunctionGroupServiceImpl extends ServiceImpl<FunctionGroupMapper, F
      */
     private void setDefaultValue(FunctionGroup functionGroup) {
         functionGroup.setCreator(AppContext.getContext().getAccountId());
-        // todo 其他默认的属性
+        
 
     }
 
@@ -143,17 +143,17 @@ public class FunctionGroupServiceImpl extends ServiceImpl<FunctionGroupMapper, F
 
         if (queryFunctionGroupDTO != null) {
 
-            // todo 需判断使用like还是eq
+            
             if (StringUtils.isNotEmpty(queryFunctionGroupDTO.getName())) {
                 queryWrapper.like(FunctionGroup.PROP_NAME, queryFunctionGroupDTO.getName());
             }
 
-            // todo 需判断使用like还是eq
+            
             if (StringUtils.isNotEmpty(queryFunctionGroupDTO.getGroupIds())) {
                 queryWrapper.like(FunctionGroup.PROP_GROUP_IDS, queryFunctionGroupDTO.getGroupIds());
             }
 
-            // todo 需判断使用like还是eq
+            
             if (StringUtils.isNotEmpty(queryFunctionGroupDTO.getFunctionIds())) {
                 queryWrapper.like(FunctionGroup.PROP_FUNCTION_IDS, queryFunctionGroupDTO.getFunctionIds());
             }
@@ -190,17 +190,17 @@ public class FunctionGroupServiceImpl extends ServiceImpl<FunctionGroupMapper, F
             }
         }
 
-        // todo 需判断使用like还是eq
+        
         if (StringUtils.isNotEmpty(pageQueryFunctionGroupDTO.getName())) {
             queryWrapper.like(FunctionGroup.PROP_NAME, pageQueryFunctionGroupDTO.getName());
         }
 
-        // todo 需判断使用like还是eq
+        
         if (StringUtils.isNotEmpty(pageQueryFunctionGroupDTO.getGroupIds())) {
             queryWrapper.like(FunctionGroup.PROP_GROUP_IDS, pageQueryFunctionGroupDTO.getGroupIds());
         }
 
-        // todo 需判断使用like还是eq
+        
         if (StringUtils.isNotEmpty(pageQueryFunctionGroupDTO.getFunctionIds())) {
             queryWrapper.like(FunctionGroup.PROP_FUNCTION_IDS, pageQueryFunctionGroupDTO.getFunctionIds());
         }

+ 6 - 6
src/main/java/com/persagy/apm/energy/report/monthly/config/rel/detailstatisticsitem/model/dto/UpdateReportDetailStatisticsItemRelDTO.java

@@ -17,27 +17,27 @@ import java.util.Date;
 @ApiModel(value = "更新报告详情与统计条目的关联入参")
 public class UpdateReportDetailStatisticsItemRelDTO {
     @ApiModelProperty(value = "主键", required = true)
-    @NotNull(message = "主键不能为空") // todo 更新校验规则
+    @NotNull(message = "主键不能为空") 
     private String id;
 
     @ApiModelProperty(value = "报告详情主键", required = true)
-    @NotNull(message = "报告详情主键不能为空") // todo 更新校验规则
+    @NotNull(message = "报告详情主键不能为空") 
     private String reportDetailId;
 
     @ApiModelProperty(value = "报告类型id", required = true)
-    @NotNull(message = "报告类型id不能为空") // todo 更新校验规则
+    @NotNull(message = "报告类型id不能为空") 
     private String reportTypeId;
 
     @ApiModelProperty(value = "统计条目id", required = true)
-    @NotNull(message = "统计条目id不能为空") // todo 更新校验规则
+    @NotNull(message = "统计条目id不能为空") 
     private String statisticsItemId;
 
     @ApiModelProperty(value = "不合格原因", required = true)
-    @NotNull(message = "不合格原因不能为空") // todo 更新校验规则
+    @NotNull(message = "不合格原因不能为空") 
     private String unqualifiedReason;
 
     @ApiModelProperty(value = "备注", required = true)
-    @NotNull(message = "备注不能为空") // todo 更新校验规则
+    @NotNull(message = "备注不能为空") 
     private String remark;
 
 }

+ 11 - 11
src/main/java/com/persagy/apm/energy/report/monthly/config/rel/detailstatisticsitem/service/impl/ReportDetailStatisticsItemRelServiceImpl.java

@@ -54,7 +54,7 @@ public class ReportDetailStatisticsItemRelServiceImpl extends ServiceImpl<Report
      */
     private void setDefaultValue(ReportDetailStatisticsItemRel reportDetailStatisticsItemRel) {
         reportDetailStatisticsItemRel.setCreator(AppContext.getContext().getAccountId());
-        // todo 其他默认的属性
+        
 
     }
 
@@ -143,27 +143,27 @@ public class ReportDetailStatisticsItemRelServiceImpl extends ServiceImpl<Report
 
         if (queryReportDetailStatisticsItemRelDTO != null) {
 
-            // todo 需判断使用like还是eq
+            
             if (StringUtils.isNotEmpty(queryReportDetailStatisticsItemRelDTO.getReportDetailId())) {
                 queryWrapper.like(ReportDetailStatisticsItemRel.PROP_REPORT_DETAIL_ID, queryReportDetailStatisticsItemRelDTO.getReportDetailId());
             }
 
-            // todo 需判断使用like还是eq
+            
             if (StringUtils.isNotEmpty(queryReportDetailStatisticsItemRelDTO.getReportTypeId())) {
                 queryWrapper.like(ReportDetailStatisticsItemRel.PROP_REPORT_TYPE_ID, queryReportDetailStatisticsItemRelDTO.getReportTypeId());
             }
 
-            // todo 需判断使用like还是eq
+            
             if (StringUtils.isNotEmpty(queryReportDetailStatisticsItemRelDTO.getStatisticsItemId())) {
                 queryWrapper.like(ReportDetailStatisticsItemRel.PROP_STATISTICS_ITEM_ID, queryReportDetailStatisticsItemRelDTO.getStatisticsItemId());
             }
 
-            // todo 需判断使用like还是eq
+            
             if (StringUtils.isNotEmpty(queryReportDetailStatisticsItemRelDTO.getUnqualifiedReason())) {
                 queryWrapper.like(ReportDetailStatisticsItemRel.PROP_UNQUALIFIED_REASON, queryReportDetailStatisticsItemRelDTO.getUnqualifiedReason());
             }
 
-            // todo 需判断使用like还是eq
+            
             if (StringUtils.isNotEmpty(queryReportDetailStatisticsItemRelDTO.getRemark())) {
                 queryWrapper.like(ReportDetailStatisticsItemRel.PROP_REMARK, queryReportDetailStatisticsItemRelDTO.getRemark());
             }
@@ -199,27 +199,27 @@ public class ReportDetailStatisticsItemRelServiceImpl extends ServiceImpl<Report
             }
         }
 
-        // todo 需判断使用like还是eq
+        
         if (StringUtils.isNotEmpty(pageQueryReportDetailStatisticsItemRelDTO.getReportDetailId())) {
             queryWrapper.like(ReportDetailStatisticsItemRel.PROP_REPORT_DETAIL_ID, pageQueryReportDetailStatisticsItemRelDTO.getReportDetailId());
         }
 
-        // todo 需判断使用like还是eq
+        
         if (StringUtils.isNotEmpty(pageQueryReportDetailStatisticsItemRelDTO.getReportTypeId())) {
             queryWrapper.like(ReportDetailStatisticsItemRel.PROP_REPORT_TYPE_ID, pageQueryReportDetailStatisticsItemRelDTO.getReportTypeId());
         }
 
-        // todo 需判断使用like还是eq
+        
         if (StringUtils.isNotEmpty(pageQueryReportDetailStatisticsItemRelDTO.getStatisticsItemId())) {
             queryWrapper.like(ReportDetailStatisticsItemRel.PROP_STATISTICS_ITEM_ID, pageQueryReportDetailStatisticsItemRelDTO.getStatisticsItemId());
         }
 
-        // todo 需判断使用like还是eq
+        
         if (StringUtils.isNotEmpty(pageQueryReportDetailStatisticsItemRelDTO.getUnqualifiedReason())) {
             queryWrapper.like(ReportDetailStatisticsItemRel.PROP_UNQUALIFIED_REASON, pageQueryReportDetailStatisticsItemRelDTO.getUnqualifiedReason());
         }
 
-        // todo 需判断使用like还是eq
+        
         if (StringUtils.isNotEmpty(pageQueryReportDetailStatisticsItemRelDTO.getRemark())) {
             queryWrapper.like(ReportDetailStatisticsItemRel.PROP_REMARK, pageQueryReportDetailStatisticsItemRelDTO.getRemark());
         }

+ 3 - 3
src/main/java/com/persagy/apm/energy/report/monthly/config/rel/typefunction/model/dto/AddReportTypeFunctionRelDTO.java

@@ -17,15 +17,15 @@ import java.util.Date;
 @ApiModel(value = "创建报告类型入参")
 public class AddReportTypeFunctionRelDTO {
     @ApiModelProperty(value = "报告类型id", required = true)
-    @NotNull(message = "报告类型id不能为空") // todo 更新校验规则
+    @NotNull(message = "报告类型id不能为空") 
     private String reportTypeId;
 
     @ApiModelProperty(value = "信息点id", required = true)
-    @NotNull(message = "信息点id不能为空") // todo 更新校验规则
+    @NotNull(message = "信息点id不能为空") 
     private String functionId;
 
     @ApiModelProperty(value = "所属段落", required = true)
-    @NotNull(message = "所属段落不能为空") // todo 更新校验规则
+    @NotNull(message = "所属段落不能为空") 
     private String belongParagraph;
 
 }

+ 4 - 4
src/main/java/com/persagy/apm/energy/report/monthly/config/rel/typefunction/model/dto/UpdateReportTypeFunctionRelDTO.java

@@ -17,19 +17,19 @@ import java.util.Date;
 @ApiModel(value = "更新报告类型入参")
 public class UpdateReportTypeFunctionRelDTO {
     @ApiModelProperty(value = "主键", required = true)
-    @NotNull(message = "主键不能为空") // todo 更新校验规则
+    @NotNull(message = "主键不能为空") 
     private String id;
 
     @ApiModelProperty(value = "报告类型id", required = true)
-    @NotNull(message = "报告类型id不能为空") // todo 更新校验规则
+    @NotNull(message = "报告类型id不能为空") 
     private String reportTypeId;
 
     @ApiModelProperty(value = "信息点id", required = true)
-    @NotNull(message = "信息点id不能为空") // todo 更新校验规则
+    @NotNull(message = "信息点id不能为空") 
     private String functionId;
 
     @ApiModelProperty(value = "所属段落", required = true)
-    @NotNull(message = "所属段落不能为空") // todo 更新校验规则
+    @NotNull(message = "所属段落不能为空") 
     private String belongParagraph;
 
 }

+ 7 - 7
src/main/java/com/persagy/apm/energy/report/monthly/config/rel/typefunction/service/impl/ReportTypeFunctionRelServiceImpl.java

@@ -54,7 +54,7 @@ public class ReportTypeFunctionRelServiceImpl extends ServiceImpl<ReportTypeFunc
      */
     private void setDefaultValue(ReportTypeFunctionRel reportTypeFunctionRel) {
         reportTypeFunctionRel.setCreator(AppContext.getContext().getAccountId());
-        // todo 其他默认的属性
+        
 
     }
 
@@ -143,17 +143,17 @@ public class ReportTypeFunctionRelServiceImpl extends ServiceImpl<ReportTypeFunc
 
         if (queryReportTypeFunctionRelDTO != null) {
 
-            // todo 需判断使用like还是eq
+            
             if (StringUtils.isNotEmpty(queryReportTypeFunctionRelDTO.getReportTypeId())) {
                 queryWrapper.like(ReportTypeFunctionRel.PROP_REPORT_TYPE_ID, queryReportTypeFunctionRelDTO.getReportTypeId());
             }
 
-            // todo 需判断使用like还是eq
+            
             if (StringUtils.isNotEmpty(queryReportTypeFunctionRelDTO.getFunctionId())) {
                 queryWrapper.like(ReportTypeFunctionRel.PROP_FUNCTION_ID, queryReportTypeFunctionRelDTO.getFunctionId());
             }
 
-            // todo 需判断使用like还是eq
+            
             if (StringUtils.isNotEmpty(queryReportTypeFunctionRelDTO.getBelongParagraph())) {
                 queryWrapper.like(ReportTypeFunctionRel.PROP_BELONG_PARAGRAPH, queryReportTypeFunctionRelDTO.getBelongParagraph());
             }
@@ -189,17 +189,17 @@ public class ReportTypeFunctionRelServiceImpl extends ServiceImpl<ReportTypeFunc
             }
         }
 
-        // todo 需判断使用like还是eq
+        
         if (StringUtils.isNotEmpty(pageQueryReportTypeFunctionRelDTO.getReportTypeId())) {
             queryWrapper.like(ReportTypeFunctionRel.PROP_REPORT_TYPE_ID, pageQueryReportTypeFunctionRelDTO.getReportTypeId());
         }
 
-        // todo 需判断使用like还是eq
+        
         if (StringUtils.isNotEmpty(pageQueryReportTypeFunctionRelDTO.getFunctionId())) {
             queryWrapper.like(ReportTypeFunctionRel.PROP_FUNCTION_ID, pageQueryReportTypeFunctionRelDTO.getFunctionId());
         }
 
-        // todo 需判断使用like还是eq
+        
         if (StringUtils.isNotEmpty(pageQueryReportTypeFunctionRelDTO.getBelongParagraph())) {
             queryWrapper.like(ReportTypeFunctionRel.PROP_BELONG_PARAGRAPH, pageQueryReportTypeFunctionRelDTO.getBelongParagraph());
         }

+ 3 - 3
src/main/java/com/persagy/apm/energy/report/monthly/config/rel/typefunctiongroup/model/dto/AddReportTypeFunctionGroupRelDTO.java

@@ -17,15 +17,15 @@ import java.util.Date;
 @ApiModel(value = "创建报告类型入参")
 public class AddReportTypeFunctionGroupRelDTO {
     @ApiModelProperty(value = "报告类型id", required = true)
-    @NotNull(message = "报告类型id不能为空") // todo 更新校验规则
+    @NotNull(message = "报告类型id不能为空") 
     private String reportTypeId;
 
     @ApiModelProperty(value = "信息点分组id", required = true)
-    @NotNull(message = "信息点分组id不能为空") // todo 更新校验规则
+    @NotNull(message = "信息点分组id不能为空") 
     private String functionGroupId;
 
     @ApiModelProperty(value = "所属段落", required = true)
-    @NotNull(message = "所属段落不能为空") // todo 更新校验规则
+    @NotNull(message = "所属段落不能为空") 
     private String belongParagraph;
 
 }

+ 4 - 4
src/main/java/com/persagy/apm/energy/report/monthly/config/rel/typefunctiongroup/model/dto/UpdateReportTypeFunctionGroupRelDTO.java

@@ -17,19 +17,19 @@ import java.util.Date;
 @ApiModel(value = "更新报告类型入参")
 public class UpdateReportTypeFunctionGroupRelDTO {
     @ApiModelProperty(value = "主键", required = true)
-    @NotNull(message = "主键不能为空") // todo 更新校验规则
+    @NotNull(message = "主键不能为空") 
     private String id;
 
     @ApiModelProperty(value = "报告类型id", required = true)
-    @NotNull(message = "报告类型id不能为空") // todo 更新校验规则
+    @NotNull(message = "报告类型id不能为空") 
     private String reportTypeId;
 
     @ApiModelProperty(value = "信息点分组id", required = true)
-    @NotNull(message = "信息点分组id不能为空") // todo 更新校验规则
+    @NotNull(message = "信息点分组id不能为空") 
     private String functionGroupId;
 
     @ApiModelProperty(value = "所属段落", required = true)
-    @NotNull(message = "所属段落不能为空") // todo 更新校验规则
+    @NotNull(message = "所属段落不能为空") 
     private String belongParagraph;
 
 }

+ 4 - 4
src/main/java/com/persagy/apm/energy/report/monthly/config/rel/typefunctiongroup/service/impl/ReportTypeFunctionGroupRelServiceImpl.java

@@ -54,7 +54,7 @@ public class ReportTypeFunctionGroupRelServiceImpl extends ServiceImpl<ReportTyp
      */
     private void setDefaultValue(ReportTypeFunctionGroupRel reportTypeFunctionGroupRel) {
         reportTypeFunctionGroupRel.setCreator(AppContext.getContext().getAccountId());
-        // todo 其他默认的属性
+        
 
     }
 
@@ -186,17 +186,17 @@ public class ReportTypeFunctionGroupRelServiceImpl extends ServiceImpl<ReportTyp
             }
         }
 
-        // todo 需判断使用like还是eq
+        
         if (StringUtils.isNotEmpty(pageQueryReportTypeFunctionGroupRelDTO.getReportTypeId())) {
             queryWrapper.like(ReportTypeFunctionGroupRel.PROP_REPORT_TYPE_ID, pageQueryReportTypeFunctionGroupRelDTO.getReportTypeId());
         }
 
-        // todo 需判断使用like还是eq
+        
         if (StringUtils.isNotEmpty(pageQueryReportTypeFunctionGroupRelDTO.getFunctionGroupId())) {
             queryWrapper.like(ReportTypeFunctionGroupRel.PROP_FUNCTION_GROUP_ID, pageQueryReportTypeFunctionGroupRelDTO.getFunctionGroupId());
         }
 
-        // todo 需判断使用like还是eq
+        
         if (StringUtils.isNotEmpty(pageQueryReportTypeFunctionGroupRelDTO.getBelongParagraph())) {
             queryWrapper.like(ReportTypeFunctionGroupRel.PROP_BELONG_PARAGRAPH, pageQueryReportTypeFunctionGroupRelDTO.getBelongParagraph());
         }

+ 2 - 2
src/main/java/com/persagy/apm/energy/report/monthly/config/rel/typestatisticsitem/model/dto/AddReportTypeStatisticsItemRelDTO.java

@@ -17,11 +17,11 @@ import java.util.Date;
 @ApiModel(value = "创建报告类型和统计条目关联关系入参")
 public class AddReportTypeStatisticsItemRelDTO {
     @ApiModelProperty(value = "报告类型id", required = true)
-    @NotNull(message = "报告类型id不能为空") // todo 更新校验规则
+    @NotNull(message = "报告类型id不能为空") 
     private String reportTypeId;
 
     @ApiModelProperty(value = "统计条目id", required = true)
-    @NotNull(message = "统计条目id不能为空") // todo 更新校验规则
+    @NotNull(message = "统计条目id不能为空") 
     private String statisticsItemId;
 
 }

+ 3 - 3
src/main/java/com/persagy/apm/energy/report/monthly/config/rel/typestatisticsitem/model/dto/UpdateReportTypeStatisticsItemRelDTO.java

@@ -17,15 +17,15 @@ import java.util.Date;
 @ApiModel(value = "更新报告类型和统计条目关联关系入参")
 public class UpdateReportTypeStatisticsItemRelDTO {
     @ApiModelProperty(value = "主键", required = true)
-    @NotNull(message = "主键不能为空") // todo 更新校验规则
+    @NotNull(message = "主键不能为空") 
     private String id;
 
     @ApiModelProperty(value = "报告类型id", required = true)
-    @NotNull(message = "报告类型id不能为空") // todo 更新校验规则
+    @NotNull(message = "报告类型id不能为空") 
     private String reportTypeId;
 
     @ApiModelProperty(value = "统计条目id", required = true)
-    @NotNull(message = "统计条目id不能为空") // todo 更新校验规则
+    @NotNull(message = "统计条目id不能为空") 
     private String statisticsItemId;
 
 }

+ 5 - 5
src/main/java/com/persagy/apm/energy/report/monthly/config/rel/typestatisticsitem/service/impl/ReportTypeStatisticsItemRelServiceImpl.java

@@ -54,7 +54,7 @@ public class ReportTypeStatisticsItemRelServiceImpl extends ServiceImpl<ReportTy
      */
     private void setDefaultValue(ReportTypeStatisticsItemRel reportTypeStatisticsItemRel) {
         reportTypeStatisticsItemRel.setCreator(AppContext.getContext().getAccountId());
-        // todo 其他默认的属性
+        
 
     }
 
@@ -143,12 +143,12 @@ public class ReportTypeStatisticsItemRelServiceImpl extends ServiceImpl<ReportTy
 
         if (queryReportTypeStatisticsItemRelDTO != null) {
 
-            // todo 需判断使用like还是eq
+            
             if (StringUtils.isNotEmpty(queryReportTypeStatisticsItemRelDTO.getReportTypeId())) {
                 queryWrapper.like(ReportTypeStatisticsItemRel.PROP_REPORT_TYPE_ID, queryReportTypeStatisticsItemRelDTO.getReportTypeId());
             }
 
-            // todo 需判断使用like还是eq
+            
             if (StringUtils.isNotEmpty(queryReportTypeStatisticsItemRelDTO.getStatisticsItemId())) {
                 queryWrapper.like(ReportTypeStatisticsItemRel.PROP_STATISTICS_ITEM_ID, queryReportTypeStatisticsItemRelDTO.getStatisticsItemId());
             }
@@ -184,12 +184,12 @@ public class ReportTypeStatisticsItemRelServiceImpl extends ServiceImpl<ReportTy
             }
         }
 
-        // todo 需判断使用like还是eq
+        
         if (StringUtils.isNotEmpty(pageQueryReportTypeStatisticsItemRelDTO.getReportTypeId())) {
             queryWrapper.like(ReportTypeStatisticsItemRel.PROP_REPORT_TYPE_ID, pageQueryReportTypeStatisticsItemRelDTO.getReportTypeId());
         }
 
-        // todo 需判断使用like还是eq
+        
         if (StringUtils.isNotEmpty(pageQueryReportTypeStatisticsItemRelDTO.getStatisticsItemId())) {
             queryWrapper.like(ReportTypeStatisticsItemRel.PROP_STATISTICS_ITEM_ID, pageQueryReportTypeStatisticsItemRelDTO.getStatisticsItemId());
         }

+ 4 - 4
src/main/java/com/persagy/apm/energy/report/monthly/config/statisticsitems/model/dto/AddStatisticItemsDTO.java

@@ -17,19 +17,19 @@ import java.util.Date;
 @ApiModel(value = "创建统计条目入参")
 public class AddStatisticItemsDTO {
     @ApiModelProperty(value = "条目编码", required = true)
-    @NotNull(message = "条目编码不能为空") // todo 更新校验规则
+    @NotNull(message = "条目编码不能为空") 
     private String itemCode;
 
     @ApiModelProperty(value = "条目来源", required = true)
-    @NotNull(message = "条目来源不能为空") // todo 更新校验规则
+    @NotNull(message = "条目来源不能为空") 
     private String itemSource;
 
     @ApiModelProperty(value = "合格的标准", required = true)
-    @NotNull(message = "合格的标准不能为空") // todo 更新校验规则
+    @NotNull(message = "合格的标准不能为空") 
     private String standardValue;
 
     @ApiModelProperty(value = "合格的判断公式", required = true)
-    @NotNull(message = "合格的判断公式不能为空") // todo 更新校验规则
+    @NotNull(message = "合格的判断公式不能为空") 
     private String qualifyFormula;
 
 }

+ 5 - 5
src/main/java/com/persagy/apm/energy/report/monthly/config/statisticsitems/model/dto/UpdateStatisticItemsDTO.java

@@ -17,23 +17,23 @@ import java.util.Date;
 @ApiModel(value = "更新统计条目入参")
 public class UpdateStatisticItemsDTO {
     @ApiModelProperty(value = "主键", required = true)
-    @NotNull(message = "主键不能为空") // todo 更新校验规则
+    @NotNull(message = "主键不能为空") 
     private String id;
 
     @ApiModelProperty(value = "条目编码", required = true)
-    @NotNull(message = "条目编码不能为空") // todo 更新校验规则
+    @NotNull(message = "条目编码不能为空") 
     private String itemCode;
 
     @ApiModelProperty(value = "条目来源", required = true)
-    @NotNull(message = "条目来源不能为空") // todo 更新校验规则
+    @NotNull(message = "条目来源不能为空") 
     private String itemSource;
 
     @ApiModelProperty(value = "合格的标准", required = true)
-    @NotNull(message = "合格的标准不能为空") // todo 更新校验规则
+    @NotNull(message = "合格的标准不能为空") 
     private String standardValue;
 
     @ApiModelProperty(value = "合格的判断公式", required = true)
-    @NotNull(message = "合格的判断公式不能为空") // todo 更新校验规则
+    @NotNull(message = "合格的判断公式不能为空") 
     private String qualifyFormula;
 
 }

+ 5 - 5
src/main/java/com/persagy/apm/energy/report/monthly/config/statisticsitems/service/impl/StatisticItemsServiceImpl.java

@@ -54,7 +54,7 @@ public class StatisticItemsServiceImpl extends ServiceImpl<StatisticItemsMapper,
      */
     private void setDefaultValue(StatisticItems statisticItems) {
         statisticItems.setCreator(AppContext.getContext().getAccountId());
-        // todo 其他默认的属性
+        
 
     }
 
@@ -194,22 +194,22 @@ public class StatisticItemsServiceImpl extends ServiceImpl<StatisticItemsMapper,
             }
         }
 
-        // todo 需判断使用like还是eq
+        
         if (StringUtils.isNotEmpty(pageQueryStatisticItemsDTO.getItemCode())) {
             queryWrapper.like(StatisticItems.PROP_ITEM_CODE, pageQueryStatisticItemsDTO.getItemCode());
         }
 
-        // todo 需判断使用like还是eq
+        
         if (StringUtils.isNotEmpty(pageQueryStatisticItemsDTO.getItemSource())) {
             queryWrapper.like(StatisticItems.PROP_ITEM_SOURCE, pageQueryStatisticItemsDTO.getItemSource());
         }
 
-        // todo 需判断使用like还是eq
+        
         if (StringUtils.isNotEmpty(pageQueryStatisticItemsDTO.getStandardValue())) {
             queryWrapper.like(StatisticItems.PROP_STANDARD_VALUE, pageQueryStatisticItemsDTO.getStandardValue());
         }
 
-        // todo 需判断使用like还是eq
+        
         if (StringUtils.isNotEmpty(pageQueryStatisticItemsDTO.getQualifyFormula())) {
             queryWrapper.like(StatisticItems.PROP_QUALIFY_FORMULA, pageQueryStatisticItemsDTO.getQualifyFormula());
         }

+ 3 - 3
src/main/java/com/persagy/apm/energy/report/monthly/config/type/model/dto/AddReportTypeDTO.java

@@ -15,15 +15,15 @@ import lombok.Data;
 @ApiModel(value = "创建报告类型入参")
 public class AddReportTypeDTO {
     @ApiModelProperty(value = "报告类型名称", required = true)
-    @NotNull(message = "报告类型名称不能为空") // todo 更新校验规则
+    @NotNull(message = "报告类型名称不能为空") 
     private String name;
 
     @ApiModelProperty(value = "业态 enum 0-商业;1-酒店", required = true)
-    @NotNull(message = "业态 enum 0-商业;1-酒店不能为空") // todo 更新校验规则
+    @NotNull(message = "业态 enum 0-商业;1-酒店不能为空") 
     private Integer businessType;
 
     @ApiModelProperty(value = "报告所属类型 enum 0-项目;1-大区", required = true)
-    @NotNull(message = "报告所属类型 enum 0-项目;1-大区不能为空") // todo 更新校验规则
+    @NotNull(message = "报告所属类型 enum 0-项目;1-大区不能为空") 
     private Integer belongType;
 
 }

+ 5 - 5
src/main/java/com/persagy/apm/energy/report/monthly/config/type/model/dto/QueryReportTypeDTO.java

@@ -11,13 +11,13 @@ import lombok.Data;
 @Data
 @ApiModel(value = "查询报告类型入参")
 public class QueryReportTypeDTO {
-    @ApiModelProperty(value = "报告类型名称", required = true)
+    @ApiModelProperty(value = "报告类型名称")
     private String name;
 
-    @ApiModelProperty(value = "业态 enum 0-商业;1-酒店", required = true)
-    private Integer businessType;
+    @ApiModelProperty(value = "业态 enum 0-商业;1-酒店")
+    private String businessType;
 
-    @ApiModelProperty(value = "报告所属类型 enum 0-项目;1-大区", required = true)
-    private Integer belongType;
+    @ApiModelProperty(value = "报告所属类型 enum 0-项目;1-大区")
+    private String belongType;
 
 }

+ 4 - 4
src/main/java/com/persagy/apm/energy/report/monthly/config/type/model/dto/UpdateReportTypeDTO.java

@@ -15,19 +15,19 @@ import lombok.Data;
 @ApiModel(value = "更新报告类型入参")
 public class UpdateReportTypeDTO {
     @ApiModelProperty(value = "主键", required = true)
-    @NotNull(message = "主键不能为空") // todo 更新校验规则
+    @NotNull(message = "主键不能为空") 
     private String id;
 
     @ApiModelProperty(value = "报告类型名称", required = true)
-    @NotNull(message = "报告类型名称不能为空") // todo 更新校验规则
+    @NotNull(message = "报告类型名称不能为空") 
     private String name;
 
     @ApiModelProperty(value = "业态 enum 0-商业;1-酒店", required = true)
-    @NotNull(message = "业态 enum 0-商业;1-酒店不能为空") // todo 更新校验规则
+    @NotNull(message = "业态 enum 0-商业;1-酒店不能为空") 
     private Integer businessType;
 
     @ApiModelProperty(value = "报告所属类型 enum 0-项目;1-大区", required = true)
-    @NotNull(message = "报告所属类型 enum 0-项目;1-大区不能为空") // todo 更新校验规则
+    @NotNull(message = "报告所属类型 enum 0-项目;1-大区不能为空") 
     private Integer belongType;
 
 }

+ 7 - 0
src/main/java/com/persagy/apm/energy/report/monthly/config/type/model/vo/ResponseReportTypeListItemVO.java

@@ -1,11 +1,14 @@
 package com.persagy.apm.energy.report.monthly.config.type.model.vo;
 
+import com.fasterxml.jackson.annotation.JsonIgnore;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
 import com.fasterxml.jackson.annotation.JsonInclude;
 
+import java.util.List;
+
 /**
  * @author lixing
  * @version V1.0 2021-05-19 10:39:18
@@ -25,4 +28,8 @@ public class ResponseReportTypeListItemVO {
 
     @ApiModelProperty(value = "报告所属类型", notes = "com.persagy.apm.energy.report.monthly.config.type.constant.enums.BelongTypeEnum")
     private String belongType;
+
+    @ApiModelProperty(value = "可用报告所属id", hidden = true)
+    @JsonIgnore
+    private List<String> availableBelongIds;
 }

+ 47 - 23
src/main/java/com/persagy/apm/energy/report/monthly/config/type/service/impl/ReportTypeServiceImpl.java

@@ -30,7 +30,9 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.util.CollectionUtils;
 
+import java.util.ArrayList;
 import java.util.List;
+import java.util.stream.Collectors;
 
 /**
  * 报告类型(ReportType) service层
@@ -71,7 +73,7 @@ public class ReportTypeServiceImpl extends ServiceImpl<ReportTypeMapper, ReportT
      */
     private void setDefaultValue(ReportType reportType) {
         reportType.setCreator(PoemsContext.getContext().getUserId());
-        // todo 其他默认的属性
+        
 
     }
 
@@ -159,8 +161,6 @@ public class ReportTypeServiceImpl extends ServiceImpl<ReportTypeMapper, ReportT
         queryWrapper.orderBy(true, false, ReportType.PROP_CREATIONTIME);
 
         if (queryReportTypeDTO != null) {
-
-            // todo 需判断使用like还是eq
             if (StringUtils.isNotEmpty(queryReportTypeDTO.getName())) {
                 queryWrapper.like(ReportType.PROP_NAME, queryReportTypeDTO.getName());
             }
@@ -172,7 +172,6 @@ public class ReportTypeServiceImpl extends ServiceImpl<ReportTypeMapper, ReportT
             if (queryReportTypeDTO.getBelongType() != null) {
                 queryWrapper.eq(ReportType.PROP_BELONG_TYPE, queryReportTypeDTO.getBelongType());
             }
-
         }
 
         return list(queryWrapper);
@@ -204,7 +203,7 @@ public class ReportTypeServiceImpl extends ServiceImpl<ReportTypeMapper, ReportT
             }
         }
 
-        // todo 需判断使用like还是eq
+        
         if (StringUtils.isNotEmpty(pageQueryReportTypeDTO.getName())) {
             queryWrapper.like(ReportType.PROP_NAME, pageQueryReportTypeDTO.getName());
         }
@@ -223,39 +222,64 @@ public class ReportTypeServiceImpl extends ServiceImpl<ReportTypeMapper, ReportT
     @Override
     public IPage<ResponseReportTypeListItemVO> queryAvailableReportTypes() {
         IPage<ResponseReportTypeListItemVO> result = new Page<>();
+        List<ResponseReportTypeListItemVO> listItemVOList = Lists.newArrayList();
 
         List<EnumVO> buildingTypes = reportTypeEnumService.queryBuildingTypeEnum();
-        // 当前用户可用的业态
-        List<String> availableBuildingTypes = Lists.newArrayList();
-        // 当前用户可用的所属类型
-        List<String> availableBelongTypes = Lists.newArrayList();
         for (EnumVO buildingType : buildingTypes) {
             List<SimpleProjectVO> availableProjects = saasWebService.getAvailableProjects(buildingType.getKey());
             if (!CollectionUtils.isEmpty(availableProjects)) {
-                availableBuildingTypes.add(buildingType.getKey());
-                availableBelongTypes.add(BelongTypeEnum.PROJECT.getType());
+                List<String> availableBelongIds = availableProjects.stream().map(
+                        SimpleProjectVO::getProjectId).collect(Collectors.toList());
+                QueryReportTypeDTO queryReportTypeDTO = new QueryReportTypeDTO();
+                queryReportTypeDTO.setBelongType(BelongTypeEnum.PROJECT.getType());
+                queryReportTypeDTO.setBusinessType(buildingType.getKey());
+                List<ReportType> reportTypes = queryReportTypeList(queryReportTypeDTO);
+                List<ResponseReportTypeListItemVO> voList = packageReportTypeListItemVOList(
+                        reportTypes, availableBelongIds);
+                listItemVOList.addAll(voList);
             }
             List<PartitionVO> availableAreas = saasWebService.getAvailableAreas(buildingType.getKey());
             if (!CollectionUtils.isEmpty(availableAreas)) {
-                availableBelongTypes.add(BelongTypeEnum.AREA.getType());
+                List<String> availableBelongIds = availableAreas.stream().map(
+                        PartitionVO::getAreaId).collect(Collectors.toList());
+                QueryReportTypeDTO queryReportTypeDTO = new QueryReportTypeDTO();
+                queryReportTypeDTO.setBelongType(BelongTypeEnum.AREA.getType());
+                queryReportTypeDTO.setBusinessType(buildingType.getKey());
+                List<ReportType> reportTypes = queryReportTypeList(queryReportTypeDTO);
+                List<ResponseReportTypeListItemVO> voList = packageReportTypeListItemVOList(
+                        reportTypes, availableBelongIds);
+                listItemVOList.addAll(voList);
             }
         }
-        LambdaQueryWrapper<ReportType> queryWrapper = new LambdaQueryWrapper<>();
-        if (CollectionUtils.isEmpty(availableBuildingTypes) || CollectionUtils.isEmpty(availableBelongTypes)) {
-            result.setTotal(0);
-            result.setRecords(Lists.newArrayList());
-            return result;
-        }
-        queryWrapper.eq(ReportType::getValid, ValidEnum.TRUE.getType());
-        queryWrapper.in(ReportType::getBelongType, availableBelongTypes);
-        queryWrapper.in(ReportType::getBuildingType, availableBuildingTypes);
 
-        List<ReportType> availableReportTypeList = list(queryWrapper);
-        List<ResponseReportTypeListItemVO> listItemVOList = ConvertReportTypeTool.INSTANCE.convert2List(availableReportTypeList);
         result.setRecords(listItemVOList);
         result.setTotal(listItemVOList.size());
 
         return result;
     }
 
+    /**
+     * 包装reportTypeListItemVO列表
+     *
+     * @param reportTypes 报告类型对象列表
+     * @param availableBelongIds 报告类型下可用的报告所属
+     * @return 包装后的reportTypeListItemVO列表
+     * @author lixing
+     * @version V1.0 2021/6/23 5:39 下午
+     */
+    private List<ResponseReportTypeListItemVO> packageReportTypeListItemVOList(
+            List<ReportType> reportTypes, List<String> availableBelongIds) {
+        if (CollectionUtils.isEmpty(reportTypes)) {
+            return Lists.newArrayList();
+        }
+        List<ResponseReportTypeListItemVO> results = new ArrayList<>();
+        for (ReportType reportType : reportTypes) {
+            ResponseReportTypeListItemVO responseReportTypeListItemVO = ConvertReportTypeTool.INSTANCE.
+                    convert2ResponseListItemDTO(reportType);
+            responseReportTypeListItemVO.setAvailableBelongIds(availableBelongIds);
+            results.add(responseReportTypeListItemVO);
+        }
+        return results;
+    }
+
 }

+ 13 - 13
src/main/java/com/persagy/apm/energy/report/monthly/detail/business/service/impl/ReportBusinessDetailServiceImpl.java

@@ -82,7 +82,7 @@ public class ReportBusinessDetailServiceImpl extends ServiceImpl<ReportBusinessD
      */
     private void setDefaultValue(ReportBusinessDetail reportBusinessDetail) {
         reportBusinessDetail.setCreator(PoemsContext.getContext().getUserId());
-        // todo 其他默认的属性
+        
 
     }
 
@@ -181,7 +181,7 @@ public class ReportBusinessDetailServiceImpl extends ServiceImpl<ReportBusinessD
                 queryWrapper.eq(ReportBusinessDetail.PROP_OPEN_POWER, queryReportBusinessDetailDTO.getOpenPower());
             }
 
-            // todo 需判断使用like还是eq
+            
             if (StringUtils.isNotEmpty(queryReportBusinessDetailDTO.getOpenPowerExplain())) {
                 queryWrapper.like(ReportBusinessDetail.PROP_OPEN_POWER_EXPLAIN, queryReportBusinessDetailDTO.getOpenPowerExplain());
             }
@@ -190,7 +190,7 @@ public class ReportBusinessDetailServiceImpl extends ServiceImpl<ReportBusinessD
                 queryWrapper.eq(ReportBusinessDetail.PROP_COMPARE_POWER, queryReportBusinessDetailDTO.getComparePower());
             }
 
-            // todo 需判断使用like还是eq
+            
             if (StringUtils.isNotEmpty(queryReportBusinessDetailDTO.getComparePowerExplain())) {
                 queryWrapper.like(ReportBusinessDetail.PROP_COMPARE_POWER_EXPLAIN, queryReportBusinessDetailDTO.getComparePowerExplain());
             }
@@ -199,7 +199,7 @@ public class ReportBusinessDetailServiceImpl extends ServiceImpl<ReportBusinessD
                 queryWrapper.eq(ReportBusinessDetail.PROP_OPEN_COST, queryReportBusinessDetailDTO.getOpenCost());
             }
 
-            // todo 需判断使用like还是eq
+            
             if (StringUtils.isNotEmpty(queryReportBusinessDetailDTO.getOpenCostExplain())) {
                 queryWrapper.like(ReportBusinessDetail.PROP_OPEN_COST_EXPLAIN, queryReportBusinessDetailDTO.getOpenCostExplain());
             }
@@ -208,7 +208,7 @@ public class ReportBusinessDetailServiceImpl extends ServiceImpl<ReportBusinessD
                 queryWrapper.eq(ReportBusinessDetail.PROP_COMPARE_COST, queryReportBusinessDetailDTO.getCompareCost());
             }
 
-            // todo 需判断使用like还是eq
+            
             if (StringUtils.isNotEmpty(queryReportBusinessDetailDTO.getCompareCostExplain())) {
                 queryWrapper.like(ReportBusinessDetail.PROP_COMPARE_COST_EXPLAIN, queryReportBusinessDetailDTO.getCompareCostExplain());
             }
@@ -217,7 +217,7 @@ public class ReportBusinessDetailServiceImpl extends ServiceImpl<ReportBusinessD
                 queryWrapper.eq(ReportBusinessDetail.PROP_JOB, queryReportBusinessDetailDTO.getJob());
             }
 
-            // todo 需判断使用like还是eq
+            
             if (StringUtils.isNotEmpty(queryReportBusinessDetailDTO.getRemark())) {
                 queryWrapper.like(ReportBusinessDetail.PROP_REMARK, queryReportBusinessDetailDTO.getRemark());
             }
@@ -226,7 +226,7 @@ public class ReportBusinessDetailServiceImpl extends ServiceImpl<ReportBusinessD
                 queryWrapper.eq(ReportBusinessDetail.PROP_PLATFORM, queryReportBusinessDetailDTO.getPlatform());
             }
 
-            // todo 需判断使用like还是eq
+            
             if (StringUtils.isNotEmpty(queryReportBusinessDetailDTO.getItemExplain())) {
                 queryWrapper.like(ReportBusinessDetail.PROP_ITEM_EXPLAIN, queryReportBusinessDetailDTO.getItemExplain());
             }
@@ -270,7 +270,7 @@ public class ReportBusinessDetailServiceImpl extends ServiceImpl<ReportBusinessD
             queryWrapper.eq(ReportBusinessDetail.PROP_OPEN_POWER, pageQueryReportBusinessDetailDTO.getOpenPower());
         }
 
-        // todo 需判断使用like还是eq
+        
         if (StringUtils.isNotEmpty(pageQueryReportBusinessDetailDTO.getOpenPowerExplain())) {
             queryWrapper.like(ReportBusinessDetail.PROP_OPEN_POWER_EXPLAIN, pageQueryReportBusinessDetailDTO.getOpenPowerExplain());
         }
@@ -279,7 +279,7 @@ public class ReportBusinessDetailServiceImpl extends ServiceImpl<ReportBusinessD
             queryWrapper.eq(ReportBusinessDetail.PROP_COMPARE_POWER, pageQueryReportBusinessDetailDTO.getComparePower());
         }
 
-        // todo 需判断使用like还是eq
+        
         if (StringUtils.isNotEmpty(pageQueryReportBusinessDetailDTO.getComparePowerExplain())) {
             queryWrapper.like(ReportBusinessDetail.PROP_COMPARE_POWER_EXPLAIN, pageQueryReportBusinessDetailDTO.getComparePowerExplain());
         }
@@ -288,7 +288,7 @@ public class ReportBusinessDetailServiceImpl extends ServiceImpl<ReportBusinessD
             queryWrapper.eq(ReportBusinessDetail.PROP_OPEN_COST, pageQueryReportBusinessDetailDTO.getOpenCost());
         }
 
-        // todo 需判断使用like还是eq
+        
         if (StringUtils.isNotEmpty(pageQueryReportBusinessDetailDTO.getOpenCostExplain())) {
             queryWrapper.like(ReportBusinessDetail.PROP_OPEN_COST_EXPLAIN, pageQueryReportBusinessDetailDTO.getOpenCostExplain());
         }
@@ -297,7 +297,7 @@ public class ReportBusinessDetailServiceImpl extends ServiceImpl<ReportBusinessD
             queryWrapper.eq(ReportBusinessDetail.PROP_COMPARE_COST, pageQueryReportBusinessDetailDTO.getCompareCost());
         }
 
-        // todo 需判断使用like还是eq
+        
         if (StringUtils.isNotEmpty(pageQueryReportBusinessDetailDTO.getCompareCostExplain())) {
             queryWrapper.like(ReportBusinessDetail.PROP_COMPARE_COST_EXPLAIN, pageQueryReportBusinessDetailDTO.getCompareCostExplain());
         }
@@ -306,7 +306,7 @@ public class ReportBusinessDetailServiceImpl extends ServiceImpl<ReportBusinessD
             queryWrapper.eq(ReportBusinessDetail.PROP_JOB, pageQueryReportBusinessDetailDTO.getJob());
         }
 
-        // todo 需判断使用like还是eq
+        
         if (StringUtils.isNotEmpty(pageQueryReportBusinessDetailDTO.getRemark())) {
             queryWrapper.like(ReportBusinessDetail.PROP_REMARK, pageQueryReportBusinessDetailDTO.getRemark());
         }
@@ -315,7 +315,7 @@ public class ReportBusinessDetailServiceImpl extends ServiceImpl<ReportBusinessD
             queryWrapper.eq(ReportBusinessDetail.PROP_PLATFORM, pageQueryReportBusinessDetailDTO.getPlatform());
         }
 
-        // todo 需判断使用like还是eq
+        
         if (StringUtils.isNotEmpty(pageQueryReportBusinessDetailDTO.getItemExplain())) {
             queryWrapper.like(ReportBusinessDetail.PROP_ITEM_EXPLAIN, pageQueryReportBusinessDetailDTO.getItemExplain());
         }

+ 6 - 0
src/main/java/com/persagy/apm/energy/report/monthly/detail/common/model/vo/CostItemVO.java

@@ -48,10 +48,16 @@ public class CostItemVO {
     @ApiModelProperty("本年单方能源费")
     public Double yearPerCount;
 
+    @ApiModelProperty("本月单方能源费")
+    public Double currentMonthPerSqm;
+
     @ApiModelProperty("去年单方能源费")
     public Double lastYearPerCount;
 
 
+    @ApiModelProperty("去年同期单月费用")
+    public Double sameTime;
+
     @ApiModelProperty("去年同期单月同比增量")
     public Double sameTimeGrowth;
 

+ 4 - 4
src/main/java/com/persagy/apm/energy/report/monthly/detail/common/model/vo/HotelRankVO.java

@@ -13,8 +13,8 @@ import lombok.Data;
 @ApiModel(value = "酒店排名信息")
 @JsonInclude(JsonInclude.Include.NON_NULL)
 public class HotelRankVO {
-    @ApiModelProperty(value = "同气候区项目数")
-    private Integer projectNumWithinClimateZone;
-    @ApiModelProperty(value = "同气候区排名")
-    private Integer rankWithinClimateZone;
+    @ApiModelProperty(value = "项目数")
+    private Integer projectTotalCount;
+    @ApiModelProperty(value = "排名")
+    private Integer rank;
 }

+ 49 - 12
src/main/java/com/persagy/apm/energy/report/monthly/detail/common/service/impl/ReportCostInfoServiceImpl.java

@@ -126,6 +126,8 @@ public abstract class ReportCostInfoServiceImpl implements IReportCostInfoServic
         }
         String functionId = function.getId();
         String functionType = function.getFunctionType();
+        
+        double zero = 0d;
         // 单位
         double unit = 1d;
         // 费用展示为万元
@@ -137,6 +139,10 @@ public abstract class ReportCostInfoServiceImpl implements IReportCostInfoServic
         Double currentMonth = functionValueService.getFunctionValue(functionId, reportMonth, projectId);
         if (currentMonth != null) {
             costItemVO.setCurrentMonth(DataUtils.doubleDivide(currentMonth, unit));
+            if (costBuildingArea != null && !costBuildingArea.equals(zero) ) {
+                Double currentMonthPerSqm = DataUtils.doubleDivide(currentMonth, costBuildingArea);
+                costItemVO.setCurrentMonthPerSqm(DataUtils.doubleDivide(currentMonthPerSqm, unit));
+            }
         }
 
         Double lastMonth = functionValueService.getFunctionValue(
@@ -157,7 +163,7 @@ public abstract class ReportCostInfoServiceImpl implements IReportCostInfoServic
             tmp.setLastYearCount(functionValueService.getFunctionValue(functionId, lastYearMonth, projectId));
             lastYearItems.add(tmp);
         }
-        Double zero = 0d;
+
         CostItemVO lastYearSumItem = getCostSum(lastYearItems);
         if (lastYearSumItem != null) {
             lastYearCount = lastYearSumItem.getLastYearCount();
@@ -165,7 +171,8 @@ public abstract class ReportCostInfoServiceImpl implements IReportCostInfoServic
                 costItemVO.setLastYearCount(DataUtils.doubleDivide(lastYearCount, unit));
             }
             if (costBuildingArea != null && !costBuildingArea.equals(zero) && lastYearCount != null) {
-                costItemVO.setLastYearPerCount(DataUtils.doubleDivide(lastYearCount, costBuildingArea));
+                Double lastYearPerCount = DataUtils.doubleDivide(lastYearCount, costBuildingArea);
+                costItemVO.setLastYearPerCount(DataUtils.doubleDivide(lastYearPerCount, unit));
             }
         }
 
@@ -188,7 +195,8 @@ public abstract class ReportCostInfoServiceImpl implements IReportCostInfoServic
                 costItemVO.setYearCount(DataUtils.doubleDivide(yearCount, unit));
             }
             if (costBuildingArea != null && !costBuildingArea.equals(zero) && yearCount != null) {
-                costItemVO.setYearPerCount(DataUtils.doubleDivide(yearCount, costBuildingArea));
+                Double yearPerCount = DataUtils.doubleDivide(yearCount, costBuildingArea);
+                costItemVO.setYearPerCount(DataUtils.doubleDivide(yearPerCount, unit));
             }
         }
 
@@ -214,13 +222,16 @@ public abstract class ReportCostInfoServiceImpl implements IReportCostInfoServic
         // 去年同期月
         Double lastYearSameTimeValue = functionValueService.getFunctionValue(functionId, lastYearSameTime, projectId);
 
-        if (lastYearSameTimeValue != null && currentMonth != null) {
-            double sameTimeGrowth = DataUtils.doubleSubtract(currentMonth, lastYearSameTimeValue);
-            // 月同比增量
-            costItemVO.setSameTimeGrowth(sameTimeGrowth);
-            if (!lastYearSameTimeValue.equals(zero)) {
-                // 月同比增幅
-                costItemVO.setSameTimeRange(DataUtils.doubleDivide(sameTimeGrowth, lastYearSameTimeValue));
+        if (lastYearSameTimeValue != null) {
+            costItemVO.setSameTime(DataUtils.doubleDivide(lastYearSameTimeValue, unit));
+            if (currentMonth != null) {
+                double sameTimeGrowth = DataUtils.doubleSubtract(currentMonth, lastYearSameTimeValue);
+                // 月同比增量
+                costItemVO.setSameTimeGrowth(DataUtils.doubleDivide(sameTimeGrowth, unit));
+                if (!lastYearSameTimeValue.equals(zero)) {
+                    // 月同比增幅
+                    costItemVO.setSameTimeRange(DataUtils.doubleDivide(sameTimeGrowth, lastYearSameTimeValue));
+                }
             }
         }
 
@@ -230,9 +241,35 @@ public abstract class ReportCostInfoServiceImpl implements IReportCostInfoServic
 
     @Override
     public CostItemVO getCostSum(List<CostItemVO> costItems) {
-        return DataUtils.sumDoubleParams(costItems, CostItemVO.class);
-    }
+        CostItemVO result = DataUtils.sumDoubleParams(costItems, CostItemVO.class);
+        if (result == null) {
+            return null;
+        }
+        // 环比增幅
+        Double linkCount = result.getLinkCount();
+        Double lastMonth = result.getLastMonth();
+
+        if (DataUtils.isNotNull(linkCount, lastMonth)) {
+            result.setLinkRange(DataUtils.doubleDivide(linkCount, lastMonth));
+        }
 
+        // 同期累计同比增幅
+        Double sameCount = result.getSameCount();
+        Double lastYearCount = result.getLastYearCount();
+
+        if (DataUtils.isNotNull(sameCount, lastYearCount)) {
+            result.setSameRange(DataUtils.doubleDivide(sameCount, lastYearCount));
+        }
+
+        // 同期单月同比增幅
+        Double sameTimeGrowth = result.getSameTimeGrowth();
+        Double sameTime = result.getSameTime();
+        if (DataUtils.isNotNull(sameTimeGrowth, sameTime)) {
+            result.setSameRange(DataUtils.doubleDivide(sameTimeGrowth, sameTime));
+        }
+
+        return result;
+    }
 
     @Override
     public List<GroupInfo<CostItemVO>> getCostGroupInfos(List<String> groupIdList, Date reportMonth, List<String> projectIds) {

+ 28 - 1
src/main/java/com/persagy/apm/energy/report/monthly/detail/common/service/impl/ReportPowerInfoServiceImpl.java

@@ -257,7 +257,34 @@ public abstract class ReportPowerInfoServiceImpl implements IReportPowerInfoServ
 
     @Override
     public PowerItemVO getPowerSum(List<PowerItemVO> powerItems) {
-        return DataUtils.sumDoubleParams(powerItems, PowerItemVO.class);
+        PowerItemVO result = DataUtils.sumDoubleParams(powerItems, PowerItemVO.class);
+        if (result == null) {
+            return null;
+        }
+        // 环比增幅
+        Double linkCount = result.getLinkCount();
+        Double lastMonth = result.getLastMonth();
+
+        if (DataUtils.isNotNull(linkCount, lastMonth)) {
+            result.setLinkRange(DataUtils.doubleDivide(linkCount, lastMonth));
+        }
+
+        // 同期累计同比增幅
+        Double sameCount = result.getSameCount();
+        Double lastYearCount = result.getLastYearCount();
+
+        if (DataUtils.isNotNull(sameCount, lastYearCount)) {
+            result.setSameRange(DataUtils.doubleDivide(sameCount, lastYearCount));
+        }
+
+        // 同期单月同比增幅
+        Double sameTimeGrowth = result.getSameTimeGrowth();
+        Double sameTime = result.getLastYearSameTime();
+        if (DataUtils.isNotNull(sameTimeGrowth, sameTime)) {
+            result.setSameRange(DataUtils.doubleDivide(sameTimeGrowth, sameTime));
+        }
+
+        return result;
     }
 
     @Override

+ 9 - 9
src/main/java/com/persagy/apm/energy/report/monthly/detail/hotel/area/service/impl/ReportHotelAreaDetailServiceImpl.java

@@ -63,7 +63,7 @@ public class ReportHotelAreaDetailServiceImpl extends ServiceImpl<ReportHotelAre
      */
     private void setDefaultValue(ReportHotelAreaDetail reportHotelAreaDetail) {
         reportHotelAreaDetail.setCreator(AppContext.getContext().getAccountId());
-        // todo 其他默认的属性
+        
 
     }
 
@@ -158,7 +158,7 @@ public class ReportHotelAreaDetailServiceImpl extends ServiceImpl<ReportHotelAre
                 queryWrapper.eq(ReportHotelAreaDetail.PROP_PLATFORM_RUNTIME_INFO, queryReportHotelAreaDetailDTO.getPlatformRuntimeInfo());
             }
 
-            // todo 需判断使用like还是eq
+            
             if (StringUtils.isNotEmpty(queryReportHotelAreaDetailDTO.getPlatformRuntimeDescription())) {
                 queryWrapper.like(ReportHotelAreaDetail.PROP_PLATFORM_RUNTIME_DESCRIPTION, queryReportHotelAreaDetailDTO.getPlatformRuntimeDescription());
             }
@@ -167,7 +167,7 @@ public class ReportHotelAreaDetailServiceImpl extends ServiceImpl<ReportHotelAre
                 queryWrapper.eq(ReportHotelAreaDetail.PROP_COST_INFO, queryReportHotelAreaDetailDTO.getCostInfo());
             }
 
-            // todo 需判断使用like还是eq
+            
             if (StringUtils.isNotEmpty(queryReportHotelAreaDetailDTO.getCostDescription())) {
                 queryWrapper.like(ReportHotelAreaDetail.PROP_COST_DESCRIPTION, queryReportHotelAreaDetailDTO.getCostDescription());
             }
@@ -176,7 +176,7 @@ public class ReportHotelAreaDetailServiceImpl extends ServiceImpl<ReportHotelAre
                 queryWrapper.eq(ReportHotelAreaDetail.PROP_POWER_USAGE_OUTLINE, queryReportHotelAreaDetailDTO.getPowerUsageOutline());
             }
 
-            // todo 需判断使用like还是eq
+            
             if (StringUtils.isNotEmpty(queryReportHotelAreaDetailDTO.getPowerUsageDescription())) {
                 queryWrapper.like(ReportHotelAreaDetail.PROP_POWER_USAGE_DESCRIPTION, queryReportHotelAreaDetailDTO.getPowerUsageDescription());
             }
@@ -185,7 +185,7 @@ public class ReportHotelAreaDetailServiceImpl extends ServiceImpl<ReportHotelAre
                 queryWrapper.eq(ReportHotelAreaDetail.PROP_ENERGY_WORK_ORDER_INFO, queryReportHotelAreaDetailDTO.getEnergyWorkOrderInfo());
             }
 
-            // todo 需判断使用like还是eq
+            
             if (StringUtils.isNotEmpty(queryReportHotelAreaDetailDTO.getEnergyWorkOrderDescription())) {
                 queryWrapper.like(ReportHotelAreaDetail.PROP_ENERGY_WORK_ORDER_DESCRIPTION, queryReportHotelAreaDetailDTO.getEnergyWorkOrderDescription());
             }
@@ -233,7 +233,7 @@ public class ReportHotelAreaDetailServiceImpl extends ServiceImpl<ReportHotelAre
             queryWrapper.eq(ReportHotelAreaDetail.PROP_PLATFORM_RUNTIME_INFO, pageQueryReportHotelAreaDetailDTO.getPlatformRuntimeInfo());
         }
 
-        // todo 需判断使用like还是eq
+        
         if (StringUtils.isNotEmpty(pageQueryReportHotelAreaDetailDTO.getPlatformRuntimeDescription())) {
             queryWrapper.like(ReportHotelAreaDetail.PROP_PLATFORM_RUNTIME_DESCRIPTION, pageQueryReportHotelAreaDetailDTO.getPlatformRuntimeDescription());
         }
@@ -242,7 +242,7 @@ public class ReportHotelAreaDetailServiceImpl extends ServiceImpl<ReportHotelAre
             queryWrapper.eq(ReportHotelAreaDetail.PROP_COST_INFO, pageQueryReportHotelAreaDetailDTO.getCostInfo());
         }
 
-        // todo 需判断使用like还是eq
+        
         if (StringUtils.isNotEmpty(pageQueryReportHotelAreaDetailDTO.getCostDescription())) {
             queryWrapper.like(ReportHotelAreaDetail.PROP_COST_DESCRIPTION, pageQueryReportHotelAreaDetailDTO.getCostDescription());
         }
@@ -251,7 +251,7 @@ public class ReportHotelAreaDetailServiceImpl extends ServiceImpl<ReportHotelAre
             queryWrapper.eq(ReportHotelAreaDetail.PROP_POWER_USAGE_OUTLINE, pageQueryReportHotelAreaDetailDTO.getPowerUsageOutline());
         }
 
-        // todo 需判断使用like还是eq
+        
         if (StringUtils.isNotEmpty(pageQueryReportHotelAreaDetailDTO.getPowerUsageDescription())) {
             queryWrapper.like(ReportHotelAreaDetail.PROP_POWER_USAGE_DESCRIPTION, pageQueryReportHotelAreaDetailDTO.getPowerUsageDescription());
         }
@@ -260,7 +260,7 @@ public class ReportHotelAreaDetailServiceImpl extends ServiceImpl<ReportHotelAre
             queryWrapper.eq(ReportHotelAreaDetail.PROP_ENERGY_WORK_ORDER_INFO, pageQueryReportHotelAreaDetailDTO.getEnergyWorkOrderInfo());
         }
 
-        // todo 需判断使用like还是eq
+        
         if (StringUtils.isNotEmpty(pageQueryReportHotelAreaDetailDTO.getEnergyWorkOrderDescription())) {
             queryWrapper.like(ReportHotelAreaDetail.PROP_ENERGY_WORK_ORDER_DESCRIPTION, pageQueryReportHotelAreaDetailDTO.getEnergyWorkOrderDescription());
         }

+ 1 - 1
src/main/java/com/persagy/apm/energy/report/monthly/detail/hotel/project/service/impl/HotelProjectReportCostServiceImpl.java

@@ -114,7 +114,7 @@ public class HotelProjectReportCostServiceImpl extends ReportCostInfoServiceImpl
             CostItemVO costSum = getCostSum(costFunctionsInfo);
             hotelProjectCostInfo.setTotalCost(costSum.getCurrentMonth());
             hotelProjectCostInfo.setCostSameTimeRange(costSum.getSameTimeRange());
-            hotelProjectCostInfo.setCostPerSquareMetre(costSum.getYearPerCount());
+            hotelProjectCostInfo.setCostPerSquareMetre(costSum.getCurrentMonthPerSqm());
         }
 
         return hotelProjectCostInfo;

+ 2 - 2
src/main/java/com/persagy/apm/energy/report/monthly/detail/hotel/project/service/impl/HotelProjectReportPublicPowerInfoServiceImpl.java

@@ -70,7 +70,7 @@ public class HotelProjectReportPublicPowerInfoServiceImpl extends ReportPowerInf
                     saasWebService.getProjectClimateZone(projectId), BuildingTypeEnum.HOTEL.getType());
             if (!CollectionUtils.isEmpty(projectsInSameClimate)) {
                 // 同气候区项目数量
-                hotelProjectPublicPowerConsumption.setProjectNumWithinClimateZone(projectsInSameClimate.size());
+                hotelProjectPublicPowerConsumption.setProjectTotalCount(projectsInSameClimate.size());
                 List<String> projectIdsInSameClimate = projectsInSameClimate.stream().map(
                         PoemsProjectVO::getProjectId).collect(Collectors.toList());
                 // 获取同气候区项目本年累计单方用电量
@@ -81,7 +81,7 @@ public class HotelProjectReportPublicPowerInfoServiceImpl extends ReportPowerInf
                     consumptionPerSqmCurrentYear = consumptionPerSqmCurrentYear.stream().
                             sorted(Comparator.reverseOrder()).collect(Collectors.toList());
 
-                    hotelProjectPublicPowerConsumption.setRankWithinClimateZone(
+                    hotelProjectPublicPowerConsumption.setRank(
                             consumptionPerSqmCurrentYear.indexOf(summary.getYearPerCount()) + 1);
                 }
             }

+ 15 - 15
src/main/java/com/persagy/apm/energy/report/monthly/detail/hotel/project/service/impl/ReportHotelProjectDetailServiceImpl.java

@@ -63,7 +63,7 @@ public class ReportHotelProjectDetailServiceImpl extends ServiceImpl<ReportHotel
      */
     private void setDefaultValue(ReportHotelProjectDetail reportHotelProjectDetail) {
         reportHotelProjectDetail.setCreator(AppContext.getContext().getAccountId());
-        // todo 其他默认的属性
+        
 
     }
 
@@ -159,7 +159,7 @@ public class ReportHotelProjectDetailServiceImpl extends ServiceImpl<ReportHotel
                 queryWrapper.eq(ReportHotelProjectDetail.PROP_COST_INFO, queryReportHotelProjectDetailDTO.getCostInfo());
             }
 
-            // todo 需判断使用like还是eq
+            
             if (StringUtils.isNotEmpty(queryReportHotelProjectDetailDTO.getCostDescription())) {
                 queryWrapper.like(ReportHotelProjectDetail.PROP_COST_DESCRIPTION, queryReportHotelProjectDetailDTO.getCostDescription());
             }
@@ -172,7 +172,7 @@ public class ReportHotelProjectDetailServiceImpl extends ServiceImpl<ReportHotel
                 queryWrapper.eq(ReportHotelProjectDetail.PROP_PUBLIC_AREA_POWER_USAGE, queryReportHotelProjectDetailDTO.getPublicAreaPowerUsage());
             }
 
-            // todo 需判断使用like还是eq
+            
             if (StringUtils.isNotEmpty(queryReportHotelProjectDetailDTO.getPowerUsageDescription())) {
                 queryWrapper.like(ReportHotelProjectDetail.PROP_POWER_USAGE_DESCRIPTION, queryReportHotelProjectDetailDTO.getPowerUsageDescription());
             }
@@ -181,7 +181,7 @@ public class ReportHotelProjectDetailServiceImpl extends ServiceImpl<ReportHotel
                 queryWrapper.eq(ReportHotelProjectDetail.PROP_AIR_CONDITIONER_EFFICIENCY, queryReportHotelProjectDetailDTO.getAirConditionerEfficiency());
             }
 
-            // todo 需判断使用like还是eq
+            
             if (StringUtils.isNotEmpty(queryReportHotelProjectDetailDTO.getAirConditionerEfficiencyExplain())) {
                 queryWrapper.like(ReportHotelProjectDetail.PROP_AIR_CONDITIONER_EFFICIENCY_EXPLAIN, queryReportHotelProjectDetailDTO.getAirConditionerEfficiencyExplain());
             }
@@ -190,7 +190,7 @@ public class ReportHotelProjectDetailServiceImpl extends ServiceImpl<ReportHotel
                 queryWrapper.eq(ReportHotelProjectDetail.PROP_ENV_INFO, queryReportHotelProjectDetailDTO.getEnvInfo());
             }
 
-            // todo 需判断使用like还是eq
+            
             if (StringUtils.isNotEmpty(queryReportHotelProjectDetailDTO.getEnvDescription())) {
                 queryWrapper.like(ReportHotelProjectDetail.PROP_ENV_DESCRIPTION, queryReportHotelProjectDetailDTO.getEnvDescription());
             }
@@ -199,7 +199,7 @@ public class ReportHotelProjectDetailServiceImpl extends ServiceImpl<ReportHotel
                 queryWrapper.eq(ReportHotelProjectDetail.PROP_ENERGY_WORK_ORDER_INFO, queryReportHotelProjectDetailDTO.getEnergyWorkOrderInfo());
             }
 
-            // todo 需判断使用like还是eq
+            
             if (StringUtils.isNotEmpty(queryReportHotelProjectDetailDTO.getEnergyWorkOrderDescription())) {
                 queryWrapper.like(ReportHotelProjectDetail.PROP_ENERGY_WORK_ORDER_DESCRIPTION, queryReportHotelProjectDetailDTO.getEnergyWorkOrderDescription());
             }
@@ -208,7 +208,7 @@ public class ReportHotelProjectDetailServiceImpl extends ServiceImpl<ReportHotel
                 queryWrapper.eq(ReportHotelProjectDetail.PROP_PLATFORM_RUNTIME_INFO, queryReportHotelProjectDetailDTO.getPlatformRuntimeInfo());
             }
 
-            // todo 需判断使用like还是eq
+            
             if (StringUtils.isNotEmpty(queryReportHotelProjectDetailDTO.getPlatformRuntimeDescription())) {
                 queryWrapper.like(ReportHotelProjectDetail.PROP_PLATFORM_RUNTIME_DESCRIPTION, queryReportHotelProjectDetailDTO.getPlatformRuntimeDescription());
             }
@@ -217,7 +217,7 @@ public class ReportHotelProjectDetailServiceImpl extends ServiceImpl<ReportHotel
                 queryWrapper.eq(ReportHotelProjectDetail.PROP_ALARM_DEAL_INFO, queryReportHotelProjectDetailDTO.getAlarmDealInfo());
             }
 
-            // todo 需判断使用like还是eq
+            
             if (StringUtils.isNotEmpty(queryReportHotelProjectDetailDTO.getAlarmDealDescription())) {
                 queryWrapper.like(ReportHotelProjectDetail.PROP_ALARM_DEAL_DESCRIPTION, queryReportHotelProjectDetailDTO.getAlarmDealDescription());
             }
@@ -257,7 +257,7 @@ public class ReportHotelProjectDetailServiceImpl extends ServiceImpl<ReportHotel
             queryWrapper.eq(ReportHotelProjectDetail.PROP_COST_INFO, pageQueryReportHotelProjectDetailDTO.getCostInfo());
         }
 
-        // todo 需判断使用like还是eq
+        
         if (StringUtils.isNotEmpty(pageQueryReportHotelProjectDetailDTO.getCostDescription())) {
             queryWrapper.like(ReportHotelProjectDetail.PROP_COST_DESCRIPTION, pageQueryReportHotelProjectDetailDTO.getCostDescription());
         }
@@ -270,7 +270,7 @@ public class ReportHotelProjectDetailServiceImpl extends ServiceImpl<ReportHotel
             queryWrapper.eq(ReportHotelProjectDetail.PROP_PUBLIC_AREA_POWER_USAGE, pageQueryReportHotelProjectDetailDTO.getPublicAreaPowerUsage());
         }
 
-        // todo 需判断使用like还是eq
+        
         if (StringUtils.isNotEmpty(pageQueryReportHotelProjectDetailDTO.getPowerUsageDescription())) {
             queryWrapper.like(ReportHotelProjectDetail.PROP_POWER_USAGE_DESCRIPTION, pageQueryReportHotelProjectDetailDTO.getPowerUsageDescription());
         }
@@ -279,7 +279,7 @@ public class ReportHotelProjectDetailServiceImpl extends ServiceImpl<ReportHotel
             queryWrapper.eq(ReportHotelProjectDetail.PROP_AIR_CONDITIONER_EFFICIENCY, pageQueryReportHotelProjectDetailDTO.getAirConditionerEfficiency());
         }
 
-        // todo 需判断使用like还是eq
+        
         if (StringUtils.isNotEmpty(pageQueryReportHotelProjectDetailDTO.getAirConditionerEfficiencyExplain())) {
             queryWrapper.like(ReportHotelProjectDetail.PROP_AIR_CONDITIONER_EFFICIENCY_EXPLAIN, pageQueryReportHotelProjectDetailDTO.getAirConditionerEfficiencyExplain());
         }
@@ -288,7 +288,7 @@ public class ReportHotelProjectDetailServiceImpl extends ServiceImpl<ReportHotel
             queryWrapper.eq(ReportHotelProjectDetail.PROP_ENV_INFO, pageQueryReportHotelProjectDetailDTO.getEnvInfo());
         }
 
-        // todo 需判断使用like还是eq
+        
         if (StringUtils.isNotEmpty(pageQueryReportHotelProjectDetailDTO.getEnvDescription())) {
             queryWrapper.like(ReportHotelProjectDetail.PROP_ENV_DESCRIPTION, pageQueryReportHotelProjectDetailDTO.getEnvDescription());
         }
@@ -297,7 +297,7 @@ public class ReportHotelProjectDetailServiceImpl extends ServiceImpl<ReportHotel
             queryWrapper.eq(ReportHotelProjectDetail.PROP_ENERGY_WORK_ORDER_INFO, pageQueryReportHotelProjectDetailDTO.getEnergyWorkOrderInfo());
         }
 
-        // todo 需判断使用like还是eq
+        
         if (StringUtils.isNotEmpty(pageQueryReportHotelProjectDetailDTO.getEnergyWorkOrderDescription())) {
             queryWrapper.like(ReportHotelProjectDetail.PROP_ENERGY_WORK_ORDER_DESCRIPTION, pageQueryReportHotelProjectDetailDTO.getEnergyWorkOrderDescription());
         }
@@ -306,7 +306,7 @@ public class ReportHotelProjectDetailServiceImpl extends ServiceImpl<ReportHotel
             queryWrapper.eq(ReportHotelProjectDetail.PROP_PLATFORM_RUNTIME_INFO, pageQueryReportHotelProjectDetailDTO.getPlatformRuntimeInfo());
         }
 
-        // todo 需判断使用like还是eq
+        
         if (StringUtils.isNotEmpty(pageQueryReportHotelProjectDetailDTO.getPlatformRuntimeDescription())) {
             queryWrapper.like(ReportHotelProjectDetail.PROP_PLATFORM_RUNTIME_DESCRIPTION, pageQueryReportHotelProjectDetailDTO.getPlatformRuntimeDescription());
         }
@@ -315,7 +315,7 @@ public class ReportHotelProjectDetailServiceImpl extends ServiceImpl<ReportHotel
             queryWrapper.eq(ReportHotelProjectDetail.PROP_ALARM_DEAL_INFO, pageQueryReportHotelProjectDetailDTO.getAlarmDealInfo());
         }
 
-        // todo 需判断使用like还是eq
+        
         if (StringUtils.isNotEmpty(pageQueryReportHotelProjectDetailDTO.getAlarmDealDescription())) {
             queryWrapper.like(ReportHotelProjectDetail.PROP_ALARM_DEAL_DESCRIPTION, pageQueryReportHotelProjectDetailDTO.getAlarmDealDescription());
         }

+ 4 - 4
src/main/java/com/persagy/apm/energy/report/monthly/functionvalue/model/dto/AddFunctionValueDTO.java

@@ -17,19 +17,19 @@ import java.util.Date;
 @ApiModel(value = "创建能耗报告信息点取值入参")
 public class AddFunctionValueDTO {
     @ApiModelProperty(value = "信息点id", required = true)
-    @NotNull(message = "信息点id不能为空") // todo 更新校验规则
+    @NotNull(message = "信息点id不能为空") 
     private String functionId;
 
     @ApiModelProperty(value = "项目id", required = true)
-    @NotNull(message = "项目id不能为空") // todo 更新校验规则
+    @NotNull(message = "项目id不能为空") 
     private String projectId;
 
     @ApiModelProperty(value = "数据时间", required = true)
-    @NotNull(message = "数据时间不能为空") // todo 更新校验规则
+    @NotNull(message = "数据时间不能为空") 
     private Date dataTime;
 
     @ApiModelProperty(value = "信息点的值", required = true)
-    @NotNull(message = "信息点的值不能为空") // todo 更新校验规则
+    @NotNull(message = "信息点的值不能为空") 
     private String value;
 
 }

+ 5 - 5
src/main/java/com/persagy/apm/energy/report/monthly/functionvalue/model/dto/UpdateFunctionValueDTO.java

@@ -17,23 +17,23 @@ import java.util.Date;
 @ApiModel(value = "更新能耗报告信息点取值入参")
 public class UpdateFunctionValueDTO {
     @ApiModelProperty(value = "主键", required = true)
-    @NotNull(message = "主键不能为空") // todo 更新校验规则
+    @NotNull(message = "主键不能为空") 
     private String id;
 
     @ApiModelProperty(value = "信息点id", required = true)
-    @NotNull(message = "信息点id不能为空") // todo 更新校验规则
+    @NotNull(message = "信息点id不能为空") 
     private String functionId;
 
     @ApiModelProperty(value = "项目id", required = true)
-    @NotNull(message = "项目id不能为空") // todo 更新校验规则
+    @NotNull(message = "项目id不能为空") 
     private String projectId;
 
     @ApiModelProperty(value = "数据时间", required = true)
-    @NotNull(message = "数据时间不能为空") // todo 更新校验规则
+    @NotNull(message = "数据时间不能为空") 
     private Date dataTime;
 
     @ApiModelProperty(value = "信息点的值", required = true)
-    @NotNull(message = "信息点的值不能为空") // todo 更新校验规则
+    @NotNull(message = "信息点的值不能为空") 
     private String value;
 
 }

+ 4 - 4
src/main/java/com/persagy/apm/energy/report/monthly/functionvalue/service/impl/FunctionValueServiceImpl.java

@@ -63,7 +63,7 @@ public class FunctionValueServiceImpl extends ServiceImpl<FunctionValueMapper, F
      */
     private void setDefaultValue(FunctionValue functionValue) {
         functionValue.setCreator(AppContext.getContext().getAccountId());
-        // todo 其他默认的属性
+        
 
     }
 
@@ -238,12 +238,12 @@ public class FunctionValueServiceImpl extends ServiceImpl<FunctionValueMapper, F
             }
         }
 
-        // todo 需判断使用like还是eq
+        
         if (StringUtils.isNotEmpty(pageQueryFunctionValueDTO.getFunctionId())) {
             queryWrapper.like(FunctionValue.PROP_FUNCTION_ID, pageQueryFunctionValueDTO.getFunctionId());
         }
 
-        // todo 需判断使用like还是eq
+        
         if (StringUtils.isNotEmpty(pageQueryFunctionValueDTO.getProjectId())) {
             queryWrapper.like(FunctionValue.PROP_PROJECT_ID, pageQueryFunctionValueDTO.getProjectId());
         }
@@ -252,7 +252,7 @@ public class FunctionValueServiceImpl extends ServiceImpl<FunctionValueMapper, F
             queryWrapper.eq(FunctionValue.PROP_DATA_TIME, pageQueryFunctionValueDTO.getDataTime());
         }
 
-        // todo 需判断使用like还是eq
+        
         if (StringUtils.isNotEmpty(pageQueryFunctionValueDTO.getValue())) {
             queryWrapper.like(FunctionValue.PROP_VALUE, pageQueryFunctionValueDTO.getValue());
         }

+ 9 - 2
src/main/java/com/persagy/apm/energy/report/monthly/outline/controller/ReportOutlineController.java

@@ -1,11 +1,16 @@
 package com.persagy.apm.energy.report.monthly.outline.controller;
 
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.persagy.apm.common.context.DefaultAppContext;
+import com.persagy.apm.common.context.poems.PoemsContext;
 import com.persagy.apm.common.response.ApmResponseUpsertVO;
 import com.persagy.apm.common.response.CommonResult;
 import com.persagy.apm.common.response.PageList;
 import com.persagy.apm.common.utils.ResultHelper;
+import com.persagy.apm.energy.report.common.utils.DateUtils;
 import com.persagy.apm.energy.report.monthly.config.type.model.ConvertReportTypeTool;
 import com.persagy.apm.energy.report.monthly.config.type.model.ReportType;
 import com.persagy.apm.energy.report.monthly.config.type.model.vo.ResponseReportTypeItemVO;
@@ -35,7 +40,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
 import javax.validation.Valid;
+import java.util.Date;
 import java.util.List;
+import java.util.Map;
 
 /**
  * 报告概要控制层
@@ -84,11 +91,11 @@ public class ReportOutlineController {
     public CommonResult<PageList<ResponseReportOutlineListItemVO>> queryReportOutline(
             @Valid @RequestBody PageQueryReportOutlineDTO pageQueryReportOutlineDTO) {
         // 查询当前人员的项目权限
-
+        Date date = new Date();
         IPage<ReportOutline> pagedList = reportOutlineService.pageQueryReportOutline(pageQueryReportOutlineDTO);
+        DateUtils.printDuration(date);
         IPage<ResponseReportOutlineListItemVO> pagedResultList = pagedList.convert(item -> {
             try {
-
                 ResponseReportOutlineListItemVO responseReportOutlineListItemVO = ConvertReportOutlineTool.INSTANCE.convert2ResponseListItemDTO(item);
                 ReportType reportType = reportTypeService.queryReportTypeDetail(item.getReportTypeId());
                 ResponseReportTypeItemVO responseReportTypeItemVO = ConvertReportTypeTool.INSTANCE.convert2ResponseItemDTO(reportType);

+ 1 - 1
src/main/java/com/persagy/apm/energy/report/monthly/outline/model/ReportOutline.java

@@ -51,7 +51,7 @@ public class ReportOutline extends AuditableEntity<ReportOutline> implements Ser
     public static String PROP_NAME = "name";
     public static String PROP_REPORT_MONTH = "report_month";
     public static String PROP_BELONG = "belong";
-    public static String PROP_REPORT_TYPE_ID = "reportTypeId";
+    public static String PROP_REPORT_TYPE_ID = "report_type_id";
     public static String PROP_DETAIL_ID = "detail_id";
     public static String PROP_STATUS = "status";
     public static String PROP_REMARK = "remark";

+ 3 - 1
src/main/java/com/persagy/apm/energy/report/monthly/outline/service/builder/hotel/impl/HotelAreaReportBuilder.java

@@ -110,6 +110,8 @@ public class HotelAreaReportBuilder extends ReportBuilder implements IHotelAreaR
     public List<HotelAreaPowerConsumptionOutline> getPowerUsageOutline(ReportOutline reportOutline) {
         List<String> functionIdList = getFunctionsByParagraph(
                 reportOutline.getReportTypeId(), HotelReportParagraphs.POWER_CONSUMPTION_OUTLINE);
+        List<String> publicFunctionIdList = getFunctionsByParagraph(
+                reportOutline.getReportTypeId(), HotelReportParagraphs.PUBLIC_POWER_CONSUMPTION);
 
         List<String> projectIds = reportOutlineService.queryRelatedProjectIds(reportOutline);
         if (CollectionUtils.isEmpty(projectIds)) {
@@ -121,7 +123,7 @@ public class HotelAreaReportBuilder extends ReportBuilder implements IHotelAreaR
             HotelProjectPowerConsumptionOutline consumptionOutline = hotelProjectReportPowerInfoOutlineService.
                     getConsumptionOutline(projectId, reportOutline.getReportMonth(), functionIdList);
             HotelProjectPublicPowerConsumption publicConsumption = hotelProjectReportPublicPowerInfoService.
-                    getPublicConsumption(projectId, reportOutline.getReportMonth(), functionIdList);
+                    getPublicConsumption(projectId, reportOutline.getReportMonth(), publicFunctionIdList);
             HotelAreaPowerConsumptionOutline hotelAreaPowerConsumptionOutline = ConvertReportHotelAreaDetailTool.
                     INSTANCE.convert2HotelAreaPowerConsumptionOutline(consumptionOutline, publicConsumption);
 

+ 24 - 6
src/main/java/com/persagy/apm/energy/report/monthly/outline/service/builder/hotel/impl/HotelProjectReportBuilder.java

@@ -100,10 +100,9 @@ public class HotelProjectReportBuilder extends ReportBuilder implements IHotelPr
             return null;
         }
 
-        // 查询同气候区下的项目
-        String projectId = reportOutline.getBelong();
+        // 查询同业态的项目
         String buildingType = reportOutlineService.getBuildingType(reportOutline);
-        List<String> projectIdsInSameClimateZone = getProjectIdsInSameClimateZone(projectId, buildingType);
+        List<String> projectIdsInSameClimateZone = getProjectIdsByBuildingType(buildingType);
         // 查询段落下的功能点
         QueryFunctionDTO queryFunctionDTO = new QueryFunctionDTO();
         queryFunctionDTO.setFunctionIdList(functionIdList);
@@ -134,7 +133,7 @@ public class HotelProjectReportBuilder extends ReportBuilder implements IHotelPr
 
         String projectId = reportOutline.getBelong();
         String buildingType = reportOutlineService.getBuildingType(reportOutline);
-        List<String> projectIdsInClimateZone = getProjectIdsInSameClimateZone(projectId, buildingType);
+        List<String> projectIdsInClimateZone = getProjectIdsByBuildingType(buildingType);
         List<HotelProjectKpiItem> kpiItems = new ArrayList<>();
 
         for (String functionId : functionIdList) {
@@ -171,12 +170,31 @@ public class HotelProjectReportBuilder extends ReportBuilder implements IHotelPr
         return null;
     }
 
+    /**
+     * 获取同同业态的项目id列表
+     *
+     * @param buildingType 业态类型
+     * @return 项目id列表
+     * @author lixing
+     * @version V1.0 2021/6/10 7:13 下午
+     */
+    private List<String> getProjectIdsByBuildingType(String buildingType) {
+        // 根据气候区获取项目
+        List<PoemsProjectVO> projects = saasWebService.getProjectsByBuildingType(buildingType);
+        if (!CollectionUtils.isEmpty(projects)) {
+            return projects.stream().
+                    map(PoemsProjectVO::getProjectId).
+                    collect(Collectors.toList());
+        }
+        return null;
+    }
+
     @Override
     public HotelProjectChillerPlantEfficiency getChillerPlanEfficiency(ReportOutline reportOutline) {
         String buildingType = reportOutlineService.getBuildingType(reportOutline);
-        List<String> projectIdsInSameClimateZone = getProjectIdsInSameClimateZone(reportOutline.getBelong(), buildingType);
+        List<String> projectIds = getProjectIdsByBuildingType(buildingType);
         return commonService.getHotelProjectChillerPlantEfficiency(
-                reportOutline.getBelong(), reportOutline.getReportMonth(), projectIdsInSameClimateZone);
+                reportOutline.getBelong(), reportOutline.getReportMonth(), projectIds);
     }
 
     @Override

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

@@ -12,6 +12,7 @@ import com.persagy.apm.energy.report.common.utils.DateUtils;
 import com.persagy.apm.energy.report.monthly.config.rel.detailstatisticsitem.service.IReportDetailStatisticsItemRelService;
 import com.persagy.apm.energy.report.monthly.config.type.constant.enums.BelongTypeEnum;
 import com.persagy.apm.energy.report.monthly.config.type.model.ReportType;
+import com.persagy.apm.energy.report.monthly.config.type.model.vo.ResponseReportTypeListItemVO;
 import com.persagy.apm.energy.report.monthly.config.type.service.IReportTypeService;
 import com.persagy.apm.energy.report.monthly.detail.business.model.vo.ResponseReportBusinessDetailItemVO;
 import com.persagy.apm.energy.report.monthly.detail.business.service.IReportBusinessDetailService;
@@ -37,9 +38,12 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.CollectionUtils;
 
+import java.text.Collator;
 import java.time.LocalDate;
 import java.util.ArrayList;
+import java.util.Comparator;
 import java.util.List;
+import java.util.Locale;
 import java.util.stream.Collectors;
 
 /**
@@ -160,7 +164,6 @@ public class ReportOutlineServiceImpl extends ServiceImpl<ReportOutlineMapper, R
     }
 
 
-
     /**
      * 报告概要详情
      *
@@ -313,6 +316,7 @@ public class ReportOutlineServiceImpl extends ServiceImpl<ReportOutlineMapper, R
 
     @Override
     public IPage<ReportOutline> pageQueryReportOutline(PageQueryReportOutlineDTO pageQueryReportOutlineDTO) {
+
         QueryWrapper<ReportOutline> queryWrapper = new QueryWrapper<>();
         queryWrapper.eq(ReportOutline.PROP_VALID, ValidEnum.TRUE.getType());
         // 这里认为pageQueryDTO是经过校验的,肯定包含分页信息
@@ -330,6 +334,24 @@ public class ReportOutlineServiceImpl extends ServiceImpl<ReportOutlineMapper, R
             }
         }
 
+        IPage<ResponseReportTypeListItemVO> availableReportTypes = reportTypeService.queryAvailableReportTypes();
+        if (availableReportTypes != null) {
+            List<ResponseReportTypeListItemVO> records = availableReportTypes.getRecords();
+            if (!CollectionUtils.isEmpty(records)) {
+                // 每一类报告类型拼装一个or条件
+                queryWrapper.and(wrapper -> {
+                    for (ResponseReportTypeListItemVO record : records) {
+                        // 根据报告类型id + 报告所属查询
+                        wrapper.or(
+                                innerWrapper -> innerWrapper.eq(
+                                        ReportOutline.PROP_REPORT_TYPE_ID, record.getId()).in(
+                                                ReportOutline.PROP_BELONG, record.getAvailableBelongIds())
+                        );
+                    }
+                });
+            }
+        }
+
         if (StringUtils.isNotEmpty(pageQueryReportOutlineDTO.getName())) {
             queryWrapper.like(ReportOutline.PROP_NAME, pageQueryReportOutlineDTO.getName());
         }
@@ -361,9 +383,15 @@ public class ReportOutlineServiceImpl extends ServiceImpl<ReportOutlineMapper, R
             String areaId = reportOutline.getBelong();
             // 获取区域下的项目
             List<PoemsProjectVO> projectsByArea = saasWebService.getProjectsByAreaAndBuildingType(areaId, buildingType);
+
             if (!CollectionUtils.isEmpty(projectsByArea)) {
-                projectIds.addAll(projectsByArea.stream().map(
-                        PoemsProjectVO::getProjectId).collect(Collectors.toList()));
+                projectIds.addAll(
+                        projectsByArea.stream().
+                        // 项目根据名称首字母排序
+                        sorted(Comparator.comparing(PoemsProjectVO::getProjectLocalName,
+                                Collator.getInstance(java.util.Locale.CHINA))).
+                        map(PoemsProjectVO::getProjectId).
+                        collect(Collectors.toList()));
             }
         }
         return projectIds;

+ 35 - 0
src/main/java/com/persagy/apm/energy/report/saasweb/constants/enums/AreaTypeEnum.java

@@ -0,0 +1,35 @@
+package com.persagy.apm.energy.report.saasweb.constants.enums;
+
+import com.persagy.apm.common.model.annotation.SwaggerDisplayEnum;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 面积类型
+ *
+ * @author lixing
+ * @version V1.0 2021/5/17 10:51 上午
+ */
+@SwaggerDisplayEnum
+public enum AreaTypeEnum {
+    /**
+     * 面积类型
+     */
+    TOTAL("1", "总建筑面积"),
+    UNDERGROUND_GARAGE("2", "地下停车场面积"),
+    PUBLIC_AREA("3", "公区面积"),
+    COMMERCIAL("4", "商业面积");
+
+
+    @Setter
+    @Getter
+    private String type;
+    @Setter
+    @Getter
+    private String desc;
+
+    AreaTypeEnum(String type, String desc) {
+        this.type = type;
+        this.desc = desc;
+    }
+}

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

@@ -158,6 +158,16 @@ public interface ISaasWebService {
     List<PoemsProjectVO> getProjectsByAreaAndBuildingType(String areaCode, String buildingType);
 
     /**
+     * 根据建筑类型(包含其子类型)查询项目
+     *
+     * @param buildingType 建筑类型
+     * @return 项目列表
+     * @author lixing
+     * @version V1.0 2021/6/25 10:52 上午
+     */
+    List<PoemsProjectVO> getProjectsByBuildingType(String buildingType);
+
+    /**
      * 根据业态获取用户可选的项目
      *
      * @param buildingType 项目业态

+ 70 - 60
src/main/java/com/persagy/apm/energy/report/saasweb/service/impl/SaasWebServiceImpl.java

@@ -3,8 +3,10 @@ package com.persagy.apm.energy.report.saasweb.service.impl;
 import com.google.common.collect.Maps;
 import com.persagy.apm.common.model.dto.PoemsFeignBaseDTO;
 import com.persagy.apm.common.response.PoemsFeignResponse;
+import com.persagy.apm.energy.report.common.utils.DataUtils;
 import com.persagy.apm.energy.report.common.utils.DateUtils;
 import com.persagy.apm.energy.report.saasweb.constants.SaaswebConstants;
+import com.persagy.apm.energy.report.saasweb.constants.enums.AreaTypeEnum;
 import com.persagy.apm.energy.report.saasweb.model.ConvertSaasWebTool;
 import com.persagy.apm.energy.report.saasweb.model.dto.QueryByProjectIdDTO;
 import com.persagy.apm.energy.report.saasweb.model.dto.QueryPartitionDTO;
@@ -91,34 +93,22 @@ public class SaasWebServiceImpl implements ISaasWebService {
         PoemsFeignResponse<BuildingInfoVO> buildsResponse = saasWebClientWrapper.listBuildingsByProjectId(queryByProjectIdDTO);
         List<BuildingInfoVO> buildingInfoVOList = buildsResponse.getContent();
         // 统计项目下建筑总的商业面积,地下停车场面积,总面积,公区面积
-        BigDecimal totalCommercialArea = new BigDecimal("0");
-        BigDecimal totalUndergroundGarageArea = new BigDecimal("0");
-        BigDecimal totalBuildingArea = new BigDecimal("0");
-        BigDecimal totalPublicArea = new BigDecimal("0");
         if (!CollectionUtils.isEmpty(buildingInfoVOList)) {
-            for (BuildingInfoVO buildingInfoVO : buildingInfoVOList) {
-                String commercialArea = buildingInfoVO.getCommercialArea();
-                String undergroundGarageArea = buildingInfoVO.getUndergroundGarageArea();
-                String totalArea = buildingInfoVO.getTotalArea();
-                String publicArea = buildingInfoVO.getPublicArea();
-                if (StringUtils.isNotBlank(commercialArea)) {
-                    totalCommercialArea = totalCommercialArea.add(new BigDecimal(commercialArea));
-                }
-                if (StringUtils.isNotBlank(undergroundGarageArea)) {
-                    totalUndergroundGarageArea = totalUndergroundGarageArea.add(new BigDecimal(undergroundGarageArea));
-                }
-                if (StringUtils.isNotBlank(totalArea)) {
-                    totalBuildingArea = totalBuildingArea.add(new BigDecimal(totalArea));
-                }
-                if (StringUtils.isNotBlank(publicArea)) {
-                    totalPublicArea = totalPublicArea.add(new BigDecimal(publicArea));
-                }
-            }
+            List<String> commercialAreaList = buildingInfoVOList.stream().map(
+                    BuildingInfoVO::getCommercialArea).collect(Collectors.toList());
+            List<String> undergroundGarageAreaList = buildingInfoVOList.stream().map(
+                    BuildingInfoVO::getUndergroundGarageArea).collect(Collectors.toList());
+            List<String> totalAreaList = buildingInfoVOList.stream().map(
+                    BuildingInfoVO::getTotalArea).collect(Collectors.toList());
+            List<String> publicAreaAreaList = buildingInfoVOList.stream().map(
+                    BuildingInfoVO::getPublicArea).collect(Collectors.toList());
+
+            reportProjectVO.setCommercialArea(DataUtils.getSum(commercialAreaList));
+            reportProjectVO.setUndergroundGarageArea(DataUtils.getSum(undergroundGarageAreaList));
+            reportProjectVO.setTotalBuildingArea(DataUtils.getSum(totalAreaList));
+            reportProjectVO.setPublicArea(DataUtils.getSum(publicAreaAreaList));
         }
-        reportProjectVO.setCommercialArea(totalCommercialArea.toString());
-        reportProjectVO.setUndergroundGarageArea(totalUndergroundGarageArea.toString());
-        reportProjectVO.setTotalBuildingArea(totalBuildingArea.toString());
-        reportProjectVO.setPublicArea(totalPublicArea.toString());
+
         return reportProjectVO;
     }
 
@@ -214,7 +204,7 @@ public class SaasWebServiceImpl implements ISaasWebService {
 
     @Override
     public List<PoemsProjectVO> getProjectsByAreaAndBuildingType(String areaCode, String buildingType) {
-        if (StringUtils.isBlank(areaCode) || StringUtils.isBlank(areaCode)) {
+        if (StringUtils.isBlank(areaCode) || StringUtils.isBlank(buildingType)) {
             return Lists.newArrayList();
         }
         List<PoemsProjectVO> projectsByArea = getProjectsByArea(areaCode);
@@ -233,12 +223,27 @@ public class SaasWebServiceImpl implements ISaasWebService {
                 ).collect(Collectors.toList());
     }
 
+    @Override
+    public List<PoemsProjectVO> getProjectsByBuildingType(String buildingType) {
+        List<PoemsProjectVO> allProjects = getAllProjects();
+        List<String> buildingTypeCodes = getRelatedBuildingTypes(buildingType);
+
+        if (CollectionUtils.isEmpty(buildingTypeCodes)) {
+            return Lists.newArrayList();
+        }
+        return allProjects.stream().
+                filter(
+                        poemsProjectVO -> satisfyBuildingTypeAndClimateZone(
+                                buildingTypeCodes, null, poemsProjectVO)
+                ).collect(Collectors.toList());
+    }
+
     /**
      * 判断项目是否满足业态和气候区筛选条件
      *
      * @param allBuildingTypes 所有用来筛选的业态
-     * @param climateZoneCode 用来筛选的气候区
-     * @param projectVO PoemsProjectVO对象
+     * @param climateZoneCode  用来筛选的气候区
+     * @param projectVO        PoemsProjectVO对象
      * @return 是否满足条件
      * @author lixing
      * @version V1.0 2021/6/15 5:12 下午
@@ -378,6 +383,7 @@ public class SaasWebServiceImpl implements ISaasWebService {
         return filterPartitionMap2Tree(filterPartitionMap);
     }
 
+
     @Override
     public List<PartitionProjectVO> getAvailableProjectTree(String buildingType) {
         // 查询用户权限范围内的分区和项目
@@ -407,9 +413,9 @@ public class SaasWebServiceImpl implements ISaasWebService {
     /**
      * 递归过滤用户可用的分区和项目
      *
-     * @param treeBeforeFilter 需要过滤的树
+     * @param treeBeforeFilter      需要过滤的树
      * @param availablePartitionMap 可用分区map
-     * @param availableProjectMap 可用项目map
+     * @param availableProjectMap   可用项目map
      * @return 用户可用的分区项目树
      * @author lixing
      * @version V1.0 2021/6/18 11:12 上午
@@ -666,49 +672,53 @@ public class SaasWebServiceImpl implements ISaasWebService {
 
     @Override
     public Double getTotalCommercialArea(List<String> projectIds) {
-        if (CollectionUtils.isEmpty(projectIds)) {
-            return 0d;
-        }
-
-        BigDecimal result = new BigDecimal("0");
-        for (String projectId : projectIds) {
-            ReportProjectVO projectAreas = getProjectAreas(projectId);
-            String commercialArea = projectAreas.getCommercialArea();
-            result = result.add(new BigDecimal(commercialArea));
-        }
-        return result.doubleValue();
+        return calculateProjectsArea(projectIds, AreaTypeEnum.COMMERCIAL);
     }
 
     @Override
     public Double getTotalPublicArea(List<String> projectIds) {
-        if (CollectionUtils.isEmpty(projectIds)) {
-            return 0d;
-        }
-
-        BigDecimal result = new BigDecimal("0");
-        for (String projectId : projectIds) {
-            ReportProjectVO projectAreas = getProjectAreas(projectId);
-            String publicArea = projectAreas.getPublicArea();
-            result = result.add(new BigDecimal(publicArea));
-        }
-        return result.doubleValue();
+        return calculateProjectsArea(projectIds, AreaTypeEnum.PUBLIC_AREA);
     }
 
     @Override
     public Double getTotalBuildingArea(List<String> projectIds) {
-        BigDecimal totalBuildingArea = new BigDecimal("0");
-        for (String projectId : projectIds) {
-            // 获取项目总的建筑面积
+        return calculateProjectsArea(projectIds, AreaTypeEnum.TOTAL);
+    }
+
+    /**
+     * 计算项目的面积总和
+     *
+     * @param projectIds 要计算的项目id列表
+     * @param areaType 面积类型
+     * @return 计算结果
+     * @author lixing
+     * @version V1.0 2021/6/23 2:58 下午
+     */
+    private Double calculateProjectsArea(List<String> projectIds, AreaTypeEnum areaType) {
+        if (CollectionUtils.isEmpty(projectIds)) {
+            return null;
+        }
+        List<String> areaList = projectIds.stream().map(projectId -> {
             ReportProjectVO reportProjectInfo = getReportProjectInfo(projectId);
             if (reportProjectInfo == null) {
                 return null;
             }
-            if (StringUtils.isNotBlank(reportProjectInfo.getTotalBuildingArea())) {
-                totalBuildingArea = totalBuildingArea.add(new BigDecimal(reportProjectInfo.getTotalBuildingArea()));
+            switch (areaType) {
+                case TOTAL:
+                    return reportProjectInfo.getTotalBuildingArea();
+                case PUBLIC_AREA:
+                    return reportProjectInfo.getPublicArea();
+                case UNDERGROUND_GARAGE:
+                    return reportProjectInfo.getUndergroundGarageArea();
+                case COMMERCIAL:
+                    return reportProjectInfo.getCommercialArea();
+                default:
+                    return null;
             }
+        }).collect(Collectors.toList());
 
-        }
-        return totalBuildingArea.doubleValue();
+        String resultStr = DataUtils.getSum(areaList);
+        return StringUtils.isBlank(resultStr)? null: Double.parseDouble(resultStr);
     }
 
     @Override

+ 3 - 1
src/main/resources/bootstrap.yml

@@ -5,5 +5,7 @@ spring:
 EUREKA_CLIENT_DEFAULT_ZONE: http://frame:123456@develop.persagy.com/integrated-eureka/eureka/
 #EUREKA_CLIENT_DEFAULT_ZONE: http://pbsage:123456@hr.persagy.com/poems-eureka/eureka/
 
-
+mybatis-plus:
+  configuration:
+    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl