|
@@ -98,12 +98,16 @@ public class ICenterMiddlewareWebServiceImp implements ICenterMiddlewareWebServi
|
|
Double coolingCapacity = date_coolingCapacityMap.get(date);
|
|
Double coolingCapacity = date_coolingCapacityMap.get(date);
|
|
Double powerConsumption = date_powerConsumptionMap.get(date);
|
|
Double powerConsumption = date_powerConsumptionMap.get(date);
|
|
Double eer = null;
|
|
Double eer = null;
|
|
- if (coolingCapacity != null && powerConsumption != null) {
|
|
|
|
|
|
+ if (coolingCapacity != null && powerConsumption != null && powerConsumption != 0.0) {
|
|
eer = coolingCapacity / powerConsumption;
|
|
eer = coolingCapacity / powerConsumption;
|
|
|
|
+ }
|
|
|
|
+ if (coolingCapacity != null) {
|
|
if (null == allCoolingCapacity) {
|
|
if (null == allCoolingCapacity) {
|
|
allCoolingCapacity = 0.0;
|
|
allCoolingCapacity = 0.0;
|
|
}
|
|
}
|
|
allCoolingCapacity = allCoolingCapacity + coolingCapacity;
|
|
allCoolingCapacity = allCoolingCapacity + coolingCapacity;
|
|
|
|
+ }
|
|
|
|
+ if (powerConsumption != null) {
|
|
if (null == allPowerConsumption) {
|
|
if (null == allPowerConsumption) {
|
|
allPowerConsumption = 0.0;
|
|
allPowerConsumption = 0.0;
|
|
}
|
|
}
|
|
@@ -113,7 +117,7 @@ public class ICenterMiddlewareWebServiceImp implements ICenterMiddlewareWebServi
|
|
dateGraphItemVOList.add(dateGraphItemVO);
|
|
dateGraphItemVOList.add(dateGraphItemVO);
|
|
}
|
|
}
|
|
Double allEer = null;
|
|
Double allEer = null;
|
|
- if (allCoolingCapacity != null && allPowerConsumption != null) {
|
|
|
|
|
|
+ if (allCoolingCapacity != null && allPowerConsumption != null && allPowerConsumption != 0.0) {
|
|
allEer = allCoolingCapacity / allPowerConsumption;
|
|
allEer = allCoolingCapacity / allPowerConsumption;
|
|
}
|
|
}
|
|
projectEERDataVo.setProjectId(pjId);
|
|
projectEERDataVo.setProjectId(pjId);
|
|
@@ -153,18 +157,7 @@ public class ICenterMiddlewareWebServiceImp implements ICenterMiddlewareWebServi
|
|
private TreeMap<Date, Double> getDayCountData(String pjId, String groupCode, Date reportDate, String infoCode, List<String> classCodeList, List<Date> dateList) {
|
|
private TreeMap<Date, Double> getDayCountData(String pjId, String groupCode, Date reportDate, String infoCode, List<String> classCodeList, List<Date> dateList) {
|
|
List<String> objectIdList = getObjectIdList(pjId, groupCode, classCodeList);
|
|
List<String> objectIdList = getObjectIdList(pjId, groupCode, classCodeList);
|
|
if (!CollectionUtils.isEmpty(objectIdList)) {
|
|
if (!CollectionUtils.isEmpty(objectIdList)) {
|
|
- TreeMap<Date, Double> date_dataMap = new TreeMap<>();
|
|
|
|
- TreeMap<Date, Double> day_coolDataMap = getInfoCodePeriodDataCountMap(pjId, groupCode, objectIdList, reportDate, infoCode, "1d");
|
|
|
|
- for (Date date : dateList) {
|
|
|
|
- Double currentDayCoolData = day_coolDataMap.get(date);
|
|
|
|
- Double nextDayCoolData = day_coolDataMap.get(DateUtils.getDayOff(date, 1));
|
|
|
|
- if (currentDayCoolData != null && nextDayCoolData != null) {
|
|
|
|
- date_dataMap.put(date, nextDayCoolData - currentDayCoolData);
|
|
|
|
- } else {
|
|
|
|
- date_dataMap.put(date, null);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- return date_dataMap;
|
|
|
|
|
|
+ return getInfoCodePeriodDataCountMap(pjId, groupCode, objectIdList, reportDate, infoCode, "1d",dateList);
|
|
}
|
|
}
|
|
return new TreeMap<>();
|
|
return new TreeMap<>();
|
|
}
|
|
}
|
|
@@ -195,7 +188,7 @@ public class ICenterMiddlewareWebServiceImp implements ICenterMiddlewareWebServi
|
|
return resultList;
|
|
return resultList;
|
|
}
|
|
}
|
|
|
|
|
|
- private TreeMap<Date, Double> getInfoCodePeriodDataCountMap(String pjId, String groupCode, List<String> objectIdList, Date reportDate, String infoCode, String period) {
|
|
|
|
|
|
+ private TreeMap<Date, Double> getInfoCodePeriodDataCountMap(String pjId, String groupCode, List<String> objectIdList, Date reportDate, String infoCode, String period, List<Date> dateList) {
|
|
if (StringUtils.isEmpty(pjId) || StringUtils.isEmpty(groupCode) || CollectionUtils.isEmpty(objectIdList) || null == reportDate) {
|
|
if (StringUtils.isEmpty(pjId) || StringUtils.isEmpty(groupCode) || CollectionUtils.isEmpty(objectIdList) || null == reportDate) {
|
|
log.info("查询历史数据时参数为空,故不进行查询");
|
|
log.info("查询历史数据时参数为空,故不进行查询");
|
|
return new TreeMap<>();
|
|
return new TreeMap<>();
|
|
@@ -229,16 +222,27 @@ public class ICenterMiddlewareWebServiceImp implements ICenterMiddlewareWebServi
|
|
if (CollectionUtils.isEmpty(periodDataInfoVOList)) {
|
|
if (CollectionUtils.isEmpty(periodDataInfoVOList)) {
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
|
|
+ // 每个设备每天的数据
|
|
|
|
+ Map<Date, Double> day_coolDataMap = new TreeMap<>();
|
|
for (PeriodDataInfoVO vo : periodDataInfoVOList) {
|
|
for (PeriodDataInfoVO vo : periodDataInfoVOList) {
|
|
if (null == vo.getData_value() || StringUtils.isEmpty(vo.getData_time())) {
|
|
if (null == vo.getData_value() || StringUtils.isEmpty(vo.getData_time())) {
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
- Double data = dataMap.get(DateUtils.str2Date(vo.getData_time(), DateUtils.SDFSECOND));
|
|
|
|
- if (null == data) {
|
|
|
|
- data = 0.0;
|
|
|
|
|
|
+ day_coolDataMap.put(DateUtils.str2Date(vo.getData_time(), DateUtils.SDFSECOND), vo.getData_value());
|
|
|
|
+ }
|
|
|
|
+ for (Date date : dateList) {
|
|
|
|
+ Double currentDayCoolData = day_coolDataMap.get(date);
|
|
|
|
+ Double nextDayCoolData = day_coolDataMap.get(DateUtils.getDayOff(date, 1));
|
|
|
|
+ Double allCool = dataMap.get(date);
|
|
|
|
+ if (allCool == null) {
|
|
|
|
+ allCool = 0.0;
|
|
|
|
+ }
|
|
|
|
+ Double cool = 0.0;
|
|
|
|
+ if (currentDayCoolData != null && nextDayCoolData != null) {
|
|
|
|
+ cool = nextDayCoolData - currentDayCoolData;
|
|
}
|
|
}
|
|
- data = data + vo.getData_value();
|
|
|
|
- dataMap.put(DateUtils.str2Date(vo.getData_time(), DateUtils.SDFSECOND), data);
|
|
|
|
|
|
+ allCool = allCool + cool;
|
|
|
|
+ dataMap.put(date, allCool);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|