From e7fbee4bc2106fc4c089bc8e8423377696f9d71c Mon Sep 17 00:00:00 2001 From: zhao-meiyu <2970484253@qq.com> Date: Sat, 13 Jan 2024 17:22:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=84=9F=E7=9F=A5=E4=BA=8B=E4=BB=B6=E4=B8=93?= =?UTF-8?q?=E9=A2=98=EF=BC=8C=E5=85=A8=E8=B7=AF=E6=AE=B5=E6=84=9F=E7=9F=A5?= =?UTF-8?q?=E4=BA=8B=E4=BB=B6=EF=BC=8C=E6=84=9F=E7=9F=A5=E4=BA=8B=E4=BB=B6?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=EF=BC=8C=E6=84=9F=E7=9F=A5=E4=BA=8B=E4=BB=B6?= =?UTF-8?q?=E6=89=93=E7=82=B9=E7=B1=BB=E5=9E=8B=E6=9F=A5=E8=AF=A2=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E7=9B=B8=E5=85=B3=E6=95=B0=E6=8D=AE=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DCPerceivedEventsWarningController.java | 46 ++++ .../com/zc/business/domain/DcWarning.java | 235 ++++++++++++++++++ .../DcPerceivedEventsWarningMapper.java | 27 ++ .../IDCPerceivedEventsWarningService.java | 23 ++ .../DcPerceivedEventsWarningServiceImpl.java | 44 ++++ .../DcPerceivedEventsWarningMapper.xml | 30 +++ 6 files changed, 405 insertions(+) create mode 100644 zc-business/src/main/java/com/zc/business/controller/DCPerceivedEventsWarningController.java create mode 100644 zc-business/src/main/java/com/zc/business/domain/DcWarning.java create mode 100644 zc-business/src/main/java/com/zc/business/mapper/DcPerceivedEventsWarningMapper.java create mode 100644 zc-business/src/main/java/com/zc/business/service/IDCPerceivedEventsWarningService.java create mode 100644 zc-business/src/main/java/com/zc/business/service/impl/DcPerceivedEventsWarningServiceImpl.java create mode 100644 zc-business/src/main/resources/mapper/business/DcPerceivedEventsWarningMapper.xml 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/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/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/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/resources/mapper/business/DcPerceivedEventsWarningMapper.xml b/zc-business/src/main/resources/mapper/business/DcPerceivedEventsWarningMapper.xml new file mode 100644 index 00000000..d3b50a56 --- /dev/null +++ b/zc-business/src/main/resources/mapper/business/DcPerceivedEventsWarningMapper.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + \ No newline at end of file