|
|
|
@ -15,15 +15,12 @@ import com.mh.system.mapper.SysDictDataMapper; |
|
|
|
import com.mh.system.mapper.device.CollectionParamsManageMapper; |
|
|
|
import com.mh.system.mapper.device.CollectionParamsManageMapper; |
|
|
|
import com.mh.system.mapper.energy.OverviewMapper; |
|
|
|
import com.mh.system.mapper.energy.OverviewMapper; |
|
|
|
import com.mh.system.service.overview.IProOverviewService; |
|
|
|
import com.mh.system.service.overview.IProOverviewService; |
|
|
|
import lombok.Getter; |
|
|
|
|
|
|
|
import lombok.Setter; |
|
|
|
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
|
|
|
import java.math.BigDecimal; |
|
|
|
import java.math.BigDecimal; |
|
|
|
import java.math.RoundingMode; |
|
|
|
import java.math.RoundingMode; |
|
|
|
import java.time.LocalDate; |
|
|
|
import java.time.LocalDate; |
|
|
|
import java.time.LocalDateTime; |
|
|
|
import java.time.LocalDateTime; |
|
|
|
import java.time.ZoneId; |
|
|
|
|
|
|
|
import java.time.temporal.TemporalAdjusters; |
|
|
|
import java.time.temporal.TemporalAdjusters; |
|
|
|
import java.util.*; |
|
|
|
import java.util.*; |
|
|
|
import java.util.concurrent.CompletableFuture; |
|
|
|
import java.util.concurrent.CompletableFuture; |
|
|
|
@ -93,6 +90,86 @@ public class ProOverviewServiceImpl implements IProOverviewService { |
|
|
|
// return null;
|
|
|
|
// return null;
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public List<?> getCoe() { |
|
|
|
|
|
|
|
//todo 系统能效系数、主机能效、冷冻泵输送系数、冷却泵输送系数、冷却塔输送系数
|
|
|
|
|
|
|
|
List<Map<String, Object>> instantData = overviewMapper.selectLastCap(); |
|
|
|
|
|
|
|
//筛选系统用电量
|
|
|
|
|
|
|
|
BigDecimal cap = new BigDecimal(0); |
|
|
|
|
|
|
|
BigDecimal sysEle = new BigDecimal(0); |
|
|
|
|
|
|
|
BigDecimal chillerEle = new BigDecimal(0); |
|
|
|
|
|
|
|
BigDecimal chillPumpEle = new BigDecimal(0); |
|
|
|
|
|
|
|
BigDecimal coolPumpEle = new BigDecimal(0); |
|
|
|
|
|
|
|
BigDecimal towerEle = new BigDecimal(0); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (Map<String, Object> val : instantData) { |
|
|
|
|
|
|
|
String name = (String) val.get("name"); |
|
|
|
|
|
|
|
if (name == null) { |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
BigDecimal value = (BigDecimal) val.get("value"); |
|
|
|
|
|
|
|
if (value == null) { |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
Date time = (Date) val.get("time"); |
|
|
|
|
|
|
|
boolean today = DateUtils.isToday(time); |
|
|
|
|
|
|
|
if (!today) { |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (name.contains("系统")) { |
|
|
|
|
|
|
|
// 系统
|
|
|
|
|
|
|
|
sysEle = sysEle.add(value); |
|
|
|
|
|
|
|
} else if (name.contains("主机")) { |
|
|
|
|
|
|
|
// 主机
|
|
|
|
|
|
|
|
chillerEle = chillerEle.add(value); |
|
|
|
|
|
|
|
} else if (name.contains("冷冻泵")) { |
|
|
|
|
|
|
|
// 冷冻泵
|
|
|
|
|
|
|
|
chillPumpEle = chillPumpEle.add(value); |
|
|
|
|
|
|
|
} else if (name.contains("冷却泵")) { |
|
|
|
|
|
|
|
// 冷却泵
|
|
|
|
|
|
|
|
coolPumpEle = coolPumpEle.add(value); |
|
|
|
|
|
|
|
} else if (name.contains("冷却塔")) { |
|
|
|
|
|
|
|
// 冷却塔
|
|
|
|
|
|
|
|
towerEle = towerEle.add(value); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
Map<String, Object> resultMap = new HashMap<>(); |
|
|
|
|
|
|
|
if (sysEle.compareTo(BigDecimal.ZERO) == 0) { |
|
|
|
|
|
|
|
resultMap.put("sysCoe", 0); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (chillerEle.compareTo(BigDecimal.ZERO) == 0) { |
|
|
|
|
|
|
|
resultMap.put("chillerCoe", 0); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (chillPumpEle.compareTo(BigDecimal.ZERO) == 0) { |
|
|
|
|
|
|
|
resultMap.put("chillPumpCoe", 0); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (coolPumpEle.compareTo(BigDecimal.ZERO) == 0) { |
|
|
|
|
|
|
|
resultMap.put("coolPumpCoe", 0); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (towerEle.compareTo(BigDecimal.ZERO) == 0) { |
|
|
|
|
|
|
|
resultMap.put("towerCoe", 0); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (sysEle.compareTo(BigDecimal.ZERO) != 0) { |
|
|
|
|
|
|
|
resultMap.put("sysCoe", cap.divide(sysEle, 2, RoundingMode.HALF_UP)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (chillerEle.compareTo(BigDecimal.ZERO) != 0) { |
|
|
|
|
|
|
|
resultMap.put("chillerCoe", cap.divide(chillerEle, 2, RoundingMode.HALF_UP)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (chillPumpEle.compareTo(BigDecimal.ZERO) != 0) { |
|
|
|
|
|
|
|
resultMap.put("chillPumpCoe", cap.divide(chillPumpEle, 2, RoundingMode.HALF_UP)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (coolPumpEle.compareTo(BigDecimal.ZERO) != 0) { |
|
|
|
|
|
|
|
resultMap.put("coolPumpCoe", cap.divide(coolPumpEle, 2, RoundingMode.HALF_UP)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (towerEle.compareTo(BigDecimal.ZERO) != 0) { |
|
|
|
|
|
|
|
resultMap.put("towerCoe", cap.divide(towerEle, 2, RoundingMode.HALF_UP)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return List.of(resultMap); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public List<?> ersDatas(String systemType) { |
|
|
|
public List<?> ersDatas(String systemType) { |
|
|
|
// 从collection_params_manage、device_ledger中查询数据,获取device_ledger.device_name,order_num,system_type,device_type
|
|
|
|
// 从collection_params_manage、device_ledger中查询数据,获取device_ledger.device_name,order_num,system_type,device_type
|
|
|
|
|