|
@@ -12,6 +12,7 @@ import com.gyee.impala.model.custom.diagnose.FaultInfo;
|
|
import com.gyee.impala.model.custom.diagnose.PointData;
|
|
import com.gyee.impala.model.custom.diagnose.PointData;
|
|
import com.gyee.impala.model.master.diagnose.Diagnosepoint;
|
|
import com.gyee.impala.model.master.diagnose.Diagnosepoint;
|
|
import com.gyee.impala.model.master.diagnose.Diagnosereport;
|
|
import com.gyee.impala.model.master.diagnose.Diagnosereport;
|
|
|
|
+import com.gyee.impala.service.custom.diagnose.AutoCmdService;
|
|
import com.gyee.impala.service.custom.diagnose.DataPointService;
|
|
import com.gyee.impala.service.custom.diagnose.DataPointService;
|
|
import com.gyee.impala.service.custom.diagnose.DataService;
|
|
import com.gyee.impala.service.custom.diagnose.DataService;
|
|
import com.gyee.impala.service.master.diagnose.DiagnosereportService;
|
|
import com.gyee.impala.service.master.diagnose.DiagnosereportService;
|
|
@@ -32,6 +33,8 @@ public class AutoFaultController {
|
|
private SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
private SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
|
@Resource
|
|
@Resource
|
|
|
|
+ private AutoCmdService autoCmdService;
|
|
|
|
+ @Resource
|
|
private DataService dataService;
|
|
private DataService dataService;
|
|
@Resource
|
|
@Resource
|
|
private DataPointService dataPointService;
|
|
private DataPointService dataPointService;
|
|
@@ -144,6 +147,25 @@ public class AutoFaultController {
|
|
return JsonResult.successData(ResultCode.SUCCESS, list);
|
|
return JsonResult.successData(ResultCode.SUCCESS, list);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ * 在线测试 调用训练的脚本
|
|
|
|
+ * @param faultid
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @GetMapping("/test/{faultid}")
|
|
|
|
+ public JSONObject test(@PathVariable long faultid) {
|
|
|
|
+ List<FaultInfo> fis = shardingBuilder.sharding().getFaultHistoryById(faultid + "");
|
|
|
|
+ if (fis == null || fis.size() <= 0) {
|
|
|
|
+ return JsonResult.error(ResultCode.ERROR_DATA);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ FaultInfo fi = fis.get(0);
|
|
|
|
+ autoCmdService.exec(fi);
|
|
|
|
+ return JsonResult.success(ResultCode.SUCCESS);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
public static void main(String[] args){
|
|
public static void main(String[] args){
|
|
Calendar calendar = Calendar.getInstance();
|
|
Calendar calendar = Calendar.getInstance();
|
|
System.out.println(DateUtil.format(calendar.getTime(), DateUtil.YYYY_MM_DD_HH_MM_SS));
|
|
System.out.println(DateUtil.format(calendar.getTime(), DateUtil.YYYY_MM_DD_HH_MM_SS));
|