diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/BaseEntity.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/BaseEntity.java index 22553cbf..609db8b9 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/BaseEntity.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/BaseEntity.java @@ -10,6 +10,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; * Entity基类 * */ + public class BaseEntity implements Serializable { private static final long serialVersionUID = 1L; @@ -32,6 +33,7 @@ public class BaseEntity implements Serializable private Date updateTime; /** 备注 */ + private String remark; /** 请求参数 */ diff --git a/zc-business/src/main/java/com/zc/business/controller/DCPerceivedEventsWarningController.java b/zc-business/src/main/java/com/zc/business/controller/DCPerceivedEventsWarningController.java new file mode 100644 index 00000000..411fce8b --- /dev/null +++ b/zc-business/src/main/java/com/zc/business/controller/DCPerceivedEventsWarningController.java @@ -0,0 +1,46 @@ +package com.zc.business.controller; + +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.zc.business.domain.DcWarning; +import com.zc.business.service.IDCPerceivedEventsWarningService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @author 王思祥 + * @ClassName DCPerceivedEventsWarningController + */ +@RestController +@RequestMapping("/perceivedEvents/warning") + +public class DCPerceivedEventsWarningController extends BaseController { + @Autowired + private IDCPerceivedEventsWarningService perceivedEventsWarningService; + //查询预警表与历史表所有感知事件的数量 + @PostMapping("/warningTotal") + public AjaxResult getPerceivedEventsWarning(){ + return AjaxResult.success(perceivedEventsWarningService.perceivedEventsWarningNum()); + } + + //感知事件类型 + @PostMapping("/evenType") + public AjaxResult getEvenTypeList(){ + return AjaxResult.success(perceivedEventsWarningService.selectEventTypeList()); + } + + //查询预警感知事件类型 + @PostMapping("/warningType") + public AjaxResult getWarningTypeList(){ + return AjaxResult.success(perceivedEventsWarningService.selectWarningTypeList()); + } + //根据类型查询预计事件 + @PostMapping("/perceivedEventsList") + public AjaxResult getPerceivedEventsList(@RequestBody DcWarning dcWarning){ + return AjaxResult.success(perceivedEventsWarningService.selectPerceivedEventsList(dcWarning)); + } + +} diff --git a/zc-business/src/main/java/com/zc/business/controller/DcEventAbnormalWeatherController.java b/zc-business/src/main/java/com/zc/business/controller/DcEventAbnormalWeatherController.java index 929e8ad8..0182590e 100644 --- a/zc-business/src/main/java/com/zc/business/controller/DcEventAbnormalWeatherController.java +++ b/zc-business/src/main/java/com/zc/business/controller/DcEventAbnormalWeatherController.java @@ -5,6 +5,8 @@ import javax.servlet.http.HttpServletResponse; import com.zc.business.domain.DcEventAbnormalWeather; import com.zc.business.service.IDcEventAbnormalWeatherService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; @@ -24,7 +26,7 @@ import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.core.page.TableDataInfo; /** - * 设备设施隐患事件 + * 异常天气事件 "异常天气"为事件“事件子类”Controller * @@ -33,17 +35,20 @@ import com.ruoyi.common.core.page.TableDataInfo; */ @RestController @RequestMapping("/system/weather") +@Api(tags = "异常天气事件") public class DcEventAbnormalWeatherController extends BaseController { @Autowired private IDcEventAbnormalWeatherService dcEventAbnormalWeatherService; /** - * 查询设备设施隐患事件 + * 查询异常天气事件事件 "异常天气"为事件“事件子类”列表 */ - @PreAuthorize("@ss.hasPermi('system:weather:list')") + @ApiOperation("查询异常天气事件") + + // @PreAuthorize("@ss.hasPermi('system:weather:list')") @GetMapping("/list") public TableDataInfo list(DcEventAbnormalWeather dcEventAbnormalWeather) { @@ -53,12 +58,12 @@ public class DcEventAbnormalWeatherController extends BaseController } /** - * 导出设备设施隐患事件 + * 导出异常天气事件事件 "异常天气"为事件“事件子类”列表 */ - @PreAuthorize("@ss.hasPermi('system:weather:export')") - @Log(title = "设备设施隐患事件 为事件“事件子类”", businessType = BusinessType.EXPORT) + //@PreAuthorize("@ss.hasPermi('system:weather:export')") + @Log(title = "异常天气事件 为事件“事件子类”", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, DcEventAbnormalWeather dcEventAbnormalWeather) { @@ -68,11 +73,12 @@ public class DcEventAbnormalWeatherController extends BaseController } /** - * 获取设备设施隐患事件 + * 获取异常天气事件 "异常天气"为事件“事件子类”详细信息 */ - @PreAuthorize("@ss.hasPermi('system:weather:query')") + @ApiOperation("根据id获取异常天气事件") + //@PreAuthorize("@ss.hasPermi('system:weather:query')") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") String id) { @@ -80,11 +86,12 @@ public class DcEventAbnormalWeatherController extends BaseController } /** - * 新增设备设施隐患事件 + * 新增异常天气事件 "异常天气"为事件“事件子类” */ - @PreAuthorize("@ss.hasPermi('system:weather:add')") + @ApiOperation("新增异常天气事件") + //@PreAuthorize("@ss.hasPermi('system:weather:add')") @Log(title = "设备设施隐患事件 ", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody DcEventAbnormalWeather dcEventAbnormalWeather) @@ -93,12 +100,13 @@ public class DcEventAbnormalWeatherController extends BaseController } /** - * 修改设备设施隐患事件 + * 修改异常天气事件 "异常天气"为事件“事件子类” */ - @PreAuthorize("@ss.hasPermi('system:weather:edit')") - @Log(title = "设备设施隐患事件 ", businessType = BusinessType.UPDATE) + @ApiOperation("修改异常天气事件") + //@PreAuthorize("@ss.hasPermi('system:weather:edit')") + @Log(title = "设备异常天气事件 ", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody DcEventAbnormalWeather dcEventAbnormalWeather) { @@ -106,12 +114,13 @@ public class DcEventAbnormalWeatherController extends BaseController } /** - * 删除设备设施隐患事件 + * 删除异常天气事件 "异常天气"为事件“事件子类” */ - @PreAuthorize("@ss.hasPermi('system:weather:remove')") - @Log(title = "设备设施隐患事件 ", businessType = BusinessType.DELETE) + @ApiOperation("删除异常天气事件") + //@PreAuthorize("@ss.hasPermi('system:weather:remove')") + @Log(title = "设备异常天气事件 ", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable String[] ids) { diff --git a/zc-business/src/main/java/com/zc/business/controller/DcEventConstructionController.java b/zc-business/src/main/java/com/zc/business/controller/DcEventConstructionController.java index 2ef7e187..c6588986 100644 --- a/zc-business/src/main/java/com/zc/business/controller/DcEventConstructionController.java +++ b/zc-business/src/main/java/com/zc/business/controller/DcEventConstructionController.java @@ -6,6 +6,8 @@ import javax.servlet.http.HttpServletResponse; import com.ruoyi.common.enums.BusinessType; import com.zc.business.domain.DcEventConstruction; import com.zc.business.service.IDcEventConstructionService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; @@ -31,8 +33,9 @@ import com.ruoyi.common.core.page.TableDataInfo; * @author ruoyi * @date 2024-01-12 */ +@Api(tags = "施工建设事件") @RestController -@RequestMapping("/system/construction") +@RequestMapping("/dc/system/construction") public class DcEventConstructionController extends BaseController { @Autowired @@ -43,7 +46,8 @@ public class DcEventConstructionController extends BaseController "施工分类"为事件“事件子类”列表 */ - @PreAuthorize("@ss.hasPermi('system:construction:list')") + @ApiOperation("查询施工建设事件") + // @PreAuthorize("@ss.hasPermi('system:construction:list')") @GetMapping("/list") public TableDataInfo list(DcEventConstruction dcEventConstruction) { @@ -57,7 +61,8 @@ public class DcEventConstructionController extends BaseController "施工分类"为事件“事件子类”列表 */ - @PreAuthorize("@ss.hasPermi('system:construction:export')") + + //@PreAuthorize("@ss.hasPermi('system:construction:export')") @Log(title = "施工建设事件 ", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, DcEventConstruction dcEventConstruction) @@ -72,7 +77,8 @@ public class DcEventConstructionController extends BaseController "施工分类"为事件“事件子类”详细信息 */ - @PreAuthorize("@ss.hasPermi('system:construction:query')") + @ApiOperation("获取施工建设事件") + // @PreAuthorize("@ss.hasPermi('system:construction:query')") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") String id) { @@ -84,7 +90,8 @@ public class DcEventConstructionController extends BaseController "施工分类"为事件“事件子类” */ - @PreAuthorize("@ss.hasPermi('system:construction:add')") + @ApiOperation("新增施工建设事件") + //@PreAuthorize("@ss.hasPermi('system:construction:add')") @Log(title = "施工建设事件施工分类", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody DcEventConstruction dcEventConstruction) @@ -97,7 +104,8 @@ public class DcEventConstructionController extends BaseController "施工分类"为事件“事件子类” */ - @PreAuthorize("@ss.hasPermi('system:construction:edit')") + @ApiOperation("修改施工建设事件") + //@PreAuthorize("@ss.hasPermi('system:construction:edit')") @Log(title = "施工建设事件施工分类", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody DcEventConstruction dcEventConstruction) @@ -110,7 +118,8 @@ public class DcEventConstructionController extends BaseController "施工分类"为事件“事件子类” */ - @PreAuthorize("@ss.hasPermi('system:construction:remove')") + @ApiOperation("删除施工建设事件") + //@PreAuthorize("@ss.hasPermi('system:construction:remove')") @Log(title = "施工建设事件施工分类", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable String[] ids) diff --git a/zc-business/src/main/java/com/zc/business/controller/DcEventController.java b/zc-business/src/main/java/com/zc/business/controller/DcEventController.java index 6d7bc0c7..7e68c14e 100644 --- a/zc-business/src/main/java/com/zc/business/controller/DcEventController.java +++ b/zc-business/src/main/java/com/zc/business/controller/DcEventController.java @@ -47,7 +47,7 @@ public class DcEventController extends BaseController * 查询事件信息列表 */ @ApiOperation("查询事件信息列表") - @PreAuthorize("@ss.hasPermi('system:event:list')") + // @PreAuthorize("@ss.hasPermi('system:event:list')") @GetMapping("/list") public TableDataInfo list(DcEvent dcEvent) { @@ -77,7 +77,7 @@ public class DcEventController extends BaseController * 获取事件信息详细信息 */ @ApiOperation("获取事件信息详细信息") - @PreAuthorize("@ss.hasPermi('system:event:query')") + //@PreAuthorize("@ss.hasPermi('system:event:query')") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") String id) { @@ -89,7 +89,7 @@ public class DcEventController extends BaseController * 新增事件信息 */ @ApiOperation("新增事件信息") - @PreAuthorize("@ss.hasPermi('system:event:add')") + //@PreAuthorize("@ss.hasPermi('system:event:add')") @Log(title = "事件信息", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody DcEvent dcEvent) @@ -102,7 +102,7 @@ public class DcEventController extends BaseController * 修改事件信息 */ @ApiOperation("修改事件信息") - @PreAuthorize("@ss.hasPermi('system:event:edit')") + // @PreAuthorize("@ss.hasPermi('system:event:edit')") @Log(title = "事件信息", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody DcEvent dcEvent) @@ -114,7 +114,7 @@ public class DcEventController extends BaseController * 删除事件信息 */ @ApiOperation("删除事件信息") - @PreAuthorize("@ss.hasPermi('system:event:remove')") + // @PreAuthorize("@ss.hasPermi('system:event:remove')") @Log(title = "事件信息", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable String[] ids) diff --git a/zc-business/src/main/java/com/zc/business/controller/DcEventHistoryController.java b/zc-business/src/main/java/com/zc/business/controller/DcEventHistoryController.java index cc2dc741..116374e4 100644 --- a/zc-business/src/main/java/com/zc/business/controller/DcEventHistoryController.java +++ b/zc-business/src/main/java/com/zc/business/controller/DcEventHistoryController.java @@ -44,7 +44,7 @@ public class DcEventHistoryController extends BaseController * 查询事件历史信息列表 */ @ApiOperation("查询事件历史信息列表") - @PreAuthorize("@ss.hasPermi('system:history:list')") + //@PreAuthorize("@ss.hasPermi('system:history:list')") @GetMapping("/list") public TableDataInfo list(DcEventHistory dcEventHistory) { @@ -57,7 +57,7 @@ public class DcEventHistoryController extends BaseController * 导出事件历史信息列表 */ @ApiOperation("导出事件历史信息列表") - @PreAuthorize("@ss.hasPermi('system:history:export')") + //@PreAuthorize("@ss.hasPermi('system:history:export')") @Log(title = "事件历史信息", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, DcEventHistory dcEventHistory) diff --git a/zc-business/src/main/java/com/zc/business/controller/DcEventServiceAreaController.java b/zc-business/src/main/java/com/zc/business/controller/DcEventServiceAreaController.java index add3981d..50b7b4e9 100644 --- a/zc-business/src/main/java/com/zc/business/controller/DcEventServiceAreaController.java +++ b/zc-business/src/main/java/com/zc/business/controller/DcEventServiceAreaController.java @@ -5,6 +5,8 @@ import javax.servlet.http.HttpServletResponse; import com.zc.business.domain.DcEventServiceArea; import com.zc.business.service.IDcEventServiceAreaService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -25,6 +27,7 @@ import com.ruoyi.common.core.page.TableDataInfo; * @author ruoyi * @date 2024-01-12 */ +@Api(tags = "服务区异常事件") @RestController @RequestMapping("/system/area") public class DcEventServiceAreaController extends BaseController @@ -37,7 +40,8 @@ public class DcEventServiceAreaController extends BaseController "异常分类"为事件“事件子类”列表 */ - @PreAuthorize("@ss.hasPermi('system:area:list')") + @ApiOperation("查询服务区异常事件") + // @PreAuthorize("@ss.hasPermi('system:area:list')") @GetMapping("/list") public TableDataInfo list(DcEventServiceArea dcEventServiceArea) { @@ -51,7 +55,8 @@ public class DcEventServiceAreaController extends BaseController "异常分类"为事件“事件子类”列表 */ - @PreAuthorize("@ss.hasPermi('system:area:export')") + @ApiOperation("导出服务区异常事件") + // @PreAuthorize("@ss.hasPermi('system:area:export')") @Log(title = "服务区异常事异常分类", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, DcEventServiceArea dcEventServiceArea) @@ -66,7 +71,8 @@ public class DcEventServiceAreaController extends BaseController "异常分类"为事件“事件子类”详细信息 */ - @PreAuthorize("@ss.hasPermi('system:area:query')") + @ApiOperation("获取服务区异常事件") + //@PreAuthorize("@ss.hasPermi('system:area:query')") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") String id) { @@ -78,7 +84,8 @@ public class DcEventServiceAreaController extends BaseController "异常分类"为事件“事件子类” */ - @PreAuthorize("@ss.hasPermi('system:area:add')") + @ApiOperation("新增服务区异常事件") + //@PreAuthorize("@ss.hasPermi('system:area:add')") @Log(title = "服务区异常事件 ", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody DcEventServiceArea dcEventServiceArea) @@ -91,7 +98,8 @@ public class DcEventServiceAreaController extends BaseController "异常分类"为事件“事件子类” */ - @PreAuthorize("@ss.hasPermi('system:area:edit')") + @ApiOperation("修改服务区异常事件") + // @PreAuthorize("@ss.hasPermi('system:area:edit')") @Log(title = "服务区异常事件", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody DcEventServiceArea dcEventServiceArea) @@ -104,7 +112,8 @@ public class DcEventServiceAreaController extends BaseController "异常分类"为事件“事件子类” */ - @PreAuthorize("@ss.hasPermi('system:area:remove')") + @ApiOperation("删除服务区异常事件") + // @PreAuthorize("@ss.hasPermi('system:area:remove')") @Log(title = "服务区异常事件 ", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable String[] ids) diff --git a/zc-business/src/main/java/com/zc/business/controller/DcEventTrafficCongestionController.java b/zc-business/src/main/java/com/zc/business/controller/DcEventTrafficCongestionController.java index 81bd6495..d3cbcc76 100644 --- a/zc-business/src/main/java/com/zc/business/controller/DcEventTrafficCongestionController.java +++ b/zc-business/src/main/java/com/zc/business/controller/DcEventTrafficCongestionController.java @@ -6,6 +6,7 @@ import javax.servlet.http.HttpServletResponse; import com.zc.business.domain.DcEventTrafficCongestion; import com.zc.business.service.IDcEventTrafficCongestionService; import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; @@ -45,7 +46,8 @@ public class DcEventTrafficCongestionController extends BaseController "拥堵类型"为事件“事件子类”列表 */ - @PreAuthorize("@ss.hasPermi('system:congestion:list')") + @ApiOperation("查询交通拥堵事件") + //@PreAuthorize("@ss.hasPermi('system:congestion:list')") @GetMapping("/list") public TableDataInfo list(DcEventTrafficCongestion dcEventTrafficCongestion) { @@ -59,7 +61,8 @@ public class DcEventTrafficCongestionController extends BaseController "拥堵类型"为事件“事件子类”列表 */ - @PreAuthorize("@ss.hasPermi('system:congestion:export')") + + //@PreAuthorize("@ss.hasPermi('system:congestion:export')") @Log(title = "交通拥堵事件 ", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, DcEventTrafficCongestion dcEventTrafficCongestion) @@ -74,7 +77,8 @@ public class DcEventTrafficCongestionController extends BaseController "拥堵类型"为事件“事件子类”详细信息 */ - @PreAuthorize("@ss.hasPermi('system:congestion:query')") + @ApiOperation("获取交通拥堵事件") + // @PreAuthorize("@ss.hasPermi('system:congestion:query')") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") String id) { @@ -86,7 +90,8 @@ public class DcEventTrafficCongestionController extends BaseController "拥堵类型"为事件“事件子类” */ - @PreAuthorize("@ss.hasPermi('system:congestion:add')") + @ApiOperation("新增交通拥堵事件") + //@PreAuthorize("@ss.hasPermi('system:congestion:add')") @Log(title = "交通拥堵事件", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody DcEventTrafficCongestion dcEventTrafficCongestion) @@ -99,7 +104,8 @@ public class DcEventTrafficCongestionController extends BaseController "拥堵类型"为事件“事件子类” */ - @PreAuthorize("@ss.hasPermi('system:congestion:edit')") + @ApiOperation("修改交通拥堵事件") + // @PreAuthorize("@ss.hasPermi('system:congestion:edit')") @Log(title = "交通拥堵事件", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody DcEventTrafficCongestion dcEventTrafficCongestion) @@ -112,7 +118,8 @@ public class DcEventTrafficCongestionController extends BaseController "拥堵类型"为事件“事件子类” */ - @PreAuthorize("@ss.hasPermi('system:congestion:remove')") + @ApiOperation("删除交通拥堵事件") + // @PreAuthorize("@ss.hasPermi('system:congestion:remove')") @Log(title = "交通拥堵事件", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable String[] ids) diff --git a/zc-business/src/main/java/com/zc/business/controller/DcEventTrafficControlController.java b/zc-business/src/main/java/com/zc/business/controller/DcEventTrafficControlController.java index 3aee14a1..0e1e6464 100644 --- a/zc-business/src/main/java/com/zc/business/controller/DcEventTrafficControlController.java +++ b/zc-business/src/main/java/com/zc/business/controller/DcEventTrafficControlController.java @@ -5,6 +5,8 @@ import javax.servlet.http.HttpServletResponse; import com.zc.business.domain.DcEventTrafficControl; import com.zc.business.service.IDcEventTrafficControlService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; @@ -31,6 +33,7 @@ import com.ruoyi.common.core.page.TableDataInfo; * @author ruoyi * @date 2024-01-12 */ +@Api(tags = "交通管制事件") @RestController @RequestMapping("/system/control") public class DcEventTrafficControlController extends BaseController @@ -43,7 +46,8 @@ public class DcEventTrafficControlController extends BaseController "管制设施"为事件“事件子类”列表 */ - @PreAuthorize("@ss.hasPermi('system:control:list')") + @ApiOperation("查询交通管制事件") + //@PreAuthorize("@ss.hasPermi('system:control:list')") @GetMapping("/list") public TableDataInfo list(DcEventTrafficControl dcEventTrafficControl) { @@ -57,7 +61,7 @@ public class DcEventTrafficControlController extends BaseController "管制设施"为事件“事件子类”列表 */ - @PreAuthorize("@ss.hasPermi('system:control:export')") + // @PreAuthorize("@ss.hasPermi('system:control:export')") @Log(title = "交通管制事件 ", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, DcEventTrafficControl dcEventTrafficControl) @@ -72,7 +76,8 @@ public class DcEventTrafficControlController extends BaseController "管制设施"为事件“事件子类”详细信息 */ - @PreAuthorize("@ss.hasPermi('system:control:query')") + @ApiOperation("获取交通管制事件") + // @PreAuthorize("@ss.hasPermi('system:control:query')") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") String id) { @@ -84,7 +89,8 @@ public class DcEventTrafficControlController extends BaseController "管制设施"为事件“事件子类” */ - @PreAuthorize("@ss.hasPermi('system:control:add')") + @ApiOperation("新增交通管制事件") + // @PreAuthorize("@ss.hasPermi('system:control:add')") @Log(title = "交通管制事件", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody DcEventTrafficControl dcEventTrafficControl) @@ -97,7 +103,8 @@ public class DcEventTrafficControlController extends BaseController "管制设施"为事件“事件子类” */ - @PreAuthorize("@ss.hasPermi('system:control:edit')") + @ApiOperation("修改交通管制事件") + //@PreAuthorize("@ss.hasPermi('system:control:edit')") @Log(title = "交通管制事件", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody DcEventTrafficControl dcEventTrafficControl) @@ -110,7 +117,8 @@ public class DcEventTrafficControlController extends BaseController "管制设施"为事件“事件子类” */ - @PreAuthorize("@ss.hasPermi('system:control:remove')") + @ApiOperation("删除交通管制事件") + //@PreAuthorize("@ss.hasPermi('system:control:remove')") @Log(title = "交通管制事件", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable String[] ids) diff --git a/zc-business/src/main/java/com/zc/business/controller/DcEventTypeController.java b/zc-business/src/main/java/com/zc/business/controller/DcEventTypeController.java index ea17ddb3..368dc349 100644 --- a/zc-business/src/main/java/com/zc/business/controller/DcEventTypeController.java +++ b/zc-business/src/main/java/com/zc/business/controller/DcEventTypeController.java @@ -26,12 +26,12 @@ import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.core.page.TableDataInfo; /** - * 事件类型Controller + * 事件处置流程Controller * * @author ruoyi * @date 2024-01-03 */ -@Api(value = "事件类型",tags = {"事件类型"}) +@Api(value = "事件处置流程配置",tags = {"事件处置流程配置"}) @RestController @RequestMapping("/business/dcEventType") public class DcEventTypeController extends BaseController @@ -40,9 +40,9 @@ public class DcEventTypeController extends BaseController private IDcEventTypeService dcEventTypeService; /** - * 查询事件类型列表 + * 查询事件类型配置列表 */ - @ApiOperation("查询事件类型列表") + @ApiOperation("查询事件类型配置列表") // @PreAuthorize("@ss.hasPermi('business:dcEventType:list')") @GetMapping("/list") public TableDataInfo list(DcEventType dcEventType) @@ -53,22 +53,22 @@ public class DcEventTypeController extends BaseController } /** - * 导出事件类型列表 + * 导出事件类型配置列表 */ // @PreAuthorize("@ss.hasPermi('business:dcEventType:export')") - @Log(title = "事件类型", businessType = BusinessType.EXPORT) + @Log(title = "事件类型配置", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, DcEventType dcEventType) { List list = dcEventTypeService.selectDcEventTypeList(dcEventType); ExcelUtil util = new ExcelUtil<>(DcEventType.class); - util.exportExcel(response, list, "事件类型数据"); + util.exportExcel(response, list, "事件类型配置数据"); } /** - * 获取事件类型详细信息 + * 获取事件类型配置详细信息 */ - @ApiOperation("获取事件类型详细信息") + @ApiOperation("获取事件类型配置详细信息") // @PreAuthorize("@ss.hasPermi('business:dcEventType:query')") @GetMapping(value = "/{eventType}") public AjaxResult getInfo(@PathVariable("eventType") @ApiParam(name = "eventType", value = "事件类型", required = true) Integer eventType) @@ -79,10 +79,10 @@ public class DcEventTypeController extends BaseController /** * 新增事件类型 */ - @ApiOperation("新增事件类型") +// @ApiOperation("新增事件类型") // @PreAuthorize("@ss.hasPermi('business:dcEventType:add')") @Log(title = "事件类型", businessType = BusinessType.INSERT) - @PostMapping + @PostMapping("/add") public AjaxResult add(@RequestBody DcEventType dcEventType) { return dcEventTypeService.insertDcEventType(dcEventType); @@ -91,19 +91,19 @@ public class DcEventTypeController extends BaseController /** * 修改事件类型 */ - @ApiOperation("修改事件类型") + @ApiOperation("修改事件流程配置") // @PreAuthorize("@ss.hasPermi('business:dcEventType:edit')") @Log(title = "事件类型", businessType = BusinessType.UPDATE) - @PutMapping - public AjaxResult edit(@RequestBody DcEventType dcEventType) + @PostMapping("/updateDcProcessConfig") + public AjaxResult updateDcProcessConfig(@RequestBody DcEventType dcEventType) { - return dcEventTypeService.updateDcEventType(dcEventType); + return dcEventTypeService.updateDcProcessConfig(dcEventType); } /** * 删除事件类型 */ - @ApiOperation("删除事件类型") +// @ApiOperation("删除事件类型") // @PreAuthorize("@ss.hasPermi('business:dcEventType:remove')") @Log(title = "事件类型", businessType = BusinessType.DELETE) @DeleteMapping("/{eventType}") diff --git a/zc-business/src/main/java/com/zc/business/controller/DcEventVehicleAccidentController.java b/zc-business/src/main/java/com/zc/business/controller/DcEventVehicleAccidentController.java index 2b5262e6..d8667e02 100644 --- a/zc-business/src/main/java/com/zc/business/controller/DcEventVehicleAccidentController.java +++ b/zc-business/src/main/java/com/zc/business/controller/DcEventVehicleAccidentController.java @@ -60,6 +60,7 @@ public class DcEventVehicleAccidentController extends BaseController * 导出车辆事故事件 列表 */ + //@PreAuthorize("@ss.hasPermi('system:accident:export')") @Log(title = "车辆事故事件 ", businessType = BusinessType.EXPORT) @PostMapping("/export") diff --git a/zc-business/src/main/java/com/zc/business/controller/DcTrafficIncidentsController.java b/zc-business/src/main/java/com/zc/business/controller/DcTrafficIncidentsController.java new file mode 100644 index 00000000..a044397b --- /dev/null +++ b/zc-business/src/main/java/com/zc/business/controller/DcTrafficIncidentsController.java @@ -0,0 +1,97 @@ +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.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @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("/getAllEventNum") + public AjaxResult getAllEventNum(){ + return trafficIncidentsService.getAllEventNum(); + } +} diff --git a/zc-business/src/main/java/com/zc/business/domain/DcEvent.java b/zc-business/src/main/java/com/zc/business/domain/DcEvent.java index 66d03504..874f0670 100644 --- a/zc-business/src/main/java/com/zc/business/domain/DcEvent.java +++ b/zc-business/src/main/java/com/zc/business/domain/DcEvent.java @@ -106,7 +106,7 @@ public class DcEvent extends BaseEntity { * 3-3 立交封闭和限行 * 3-4 服务区封闭和限行 */ - @ApiModelProperty("事件子类") + @ApiModelProperty("事件子类 例:事件子类:* 1-1 追尾* 1-2 侧翻* 1-3 撞护栏* 1-4 自然* 1-5 其他事故* 2-1 车辆故障") private String eventSubclass; /** @@ -125,14 +125,14 @@ public class DcEvent extends BaseEntity { private String description; /** * 事件状态: - * 0-待确认 - * 1-已确认 - * 2-处理中 - * 3-已完成 - * 4-已撤销 + 事件状态: + 0-待确认 + 1-已确认 + 2-处理中 + 3-已完成 + 4-已撤销 */ - @ApiModelProperty("事件状态") - + @ApiModelProperty("事件状态 事件状态:* 0-未解决1-已解决2-已关闭") private Long eventState; /** @@ -145,7 +145,7 @@ public class DcEvent extends BaseEntity { * 6-一键救援 * 7-其他 */ - @ApiModelProperty("事件来源") + @ApiModelProperty("事件来源 * 1-96659* 2-交警转接* 3-道路巡查* 4-视频巡查* 5-视频AI* 6-一键救援* 7-其他") private Long eventSource; /** @@ -153,7 +153,7 @@ public class DcEvent extends BaseEntity { * 1-首发事件 * 2-关联事件 */ - @ApiModelProperty("事件性质") + @ApiModelProperty("事件性质 * 1-首发事件* 2-关联事件") private Long eventNature; @@ -161,14 +161,12 @@ public class DcEvent extends BaseEntity { * 事件来源补充说明 */ @ApiModelProperty("事件来源补充说明") - private String eventSourceTips; /** * 是否处在隧道 */ - @ApiModelProperty("是否处在隧道") - + @ApiModelProperty("是否处在隧道 0 表示 false,1 表示 true") private Integer inTunnel; public void setId(String id) { diff --git a/zc-business/src/main/java/com/zc/business/domain/DcEventAbnormalWeather.java b/zc-business/src/main/java/com/zc/business/domain/DcEventAbnormalWeather.java index d3d8a605..8dcf4a38 100644 --- a/zc-business/src/main/java/com/zc/business/domain/DcEventAbnormalWeather.java +++ b/zc-business/src/main/java/com/zc/business/domain/DcEventAbnormalWeather.java @@ -32,21 +32,7 @@ public class DcEventAbnormalWeather extends BaseEntity /** 事件编号 */ private String id; - /** 天气情况: - 1-1 雨雾 - 1-2 雨雪 - 1-3 中雨 - 1-4 小雨 - 1-5 大雨 - 1-6 暴雨 - 2-1 小雪 - 2-2 中雪 - 2-3 大雪 - 2-4 暴雪 - 2-5 大暴雪 - 2-6 特大暴雪 - 3-1 轻雾 - 3-2 大雾 + /** 天气情况:1-1 雨雾1-2 雨雪1-3 中雨1-4 小雨1-5 大雨1-6 暴雨2-1 小雪2-2 中雪2-3 大雪2-4 暴雪2-5 大暴雪2-6 特大暴雪3-1 轻雾3-2 大雾 3-3 浓雾 3-4 强浓雾 3-5 团雾 diff --git a/zc-business/src/main/java/com/zc/business/domain/DcEventAccident.java b/zc-business/src/main/java/com/zc/business/domain/DcEventAccident.java index fac358c6..17453bce 100644 --- a/zc-business/src/main/java/com/zc/business/domain/DcEventAccident.java +++ b/zc-business/src/main/java/com/zc/business/domain/DcEventAccident.java @@ -48,7 +48,7 @@ public class DcEventAccident extends BaseEntity { * 5-自燃 * 6-追尾 */ - @ApiModelProperty("交通事故类型") + @ApiModelProperty("交通事故类型 * 1-侧翻* 2-撞障碍物* 3-货物洒落* 4-撞护栏* 5-自燃* 6-追尾") private Long accidentType; /** @@ -58,7 +58,7 @@ public class DcEventAccident extends BaseEntity { * 3-立交桥 * 4-收费站 */ - @ApiModelProperty("地点方式") + @ApiModelProperty("地点方式 * 1-高速主线* 2-服务区* 3-立交桥* 4-收费站") private Long locationType; /** @@ -75,7 +75,7 @@ public class DcEventAccident extends BaseEntity { * 4-雾 * 5-其他 */ - @ApiModelProperty("天气情况") + @ApiModelProperty("天气情况 * 1-晴* 2-雨* 3-雪* 4-雾* 5-其他") private Long weatherCondition; /** @@ -86,7 +86,7 @@ public class DcEventAccident extends BaseEntity { * 4-车辆复燃 * 5-散装人工倒货 */ - @ApiModelProperty("影响") + @ApiModelProperty("影响 1-无* 2-危化品泄漏* 3-整车自燃* 4-车辆复燃* 5-散装人工倒货") private Long impactLevel; diff --git a/zc-business/src/main/java/com/zc/business/domain/DcEventConstruction.java b/zc-business/src/main/java/com/zc/business/domain/DcEventConstruction.java index c857e13f..ddd71121 100644 --- a/zc-business/src/main/java/com/zc/business/domain/DcEventConstruction.java +++ b/zc-business/src/main/java/com/zc/business/domain/DcEventConstruction.java @@ -26,24 +26,25 @@ import com.ruoyi.common.core.domain.BaseEntity; public class DcEventConstruction extends BaseEntity { private static final long serialVersionUID = 1L; - +@ApiModelProperty("事件编号") /** 事件编号 */ private String id; /** 管制方式: 1-封闭 2-不封闭 */ - +@ApiModelProperty("管制方式") private Long controlMode; /** 地点类型: 1-单点 2-多点 */ - +@ApiModelProperty("地点类型:1-单点2-多点") private Long locationType; /** 特殊地点描述 */ @Excel(name = "特殊地点描述") + @ApiModelProperty("特殊地点描述") private String specialPlaceDescription; /** 专项施工: @@ -51,11 +52,12 @@ public class DcEventConstruction extends BaseEntity 2-改扩建专项工程施工 3-桥梁专项工程施工 4-其他专项工程施工 */ - +@ApiModelProperty(" 专项施工:1-专项工程施工2-改扩建专项工程施工3-桥梁专项工程施工\4-其他专项工程施工 ") private Long specialConstruction; /** 其他施工名称 */ @Excel(name = "其他施工名称") + @ApiModelProperty("其他施工名称") private String otherConstructionName; /** 施工措施: @@ -63,7 +65,7 @@ public class DcEventConstruction extends BaseEntity 1-并道行驶 2-临时保通 3-借路侧服务区通行 */ - +@ApiModelProperty("施工措施 0-无1-并道行驶2-临时保通3-借路侧服务区通行") private Long constructionMeasurement; /** 字段名称对应: @@ -72,24 +74,25 @@ public class DcEventConstruction extends BaseEntity 服务区 */ - +@ApiModelProperty("字段名称对应:互通立交 收费站 服务区") private Long facilityId; /** 出入口(收费站/服务区): 1-出口 2-入口 */ + @ApiModelProperty(" 出入口(收费站/服务区):1-出口 2-入口 ") @Excel(name = "出入口", readConverterExp = "收=费站/服务区") private Long exitsInlets; /** 占用车道 */ - +@ApiModelProperty("占用车道") private String laneOccupancy; /** 通行情况: 1-通行正常 2-通行受阻 */ - +@ApiModelProperty("通行情况:1-通行正常 2-通行受阻") private Long trafficCondition; @ApiModelProperty("事件信息实体") diff --git a/zc-business/src/main/java/com/zc/business/domain/DcEventServiceArea.java b/zc-business/src/main/java/com/zc/business/domain/DcEventServiceArea.java index b692323b..621068b9 100644 --- a/zc-business/src/main/java/com/zc/business/domain/DcEventServiceArea.java +++ b/zc-business/src/main/java/com/zc/business/domain/DcEventServiceArea.java @@ -26,18 +26,18 @@ import com.ruoyi.common.core.domain.BaseEntity; public class DcEventServiceArea extends BaseEntity { private static final long serialVersionUID = 1L; - +@ApiModelProperty("事件编号") /** 事件编号 */ private String id; /** 出入口: 1-出口 2-入口 */ - + @ApiModelProperty("出入口:1-出口 2-入口") private Long exitsInlets; /** 服务区 */ - @Excel(name = "服务区") + @ApiModelProperty("服务区") private Long facilityId; /** 停用设施: @@ -46,7 +46,7 @@ public class DcEventServiceArea extends BaseEntity 3-停车场 4-加油站 5-充电桩 */ - +@ApiModelProperty("停用设施:1-卫生间2-餐厅3-停车场4-加油站5-充电桩") private Long disableFacility; @ApiModelProperty("事件信息实体") //事件信息表 diff --git a/zc-business/src/main/java/com/zc/business/domain/DcEventTrafficCongestion.java b/zc-business/src/main/java/com/zc/business/domain/DcEventTrafficCongestion.java index 4e82525e..71612e8e 100644 --- a/zc-business/src/main/java/com/zc/business/domain/DcEventTrafficCongestion.java +++ b/zc-business/src/main/java/com/zc/business/domain/DcEventTrafficCongestion.java @@ -1,6 +1,7 @@ package com.zc.business.domain; import com.baomidou.mybatisplus.annotation.TableField; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.AllArgsConstructor; import lombok.Data; @@ -21,15 +22,16 @@ import com.ruoyi.common.core.domain.BaseEntity; @Data @AllArgsConstructor @NoArgsConstructor +@ApiModel(value = "DcEventTrafficCongestion",description = "交通拥堵事件") public class DcEventTrafficCongestion extends BaseEntity { private static final long serialVersionUID = 1L; - +@ApiModelProperty("事件编号") /** 事件编号 */ private String id; /** 拥堵里程(公里) */ - @Excel(name = "拥堵里程(公里)") + @ApiModelProperty("拥堵里程(公里)") private Long congestionMileage; /** 拥堵原因: @@ -38,7 +40,7 @@ public class DcEventTrafficCongestion extends BaseEntity 3-恶劣天气 4-施工 5-其他 */ - + @ApiModelProperty("拥堵原因:1-车流量大2-交通事故3-恶劣天气4-施工5-其他") private Long congestionCause; /** 字段名称对应: @@ -47,10 +49,11 @@ public class DcEventTrafficCongestion extends BaseEntity 服务器拥堵->服务区 */ - +@ApiModelProperty("字段名称对应:立交拥堵->互通立交 收费站拥堵->拥堵收费站 服务器拥堵->服务区") private Long facilityId; /** 匝道(立交) */ + @ApiModelProperty(" 匝道(立交)") @Excel(name = "匝道", readConverterExp = "立=交") private Long rampId; @@ -64,7 +67,7 @@ public class DcEventTrafficCongestion extends BaseEntity 7-出口车道 8-入口匝道 9-出口匝道 */ - @Excel(name = "地点", readConverterExp = "收=费站") + @ApiModelProperty("地点(收费站):1-入口 2-出口 3-入口内广场 4--出口内广场5-外广场6-入口车道7-出口车道8-入口匝道9-出口匝道 ") private Long location; @ApiModelProperty("事件信息实体") diff --git a/zc-business/src/main/java/com/zc/business/domain/DcEventTrafficControl.java b/zc-business/src/main/java/com/zc/business/domain/DcEventTrafficControl.java index 384cfa1e..bf900daf 100644 --- a/zc-business/src/main/java/com/zc/business/domain/DcEventTrafficControl.java +++ b/zc-business/src/main/java/com/zc/business/domain/DcEventTrafficControl.java @@ -26,14 +26,14 @@ import com.ruoyi.common.core.domain.BaseEntity; public class DcEventTrafficControl extends BaseEntity { private static final long serialVersionUID = 1L; - +@ApiModelProperty("事件编号") /** 事件编号 */ private String id; /** 管制分类: 1-封闭 2-限行 */ - +@ApiModelProperty("管制分类:1-封闭2-限行") private Long controlType; /** 管制原因: @@ -43,12 +43,13 @@ public class DcEventTrafficControl extends BaseEntity 4-施工 5-警备任务 6-其他 */ - +@ApiModelProperty("管制原因:1-车流量大 2-交通事故3-恶劣天气4-施工5-警备任务6-其他") private Long controlCause; /** 出入口(收费站/服务区): 1-出口 2-入口 */ + @ApiModelProperty("出入口(收费站/服务区):1-出口2-入口") @Excel(name = "出入口", readConverterExp = "收=费站/服务区") private Long exitsInlets; @@ -58,13 +59,16 @@ public class DcEventTrafficControl extends BaseEntity 服务区 */ + @ApiModelProperty(" 字段名称对应:立交桥 收费站 服务区") private Long facilityId; /** 匝道(立交) */ + @ApiModelProperty("匝道(立交)") @Excel(name = "匝道", readConverterExp = "立=交") private Long rampId; - +@ApiModelProperty("高速公路 id") + private Long roadId; @ApiModelProperty("事件信息实体") //事件信息表 @TableField(exist = false) diff --git a/zc-business/src/main/java/com/zc/business/domain/DcEventType.java b/zc-business/src/main/java/com/zc/business/domain/DcEventType.java index bb1eaa8a..55a675f3 100644 --- a/zc-business/src/main/java/com/zc/business/domain/DcEventType.java +++ b/zc-business/src/main/java/com/zc/business/domain/DcEventType.java @@ -21,12 +21,12 @@ public class DcEventType { /** 事件类型 */ - @ApiModelProperty(value = "事件类型", required = true) + @ApiModelProperty(value = "事件类型") @Excel(name = "事件类型") private Integer eventType; /** 事件名称 */ - @ApiModelProperty(value = "事件名称", required = true) + @ApiModelProperty(value = "事件名称") @Excel(name = "事件名称") private String eventName; diff --git a/zc-business/src/main/java/com/zc/business/domain/DcEventVehicleAccident.java b/zc-business/src/main/java/com/zc/business/domain/DcEventVehicleAccident.java index 8c8b6267..c4d850f8 100644 --- a/zc-business/src/main/java/com/zc/business/domain/DcEventVehicleAccident.java +++ b/zc-business/src/main/java/com/zc/business/domain/DcEventVehicleAccident.java @@ -1,6 +1,7 @@ package com.zc.business.domain; import com.baomidou.mybatisplus.annotation.TableField; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.AllArgsConstructor; import lombok.Data; @@ -20,19 +21,20 @@ import com.ruoyi.common.core.domain.BaseEntity; @Data @NoArgsConstructor @AllArgsConstructor +@ApiModel(value = "DcEventVehicleAccident",description = "车辆事故事件") public class DcEventVehicleAccident extends BaseEntity { private static final long serialVersionUID = 1L; - +@ApiModelProperty("事件编号") /** 事件编号 */ private String id; /** 报警人姓名 */ - @Excel(name = "报警人姓名") + @ApiModelProperty("报警人姓名") private String reporterName; /** 报警人电话 */ - @Excel(name = "报警人电话") + @ApiModelProperty("报警人电话") private String reporterPhoneNumber; /** 地点方式 @@ -40,11 +42,11 @@ public class DcEventVehicleAccident extends BaseEntity 2-服务区 3-立交桥 4-收费站 */ - + @ApiModelProperty("地点方式1-高速主线2-服务区3-立交桥4-收费站") private Long locationType; /** 压车(公里) */ - @Excel(name = "压车(公里)") + @ApiModelProperty("压车(公里)") private Long trafficJam; /** 天气情况: @@ -54,19 +56,19 @@ public class DcEventVehicleAccident extends BaseEntity 4-雾 5-其他 */ - +@ApiModelProperty("天气情况:1-晴 2-雨 3-雪 4-雾 5-其他") private Long weatherCondition; /** 前方是否拥堵 */ - @Excel(name = "前方是否拥堵") +@ApiModelProperty("前方是否拥堵") private Integer congestionAhead; /** 是否分岔口 */ - @Excel(name = "是否分岔口") + @ApiModelProperty("是否分岔口") private Integer atIntersection; /** 是否处在弯道 */ - @Excel(name = "是否处在弯道") + @ApiModelProperty( "是否处在弯道") private Integer onCurve; /** 车道占用: @@ -76,39 +78,39 @@ public class DcEventVehicleAccident extends BaseEntity 3-行3 4-行4 */ - + @ApiModelProperty("车道占用:0-应急,1-行1 ,2-行2,3-行3,4-行4") private Long laneOccupancy; /** 小型车(辆) */ - @Excel(name = "小型车(辆)") + @ApiModelProperty("小型车(辆)") private Long smallCar; /** 货车(辆) */ - @Excel(name = "货车(辆)") + @ApiModelProperty( "货车(辆)") private Long trucks; /** 客车(辆) */ - @Excel(name = "客车(辆)") + @ApiModelProperty( "客车(辆)") private Long buses; /** 罐车(辆) */ - @Excel(name = "罐车(辆)") + @ApiModelProperty("罐车(辆)") private Long tankers; /** 轻伤(人) */ - @Excel(name = "轻伤(人)") + @ApiModelProperty("轻伤(人)") private Long minorInjuries; /** 重伤(人) */ - @Excel(name = "重伤(人)") + @ApiModelProperty("重伤(人)") private Long seriousInjuries; /** 死亡(人) */ - @Excel(name = "死亡(人)") + @ApiModelProperty( "死亡(人)") private Long fatalities; /** 私密事件 */ - @Excel(name = "私密事件") + @ApiModelProperty( "私密事件") private Integer isPrivate; @ApiModelProperty("事件信息实体") diff --git a/zc-business/src/main/java/com/zc/business/domain/DcProcessConfig.java b/zc-business/src/main/java/com/zc/business/domain/DcProcessConfig.java index 936948fa..b19ee3f6 100644 --- a/zc-business/src/main/java/com/zc/business/domain/DcProcessConfig.java +++ b/zc-business/src/main/java/com/zc/business/domain/DcProcessConfig.java @@ -21,7 +21,7 @@ public class DcProcessConfig private Long id; /** 事件类型 */ - @ApiModelProperty(value = "事件类型", required = true) + @ApiModelProperty(value = "事件类型") private Integer eventType; /** 处置流程 */ diff --git a/zc-business/src/main/java/com/zc/business/domain/DcRamp.java b/zc-business/src/main/java/com/zc/business/domain/DcRamp.java index ec6b903e..120ac8b3 100644 --- a/zc-business/src/main/java/com/zc/business/domain/DcRamp.java +++ b/zc-business/src/main/java/com/zc/business/domain/DcRamp.java @@ -1,6 +1,7 @@ package com.zc.business.domain; import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import com.ruoyi.common.annotation.Excel; @@ -18,31 +19,33 @@ public class DcRamp extends BaseEntity private static final long serialVersionUID = 1L; /** 主键 */ + @ApiModelProperty("id") private Long id; /** 互通立交 */ - @Excel(name = "互通立交") + + @ApiModelProperty( "互通立交") private Long facilityId; /** 匝道名称 */ - @Excel(name = "匝道名称") + @ApiModelProperty( "匝道名称") private String rampName; /** 匝道长度(米) */ - @Excel(name = "匝道长度", readConverterExp = "米=") + @ApiModelProperty( "匝道长度米") private Long lengthMeters; /** 设计速度(公里/小时) */ - @Excel(name = "设计速度", readConverterExp = "公=里/小时") + @ApiModelProperty("设计速度(公里/小时)") private Long designSpeed; /** 匝道类型: (如:直行、转弯、环形等) */ - @Excel(name = "匝道类型:", readConverterExp = "如=:直行、转弯、环形等") + @ApiModelProperty( "匝道类型:如=:直行、转弯、环形等") private String rampType; /** 匝道宽度(米) */ - @Excel(name = "匝道宽度", readConverterExp = "米=") + @ApiModelProperty("匝道宽度(米)") private Long widthMeters; public void setId(Long id) diff --git a/zc-business/src/main/java/com/zc/business/domain/DcWarning.java b/zc-business/src/main/java/com/zc/business/domain/DcWarning.java new file mode 100644 index 00000000..c060ab34 --- /dev/null +++ b/zc-business/src/main/java/com/zc/business/domain/DcWarning.java @@ -0,0 +1,235 @@ +package com.zc.business.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 预警信息对象 dc_warning + * + * @author ruoyi + * @date 2024-01-13 + */ +public class DcWarning extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 预警编号 */ + private Long id; + + /** 所在桩号 */ + @Excel(name = "所在桩号") + private String stakeMarkId; + + /** 方向: + 1-上行 + 2-中 + 3-下行 */ + @Excel(name = "方向: 1-上行 2-中 3-下行") + private String direction; + + /** 所属部门 */ + @Excel(name = "所属部门") + private Long deptId; + + /** 警情状态: + 1-上报 + 2-已完成 + 3-已终止 + 4-自动结束 */ + @Excel(name = "警情状态: 1-上报 2-已完成 3-已终止 4-自动结束") + private Integer warningState; + + /** 预警时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "预警时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date warningTime; + + /** 处理人员 */ + @Excel(name = "处理人员") + private Long userId; + + /** 信息来源: + 1-视频AI + 2-雷达识别 + 3-锥桶 + 4-护栏碰撞 + 5-扫码报警 + 6-非机预警 */ + @Excel(name = "信息来源: 1-视频AI 2-雷达识别 3-锥桶 4-护栏碰撞 5-扫码报警 6-非机预警") + private Integer warningSource; + + /** 预警级别 */ + @Excel(name = "预警级别") + private Integer warningLevel; + + /** 事件主类: + 1-交通拥堵 + 2-行人 + 3-非机动车 + 4-停车 + 5-倒车/逆行 + 6-烟火 + 7-撒落物 + 8-异常天气 + 9-护栏碰撞 */ + @Excel(name = "事件主类: 1-交通拥堵 2-行人 3-非机动车 4-停车 5-倒车/逆行 6-烟火 7-撒落物 8-异常天气 9-护栏碰撞") + private Integer warningType; + + /** 事件子类: + 1-1 拥堵 + 1-2 缓行 */ + @Excel(name = "事件子类: 1-1 拥堵 1-2 缓行") + private String warningSubclass; + + /** 事件标题 */ + @Excel(name = "事件标题") + private String warningTitle; + + /** $column.columnComment */ + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String otherConfig; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setStakeMarkId(String stakeMarkId) + { + this.stakeMarkId = stakeMarkId; + } + + public String getStakeMarkId() + { + return stakeMarkId; + } + public void setDirection(String direction) + { + this.direction = direction; + } + + public String getDirection() + { + return direction; + } + public void setDeptId(Long deptId) + { + this.deptId = deptId; + } + + public Long getDeptId() + { + return deptId; + } + public void setWarningState(Integer warningState) + { + this.warningState = warningState; + } + + public Integer getWarningState() + { + return warningState; + } + public void setWarningTime(Date warningTime) + { + this.warningTime = warningTime; + } + + public Date getWarningTime() + { + return warningTime; + } + public void setUserId(Long userId) + { + this.userId = userId; + } + + public Long getUserId() + { + return userId; + } + public void setWarningSource(Integer warningSource) + { + this.warningSource = warningSource; + } + + public Integer getWarningSource() + { + return warningSource; + } + public void setWarningLevel(Integer warningLevel) + { + this.warningLevel = warningLevel; + } + + public Integer getWarningLevel() + { + return warningLevel; + } + public void setWarningType(Integer warningType) + { + this.warningType = warningType; + } + + public Integer getWarningType() + { + return warningType; + } + public void setWarningSubclass(String warningSubclass) + { + this.warningSubclass = warningSubclass; + } + + public String getWarningSubclass() + { + return warningSubclass; + } + public void setWarningTitle(String warningTitle) + { + this.warningTitle = warningTitle; + } + + public String getWarningTitle() + { + return warningTitle; + } + public void setOtherConfig(String otherConfig) + { + this.otherConfig = otherConfig; + } + + public String getOtherConfig() + { + return otherConfig; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("stakeMarkId", getStakeMarkId()) + .append("direction", getDirection()) + .append("deptId", getDeptId()) + .append("warningState", getWarningState()) + .append("warningTime", getWarningTime()) + .append("userId", getUserId()) + .append("warningSource", getWarningSource()) + .append("warningLevel", getWarningLevel()) + .append("remark", getRemark()) + .append("createTime", getCreateTime()) + .append("updateTime", getUpdateTime()) + .append("warningType", getWarningType()) + .append("warningSubclass", getWarningSubclass()) + .append("warningTitle", getWarningTitle()) + .append("otherConfig", getOtherConfig()) + .toString(); + } +} diff --git a/zc-business/src/main/java/com/zc/business/mapper/DcPerceivedEventsWarningMapper.java b/zc-business/src/main/java/com/zc/business/mapper/DcPerceivedEventsWarningMapper.java new file mode 100644 index 00000000..d94219ce --- /dev/null +++ b/zc-business/src/main/java/com/zc/business/mapper/DcPerceivedEventsWarningMapper.java @@ -0,0 +1,27 @@ +package com.zc.business.mapper; + +import cn.hutool.core.lang.hash.Hash; +import com.zc.business.domain.DcEventType; +import com.zc.business.domain.DcWarning; + +import java.util.HashMap; +import java.util.List; + +/** + * @author 王思祥 + * @ClassName DcPerceivedEventsWarningMapper + */ + +public interface DcPerceivedEventsWarningMapper { + + //查询预警信息表数量 + int perceivedEventsWarningNum(); + //查询历史预警信息表数量 + int perceivedEventsWarningHistoryNum(); + //感知事件类型 + List selectEventTypeList(); + //查询预警感知事件类型 + List> selectWarningTypeList(); + //根据类型查询预计事件 + List selectPerceivedEventsList(DcWarning dcWarning); +} diff --git a/zc-business/src/main/java/com/zc/business/mapper/DcTrafficIncidentsMapper.java b/zc-business/src/main/java/com/zc/business/mapper/DcTrafficIncidentsMapper.java new file mode 100644 index 00000000..4cb7bbcd --- /dev/null +++ b/zc-business/src/main/java/com/zc/business/mapper/DcTrafficIncidentsMapper.java @@ -0,0 +1,125 @@ +package com.zc.business.mapper; + +import java.util.List; +import java.util.Map; + +/** + * @Description 交通事件Mapper接口 + * + * @author liuwenge + * @date 2024/1/13 9:46 + */ +public interface DcTrafficIncidentsMapper { + + /** + * @Description 首页-当日交通事件总数 + * + * @author liuwenge + * @date 2024/1/13 10:24 + * @param + * @return java.util.Map + */ + int getTrafficIncidentsAll(); + + /** + * @Description 首页-当日交通事件未完成数量 + * + * @author liuwenge + * @date 2024/1/13 10:43 + * @param + * @return int + */ + int getTrafficIncidentsProcessing(); + + /** + * @Description 首页-施工路段未完成数量 + * + * @author liuwenge + * @date 2024/1/13 10:43 + * @param + * @return int + */ + int getConstructionNum(); + + /** + * @Description 首页-事件专题-根据事件类型获取事件列表 + * + * @author liuwenge + * @date 2024/1/13 14:29 + * @param eventType + * @return java.util.List> + */ + List> getEventListByType(String eventType); + + /** + * @Description 获取本日的交通事件数量 + * + * @author liuwenge + * @date 2024/1/13 15:11 + * @param + * @return java.util.Map + */ + Long selectTrafficIncidentsDay(); + + /** + * @Description 获取本周的交通事件数量 + * + * @author liuwenge + * @date 2024/1/13 15:11 + * @param + * @return java.util.Map + */ + Long selectTrafficIncidentsWeek(); + + /** + * @Description 获取本月的交通事件数量 + * + * @author liuwenge + * @date 2024/1/13 15:11 + * @param + * @return java.util.Map + */ + Long selectTrafficIncidentsMonth(); + + /** + * @Description 获取本年的交通事件数量 + * + * @author liuwenge + * @date 2024/1/13 15:11 + * @param + * @return java.util.Map + */ + Long selectTrafficIncidentsYear(); + + /** + * @Description 查询全部的未完成事件 + * + * @author liuwenge + * @date 2024/1/13 15:20 + * @param + * @return java.lang.Long + */ + Long selectTrafficIncidentsAllProcessing(); + + /** + * @Description 查询事件类型列表 + * + * @author liuwenge + * @date 2024/1/13 15:52 + * @param + * @return java.util.List> + */ + List> selectEventTypeList(); + + /** + * @Description 查询各个处理状态数量 + * + * @author liuwenge + * @date 2024/1/13 15:57 + * @param + * @return java.util.Map + */ + List> selectStatusCountByEventType(String eventType); + + +} diff --git a/zc-business/src/main/java/com/zc/business/service/IDCPerceivedEventsWarningService.java b/zc-business/src/main/java/com/zc/business/service/IDCPerceivedEventsWarningService.java new file mode 100644 index 00000000..926cf506 --- /dev/null +++ b/zc-business/src/main/java/com/zc/business/service/IDCPerceivedEventsWarningService.java @@ -0,0 +1,23 @@ +package com.zc.business.service; + +import com.zc.business.domain.DcEventType; +import com.zc.business.domain.DcWarning; + +import java.util.HashMap; +import java.util.List; + +/** + * @author 王思祥 + * @ClassName IDCPerceivedEventsWarningService + */ + +public interface IDCPerceivedEventsWarningService { + //查询预警表所有感知事件的数量 + int perceivedEventsWarningNum(); + //感知事件类型 + List selectEventTypeList(); + //查询预警感知事件类型 + List> selectWarningTypeList(); + //根据类型查询预计事件 + List selectPerceivedEventsList(DcWarning dcWarning); +} diff --git a/zc-business/src/main/java/com/zc/business/service/IDcEventTypeService.java b/zc-business/src/main/java/com/zc/business/service/IDcEventTypeService.java index f27638a3..32a93d2e 100644 --- a/zc-business/src/main/java/com/zc/business/service/IDcEventTypeService.java +++ b/zc-business/src/main/java/com/zc/business/service/IDcEventTypeService.java @@ -43,7 +43,7 @@ public interface IDcEventTypeService * @param dcEventType 事件类型 * @return 结果 */ - AjaxResult updateDcEventType(DcEventType dcEventType); + AjaxResult updateDcProcessConfig(DcEventType dcEventType); /** * 批量删除事件类型 diff --git a/zc-business/src/main/java/com/zc/business/service/IDcTrafficIncidentsService.java b/zc-business/src/main/java/com/zc/business/service/IDcTrafficIncidentsService.java new file mode 100644 index 00000000..bdc46528 --- /dev/null +++ b/zc-business/src/main/java/com/zc/business/service/IDcTrafficIncidentsService.java @@ -0,0 +1,62 @@ +package com.zc.business.service; + +import com.ruoyi.common.core.domain.AjaxResult; + +/** + * @Description 交通事件统计Service接口 + * + * @author liuwenge + * @date 2024/1/13 9:42 + */ +public interface IDcTrafficIncidentsService { + + /** + * @Description 首页-重点数据 + * + * @author liuwenge + * @date 2024/1/13 10:09 + * @param + * @return com.ruoyi.common.core.domain.AjaxResult + */ + AjaxResult getKeyData(); + + /** + * @Description 首页-事件专题-根据事件类型获取事件列表 + * + * @author liuwenge + * @date 2024/1/13 14:26 + * @param eventType + * @return com.ruoyi.common.core.domain.AjaxResult + */ + AjaxResult getEventListByType(String eventType); + + /** + * @Description 首页-事件专题-根据事件id获取详情 + * + * @author liuwenge + * @date 2024/1/13 14:43 + * @param eventId + * @return com.ruoyi.common.core.domain.AjaxResult + */ + AjaxResult getEventInfo(String eventId); + + /** + * @Description 首页-状况统计-获取日、周、月、年的交通事件数量 + * + * @author liuwenge + * @date 2024/1/13 15:08 + * @param + * @return com.ruoyi.common.core.domain.AjaxResult + */ + AjaxResult getTrafficIncidentsNum(); + + /** + * @Description 路网管控-事件管控分析-统计各类型的交通事件数量 + * + * @author liuwenge + * @date 2024/1/13 15:46 + * @param + * @return com.ruoyi.common.core.domain.AjaxResult + */ + AjaxResult getAllEventNum(); +} diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcEventAbnormalWeatherServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcEventAbnormalWeatherServiceImpl.java index b0f79462..76b3ea16 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/DcEventAbnormalWeatherServiceImpl.java +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcEventAbnormalWeatherServiceImpl.java @@ -150,7 +150,16 @@ public class DcEventAbnormalWeatherServiceImpl implements IDcEventAbnormalWeathe @Override public int deleteDcEventAbnormalWeatherByIds(String[] ids) { - return dcEventAbnormalWeatherMapper.deleteDcEventAbnormalWeatherByIds(ids); + + int i1 = dcEventAbnormalWeatherMapper.deleteDcEventAbnormalWeatherByIds(ids); + if (i1>0){ + //删除事件表 + int i = dcEventMapper.deleteDcEventByIds(ids); + return i; + }else { + return -1; + } + } /** diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcEventAccidentServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcEventAccidentServiceImpl.java index 8f063867..1367ab32 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/DcEventAccidentServiceImpl.java +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcEventAccidentServiceImpl.java @@ -117,7 +117,16 @@ public class DcEventAccidentServiceImpl implements IDcEventAccidentService { */ @Override public int deleteDcEventAccidentByIds(String[] ids) { - return dcEventAccidentMapper.deleteDcEventAccidentByIds(ids); + + int i1 = dcEventAccidentMapper.deleteDcEventAccidentByIds(ids); + if (i1>0){ + //删除事件表 + int i = dcEventMapper.deleteDcEventByIds(ids); + return i; + }else { + return -1; + } + } /** diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcEventConstructionServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcEventConstructionServiceImpl.java index 7a9ac7f7..2131d979 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/DcEventConstructionServiceImpl.java +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcEventConstructionServiceImpl.java @@ -149,7 +149,14 @@ public class DcEventConstructionServiceImpl implements IDcEventConstructionServi @Override public int deleteDcEventConstructionByIds(String[] ids) { - return dcEventConstructionMapper.deleteDcEventConstructionByIds(ids); + int i1 = dcEventConstructionMapper.deleteDcEventConstructionByIds(ids); + if (i1>0){ + //删除事件表 + int i = dcEventMapper.deleteDcEventByIds(ids); + return i; + }else { + return -1; + } } /** @@ -165,6 +172,13 @@ public class DcEventConstructionServiceImpl implements IDcEventConstructionServi @Override public int deleteDcEventConstructionById(String id) { - return dcEventConstructionMapper.deleteDcEventConstructionById(id); + int i1 = dcEventConstructionMapper.deleteDcEventConstructionById(id); + if (i1>0){ + //删除事件表 + int i = dcEventMapper.deleteDcEventById(id); + return i; + }else { + return -1; + } } } diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcEventServiceAreaServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcEventServiceAreaServiceImpl.java index f2170aca..95c3f778 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/DcEventServiceAreaServiceImpl.java +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcEventServiceAreaServiceImpl.java @@ -148,7 +148,16 @@ public class DcEventServiceAreaServiceImpl implements IDcEventServiceAreaService @Override public int deleteDcEventServiceAreaByIds(String[] ids) { - return dcEventServiceAreaMapper.deleteDcEventServiceAreaByIds(ids); + + int i1 = dcEventServiceAreaMapper.deleteDcEventServiceAreaByIds(ids); + if (i1>0){ + //删除事件表 + int i = dcEventMapper.deleteDcEventByIds(ids); + return i; + }else { + return -1; + } + } /** diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcEventTrafficCongestionServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcEventTrafficCongestionServiceImpl.java index a2c55879..9283fccf 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/DcEventTrafficCongestionServiceImpl.java +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcEventTrafficCongestionServiceImpl.java @@ -146,7 +146,15 @@ public class DcEventTrafficCongestionServiceImpl implements IDcEventTrafficConge @Override public int deleteDcEventTrafficCongestionByIds(String[] ids) { - return dcEventTrafficCongestionMapper.deleteDcEventTrafficCongestionByIds(ids); + int i1 = dcEventTrafficCongestionMapper.deleteDcEventTrafficCongestionByIds(ids); + if (i1>0){ + //删除事件表 + int i = dcEventMapper.deleteDcEventByIds(ids); + return i; + }else { + return -1; + } + } /** diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcEventTrafficControlServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcEventTrafficControlServiceImpl.java index a4675e8e..9ffe1df9 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/DcEventTrafficControlServiceImpl.java +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcEventTrafficControlServiceImpl.java @@ -149,7 +149,17 @@ public class DcEventTrafficControlServiceImpl implements IDcEventTrafficControlS @Override public int deleteDcEventTrafficControlByIds(String[] ids) { - return dcEventTrafficControlMapper.deleteDcEventTrafficControlByIds(ids); + + int i1 = dcEventTrafficControlMapper.deleteDcEventTrafficControlByIds(ids); + if (i1>0){ + //删除事件表 + int i = dcEventMapper.deleteDcEventByIds(ids); + return i; + }else { + return -1; + } + + } /** diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcEventTypeServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcEventTypeServiceImpl.java index 56cedee4..ab80aad2 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/DcEventTypeServiceImpl.java +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcEventTypeServiceImpl.java @@ -102,29 +102,29 @@ public class DcEventTypeServiceImpl implements IDcEventTypeService } /** - * 修改事件类型 + * 修改事件流程配置 * * @param dcEventType 事件类型 * @return 结果 */ @Override - public AjaxResult updateDcEventType(DcEventType dcEventType) + public AjaxResult updateDcProcessConfig(DcEventType dcEventType) { Integer eventType = dcEventType.getEventType(); if (eventType == null || eventType == 0){ return AjaxResult.error("修改失败,参数错误"); } - //事件类型表 - dcEventTypeMapper.updateDcEventType(dcEventType); + //先批量删除 + dcProcessConfigMapper.deleteDcProcessConfigByEventType(eventType); + //事件流程配置 List processConfigList = dcEventType.getProcessConfigList(); if (processConfigList != null && processConfigList.size() > 0){ - for (DcProcessConfig dcProcessConfig : processConfigList) { - dcProcessConfig.setEventType(dcEventType.getEventType()); + for (int i=0; i0){ + //删除事件表 + int i = dcEventMapper.deleteDcEventByIds(ids); + return i; + }else { + return -1; + } } /** diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcPerceivedEventsWarningServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcPerceivedEventsWarningServiceImpl.java new file mode 100644 index 00000000..6c29de7d --- /dev/null +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcPerceivedEventsWarningServiceImpl.java @@ -0,0 +1,44 @@ +package com.zc.business.service.impl; + +import com.zc.business.domain.DcEventType; +import com.zc.business.domain.DcWarning; +import com.zc.business.mapper.DcPerceivedEventsWarningMapper; +import com.zc.business.service.IDCPerceivedEventsWarningService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.HashMap; +import java.util.List; + +/** + * @author 王思祥 + * @ClassName DcPerceivedEventsWarningServiceImpl + */ +@Service +public class DcPerceivedEventsWarningServiceImpl implements IDCPerceivedEventsWarningService { + @Autowired + private DcPerceivedEventsWarningMapper perceivedEventsWarningMapper; + + + @Override + public int perceivedEventsWarningNum() { + int warningNum = perceivedEventsWarningMapper.perceivedEventsWarningNum();//预警表数量 + int warningHistoryNum = perceivedEventsWarningMapper.perceivedEventsWarningHistoryNum();//历史预警数量 + return warningNum+warningHistoryNum; + } + //感知事件类型 + @Override + public List selectEventTypeList() { + return perceivedEventsWarningMapper.selectEventTypeList(); + } + //查询预警感知事件类型 + @Override + public List> selectWarningTypeList() { + return perceivedEventsWarningMapper.selectWarningTypeList(); + } + //根据类型查询预计事件 + @Override + public List selectPerceivedEventsList(DcWarning dcWarning) { + return perceivedEventsWarningMapper.selectPerceivedEventsList(dcWarning); + } +} diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcTrafficIncidentsServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcTrafficIncidentsServiceImpl.java new file mode 100644 index 00000000..30b0de4c --- /dev/null +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcTrafficIncidentsServiceImpl.java @@ -0,0 +1,153 @@ +package com.zc.business.service.impl; + +import com.ruoyi.common.core.domain.AjaxResult; +import com.zc.business.domain.DcEvent; +import com.zc.business.domain.DcEventType; +import com.zc.business.mapper.DcTrafficIncidentsMapper; +import com.zc.business.service.IDcTrafficIncidentsService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @Description 交通事件统计Service业务层处理 + * + * @author liuwenge + * @date 2024/1/13 9:45 + */ +@Service +public class DcTrafficIncidentsServiceImpl implements IDcTrafficIncidentsService{ + + + @Autowired + private DcTrafficIncidentsMapper trafficIncidentsMapper; + + @Autowired + private DcEventServiceImpl eventService; + + /** + * @Description 首页-重点数据 + * + * @author liuwenge + * @date 2024/1/13 10:10 + * @param + * @return com.ruoyi.common.core.domain.AjaxResult + */ + @Override + public AjaxResult getKeyData(){ + + Map result = new HashMap<>(); + result.put("total",trafficIncidentsMapper.getTrafficIncidentsAll()); + result.put("processing",trafficIncidentsMapper.getTrafficIncidentsProcessing()); + result.put("construction",trafficIncidentsMapper.getConstructionNum()); + + return AjaxResult.success(result); + } + + /** + * @Description 首页-事件专题-根据事件类型获取事件列表 + * + * @author liuwenge + * @date 2024/1/13 14:28 + * @param eventType + * @return com.ruoyi.common.core.domain.AjaxResult + */ + @Override + public AjaxResult getEventListByType(String eventType){ + + List> eventList = trafficIncidentsMapper.getEventListByType(eventType); + return AjaxResult.success(eventList); + } + + /** + * @Description 首页-事件专题-根据事件id获取事件详情 + * + * @author liuwenge + * @date 2024/1/13 14:45 + * @param eventId + * @return com.ruoyi.common.core.domain.AjaxResult + */ + @Override + public AjaxResult getEventInfo(String eventId){ + DcEvent event = eventService.selectDcEventById(eventId); + return AjaxResult.success(event); + } + + /** + * @Description 首页-状况统计-获取日、周、月、年的交通事件数量 + * + * @author liuwenge + * @date 2024/1/13 15:09 + * @param + * @return com.ruoyi.common.core.domain.AjaxResult + */ + @Override + public AjaxResult getTrafficIncidentsNum(){ + Map result = new HashMap<>(); + //本日数量 + result.put("day",trafficIncidentsMapper.selectTrafficIncidentsDay()); + //本周数量 + result.put("week",trafficIncidentsMapper.selectTrafficIncidentsWeek()); + //本月数量 + result.put("month",trafficIncidentsMapper.selectTrafficIncidentsMonth()); + //本年数量 + result.put("year",trafficIncidentsMapper.selectTrafficIncidentsYear()); + //处理中的 + result.put("processing",trafficIncidentsMapper.selectTrafficIncidentsAllProcessing()); + return AjaxResult.success(result); + } + + /** + * @Description 路网管控-事件管控分析-统计各类型的交通事件数量 + * + * @author liuwenge + * @date 2024/1/13 15:46 + * @param + * @return com.ruoyi.common.core.domain.AjaxResult + */ + @Override + public AjaxResult getAllEventNum(){ + //事件类型 + List> eventTypeList = trafficIncidentsMapper.selectEventTypeList(); + + for (Map eventType : eventTypeList) { + //该类型下的各状态事件数量 + List> eventTypeDataList = trafficIncidentsMapper.selectStatusCountByEventType(eventType.get("eventType").toString()); + + if (eventTypeDataList != null && eventTypeDataList.size() > 0){ + int total = 0; + for (Map eventTypeData : eventTypeDataList) { + + String status = eventTypeData.get("eventState").toString(); + if ("0".equals(status)) { + //待确认 + eventType.put("unconfirmed", eventTypeData.get("num")); + } else if ("1".equals(status)) { + //处理中 + eventType.put("processing", eventTypeData.get("num")); + } else if ("2".equals(status)) { + //已完成 + eventType.put("finished", eventTypeData.get("num")); + } + total += Integer.parseInt(eventTypeData.get("num").toString()); + } + eventType.put("total",total); + } else { + //待确认 + eventType.put("unconfirmed", "0"); + //处理中 + eventType.put("processing", "0"); + //已完成 + eventType.put("finished", "0"); + //总数 + eventType.put("total", "0"); + } + + } + + return AjaxResult.success(eventTypeList); + } +} diff --git a/zc-business/src/main/resources/mapper/business/DcEventTrafficControlMapper.xml b/zc-business/src/main/resources/mapper/business/DcEventTrafficControlMapper.xml index 15575f9c..7d59de6f 100644 --- a/zc-business/src/main/resources/mapper/business/DcEventTrafficControlMapper.xml +++ b/zc-business/src/main/resources/mapper/business/DcEventTrafficControlMapper.xml @@ -4,17 +4,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + + - select id, control_type, control_cause, exits_inlets, facility_id, ramp_id from dc_event_traffic_control + select id, control_type, control_cause, exits_inlets, facility_id, ramp_id,road_id from dc_event_traffic_control + select count(1) from dc_warning + + + + + + + \ No newline at end of file diff --git a/zc-business/src/main/resources/mapper/business/DcTrafficIncidentsMapper.xml b/zc-business/src/main/resources/mapper/business/DcTrafficIncidentsMapper.xml new file mode 100644 index 00000000..904cd063 --- /dev/null +++ b/zc-business/src/main/resources/mapper/business/DcTrafficIncidentsMapper.xml @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file