Commit 56bde389 authored by tangwei's avatar tangwei

解决冲突

parents f8afbc91 8873bfb5
...@@ -139,16 +139,18 @@ public class AnalyseController extends BaseController { ...@@ -139,16 +139,18 @@ public class AnalyseController extends BaseController {
@ApiOperation(httpMethod = "GET", value = "获取influxdb数据", notes = "获取influxdb数据") @ApiOperation(httpMethod = "GET", value = "获取influxdb数据", notes = "获取influxdb数据")
@GetMapping(value = "/getInfluxdbDataByConditon") @GetMapping(value = "/getInfluxdbDataByConditon")
public ResponseModel<Map<String, Object>> getInfluxdbDataByConditon(@RequestParam String stationType, @RequestParam String pointId, @RequestParam(required = false) String startTime, @RequestParam(required = false) String endTime) { public ResponseModel<Map<String, Object>> getInfluxdbDataByConditon(@RequestParam String stationType, @RequestParam String pointId, @RequestParam(required = false) String startTime, @RequestParam(required = false) String endTime) {
if (StringUtils.isEmpty(startTime) && StringUtils.isEmpty(endTime) ){ if (StringUtils.isEmpty(startTime)) {
Date currentDayStartTime = null; Date sevenAgoDayStartTime = null;
try { try {
currentDayStartTime = DateUtils.minDateOfMonth(new Date()); sevenAgoDayStartTime = DateUtils.dateAddDays(new Date(), -7);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
Date currentDayEndTime = DateUtils.getCurrentMonthEndTime(new Date()); startTime = DateUtils.convertDateToString(DateUtils.dateAddHours(sevenAgoDayStartTime, -8), DateUtils.DATE_TIME_PATTERN);
startTime = DateUtils.convertDateToString(currentDayStartTime, DateUtils.DATE_TIME_PATTERN); }
endTime = DateUtils.convertDateToString(currentDayEndTime, DateUtils.DATE_TIME_PATTERN); DateUtils.dateAddHours(DateUtils.getCurrentDayStartTime(new Date()), -8);
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)) ;
} }
...@@ -180,16 +182,18 @@ public class AnalyseController extends BaseController { ...@@ -180,16 +182,18 @@ public class AnalyseController extends BaseController {
} }
if (StringUtils.isEmpty(startTime) && StringUtils.isEmpty(endTime) ){ if (StringUtils.isEmpty(startTime)) {
Date currentDayStartTime = null; Date sevenAgoDayStartTime = null;
try { try {
currentDayStartTime = DateUtils.minDateOfMonth(new Date()); sevenAgoDayStartTime = DateUtils.dateAddDays(new Date(), -7);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
Date currentDayEndTime = DateUtils.getCurrentMonthEndTime(new Date()); startTime = DateUtils.convertDateToString(DateUtils.dateAddHours(sevenAgoDayStartTime, -8), DateUtils.DATE_TIME_PATTERN);
startTime = DateUtils.convertDateToString(currentDayStartTime, DateUtils.DATE_TIME_PATTERN); }
endTime = DateUtils.convertDateToString(currentDayEndTime, DateUtils.DATE_TIME_PATTERN); DateUtils.dateAddHours(DateUtils.getCurrentDayStartTime(new Date()), -8);
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)) ;
} }
......
...@@ -1002,7 +1002,7 @@ ...@@ -1002,7 +1002,7 @@
HEALTH_INDEX, HEALTH_INDEX,
HEALTH_INDEX as value, HEALTH_INDEX as value,
HEALTH_LEVEL, HEALTH_LEVEL,
( CASE HEALTH_LEVEL WHEN '危险' THEN 3 WHEN '告警' THEN 2 WHEN '注意' THEN 1 ELSE 0 END ) AS status, ( CASE HEALTH_LEVEL WHEN '危险' THEN 3 WHEN '警告' THEN 2 WHEN '注意' THEN 1 ELSE 0 END ) AS status,
SUB_SYSTEM, SUB_SYSTEM,
REC_DATE, REC_DATE,
EQUIPMENT_NAME, EQUIPMENT_NAME,
...@@ -1048,7 +1048,7 @@ ...@@ -1048,7 +1048,7 @@
CAST(HEALTH_INDEX AS UNSIGNED) as HEALTH_INDEX, CAST(HEALTH_INDEX AS UNSIGNED) as HEALTH_INDEX,
CAST(HEALTH_INDEX AS UNSIGNED) as value, CAST(HEALTH_INDEX AS UNSIGNED) as value,
HEALTH_LEVEL, HEALTH_LEVEL,
( CASE HEALTH_LEVEL WHEN '危险' THEN 3 WHEN '告警' THEN 2 WHEN '注意' THEN 1 ELSE 0 END ) AS status, ( CASE HEALTH_LEVEL WHEN '危险' THEN 3 WHEN '警告' THEN 2 WHEN '注意' THEN 1 ELSE 0 END ) AS status,
SUB_SYSTEM, SUB_SYSTEM,
REC_DATE, REC_DATE,
EQUIPMENT_NAME, EQUIPMENT_NAME,
......
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