|
@@ -46,25 +46,25 @@ public class EarlyReportHandler {
|
|
|
* @author Wanghs
|
|
|
* @description 生成风机诊断报告方法
|
|
|
* xxl-job参数为json格式
|
|
|
- *
|
|
|
+ * <p>
|
|
|
* {
|
|
|
- * "reportName":"主轴隐患感知",
|
|
|
- * "windturbineParts":"CLX",
|
|
|
- * "interval": 7,
|
|
|
- * "customRuleId":
|
|
|
- * [
|
|
|
- * "ZX051NSSUP82",
|
|
|
- * "ZX534NSSUP82",
|
|
|
- * "ZX085NSSUP82"
|
|
|
- * ],
|
|
|
- * "windturbineRuleId":
|
|
|
- * [],
|
|
|
- * "resultLimit": 3,
|
|
|
- * "stationId": "NSS_FDC",
|
|
|
- * "model": "UP82"
|
|
|
+ * "reportName":"主轴隐患感知",
|
|
|
+ * "windturbineParts":"CLX",
|
|
|
+ * "interval": 7,
|
|
|
+ * "customRuleId":
|
|
|
+ * [
|
|
|
+ * "ZX051NSSUP82",
|
|
|
+ * "ZX534NSSUP82",
|
|
|
+ * "ZX085NSSUP82"
|
|
|
+ * ],
|
|
|
+ * "windturbineRuleId":
|
|
|
+ * [],
|
|
|
+ * "resultLimit": 3,
|
|
|
+ * "stationId": "NSS_FDC",
|
|
|
+ * "model": "UP82"
|
|
|
* }
|
|
|
- *
|
|
|
- *
|
|
|
+ * <p>
|
|
|
+ * <p>
|
|
|
* customRuleId为自定义报警规则id 对应alertrule2
|
|
|
* windturbineRuleId风机报警id 对应warning2
|
|
|
* interval 为分析时间区间,执行时以当天0点,前推相应天数
|
|
@@ -73,13 +73,9 @@ public class EarlyReportHandler {
|
|
|
* @date 2022/7/26
|
|
|
**/
|
|
|
@XxlJob("earlyReport")
|
|
|
- public ReturnT<String> alarmCountStat() throws InterruptedException {
|
|
|
-
|
|
|
+ public void alarmCountStat() {
|
|
|
String param = XxlJobHelper.getJobParam();
|
|
|
-
|
|
|
EarlyReportParam reportParam = JSON.parseObject(param, EarlyReportParam.class);
|
|
|
- ReturnT t = null;
|
|
|
-
|
|
|
try {
|
|
|
TaskResult result = null;
|
|
|
EarlyReportTask task = new EarlyReportTask(reportParam);
|
|
@@ -87,20 +83,14 @@ public class EarlyReportHandler {
|
|
|
new Thread(ft).start();
|
|
|
result = ft.get();
|
|
|
if (result.isSuccess()) {
|
|
|
- t = new ReturnT<String>(ReturnT.SUCCESS_CODE, "执行成功");
|
|
|
- t.setContent(result);
|
|
|
+ XxlJobHelper.log("诊断报告调度任务执行成功");
|
|
|
+ XxlJobHelper.handleFail("诊断报告调度任务执行成功");
|
|
|
} else {
|
|
|
- t = new ReturnT<String>(ReturnT.FAIL_CODE, "执行失败");
|
|
|
- t.setContent(result);
|
|
|
- }
|
|
|
- } catch (ExecutionException e) {
|
|
|
- t = new ReturnT<String>(ReturnT.FAIL_CODE, "执行失败");
|
|
|
- t.setContent(e.getStackTrace());
|
|
|
- e.printStackTrace();
|
|
|
- } finally {
|
|
|
- XxlJobHelper.log(JSON.toJSONString(t));
|
|
|
- return t;
|
|
|
|
|
|
+ XxlJobHelper.handleFail(JSON.toJSONString(result.getMsg()));
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ XxlJobHelper.handleFail(JSON.toJSONString(e.getStackTrace()));
|
|
|
}
|
|
|
|
|
|
|