|
@@ -1,20 +1,27 @@
|
|
package com.gyee.wisdom.alarm.schedule.controller;
|
|
package com.gyee.wisdom.alarm.schedule.controller;
|
|
|
|
|
|
-import com.gyee.wisdom.alarm.schedule.entity.AlarmCount;
|
|
|
|
-import com.gyee.wisdom.alarm.schedule.entity.EarlyReport;
|
|
|
|
|
|
+import com.gyee.wisdom.alarm.schedule.biz.EarlyReportBiz;
|
|
|
|
+import com.gyee.wisdom.alarm.schedule.biz.EarlyReportTask;
|
|
|
|
+import com.gyee.wisdom.alarm.schedule.entity.*;
|
|
|
|
+import com.gyee.wisdom.alarm.schedule.job.AlarmCountHandler;
|
|
|
|
+import com.gyee.wisdom.alarm.schedule.job.EarlyReportHandler;
|
|
|
|
+import com.gyee.wisdom.alarm.schedule.job.TablesManagerHandler;
|
|
import com.gyee.wisdom.alarm.schedule.mapper.AlarmCountMapper;
|
|
import com.gyee.wisdom.alarm.schedule.mapper.AlarmCountMapper;
|
|
import com.gyee.wisdom.alarm.schedule.mapper.EarlyReportMapper;
|
|
import com.gyee.wisdom.alarm.schedule.mapper.EarlyReportMapper;
|
|
|
|
+import com.gyee.wisdom.alarm.schedule.model.EarlyReportParam;
|
|
|
|
+import com.gyee.wisdom.alarm.schedule.model.TaskResult;
|
|
import com.gyee.wisdom.alarm.schedule.service.AlarmCountService;
|
|
import com.gyee.wisdom.alarm.schedule.service.AlarmCountService;
|
|
import com.gyee.wisdom.alarm.schedule.service.AlarmSnapService;
|
|
import com.gyee.wisdom.alarm.schedule.service.AlarmSnapService;
|
|
|
|
+import com.gyee.wisdom.alarm.schedule.service.TestService;
|
|
|
|
+import com.gyee.wisdom.alarm.schedule.util.SpringContextUtils;
|
|
import com.gyee.wisdom.common.utils.DateUtil;
|
|
import com.gyee.wisdom.common.utils.DateUtil;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
-import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import java.util.Arrays;
|
|
import java.util.Arrays;
|
|
import java.util.Date;
|
|
import java.util.Date;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
+import java.util.concurrent.FutureTask;
|
|
|
|
|
|
/**
|
|
/**
|
|
* @description:
|
|
* @description:
|
|
@@ -47,9 +54,44 @@ public class EarlyReportController {
|
|
}
|
|
}
|
|
@GetMapping("/test")
|
|
@GetMapping("/test")
|
|
public List<AlarmCount> getAlarmCountTest() {
|
|
public List<AlarmCount> getAlarmCountTest() {
|
|
- List<String> longs = Arrays.asList("964545037092659206", "697500304987389955");
|
|
|
|
- List<AlarmCount> alarmCount = alarmCountService.getAlarmCount(longs, null, null);
|
|
|
|
|
|
|
|
- return alarmCount;
|
|
|
|
|
|
+ EarlyReportBiz bean = SpringContextUtils.getBean(EarlyReportBiz.class);
|
|
|
|
+ List<AlertRule2> alertRule2 = bean.getAlertRule2(Arrays.asList("JN2165", "JN2148","JN2137"));
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @GetMapping("/test2")
|
|
|
|
+ public List<Test> postgresqlTest() {
|
|
|
|
+
|
|
|
|
+ EarlyReportBiz bean1 = SpringContextUtils.getBean(EarlyReportBiz.class);
|
|
|
|
+ bean1.getAlertRule2(Arrays.asList("HD01","HD02"));
|
|
|
|
+
|
|
|
|
+ TestService bean2 = SpringContextUtils.getBean(TestService.class);
|
|
|
|
+ List<Test> list = bean2.list();
|
|
|
|
+
|
|
|
|
+ return list;
|
|
|
|
+ }
|
|
|
|
+ @PostMapping("/stat")
|
|
|
|
+ public String alarmCountStat(@RequestBody EarlyReportParam reportParam){
|
|
|
|
+ // AlarmCountHandler bean = SpringContextUtils.getBean(AlarmCountHandler.class);
|
|
|
|
+ // bean.alarmCountStat();
|
|
|
|
+
|
|
|
|
+ EarlyReportTask task = new EarlyReportTask(reportParam);
|
|
|
|
+ FutureTask<TaskResult> ft = new FutureTask<>(task);
|
|
|
|
+ new Thread(ft).start();
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ return "123";
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @GetMapping("/addTable")
|
|
|
|
+ public String addTable(){
|
|
|
|
+ TablesManagerHandler bean = SpringContextUtils.getBean(TablesManagerHandler.class);
|
|
|
|
+ bean.AddAlarmHistoryTable();
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ return "123";
|
|
}
|
|
}
|
|
}
|
|
}
|