|
|
@ -168,25 +168,30 @@ public class HydroelectricServiceImpl implements HydroelectricService { |
|
|
|
device.setStartupDurationYear(-1.0); |
|
|
|
device.setStartupDurationYear(-1.0); |
|
|
|
device.setShutDownDurationYear(-1.0); |
|
|
|
device.setShutDownDurationYear(-1.0); |
|
|
|
} |
|
|
|
} |
|
|
|
// 开停机数据
|
|
|
|
if(CollectionUtil.isEmpty(startStopTimes)){ |
|
|
|
Optional<StartStopTimeVO> startStop = startStopTimes.stream().filter(o->iter.getEmCode().equals(o.getDeviceCode())).findFirst(); |
|
|
|
device.setStartDownTime("-1"); |
|
|
|
if(startStop.isPresent()){ |
|
|
|
device.setStartupDownDuration(-1.0); |
|
|
|
if(startStop.get().getQuality() == 0){ |
|
|
|
}else{ |
|
|
|
Date time; |
|
|
|
// 开停机数据
|
|
|
|
if(startStop.get().getTime().contains(".000")){ |
|
|
|
Optional<StartStopTimeVO> startStop = startStopTimes.stream().filter(o->iter.getEmCode().equals(o.getDeviceCode())).findFirst(); |
|
|
|
time = DateUtil.parse(startStop.get().getTime(), "yyyy-MM-dd HH:mm:ss.sss"); |
|
|
|
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{ |
|
|
|
}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{ |
|
|
|
}else{ |
|
|
|
device.setStartDownTime("-1"); |
|
|
|
device.setStartDownTime("-1"); |
|
|
|
device.setStartupDownDuration(-1.0); |
|
|
|
device.setStartupDownDuration(-1.0); |
|
|
|
} |
|
|
|
} |
|
|
|
}else{ |
|
|
|
|
|
|
|
device.setStartDownTime("-1"); |
|
|
|
|
|
|
|
device.setStartupDownDuration(-1.0); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
return device; |
|
|
|
return device; |
|
|
|
}).collect(Collectors.toList())); |
|
|
|
}).collect(Collectors.toList())); |
|
|
|