|
@@ -42,7 +42,7 @@ public class RealtimeService {
|
|
|
@Resource
|
|
|
private IEdosUtil edosUtil;
|
|
|
|
|
|
- public void saveWindturbineStatus2() {
|
|
|
+ public void saveWindturbineStatus2() throws ParseException {
|
|
|
|
|
|
List<ProEconWindturbineStatus2> resultList = new ArrayList<>();
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
|
|
@@ -53,7 +53,7 @@ public class RealtimeService {
|
|
|
Map<String, Map<String, Windturbinetestingpointai>> wtpAimap = CacheContext.wtpAimap;
|
|
|
|
|
|
Date samedayZero = DateUtils.getSamedayZero();
|
|
|
- Date currentDate = DateUtils.getCurrentDate();
|
|
|
+ Date currentDate = sdf.parse(DateUtils.toDate1(DateUtils.getCurrentDate()));
|
|
|
// Date befroeDate = DateUtils.addSeconds(currentDate, -1);
|
|
|
Date befroeDate = DateUtils.addMinutes(currentDate,-5);
|
|
|
|
|
@@ -81,8 +81,8 @@ public class RealtimeService {
|
|
|
proEconWindturbineStatus2.setWindpowerstationId(wt.getWindpowerstationid());
|
|
|
proEconWindturbineStatus2.setWindturbineId(wt.getId());
|
|
|
|
|
|
- proEconWindturbineStatus2.setStopTime(DateUtils.parseLongToDate(sdf.parse(DateUtils.toDate1(currentDate)).getTime()));
|
|
|
- proEconWindturbineStatus2.setStartTime(DateUtils.parseLongToDate(sdf.parse(DateUtils.toDate1(currentDate)).getTime()));
|
|
|
+ proEconWindturbineStatus2.setStopTime(DateUtils.parseLongToDate(currentDate.getTime()));
|
|
|
+ proEconWindturbineStatus2.setStartTime(DateUtils.parseLongToDate(currentDate.getTime()));
|
|
|
proEconWindturbineStatus2.setStopHours(DateUtils.hoursDiff2(proEconWindturbineStatus2.getStopTime(), proEconWindturbineStatus2.getStartTime()));
|
|
|
proEconWindturbineStatus2.setLossPower(0.0);
|
|
|
proEconWindturbineStatus2.setShutdownEventId("");
|
|
@@ -97,14 +97,14 @@ public class RealtimeService {
|
|
|
|
|
|
QueryWrapper<ProEconWindturbineStatus2> qw = new QueryWrapper<>();
|
|
|
qw.eq("windTurbine_Id",wt.getId());
|
|
|
- Date beforeFive = DateUtils.addMinutes(sdf.parse(DateUtils.toDate1(currentDate)), -5);
|
|
|
+// Date beforeFive = DateUtils.addMinutes(sdf.parse(DateUtils.toDate1(currentDate)), -5);
|
|
|
// String toDate = DateUtils.toDate(beforeFive);
|
|
|
// Date parse = sdf.parse(toDate);
|
|
|
- qw.eq("stop_Time",beforeFive);
|
|
|
+ qw.eq("stop_Time",befroeDate);
|
|
|
Optional<ProEconWindturbineStatus2> first = proEconWindturbineStatus2Service.list(qw).stream().findFirst();
|
|
|
if (first.isPresent()){
|
|
|
ProEconWindturbineStatus2 proEconWindturbineStatus = first.get();
|
|
|
- proEconWindturbineStatus.setStopTime(DateUtils.parseLongToDate(sdf.parse(DateUtils.toDate1(currentDate)).getTime()));
|
|
|
+ proEconWindturbineStatus.setStopTime(DateUtils.parseLongToDate(currentDate.getTime()));
|
|
|
proEconWindturbineStatus.setStopHours(DateUtils.hoursDiff2(proEconWindturbineStatus.getStopTime(), proEconWindturbineStatus.getStartTime()));
|
|
|
proEconWindturbineStatus.setLossPower(0.0);
|
|
|
proEconWindturbineStatus.setSpeed(speed);
|
|
@@ -116,14 +116,14 @@ public class RealtimeService {
|
|
|
}else {
|
|
|
QueryWrapper<ProEconWindturbineStatus2> qw = new QueryWrapper<>();
|
|
|
qw.eq("windTurbine_Id",wt.getId());
|
|
|
- Date beforeFive = DateUtils.addMinutes(sdf.parse(DateUtils.toDate1(currentDate)), -5);
|
|
|
+// Date beforeFive = DateUtils.addMinutes(sdf.parse(DateUtils.toDate1(currentDate)), -5);
|
|
|
// String toDate = DateUtils.toDate(beforeFive);
|
|
|
// Date parse = sdf.parse(toDate);
|
|
|
- qw.eq("stop_Time",beforeFive);
|
|
|
+ qw.eq("stop_Time",befroeDate);
|
|
|
Optional<ProEconWindturbineStatus2> first = proEconWindturbineStatus2Service.list(qw).stream().findFirst();
|
|
|
if (first.isPresent()){
|
|
|
ProEconWindturbineStatus2 proEconWindturbineStatus2 = first.get();
|
|
|
- proEconWindturbineStatus2.setStopTime(DateUtils.parseLongToDate(sdf.parse(DateUtils.toDate1(currentDate)).getTime()));
|
|
|
+ proEconWindturbineStatus2.setStopTime(DateUtils.parseLongToDate(currentDate.getTime()));
|
|
|
proEconWindturbineStatus2.setStopHours(DateUtils.hoursDiff2(proEconWindturbineStatus2.getStopTime(), proEconWindturbineStatus2.getStartTime()));
|
|
|
proEconWindturbineStatus2.setLossPower(0.0);
|
|
|
proEconWindturbineStatus2.setSpeed(speed);
|
|
@@ -135,8 +135,8 @@ public class RealtimeService {
|
|
|
proEconWindturbineStatus2.setId(CommonUtils.getUUID());
|
|
|
proEconWindturbineStatus2.setWindpowerstationId(wt.getWindpowerstationid());
|
|
|
proEconWindturbineStatus2.setWindturbineId(wt.getId());
|
|
|
- proEconWindturbineStatus2.setStopTime(DateUtils.parseLongToDate(sdf.parse(DateUtils.toDate1(currentDate)).getTime()));
|
|
|
- proEconWindturbineStatus2.setStartTime(DateUtils.parseLongToDate(sdf.parse(DateUtils.toDate1(currentDate)).getTime()));
|
|
|
+ proEconWindturbineStatus2.setStopTime(DateUtils.parseLongToDate(currentDate.getTime()));
|
|
|
+ proEconWindturbineStatus2.setStartTime(DateUtils.parseLongToDate(currentDate.getTime()));
|
|
|
proEconWindturbineStatus2.setStopHours(DateUtils.hoursDiff2(proEconWindturbineStatus2.getStopTime(), proEconWindturbineStatus2.getStartTime()));
|
|
|
proEconWindturbineStatus2.setLossPower(0.0);
|
|
|
proEconWindturbineStatus2.setShutdownEventId("");
|