package com.zc.business.controller; import com.ruoyi.common.core.domain.AjaxResult; import com.zc.business.service.IDcTrafficIncidentsService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import org.apache.ibatis.annotations.Param; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import java.util.Date; import java.util.Map; /** * @Description 交通事件统计 * * @author liuwenge * @date 2024/1/13 9:41 */ @Api(tags = "交通事件统计") @RestController @RequestMapping("/business/trafficIncidents") public class DcTrafficIncidentsController { @Autowired private IDcTrafficIncidentsService trafficIncidentsService; /** * @Description 首页-重点数据 * * @author liuwenge * @date 2024/1/13 10:10 * @param * @return com.ruoyi.common.core.domain.AjaxResult */ @ApiOperation("首页-重点监控") @GetMapping("/getKeyData") public AjaxResult getKeyData(){ return trafficIncidentsService.getKeyData(); } /** * @Description 首页-事件专题-根据事件类型获取事件列表 * * @author liuwenge * @date 2024/1/13 14:27 * @param eventType * @return com.ruoyi.common.core.domain.AjaxResult */ @ApiOperation("根据类型获取事件列表") @GetMapping("/getEventList/{eventType}") public AjaxResult getEventList(@ApiParam(value = "事件类型", name = "eventType",required = true) @PathVariable("eventType") String eventType){ return trafficIncidentsService.getEventListByType(eventType); } /** * @Description 首页-事件专题-根据事件id获取事件详情 * * @author liuwenge * @date 2024/1/13 14:43 * @param eventId * @return com.ruoyi.common.core.domain.AjaxResult */ @ApiOperation("获取交通事件详情") @GetMapping("/getEventInfo/{eventId}") public AjaxResult getEventInfo(@ApiParam(value = "事件id", name = "eventId",required = true) @PathVariable("eventId") String eventId){ return trafficIncidentsService.getEventInfo(eventId); } /** * @Description 首页-状况统计-获取日周月年交通事件数量 * * @author liuwenge * @date 2024/1/13 15:07 * @param * @return com.ruoyi.common.core.domain.AjaxResult */ @ApiOperation("获取日、周、月、年的交通事件数量") @GetMapping("/getTrafficIncidentsNum") public AjaxResult getTrafficIncidentsNum(){ return trafficIncidentsService.getTrafficIncidentsNum(); } /** * @Description 路网管控-事件管控分析-各类事件的状态数量 * * @author liuwenge * @date 2024/1/13 15:07 * @param * @return com.ruoyi.common.core.domain.AjaxResult */ @ApiOperation("各类事件的状态数量") @GetMapping("/getEventStatusNum") public AjaxResult getEventStatusNum(){ return trafficIncidentsService.getEventStatusNum(); } /** * @Description 路网管控-事件管控分析-事件类型分析占比 * * @author liuwenge * @date 2024/1/13 15:07 * @param * @return com.ruoyi.common.core.domain.AjaxResult */ @ApiOperation("事件类型分析占比") @GetMapping("/getAllEventNum") public AjaxResult getAllEventNum(){ return trafficIncidentsService.getAllEventNum(); } /** * @Description 路网管控-事件管控分析-事件源分析占比 * * @author liuwenge * @date 2024/1/13 15:07 * @param * @return com.ruoyi.common.core.domain.AjaxResult */ @ApiOperation("事件源分析占比") @GetMapping("/getEventSourceRatio") public AjaxResult getEventSourceRatio(){ return trafficIncidentsService.getEventSourceRatio(); } /** * @Description 路网管控-事件管控分析-今日事件趋势 * * @author liuwenge * @date 2024/1/15 14:30 * @param * @return com.ruoyi.common.core.domain.AjaxResult */ @ApiOperation("今日事件趋势") @GetMapping("/getEventTrend") public AjaxResult getEventTrend(){ return trafficIncidentsService.getEventTrend(); } /** * @Description 路网管控-事件管控分析-事故车型分析 * * @author liuwenge * @date 2024/1/15 15:38 * @param direction 方向 * @param direction 类型(1:日, 2:月, 3:季度, 4-年) * @param direction 时间 * @return com.ruoyi.common.core.domain.AjaxResult */ @ApiOperation("事故车型分析") // @GetMapping("/getAccidentVehicleAnalysis") @PostMapping("/selectAccidentVehicleAnalysis") public AjaxResult getAccidentVehicleAnalysis(@ApiParam(value="方向", name="direction", required=true) @RequestParam ("direction") String direction, @ApiParam(value="类型(1:日, 2:月, 3:季度, 4-年)", name="type", required=true) @RequestParam ("type") String type, @ApiParam(value="时间", name="startTime", required=true) @RequestParam ("startTime") String startTime){ return trafficIncidentsService.getAccidentVehicleAnalysis(direction,type,startTime); } /** * @Description 路网管控-事件管控分析-收费站统计分析table * * @author liuwenge * @date 2024/1/15 17:31 * @param searchType 查询条件(1:站点,2:原因) * @param facilityIdList 站点id * @param controlType 类型(1:封闭,2:限行) * @param startTime 开始时间 * @param endTime 结束时间 * @return com.ruoyi.common.core.domain.AjaxResult */ @ApiOperation("收费站统计分析table") @PostMapping("/selectTollStationAnalysis") public AjaxResult selectTollStationAnalysis(@ApiParam(value="查询条件(1:站点,2:原因)", name="searchType", required=true) @RequestParam ("searchType") String searchType, @ApiParam(value="站点id", name="facilityId", required=false) @RequestParam (name="facilityId",required = false) String[] facilityIdList, @ApiParam(value="类型(1:封闭,2:限行)", name="controlType", required=false) @RequestParam (name="controlType",required = false) String controlType, @ApiParam(value="开始时间", name="startTime", required=true) @RequestParam ("startTime") String startTime, @ApiParam(value="结束时间", name="endTime", required=true) @RequestParam ("endTime") String endTime){ return trafficIncidentsService.selectTollStationAnalysis(searchType,facilityIdList,controlType,startTime,endTime); } /** * @Description 路网管控-事件管控分析-收费站统计分析echarts(当月) * * @author liuwenge * @date 2024/1/16 11:09 * @param * @return com.ruoyi.common.core.domain.AjaxResult */ @ApiOperation("收费站统计分析echarts(当月)") @GetMapping("/getTollStationAnalysis") public AjaxResult getTollStationAnalysis(){ return trafficIncidentsService.getTollStationAnalysis(); } /** * @Description 路网管控-事件管控分析-事故多发路段分析 * * @author liuwenge * @date 2024/1/16 15:52 * @param direction 方向 * @param direction 类型(1:日, 2:月, 3:季度, 4-年) * @param direction 时间 * @return com.ruoyi.common.core.domain.AjaxResult */ @ApiOperation("事故多发路段分析") @PostMapping("/selectRoadSectionAnalysis") public AjaxResult selectRoadSectionAnalysis(@ApiParam(value="方向", name="direction", required=true) @RequestParam ("direction") String direction, @ApiParam(value="类型(1:日, 2:月, 3:季度, 4-年)", name="type", required=true) @RequestParam ("type") String type, @ApiParam(value="时间", name="startTime", required=true) @RequestParam ("startTime") String startTime){ return trafficIncidentsService.selectRoadSectionAnalysis(direction,type,startTime); } /** * @Description 路网管控-事件管控分析-事故类型分析 * * @author liuwenge * @date 2024/1/16 15:52 * @param direction 方向 * @param direction 类型(1:日, 2:月, 3:季度, 4-年) * @param direction 时间 * @return com.ruoyi.common.core.domain.AjaxResult */ @ApiOperation("事故类型分析") @PostMapping("/selectEventTypeAnalysis") public AjaxResult selectEventTypeAnalysis(@ApiParam(value="方向", name="direction", required=true) @RequestParam ("direction") String direction, @ApiParam(value="类型(1:日, 2:月, 3:季度, 4-年)", name="type", required=true) @RequestParam ("type") String type, @ApiParam(value="时间", name="startTime", required=true) @RequestParam ("startTime") String startTime){ return trafficIncidentsService.selectEventTypeAnalysis(direction,type,startTime); } }