|
@@ -4,6 +4,8 @@ import com.alibaba.fastjson.JSONObject;
|
|
import com.gyee.impala.common.result.JsonResult;
|
|
import com.gyee.impala.common.result.JsonResult;
|
|
import com.gyee.impala.common.result.ResultCode;
|
|
import com.gyee.impala.common.result.ResultCode;
|
|
import com.gyee.impala.common.spring.InitialRunner;
|
|
import com.gyee.impala.common.spring.InitialRunner;
|
|
|
|
+import com.gyee.impala.common.util.DateUtil;
|
|
|
|
+import com.gyee.impala.model.custom.diagnose.DataInfo;
|
|
import com.gyee.impala.model.custom.diagnose.PointData;
|
|
import com.gyee.impala.model.custom.diagnose.PointData;
|
|
import com.gyee.impala.model.master.Casefaultalg;
|
|
import com.gyee.impala.model.master.Casefaultalg;
|
|
import com.gyee.impala.model.master.diagnose.Diagnosetrainhistory;
|
|
import com.gyee.impala.model.master.diagnose.Diagnosetrainhistory;
|
|
@@ -16,6 +18,7 @@ import org.springframework.web.bind.annotation.GetMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
|
+import java.util.Calendar;
|
|
import java.util.HashMap;
|
|
import java.util.HashMap;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
@@ -44,15 +47,26 @@ public class DiagnoseReportController {
|
|
@GetMapping("/item")
|
|
@GetMapping("/item")
|
|
public JSONObject getOne(String id){
|
|
public JSONObject getOne(String id){
|
|
Casefaultalg fault = casefaultalgService.getById(id);
|
|
Casefaultalg fault = casefaultalgService.getById(id);
|
|
- List<Diagnosetrainhistory> info = InitialRunner.historyModelMap.get(fault.getStationen() + "_" + fault.getModel())
|
|
|
|
|
|
+ List<Diagnosetrainhistory> history = InitialRunner.historyModelMap.get(fault.getStationen() + "_" + fault.getModel())
|
|
.stream().filter(a -> a.isEnable()).collect(Collectors.toList());
|
|
.stream().filter(a -> a.isEnable()).collect(Collectors.toList());
|
|
|
|
|
|
- Map<String, List<PointData>> mappoint = diagnosereportService.getpointweightDataList(fault.getStationen(), fault.getModel(), fault.getWindturbineid(), fault.getStarttime(),info.get(0).getPointweight());
|
|
|
|
|
|
+ Calendar cal = Calendar.getInstance();
|
|
|
|
+ DataInfo info = new DataInfo();
|
|
|
|
+ info.setStationId(fault.getStationen());
|
|
|
|
+ info.setModelId(fault.getModel());
|
|
|
|
+ info.setThingId(fault.getWindturbineid());
|
|
|
|
+ info.setFaultType(fault.getDiagnosecode());
|
|
|
|
+ cal.setTime(DateUtil.parseStrtoDate(fault.getStarttime(), DateUtil.YYYY_MM_DD_HH_MM_SS));
|
|
|
|
+ cal.add(Calendar.MINUTE, -10);
|
|
|
|
+ info.setStartTs(cal.getTimeInMillis() + "");
|
|
|
|
+ cal.add(Calendar.MINUTE, 15);
|
|
|
|
+ info.setEndTs(cal.getTimeInMillis() + "");
|
|
|
|
+ Map<String, List<PointData>> mappoint = diagnosereportService.getpointweightDataList(info, history.get(0).getPointweight());
|
|
Map<String, Object> alarm = alarmService.getAlarmTree(fault.getStationen(), fault.getWindturbineid(), fault.getStarttime());
|
|
Map<String, Object> alarm = alarmService.getAlarmTree(fault.getStationen(), fault.getWindturbineid(), fault.getStarttime());
|
|
|
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
Map<String, Object> map = new HashMap<>();
|
|
map.put("fault", fault);
|
|
map.put("fault", fault);
|
|
- map.put("info", info);
|
|
|
|
|
|
+ map.put("info", history);
|
|
map.put("alarm", alarm);
|
|
map.put("alarm", alarm);
|
|
map.put("curve",mappoint);
|
|
map.put("curve",mappoint);
|
|
return JsonResult.successData(ResultCode.SUCCESS, map);
|
|
return JsonResult.successData(ResultCode.SUCCESS, map);
|
|
@@ -69,18 +83,6 @@ public class DiagnoseReportController {
|
|
return JsonResult.successData(ResultCode.SUCCESS, info);
|
|
return JsonResult.successData(ResultCode.SUCCESS, info);
|
|
}
|
|
}
|
|
|
|
|
|
- /** 获取故障时刻的测点数据
|
|
|
|
- * @param id
|
|
|
|
- * @param pointName
|
|
|
|
- * @return
|
|
|
|
- */
|
|
|
|
- @GetMapping("/pointName")
|
|
|
|
- public JSONObject getPointName(String id,String pointName) {
|
|
|
|
- Casefaultalg fault = casefaultalgService.getById(id);
|
|
|
|
- Map<String, List<PointData>> list = diagnosereportService.getpointweightData(fault.getStationen(), fault.getModel(), fault.getWindturbineid(), fault.getStarttime(),pointName);
|
|
|
|
- return JsonResult.successData(ResultCode.SUCCESS, list);
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
* 获取故障时刻斜率最大的三个测点曲线数据
|
|
* 获取故障时刻斜率最大的三个测点曲线数据
|
|
@@ -91,6 +93,31 @@ public class DiagnoseReportController {
|
|
public JSONObject getbigRising(String id) {
|
|
public JSONObject getbigRising(String id) {
|
|
String code = diagnosereportService.getbigRising(id);
|
|
String code = diagnosereportService.getbigRising(id);
|
|
return JsonResult.successData(ResultCode.SUCCESS, code);
|
|
return JsonResult.successData(ResultCode.SUCCESS, code);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 梯度计算前三个测点数据上升
|
|
|
|
+ * @param time 故障时间
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @GetMapping("/grads")
|
|
|
|
+ public JSONObject getGrads(String station, String model, String wtId, String time){
|
|
|
|
+ List<Diagnosetrainhistory> collect = InitialRunner.historyModelMap.get(station + "_" + model)
|
|
|
|
+ .stream().filter(a -> a.isEnable()).collect(Collectors.toList());
|
|
|
|
+
|
|
|
|
+ Calendar cal = Calendar.getInstance();
|
|
|
|
+ DataInfo info = new DataInfo();
|
|
|
|
+ info.setStationId(station);
|
|
|
|
+ info.setModelId(model);
|
|
|
|
+ info.setThingId(wtId);
|
|
|
|
+ cal.setTime(DateUtil.parseStrtoDate(time, DateUtil.YYYY_MM_DD_HH_MM_SS));
|
|
|
|
+ cal.add(Calendar.MINUTE, -10);
|
|
|
|
+ info.setStartTs(cal.getTimeInMillis() + "");
|
|
|
|
+ cal.add(Calendar.MINUTE, 10);
|
|
|
|
+ info.setEndTs(cal.getTimeInMillis() + "");
|
|
|
|
+ Map<String, List<PointData>> map = diagnosereportService.getpointweightDataList(info, collect.get(0).getPointweight());
|
|
|
|
+
|
|
|
|
+ return JsonResult.successData(ResultCode.SUCCESS, map);
|
|
}
|
|
}
|
|
}
|
|
}
|