Commit 3eb57a14 authored by caotao's avatar caotao

1.合并光伏风机告警详情接口增加类型进行区分

parent 7310456f
......@@ -45,7 +45,7 @@ public class AnalyseController extends BaseController {
@ApiOperation(httpMethod = "GET", value = "工况测点区间划分-风机", notes = "工况测点区间划分-风机")
@GetMapping(value = "/getFanConditionVariablesByTime")
public ResponseModel<String> getFanConditionVariablesByTime(@RequestParam(required = false) String startTime, @RequestParam(required = false) String endTime) {
if (StringUtils.isEmpty(startTime) && StringUtils.isEmpty(endTime) ){
if (StringUtils.isEmpty(startTime) && StringUtils.isEmpty(endTime)) {
Date currentDayStartTime = DateUtils.getCurrentDayStartTime(new Date());
Date currentDayEndTime = DateUtils.getCurrentDayEndTime(new Date());
startTime = DateUtils.convertDateToString(currentDayStartTime, DateUtils.DATE_TIME_PATTERN);
......@@ -53,11 +53,12 @@ public class AnalyseController extends BaseController {
}
return ResponseHelper.buildResponse(commonServiceImpl.getFanConditionVariablesByTimeThread(startTime, endTime));
}
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET", value = "工况测点区间划分-光伏", notes = "工况测点区间划分-光伏")
@GetMapping(value = "/getPvConditionVariablesByTime")
public ResponseModel<String> getPvConditionVariablesByTime(@RequestParam(required = false) String startTime, @RequestParam(required = false) String endTime) {
if (StringUtils.isEmpty(startTime) && StringUtils.isEmpty(endTime) ){
if (StringUtils.isEmpty(startTime) && StringUtils.isEmpty(endTime)) {
Date currentDayStartTime = DateUtils.getCurrentDayStartTime(new Date());
Date currentDayEndTime = DateUtils.getCurrentDayEndTime(new Date());
startTime = DateUtils.convertDateToString(currentDayStartTime, DateUtils.DATE_TIME_PATTERN);
......@@ -65,11 +66,12 @@ public class AnalyseController extends BaseController {
}
return ResponseHelper.buildResponse(commonServiceImpl.getPvConditionVariablesByTimeThread(startTime, endTime));
}
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET", value = "相关性分析-风机", notes = "相关性分析-风机")
@GetMapping(value = "/getFanConditionVariablesByTimeAnalyse")
public ResponseModel<String> getFanConditionVariablesByTimeAnalyse(@RequestParam(required = false) String startTime, @RequestParam(required = false) String endTime) {
if (StringUtils.isEmpty(startTime) && StringUtils.isEmpty(endTime) ){
if (StringUtils.isEmpty(startTime) && StringUtils.isEmpty(endTime)) {
Date currentDayStartTime = DateUtils.getCurrentDayStartTime(new Date());
Date currentDayEndTime = DateUtils.getCurrentDayEndTime(new Date());
startTime = DateUtils.convertDateToString(currentDayStartTime, DateUtils.DATE_TIME_PATTERN);
......@@ -92,7 +94,7 @@ public class AnalyseController extends BaseController {
@ApiOperation(httpMethod = "GET", value = "相关性分析 - 光伏 - 新", notes = "相关性分析 - 光伏 - 新")
@GetMapping(value = "/getPvConditionVariablesByTimeAnalyseNew")
public ResponseModel<String> getPvConditionVariablesByTimeAnalyseNew(@RequestParam(required = false) String startTime, @RequestParam(required = false) String endTime) throws InterruptedException {
if (StringUtils.isEmpty(startTime) && StringUtils.isEmpty(endTime) ){
if (StringUtils.isEmpty(startTime) && StringUtils.isEmpty(endTime)) {
startTime = DateUtils.convertDateToString(DateUtil.beginOfYear(new Date()), DateUtils.DATE_TIME_PATTERN);
endTime = DateUtils.convertDateToString(DateUtils.getCurrentDayEndTime(new Date()), DateUtils.DATE_TIME_PATTERN);
}
......@@ -105,7 +107,7 @@ public class AnalyseController extends BaseController {
@ApiOperation(httpMethod = "GET", value = "相关性分析-风机", notes = "相关性分析-风机")
@GetMapping(value = "/getPvConditionVariablesByTimeAnalyse")
public ResponseModel<String> getPvConditionVariablesByTimeAnalyse(@RequestParam(required = false) String startTime, @RequestParam(required = false) String endTime) {
if (StringUtils.isEmpty(startTime) && StringUtils.isEmpty(endTime) ){
if (StringUtils.isEmpty(startTime) && StringUtils.isEmpty(endTime)) {
Date currentDayStartTime = DateUtils.getCurrentDayStartTime(new Date());
Date currentDayEndTime = DateUtils.getCurrentDayEndTime(new Date());
startTime = DateUtils.convertDateToString(currentDayStartTime, DateUtils.DATE_TIME_PATTERN);
......@@ -113,11 +115,12 @@ public class AnalyseController extends BaseController {
}
return ResponseHelper.buildResponse(commonServiceImpl.getPvConditionVariablesByTimeAnalyseThread(startTime, endTime));
}
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET", value = "中心值计算-风机", notes = "中心值计算-风机")
@GetMapping(value = "/getFanConditionVariablesByTimeAnalyse1")
public ResponseModel<String> getFanConditionVariablesByTimeAnalyse1(@RequestParam(required = false) String startTime, @RequestParam(required = false) String endTime) {
if (StringUtils.isEmpty(startTime) && StringUtils.isEmpty(endTime) ){
if (StringUtils.isEmpty(startTime) && StringUtils.isEmpty(endTime)) {
Date currentDayStartTime = DateUtils.getCurrentDayStartTime(new Date());
Date currentDayEndTime = DateUtils.getCurrentDayEndTime(new Date());
startTime = DateUtils.convertDateToString(currentDayStartTime, DateUtils.DATE_TIME_PATTERN);
......@@ -125,11 +128,12 @@ public class AnalyseController extends BaseController {
}
return ResponseHelper.buildResponse(commonServiceImpl.getFanConditionVariablesByTimeAnalyse1Thread(startTime, endTime));
}
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET", value = "中心值计算-光伏", notes = "中心值计算-光伏")
@GetMapping(value = "/getPvConditionVariablesByTimeAnalyse1")
public ResponseModel<String> getPvConditionVariablesByTimeAnalyse1(@RequestParam(required = false) String startTime, @RequestParam(required = false) String endTime) {
if (StringUtils.isEmpty(startTime) && StringUtils.isEmpty(endTime) ){
if (StringUtils.isEmpty(startTime) && StringUtils.isEmpty(endTime)) {
Date currentDayStartTime = DateUtils.getCurrentDayStartTime(new Date());
Date currentDayEndTime = DateUtils.getCurrentDayEndTime(new Date());
startTime = DateUtils.convertDateToString(currentDayStartTime, DateUtils.DATE_TIME_PATTERN);
......@@ -172,7 +176,7 @@ public class AnalyseController extends BaseController {
if (StringUtils.isEmpty(endTime)) {
endTime = DateUtils.convertDateToString(DateUtils.dateAddHours(new Date(), -8), DateUtils.DATE_TIME_PATTERN);
}
return ResponseHelper.buildResponse(commonServiceImpl.getInfluxdbDataByConditon(stationType,pointId,startTime, endTime)) ;
return ResponseHelper.buildResponse(commonServiceImpl.getInfluxdbDataByConditon(stationType, pointId, startTime, endTime));
}
......@@ -187,16 +191,16 @@ public class AnalyseController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "post", value = "获取influxdb数据", notes = "获取influxdb数据")
@PostMapping(value = "/getInfluxdbDataByConditon")
public ResponseModel<Map<String, Object>> getDataByConditon(@RequestParam String stationType, @RequestParam(required = false) String pointId, @RequestParam(required = false) String startTime, @RequestParam(required = false) String endTime,@RequestBody Map<String,Object> map ) {
if ("FD".equals(stationType)){
public ResponseModel<Map<String, Object>> getDataByConditon(@RequestParam String stationType, @RequestParam(required = false) String pointId, @RequestParam(required = false) String startTime, @RequestParam(required = false) String endTime, @RequestBody Map<String, Object> map) {
if ("FD".equals(stationType)) {
LambdaQueryWrapper<IdxBizFanHealthIndex> indexLambdaQueryWrapper = new LambdaQueryWrapper<>();
indexLambdaQueryWrapper.eq(IdxBizFanHealthIndex::getStation,map.get("STATION"));
indexLambdaQueryWrapper.eq(IdxBizFanHealthIndex::getEquipmentName,map.get("EQUIPNAME"));
indexLambdaQueryWrapper.eq(IdxBizFanHealthIndex::getPointName,map.get("EQUIPINDEX")).last("limit 1");
indexLambdaQueryWrapper.eq(IdxBizFanHealthIndex::getStation, map.get("STATION"));
indexLambdaQueryWrapper.eq(IdxBizFanHealthIndex::getEquipmentName, map.get("EQUIPNAME"));
indexLambdaQueryWrapper.eq(IdxBizFanHealthIndex::getPointName, map.get("EQUIPINDEX")).last("limit 1");
List<IdxBizFanHealthIndex> idxBizFanHealthIndices = idxBizFanHealthIndexMapper.selectList(indexLambdaQueryWrapper);
if (CollectionUtils.isNotEmpty(idxBizFanHealthIndices)){
if (CollectionUtils.isNotEmpty(idxBizFanHealthIndices)) {
pointId = idxBizFanHealthIndices.get(0).getIndexAddress();
}
}
......@@ -230,35 +234,35 @@ public class AnalyseController extends BaseController {
if (StringUtils.isEmpty(endTime)) {
endTime = DateUtils.convertDateToString(DateUtils.dateAddHours(new Date(), -8), DateUtils.DATE_TIME_PATTERN);
}
return ResponseHelper.buildResponse(commonServiceImpl.getInfluxdbDataByConditon(stationType,pointId,startTime, endTime)) ;
return ResponseHelper.buildResponse(commonServiceImpl.getInfluxdbDataByConditon(stationType, pointId, startTime, endTime));
}
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET", value = "预警详情信息-风机", notes = "预警详情信息-风机")
@GetMapping(value = "/getAlramInfoDetailOfFan")
public ResponseModel<Map<String, Object>> getAlramInfoDetailOfFan(@RequestParam(required = true) String id){
@ApiOperation(httpMethod = "GET", value = "预警详情信息", notes = "预警详情信息")
@GetMapping(value = "/getAlramInfoDetail")
public ResponseModel<Map<String, Object>> getAlramInfoDetailOfFan(@RequestParam(required = true) String id, @RequestParam(required = true) String type) {
if ("FAN".equals(type)) {
return ResponseHelper.buildResponse(iAlarmInfoDetailService.getAlramInfoDetailOfFan(id));
}
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET", value = "预警详情信息-光伏", notes = "预警详情信息-光伏")
@GetMapping(value = "/getAlramInfoDetailOfPv")
public ResponseModel<Map<String, Object>> getAlramInfoDetailOfPv(@RequestParam(required = true) String id){
} else {
return ResponseHelper.buildResponse(iAlarmInfoDetailService.getAlramInfoDetailOfPv(id));
}
}
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET", value = "预警详情信息-光伏", notes = "预警详情信息-光伏")
@GetMapping(value = "/queryIndexByArae")
public ResponseModel<Map<String, Object>> queryIndexByArae(String ARAE, String ANALYSISTYPE,String startTimeTop,String endTimeTop){
public ResponseModel<Map<String, Object>> queryIndexByArae(String ARAE, String ANALYSISTYPE, String startTimeTop, String endTimeTop) {
List<Map<String, Object>> maps = idxBizFanHealthIndexMapper.queryIndexByArae(ARAE, ANALYSISTYPE, startTimeTop, endTimeTop);
List<String> axisData = new ArrayList<>();
List<String> seriesData = new ArrayList<>();
Map<String,Object> map = new HashMap<>();
Map<String, Object> map = new HashMap<>();
for (Map<String, Object> obj : maps) {
axisData.add( obj.get("HEALTHINDEX").toString()) ;
seriesData.add( obj.get("ANALYSISTIME").toString()) ;
axisData.add(obj.get("HEALTHINDEX").toString());
seriesData.add(obj.get("ANALYSISTIME").toString());
}
map.put("axisData",axisData);
map.put("seriesData",seriesData);
map.put("axisData", axisData);
map.put("seriesData", seriesData);
return ResponseHelper.buildResponse(map);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment