From ac73eca6706022688ec3c9470a08b2f9e827eb61 Mon Sep 17 00:00:00 2001 From: wangwei Date: Tue, 25 Dec 2018 19:51:52 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BF=AE=E6=94=B9=E9=87=8D=E7=82=B9=E4=BA=8B?= =?UTF-8?q?=E4=BB=B6=E4=BF=9D=E9=9A=9C=E9=BB=98=E8=AE=A4=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E6=9C=80=E8=BF=91=E4=B8=80=E4=B8=AA=E6=9C=88=E3=80=81=E4=BA=8B?= =?UTF-8?q?=E4=BB=B6=E5=B0=81=E5=A0=B5=E3=80=81=E7=9B=91=E6=B5=8B=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E6=9F=A5=E8=AF=A2=E6=9C=80=E8=BF=9124h=202.=E5=AE=8C?= =?UTF-8?q?=E5=96=84controller=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../restful/EventInfoController.java | 6 +++--- .../nis/web/service/restful/EventService.java | 20 +++++++++---------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/main/java/com/nis/web/controller/restful/EventInfoController.java b/src/main/java/com/nis/web/controller/restful/EventInfoController.java index eb4b7ac..55cbc68 100644 --- a/src/main/java/com/nis/web/controller/restful/EventInfoController.java +++ b/src/main/java/com/nis/web/controller/restful/EventInfoController.java @@ -27,7 +27,7 @@ import java.util.Map; * @data 2018/12/24 15:21 */ @RestController -@RequestMapping("${servicePath}") +@RequestMapping("${servicePath}/log/v1") @Api(value = "EventInfoController", description = "事件封堵、监测、保障接口") @SuppressWarnings("all") public class EventInfoController extends BaseRestController { @@ -37,7 +37,7 @@ public class EventInfoController extends BaseRestController { @Autowired EventService eventService; - @RequestMapping(value = "/log/v1/ntcEventKeyProtection", method = RequestMethod.GET) + @RequestMapping(value = "/ntcEventKeyProtection", method = RequestMethod.GET) @ApiOperation(value = "重点保障事件总览", httpMethod = "GET", notes = "获取重点保障事件信息", response = Map.class) public Map getEventKeyProtection(EventKeyProtection eventKeyProtection, HttpServletRequest request, HttpServletResponse response) { long start = System.currentTimeMillis(); @@ -61,7 +61,7 @@ public class EventInfoController extends BaseRestController { eventKeyProtectionPage, 0); } - @RequestMapping(value = "/log/v1/ntcEventsMonitorOrBlock", method = RequestMethod.GET) + @RequestMapping(value = "/ntcEventsMonitorOrBlock", method = RequestMethod.GET) @ApiOperation(value = "事件监测、封堵", httpMethod = "GET", notes = "获取事件监测、封堵信息", response = Map.class) public Map getEventsMonitorOrBlock(EventMonitorOrBlock eventMonitorOrBlock, HttpServletRequest request, HttpServletResponse response) { long start = System.currentTimeMillis(); diff --git a/src/main/java/com/nis/web/service/restful/EventService.java b/src/main/java/com/nis/web/service/restful/EventService.java index 17f2143..833efa6 100644 --- a/src/main/java/com/nis/web/service/restful/EventService.java +++ b/src/main/java/com/nis/web/service/restful/EventService.java @@ -61,17 +61,17 @@ public class EventService { }catch(Exception ex){ logger.error("时间参数处理转换异常,{}", ex); String rangeOfday = CalendarUtils.getRangeOfday(DateUtils.getDateTime()); - String startTemp = CalendarUtils.getRangeNhourOfTime(rangeOfday, -24); + String startTemp = CalendarUtils.getRangeNhourOfTime(rangeOfday, -24*30); eventKeyProtection = new EventKeyProtection(); eventKeyProtection.setSearchReportStartTime(startTemp); - logger.info("获取重点保障事件API请求参数转换异常,默认查询昨天"+startTemp+"至今数据"); + logger.info("获取重点保障事件API请求参数转换异常,默认查询起始时间"+startTemp+"至今数据"); } - if(countParamEmpty == 6){ + if(countParamEmpty == 5){ String rangeOfday = CalendarUtils.getRangeOfday(DateUtils.getDateTime()); - String startTemp = CalendarUtils.getRangeNhourOfTime(rangeOfday, -24); + String startTemp = CalendarUtils.getRangeNhourOfTime(rangeOfday, -24*30); eventKeyProtection = new EventKeyProtection(); eventKeyProtection.setSearchReportStartTime(startTemp); - logger.info("获取重点保障事件API请求参数为空,默认查询昨天"+startTemp+"至今数据"); + logger.info("获取重点保障事件API请求参数为空,默认查询起始时间"+startTemp+"至今数据"); } try { list = eventServiceDao.getEventsKeyProtection(eventKeyProtection); @@ -117,21 +117,21 @@ public class EventService { }catch(Exception ex){ logger.error("时间参数处理转换异常,{}", ex); String rangeNhourOfTime = CalendarUtils.getRangeOfhour(DateUtils.getDateTime()); - String startTemp = CalendarUtils.getRangeNhourOfTime(rangeNhourOfTime, -1); + String startTemp = CalendarUtils.getRangeNhourOfTime(rangeNhourOfTime, -24); int typeId = eventMonitorOrBlock.getReportType(); eventMonitorOrBlock = new EventMonitorOrBlock(); eventMonitorOrBlock.setSearchReportStartTime(startTemp); eventMonitorOrBlock.setReportType(typeId); - logger.info("获取"+logMark+"API请求参数转换异常,默认查询上一小时"+startTemp+"到现在的数据"); + logger.info("获取"+logMark+"API请求参数转换异常,默认查询起始时间"+startTemp+"到现在的数据"); } - if(countParamEmpty==6){ + if(countParamEmpty==5){ String rangeNhourOfTime = CalendarUtils.getRangeOfhour(DateUtils.getDateTime()); - String startTemp = CalendarUtils.getRangeNhourOfTime(rangeNhourOfTime, -1); + String startTemp = CalendarUtils.getRangeNhourOfTime(rangeNhourOfTime, -24); int typeId = eventMonitorOrBlock.getReportType(); eventMonitorOrBlock = new EventMonitorOrBlock(); eventMonitorOrBlock.setSearchReportStartTime(startTemp); eventMonitorOrBlock.setReportType(typeId); - logger.info("获取"+logMark+"API请求参数为空,默认查询上一小时"+startTemp+"到现在的数据"); + logger.info("获取"+logMark+"API请求参数为空,默认查询起始时间"+startTemp+"到现在的数据"); } try { list = eventServiceDao.getEventsMonitorOrBlock(eventMonitorOrBlock);