浏览代码

修正命名、添加注释

wangchenghong 3 年之前
父节点
当前提交
3e8a65e93f

+ 17 - 1
src/main/java/com/persagy/apm/energy/report/common/service/PlatformService.java

@@ -10,8 +10,24 @@ import java.util.List;
 @Api(value = "platform能源平台管理service接口")
 public interface PlatformService {
 
+    /**
+     * 获取项目能源管理平台运维信息
+     *
+     * @param queryPlatformParamDTO 查询条件对象
+     * @return
+     * @author wch
+     * @version V1.0 2021/5/19 4:04 下午
+     */
     List<Double> getPjPlatformRate(QueryPlatformParamDTO queryPlatformParamDTO);
-
+    /**
+     * 获取大区能源管理平台运维信息
+     *
+     * @param statisticItems 配置的条目信息
+     * @param queryPlatformParamDTO 查询条件对象
+     * @return
+     * @author wch
+     * @version V1.0 2021/5/19 4:04 下午
+     */
     PlatformAreaInfoVO getAreaPlatformRate(StatisticItems statisticItems, QueryPlatformParamDTO queryPlatformParamDTO);
 
 }

+ 6 - 6
src/main/java/com/persagy/apm/energy/report/common/service/impl/BianSunDataAnalysisPlatformServiceImpl.java

@@ -40,12 +40,12 @@ public class BianSunDataAnalysisPlatformServiceImpl implements PlatformService {
             date_rateMap.put(startDate, getBianSunRate(queryPlatformParamDTO.getUserId(), queryPlatformParamDTO.getGroupCode(), pjId, startDate));
             startDate = DateUtils.getMonthOff(startDate, 1);
         }
-        List<Double> bianSunMonthlySummaries = date_rateMap.values().stream().collect(Collectors.toList());
-        return bianSunMonthlySummaries;
+        List<Double> monthlySummaries = date_rateMap.values().stream().collect(Collectors.toList());
+        return monthlySummaries;
     }
 
     private Double getBianSunRate(String userId, String groupCode, String projectId, Date reportDate) {
-        Double bianSunRate = null;
+        Double rate = null;
         try {
             JSONObject paramObject = new JSONObject();
             paramObject.put("userId", userId);
@@ -64,13 +64,13 @@ public class BianSunDataAnalysisPlatformServiceImpl implements PlatformService {
                 List<Map> content = (List<Map>) responseObject.get("content");
                 if (CollectionUtils.isNotEmpty(content)) {
                     Map data = content.get(0);
-                    bianSunRate = DataUtils.parseDouble(data.get("bianSunRate"));
+                    rate = DataUtils.parseDouble(data.get("bianSunRate"));
                 }
             }
         } catch (Exception e) {
             e.printStackTrace();
         }
-        return bianSunRate;
+        return rate;
     }
 
     @Override
@@ -92,7 +92,7 @@ public class BianSunDataAnalysisPlatformServiceImpl implements PlatformService {
         for (String pjId : queryPlatformParamDTO.getProjectIdList()) {
             Double bianSunRate = getBianSunRate(queryPlatformParamDTO.getUserId(), queryPlatformParamDTO.getGroupCode(), pjId, queryPlatformParamDTO.getReportDate());
             if (null != bianSunRate && null != standardValue) {
-                if (DataUtils.getQualifyResult(standardValue, qualifyFormula, bianSunRate) == 0.0) {
+                if (DataUtils.getQualifyResult(standardValue, qualifyFormula, Math.abs(bianSunRate)) == 0.0) {
                     unsatisfiedCount++;
                     unsatisfiedPjIdList.add(pjId);
                 } else {

+ 10 - 10
src/main/java/com/persagy/apm/energy/report/common/service/impl/ZongZhiDataAnalysisPlatformServiceImpl.java

@@ -37,15 +37,15 @@ public class ZongZhiDataAnalysisPlatformServiceImpl implements PlatformService {
         Date reportDate = queryPlatformParamDTO.getReportDate();
         Date startDate = DateUtils.getFirstDayOfYear(reportDate);
         while (startDate.before(DateUtils.getMonthOff(reportDate, 1))) {
-            date_rateMap.put(startDate, getBianSunRate(queryPlatformParamDTO.getUserId(), queryPlatformParamDTO.getGroupCode(), pjId, startDate));
+            date_rateMap.put(startDate, getZongZhiRate(queryPlatformParamDTO.getUserId(), queryPlatformParamDTO.getGroupCode(), pjId, startDate));
             startDate = DateUtils.getMonthOff(startDate, 1);
         }
-        List<Double> bianSunMonthlySummaries = date_rateMap.values().stream().collect(Collectors.toList());
-        return bianSunMonthlySummaries;
+        List<Double> monthlySummaries = date_rateMap.values().stream().collect(Collectors.toList());
+        return monthlySummaries;
     }
 
-    private Double getBianSunRate(String userId, String groupCode, String projectId, Date reportDate) {
-        Double bianSunRate = null;
+    private Double getZongZhiRate(String userId, String groupCode, String projectId, Date reportDate) {
+        Double rate = null;
         try {
             JSONObject paramObject = new JSONObject();
             paramObject.put("userId", userId);
@@ -64,13 +64,13 @@ public class ZongZhiDataAnalysisPlatformServiceImpl implements PlatformService {
                 List<Map> content = (List<Map>) responseObject.get("content");
                 if (CollectionUtils.isNotEmpty(content)) {
                     Map data = content.get(0);
-                    bianSunRate = DataUtils.parseDouble(data.get("zongZhiRate"));
+                    rate = DataUtils.parseDouble(data.get("zongZhiRate"));
                 }
             }
         } catch (Exception e) {
             e.printStackTrace();
         }
-        return bianSunRate;
+        return rate;
     }
 
     @Override
@@ -90,9 +90,9 @@ public class ZongZhiDataAnalysisPlatformServiceImpl implements PlatformService {
         // 未达标项目id列表
         List<String> unsatisfiedPjIdList = new ArrayList<>();
         for (String pjId : queryPlatformParamDTO.getProjectIdList()) {
-            Double bianSunRate = getBianSunRate(queryPlatformParamDTO.getUserId(), queryPlatformParamDTO.getGroupCode(), pjId, queryPlatformParamDTO.getReportDate());
-            if (null != bianSunRate && null != standardValue) {
-                if (DataUtils.getQualifyResult(standardValue, qualifyFormula, bianSunRate) == 0.0) {
+            Double zongZhiRate = getZongZhiRate(queryPlatformParamDTO.getUserId(), queryPlatformParamDTO.getGroupCode(), pjId, queryPlatformParamDTO.getReportDate());
+            if (null != zongZhiRate && null != standardValue) {
+                if (DataUtils.getQualifyResult(standardValue, qualifyFormula, Math.abs(zongZhiRate)) == 0.0) {
                     unsatisfiedCount++;
                     unsatisfiedPjIdList.add(pjId);
                 } else {