|
@@ -10,6 +10,7 @@ import com.gyee.frame.model.auto.MetricsUniformCode;
|
|
|
import com.gyee.frame.model.auto.WindTurbineTestingPointAi2;
|
|
|
import com.gyee.frame.model.auto.WindTurbineTestingPointDi2;
|
|
|
import com.gyee.frame.model.custom.export.TsPointData;
|
|
|
+import com.gyee.frame.model.custom.weather.Sys;
|
|
|
import com.gyee.frame.service.Alertrule2ervice;
|
|
|
import com.gyee.frame.service.WindTurbineTestingPointAiService;
|
|
|
import com.gyee.frame.service.WindTurbineTestingPointDiService;
|
|
@@ -19,12 +20,10 @@ import io.swagger.annotations.Api;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.HashMap;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
+import java.util.*;
|
|
|
|
|
|
@RestController
|
|
|
+@CrossOrigin
|
|
|
@RequestMapping("/analysis")
|
|
|
@Api(value = "可靠性分析" ,tags = "可靠性分析")
|
|
|
public class ReliabilityAnalysisController {
|
|
@@ -58,7 +57,8 @@ public class ReliabilityAnalysisController {
|
|
|
@RequestParam(name = "wtId") String wtId,
|
|
|
@RequestParam(name = "name") String name,
|
|
|
@RequestParam(name = "startTs") long startTs,
|
|
|
- @RequestParam(name = "endTs") long endTs){
|
|
|
+ @RequestParam(name = "endTs") long endTs,
|
|
|
+ @RequestParam(name = "interval", required = false) Optional<Integer> interval){
|
|
|
|
|
|
List<Object> list = new ArrayList<>();
|
|
|
|
|
@@ -70,11 +70,15 @@ public class ReliabilityAnalysisController {
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
if (code.startsWith("AI")){
|
|
|
WindTurbineTestingPointAi2 windAI = windAIService.getWindTurbineTestingPointAi2(wtId, code);
|
|
|
- List<TsPointData> data = remoteService.ShardingService().getHistorySnap(windAI.getId(), startTs, endTs, 60);
|
|
|
+ List<TsPointData> data = null;
|
|
|
+ if (interval.isPresent() && interval.get() > 0)
|
|
|
+ data = remoteService.ShardingService().getHistorySnap(windAI.getId(), startTs, endTs, interval.get());
|
|
|
+ else
|
|
|
+ data = remoteService.ShardingService().getHistoryRaw(windAI.getId(), startTs, endTs);
|
|
|
|
|
|
// 查询点的单位和描述属性
|
|
|
- String unit = "";
|
|
|
- String desc = "";
|
|
|
+ String unit = "--";
|
|
|
+ String desc = "----";
|
|
|
List<MetricsUniformCode> metricsList = uniformCodeService.getListByStationAndUniforCode(station, windAI.getUniformcode());
|
|
|
if (metricsList != null && metricsList.size() > 0) {
|
|
|
MetricsUniformCode metricsUniformCode = metricsList.get(0);
|
|
@@ -95,4 +99,23 @@ public class ReliabilityAnalysisController {
|
|
|
return AjaxResult.successData(AjaxStatus.success.code, list);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ WindTurbineTestingPointAiService windTurbineTestingPointAiService;
|
|
|
+
|
|
|
+ @GetMapping("/test")
|
|
|
+ public AjaxResult get(){
|
|
|
+ List<String> list = alertrule2ervice.getUniformCodeByNameAndStations();
|
|
|
+
|
|
|
+ List<String> modelID = alertrule2ervice.getModelID();
|
|
|
+
|
|
|
+
|
|
|
+// for (String model : modelID)
|
|
|
+// System.out.println(model);
|
|
|
+
|
|
|
+ List<String> winds = windTurbineTestingPointAiService.findPointByUniformcode(list, modelID);
|
|
|
+
|
|
|
+ return AjaxResult.successData(AjaxStatus.success.code, winds);
|
|
|
+ }
|
|
|
+
|
|
|
}
|