|
@@ -33,6 +33,9 @@ public class ShowDataController {
|
|
|
|
|
|
@Autowired
|
|
|
ResultInfoServiceImpl resultInfoService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ ResultAlarmInfoServiceImpl resultAlarmInfoService;
|
|
|
@Autowired
|
|
|
ResultInnershortServiceImpl resultInnershortService;
|
|
|
@Autowired
|
|
@@ -103,12 +106,51 @@ public class ShowDataController {
|
|
|
response.setMinVolt(Collections.min(voltages));
|
|
|
response.setMinVoltIndex("单体电芯" + voltages.indexOf(Collections.min(voltages)));
|
|
|
response.setCellTemp(resultOriginData.getCelltemp());
|
|
|
+
|
|
|
+ // 报警信息
|
|
|
+ List<ResultAlarmInfo> resultAlarmInfo = resultAlarmInfoService.list(new QueryWrapper<ResultAlarmInfo>().eq("sn", param.getSn()));
|
|
|
+ if (resultAlarmInfo != null && resultAlarmInfo.size() > 0) {
|
|
|
+ for (ResultAlarmInfo r : resultAlarmInfo) {
|
|
|
+ if (r.getType().equals("电压离群报警")) {
|
|
|
+ response.setVoltAlarmTime(new SimpleDateFormat("yyyy-MM-dd").format(r.getAlarmtime()));
|
|
|
+ response.setVoltValue(r.getValue());
|
|
|
+ response.setVoltValueDiff(r.getValuediff());
|
|
|
+ response.setVoltThreshold(new ArrayList<Object>() {{
|
|
|
+ add(r.getThresholdDown());
|
|
|
+ add(r.getThresholdUp());
|
|
|
+
|
|
|
+ }});
|
|
|
+ response.setVoltLevel(r.getLevel());
|
|
|
+ } else if (r.getType().equals("压差离群报警")) {
|
|
|
+ response.setVoltDiffAlarmTime(new SimpleDateFormat("yyyy-MM-dd").format(r.getAlarmtime()));
|
|
|
+ response.setVoltDiffValue(r.getValue());
|
|
|
+ response.setVoltDiffValueDiff(r.getValuediff());
|
|
|
+ response.setVoltDiffThreshold(new ArrayList<Object>() {{
|
|
|
+ add(r.getThresholdDown());
|
|
|
+ add(r.getThresholdUp());
|
|
|
+
|
|
|
+ }});
|
|
|
+ response.setVoltDiffLevel(r.getLevel());
|
|
|
+ } else if (r.getType().equals("内短路报警")) {
|
|
|
+ response.setInnershortAlarmTime(new SimpleDateFormat("yyyy-MM-dd").format(r.getAlarmtime()));
|
|
|
+ response.setInnershortValue(r.getValue());
|
|
|
+ response.setInnershortValueDiff(r.getValuediff());
|
|
|
+ response.setInnershortThreshold(new ArrayList<Object>() {{
|
|
|
+ add(r.getThresholdDown());
|
|
|
+ add(r.getThresholdUp());
|
|
|
+
|
|
|
+ }});
|
|
|
+ response.setInnershortLevel(r.getLevel());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
log.info(param.getSn() + "右侧结果返回");
|
|
|
return ApiDTO.ok(response);
|
|
|
} catch (Exception e) {
|
|
|
throw new ApiRuntimeException(500, e.toString());
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
@ApiOperation(value = "获取内短路数据")
|
|
|
@PostMapping("/getInner")
|
|
|
public ApiDTO getInner(@RequestBody QueryParam param) {
|
|
@@ -148,6 +190,7 @@ public class ShowDataController {
|
|
|
throw new ApiRuntimeException(500, e.toString());
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
@ApiOperation(value = "获取电压离群数据")
|
|
|
@PostMapping("/getVolt")
|
|
|
public ApiDTO getVolt(@RequestBody QueryParam param) {
|
|
@@ -185,6 +228,7 @@ public class ShowDataController {
|
|
|
throw new ApiRuntimeException(500, e.toString());
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
@ApiOperation(value = "获取压差离群数据")
|
|
|
@PostMapping("/getVoltdiff")
|
|
|
public ApiDTO getVoltdiff(@RequestBody QueryParam param) {
|
|
@@ -222,6 +266,7 @@ public class ShowDataController {
|
|
|
throw new ApiRuntimeException(500, e.toString());
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
@ApiOperation(value = "获取soh数据")
|
|
|
@PostMapping("/getSoh")
|
|
|
public ApiDTO getSoh(@RequestBody QueryParam param) {
|
|
@@ -248,12 +293,13 @@ public class ShowDataController {
|
|
|
throw new ApiRuntimeException(500, e.toString());
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
@ApiOperation(value = "获取sn列表")
|
|
|
@PostMapping("/getSn")
|
|
|
public ApiDTO getSn(@RequestBody QueryParam param) {
|
|
|
List<String> snList = new ArrayList<>();
|
|
|
List<ResultOriginData> resultOriginData = resultOriginDataService.list(new QueryWrapper<ResultOriginData>().eq("type", param.getTableId()));
|
|
|
- resultOriginData.forEach(p->snList.add(p.getDeviceId()));
|
|
|
+ resultOriginData.forEach(p -> snList.add(p.getDeviceId()));
|
|
|
return ApiDTO.ok(snList);
|
|
|
}
|
|
|
}
|