|
@@ -160,19 +160,19 @@ public class TaskWindturbineStateTime {
|
|
|
return faultCodes;
|
|
|
}
|
|
|
|
|
|
- @Scheduled(cron = "0 */3 * * * ?")
|
|
|
+ @Scheduled(cron = "0 */30 * * * ?")
|
|
|
public void getFaultTime() {
|
|
|
- if (count == 0) {
|
|
|
+ /*if (count == 0) {
|
|
|
count++;
|
|
|
Calendar oldday = Calendar.getInstance();
|
|
|
oldday.add(Calendar.MONTH, -16);
|
|
|
getGZTime(oldday);
|
|
|
- } else {
|
|
|
+ } else {*/
|
|
|
Calendar oldday = Calendar.getInstance();
|
|
|
oldday.add(Calendar.HOUR, -10);
|
|
|
getGZTime4(oldday);
|
|
|
getGZTime5(oldday);
|
|
|
- }
|
|
|
+ //}
|
|
|
/*for (int i = 0; i > -922; i--) {
|
|
|
Calendar thisDay = Calendar.getInstance();
|
|
|
thisDay.add(Calendar.DATE, i - 1);
|
|
@@ -190,20 +190,27 @@ public class TaskWindturbineStateTime {
|
|
|
}
|
|
|
}*/
|
|
|
|
|
|
- }
|
|
|
+ }
|
|
|
|
|
|
+ /**
|
|
|
+ * 2MW连续无故障计算
|
|
|
+ * @param oldday
|
|
|
+ */
|
|
|
private void getGZTime4(Calendar oldday) {
|
|
|
Calendar today = Calendar.getInstance();
|
|
|
List<WindTurbineTestingPointAi2> wttpai2s = getStandbyCodes();
|
|
|
wttpai2s=wttpai2s.stream().filter(wttpai2->wttpai2.getModel().equals("CCWE-1500") || wttpai2.getModel().equals("UP105")).collect(Collectors.toList());
|
|
|
for (WindTurbineTestingPointAi2 wttpai2 : wttpai2s) {
|
|
|
+ if(wttpai2.getWindturbineid().equals("SG01_99")){
|
|
|
+ System.out.println();
|
|
|
+ }
|
|
|
List<TsPointData> historyRaw = remoteServiceBuilder.ShardingService().getHistoryRaw(wttpai2.getId(), oldday.getTime().getTime(), today.getTime().getTime());
|
|
|
historyRaw = historyRaw.stream().sorted(Comparator.comparing(TsPointData::getTs).reversed()).collect(Collectors.toList());
|
|
|
|
|
|
long duration = 0;//故障时间
|
|
|
long noduration = 0;//无故障运行时间
|
|
|
Date nodurationtime = new Date();//最近真故障(超过3小时)解除时间
|
|
|
- long faultTime = historyRaw.get(0).getTs();
|
|
|
+ long faultTime = Calendar.getInstance().getTimeInMillis();
|
|
|
//测点列表
|
|
|
for (TsPointData tsPointData : historyRaw) {
|
|
|
//点值
|
|
@@ -220,7 +227,7 @@ public class TaskWindturbineStateTime {
|
|
|
noduration = today.getTime().getTime() - faultTime;
|
|
|
break;
|
|
|
}
|
|
|
- faultTime = tsPointData.getTs();
|
|
|
+ //faultTime = tsPointData.getTs();
|
|
|
}else {
|
|
|
faultTime = tsPointData.getTs();
|
|
|
continue;
|
|
@@ -251,6 +258,10 @@ public class TaskWindturbineStateTime {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 1.5MW连续无故障计算
|
|
|
+ * @param oldday
|
|
|
+ */
|
|
|
private void getGZTime5(Calendar oldday) {
|
|
|
Calendar today = Calendar.getInstance();
|
|
|
List<WindTurbineTestingPointDi2> wttpdi2s = getZgzCodes();
|
|
@@ -261,7 +272,7 @@ public class TaskWindturbineStateTime {
|
|
|
long duration = 0;//故障时间
|
|
|
long noduration = 0;//无故障运行时间
|
|
|
Date nodurationtime = new Date();//最近真故障(超过3小时)解除时间
|
|
|
- long faultTime = historyRaw.get(0).getTs();
|
|
|
+ long faultTime = Calendar.getInstance().getTimeInMillis();
|
|
|
//测点列表
|
|
|
for (TsPointData tsPointData : historyRaw) {
|
|
|
//点值
|
|
@@ -279,7 +290,7 @@ public class TaskWindturbineStateTime {
|
|
|
noduration = today.getTime().getTime() - faultTime;
|
|
|
break;
|
|
|
}
|
|
|
- faultTime = tsPointData.getTs();
|
|
|
+ //faultTime = tsPointData.getTs();
|
|
|
}
|
|
|
}
|
|
|
if (noduration == 0) {
|