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 index 05eed037..0b426534 100644 --- a/zc-business/src/main/java/com/zc/business/controller/DCPerceivedEventsWarningController.java +++ b/zc-business/src/main/java/com/zc/business/controller/DCPerceivedEventsWarningController.java @@ -119,7 +119,7 @@ public class DCPerceivedEventsWarningController extends BaseController { return AjaxResult.error("参数数据异常"); } if (type.equals("quarter")) { - List> total = perceivedEventsWarningService.selectWarningSectionTypeCountQuarter(dcWarning); + String total = perceivedEventsWarningService.selectWarningSectionTypeCountQuarter(dcWarning); map.put("total",total); } else { String total = perceivedEventsWarningService.selectWarningSectionTypeCount(dcWarning); @@ -140,8 +140,21 @@ public class DCPerceivedEventsWarningController extends BaseController { if (StringUtils.isBlank(direction)){ return AjaxResult.error("参数异常"); } - return AjaxResult.success(perceivedEventsWarningService.selectSectionMark(dcWarning)); + return AjaxResult.success(perceivedEventsWarningService.selectSectionMarkOptimize(dcWarning)); } + //查询某个路段下的全部桩号 +// @PostMapping("/sectionMarkNumberOptimize") +// public AjaxResult getSectionMarkOptimize(@RequestBody DcWarning dcWarning){ +// String sectionId = dcWarning.getSectionId(); +// if (StringUtils.isBlank(sectionId)){ +// return AjaxResult.error("参数异常"); +// } +// String direction = dcWarning.getDirection(); +// if (StringUtils.isBlank(direction)){ +// return AjaxResult.error("参数异常"); +// } +// return AjaxResult.success(perceivedEventsWarningService.selectSectionMarkOptimize(dcWarning)); +// } //预警事件,事件列表 查询状态为上报的感知事件 @PostMapping("/warningEscalation") 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 index d7f02601..e7afdaeb 100644 --- a/zc-business/src/main/java/com/zc/business/domain/DcWarning.java +++ b/zc-business/src/main/java/com/zc/business/domain/DcWarning.java @@ -25,10 +25,7 @@ public class DcWarning extends BaseEntity @Excel(name = "所在桩号") private String stakeMark; - /** 方向: - 1-上行 - 2-中 - 3-下行 */ + /** 方向:1-上行2-中3-下行 */ @Excel(name = "方向: 1-上行 2-中 3-下行") private String direction; @@ -36,30 +33,20 @@ public class DcWarning extends BaseEntity @Excel(name = "所属部门") private Long deptId; - /** 警情状态: - 1-上报 - 2-已完成 - 3-已终止 - 4-自动结束 */ + /** 警情状态: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") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8") + @Excel(name = "预警时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") private Date warningTime; /** 处理人员 */ @Excel(name = "处理人员") private Long userId; - /** 信息来源: - 1-视频AI - 2-雷达识别 - 3-锥桶 - 4-护栏碰撞 - 5-扫码报警 - 6-非机预警 */ + /** 信息来源:1-视频AI2-雷达识别3-锥桶4-护栏碰撞5-扫码报警6-非机预警 */ @Excel(name = "信息来源: 1-视频AI 2-雷达识别 3-锥桶 4-护栏碰撞 5-扫码报警 6-非机预警") private Integer warningSource; @@ -67,22 +54,11 @@ public class DcWarning extends BaseEntity @Excel(name = "预警级别") private Integer warningLevel; - /** 事件主类: - 1-交通拥堵 - 2-行人 - 3-非机动车 - 4-停车 - 5-倒车/逆行 - 6-烟火 - 7-撒落物 - 8-异常天气 - 9-护栏碰撞 */ + /** 事件主类: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 缓行 */ + /** 事件子类:1-1 拥堵1-2 缓行 */ @Excel(name = "事件子类: 1-1 拥堵 1-2 缓行") private String warningSubclass; @@ -112,7 +88,8 @@ public class DcWarning extends BaseEntity private String longitude; private String latitude; - + /** 车辆类型 */ + @Excel(name = "车辆类型") private String vehicleType; public String getVehicleType() { 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 index a27a458f..66f8c064 100644 --- a/zc-business/src/main/java/com/zc/business/mapper/DcPerceivedEventsWarningMapper.java +++ b/zc-business/src/main/java/com/zc/business/mapper/DcPerceivedEventsWarningMapper.java @@ -56,7 +56,7 @@ public interface DcPerceivedEventsWarningMapper { String selectWarningSectionTypeMonthCount(DcWarning dcWarning); //感知事件某路段类型季占比 List> selectWarningSectionTypeQuarter(DcWarning dcWarning); - List> selectWarningSectionTypeQuarterCount(DcWarning dcWarning); + String selectWarningSectionTypeQuarterCount(DcWarning dcWarning); //感知事件某路段类型年占比 List> selectWarningSectionTypeYear(DcWarning dcWarning); String selectWarningSectionTypeYearCount(DcWarning dcWarning); @@ -73,4 +73,8 @@ public interface DcPerceivedEventsWarningMapper { String selectWarningMarkMonth(DcWarning dcWarning); List> selectWarningMarkQuarter(DcWarning dcWarning); String selectWarningMarkYear(DcWarning dcWarning); + + List> selectWarningMarkDayOptimize(DcWarning dcWarning); + List> selectWarningMarkQuarterOptimize(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 index 87f47928..03ab7364 100644 --- a/zc-business/src/main/java/com/zc/business/service/IDCPerceivedEventsWarningService.java +++ b/zc-business/src/main/java/com/zc/business/service/IDCPerceivedEventsWarningService.java @@ -41,9 +41,10 @@ public interface IDCPerceivedEventsWarningService { //感知事件某路段类型占比 List> selectWarningSectionType(DcWarning dcWarning); String selectWarningSectionTypeCount(DcWarning dcWarning); - List> selectWarningSectionTypeCountQuarter(DcWarning dcWarning); + String selectWarningSectionTypeCountQuarter(DcWarning dcWarning); //查询某个路段下的全部桩号 List> selectSectionMark(DcWarning dcWarning); + List> selectSectionMarkOptimize(DcWarning dcWarning); //预警事件,事件列表 查询状态为上报的感知事件 List> selectWarningEscalation(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 index 15bdbb98..3953cd0f 100644 --- 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 @@ -8,6 +8,7 @@ import com.zc.business.service.IDCPerceivedEventsWarningService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import javax.sound.midi.Soundbank; import java.util.ArrayList; import java.util.Date; import java.util.HashMap; @@ -159,7 +160,7 @@ public class DcPerceivedEventsWarningServiceImpl implements IDCPerceivedEventsWa } @Override - public List> selectWarningSectionTypeCountQuarter(DcWarning dcWarning) { + public String selectWarningSectionTypeCountQuarter(DcWarning dcWarning) { if (dcWarning.getType().equals("quarter")==false){ return null; } @@ -209,6 +210,16 @@ public class DcPerceivedEventsWarningServiceImpl implements IDCPerceivedEventsWa } + @Override + public List> selectSectionMarkOptimize(DcWarning dcWarning) { + if (dcWarning.getType().equals("quarter")){ + return perceivedEventsWarningMapper.selectWarningMarkQuarterOptimize(dcWarning); + }else { + return perceivedEventsWarningMapper.selectWarningMarkDayOptimize(dcWarning); + } + } + + //预警事件,事件列表 查询状态为上报的感知事件 @Override public List> selectWarningEscalation(DcWarning dcWarning) { diff --git a/zc-business/src/main/resources/mapper/business/DcPerceivedEventsWarningMapper.xml b/zc-business/src/main/resources/mapper/business/DcPerceivedEventsWarningMapper.xml index b0863075..463eae16 100644 --- a/zc-business/src/main/resources/mapper/business/DcPerceivedEventsWarningMapper.xml +++ b/zc-business/src/main/resources/mapper/business/DcPerceivedEventsWarningMapper.xml @@ -39,19 +39,25 @@ - SELECT - CASE - WHEN MONTH(warning.create_time) BETWEEN 1 AND 3 THEN '第一季度' - WHEN MONTH(warning.create_time) BETWEEN 4 AND 6 THEN '第二季度' - WHEN MONTH(warning.create_time) BETWEEN 7 AND 9 THEN '第三季度' - ELSE '第四季度' - END AS QUARTER,COUNT(*) AS number + COUNT(*) AS number FROM dc_warning as warning LEFT JOIN dc_stake_mark AS mark ON warning.stake_mark=mark.stake_mark WHERE YEAR(warning.create_time) =DATE_FORMAT(#{createTime},'%Y') AND warning.direction=#{direction} and mark.`section_id`=#{sectionId} - GROUP BY QUARTER @@ -286,5 +286,30 @@ select count(1) from dc_warning + + + \ No newline at end of file