|
@@ -14,6 +14,7 @@ import com.gyee.impala.model.master.Windturbinepoint;
|
|
|
import com.gyee.impala.service.master.CaseperformanceService;
|
|
|
import com.gyee.impala.service.master.WindturbinepointService;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.scheduling.annotation.Scheduled;
|
|
|
import org.springframework.stereotype.Component;
|
|
@@ -26,7 +27,7 @@ import java.util.List;
|
|
|
/**
|
|
|
* 基于欠发矩阵的统计
|
|
|
*/
|
|
|
-//@Component
|
|
|
+@Component
|
|
|
@Slf4j
|
|
|
public class TaskPerformance {
|
|
|
|
|
@@ -43,7 +44,7 @@ public class TaskPerformance {
|
|
|
private CaseperformanceService performanceService;
|
|
|
|
|
|
|
|
|
- @Scheduled(initialDelay = 10 * 1000, fixedRate = 2 * 86400000 * 1000)
|
|
|
+// @Scheduled(initialDelay = 10 * 1000, fixedRate = 2 * 86400000 * 1000)
|
|
|
// @Scheduled(cron = "0 40 2 * * ?")
|
|
|
public void performanceNSS(){
|
|
|
if (InitialRunner.wpMap.size() == 0)
|
|
@@ -71,21 +72,23 @@ public class TaskPerformance {
|
|
|
cal.setTime(new Date(time));
|
|
|
cal.add(Calendar.DATE, 30);
|
|
|
long et = cal.getTimeInMillis();
|
|
|
- /********************** Golden读取原始数据 ******************************/
|
|
|
- List<TsDoubleData> zsData = remoteService.adapter().getHistorySnapAI(wp_zs.get(0).getPoint(), st, et, interval);
|
|
|
- List<TsDoubleData> ztData = remoteService.adapter().getHistorySnapAI(wp_zt.get(0).getPoint(), st, et, interval);
|
|
|
- List<TsDoubleData> qfData = remoteService.adapter().getHistorySnapAI(wp_qf.get(0).getPoint(), st, et, interval);
|
|
|
- List<TsDoubleData> jdData = remoteService.adapter().getHistorySnapAI(wp_jy.get(0).getPoint(), st, et, interval);
|
|
|
- List<TsDoubleData> xdData = remoteService.adapter().getHistorySnapAI(wp_xd.get(0).getPoint(), st, et, interval);
|
|
|
- /********************** Golden读取原始数据 ******************************/
|
|
|
+ if (wp_zs.size() > 0 || wp_zt.size() > 0 && wp_qf.size() > 0 && wp_jy.size()>0 && wp_xd.size() > 0){
|
|
|
+ /********************** Golden读取原始数据 ******************************/
|
|
|
+ List<TsDoubleData> zsData = remoteService.adapter().getHistorySnapAI(wp_zs.get(0).getPoint(), st, et, interval);
|
|
|
+ List<TsDoubleData> ztData = remoteService.adapter().getHistorySnapAI(wp_zt.get(0).getPoint(), st, et, interval);
|
|
|
+ List<TsDoubleData> qfData = remoteService.adapter().getHistorySnapAI(wp_qf.get(0).getPoint(), st, et, interval);
|
|
|
+ List<TsDoubleData> jdData = remoteService.adapter().getHistorySnapAI(wp_jy.get(0).getPoint(), st, et, interval);
|
|
|
+ List<TsDoubleData> xdData = remoteService.adapter().getHistorySnapAI(wp_xd.get(0).getPoint(), st, et, interval);
|
|
|
+ /********************** Golden读取原始数据 ******************************/
|
|
|
|
|
|
- /** 分析保存至kudu*/
|
|
|
- saveCasePerformance(wt, k, zsData, ztData, qfData, jdData, xdData);
|
|
|
- time = et;
|
|
|
- try {
|
|
|
- Thread.sleep(1000);
|
|
|
- } catch (InterruptedException e) {
|
|
|
- e.printStackTrace();
|
|
|
+ /** 分析保存至kudu*/
|
|
|
+ saveCasePerformance(wt, k, zsData, ztData, qfData, jdData, xdData);
|
|
|
+ time = et;
|
|
|
+ try {
|
|
|
+ Thread.sleep(5000);
|
|
|
+ } catch (InterruptedException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
} catch (Exception e){
|