|
|
|
@ -168,25 +168,30 @@ public class HydroelectricServiceImpl implements HydroelectricService {
|
|
|
|
|
device.setStartupDurationYear(-1.0); |
|
|
|
|
device.setShutDownDurationYear(-1.0); |
|
|
|
|
} |
|
|
|
|
// 开停机数据
|
|
|
|
|
Optional<StartStopTimeVO> startStop = startStopTimes.stream().filter(o->iter.getEmCode().equals(o.getDeviceCode())).findFirst(); |
|
|
|
|
if(startStop.isPresent()){ |
|
|
|
|
if(startStop.get().getQuality() == 0){ |
|
|
|
|
Date time; |
|
|
|
|
if(startStop.get().getTime().contains(".000")){ |
|
|
|
|
time = DateUtil.parse(startStop.get().getTime(), "yyyy-MM-dd HH:mm:ss.sss"); |
|
|
|
|
if(CollectionUtil.isEmpty(startStopTimes)){ |
|
|
|
|
device.setStartDownTime("-1"); |
|
|
|
|
device.setStartupDownDuration(-1.0); |
|
|
|
|
}else{ |
|
|
|
|
// 开停机数据
|
|
|
|
|
Optional<StartStopTimeVO> startStop = startStopTimes.stream().filter(o->iter.getEmCode().equals(o.getDeviceCode())).findFirst(); |
|
|
|
|
if(startStop.isPresent()){ |
|
|
|
|
if(startStop.get().getQuality() == 0){ |
|
|
|
|
Date time; |
|
|
|
|
if(startStop.get().getTime().contains(".000")){ |
|
|
|
|
time = DateUtil.parse(startStop.get().getTime(), "yyyy-MM-dd HH:mm:ss.sss"); |
|
|
|
|
}else{ |
|
|
|
|
time = DateUtil.parse(startStop.get().getTime(), DateUtil.PATTERN_DATETIME); |
|
|
|
|
} |
|
|
|
|
device.setStartDownTime(DateUtil.format(time,DateUtil.PATTERN_DATETIME)); |
|
|
|
|
device.setStartupDownDuration(BigDecimal.valueOf((System.currentTimeMillis() - time.getTime()) / (1000 * 60 * 60.00)).setScale(2, RoundingMode.HALF_UP).doubleValue()); |
|
|
|
|
}else{ |
|
|
|
|
time = DateUtil.parse(startStop.get().getTime(), DateUtil.PATTERN_DATETIME); |
|
|
|
|
device.setStartDownTime("-1"); |
|
|
|
|
device.setStartupDownDuration(-1.0); |
|
|
|
|
} |
|
|
|
|
device.setStartDownTime(DateUtil.format(time,DateUtil.PATTERN_DATETIME)); |
|
|
|
|
device.setStartupDownDuration(BigDecimal.valueOf((System.currentTimeMillis() - time.getTime()) / (1000 * 60 * 60.00)).setScale(2, RoundingMode.HALF_UP).doubleValue()); |
|
|
|
|
}else{ |
|
|
|
|
device.setStartDownTime("-1"); |
|
|
|
|
device.setStartupDownDuration(-1.0); |
|
|
|
|
} |
|
|
|
|
}else{ |
|
|
|
|
device.setStartDownTime("-1"); |
|
|
|
|
device.setStartupDownDuration(-1.0); |
|
|
|
|
} |
|
|
|
|
return device; |
|
|
|
|
}).collect(Collectors.toList())); |
|
|
|
|