|
|
|
package com.zc.business.controller;
|
|
|
|
|
|
|
|
import com.ruoyi.common.core.controller.BaseController;
|
|
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
|
import com.ruoyi.common.core.page.TableDataInfo;
|
|
|
|
import com.zc.business.domain.DcWarning;
|
|
|
|
import com.zc.business.service.IDCPerceivedEventsWarningService;
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
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;
|
|
|
|
|
|
|
|
import java.util.Date;
|
|
|
|
import java.util.HashMap;
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @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("/perceivedEventsList")
|
|
|
|
public TableDataInfo getPerceivedEventsList(@RequestBody DcWarning dcWarning){
|
|
|
|
startPage();
|
|
|
|
List<DcWarning> list = perceivedEventsWarningService.selectPerceivedEventsList(dcWarning);
|
|
|
|
return getDataTable(list);
|
|
|
|
}
|
|
|
|
//查询感知数量按照路段数量进行排名
|
|
|
|
@PostMapping("/sectionPerceivedList")
|
|
|
|
public AjaxResult getSectionPerceivedEventsList(){
|
|
|
|
return AjaxResult.success(perceivedEventsWarningService.selectSectionPerceivedEventsList());
|
|
|
|
}
|
|
|
|
//查询感知数量按照路段进行区分
|
|
|
|
@PostMapping("/sectionPerceivedNumber")
|
|
|
|
public AjaxResult getSectionPerceivedNumber(){
|
|
|
|
return AjaxResult.success(perceivedEventsWarningService.selectSectionPerceivedNumber());
|
|
|
|
}
|
|
|
|
//查询当前日,日累计感知事件,按照小时进行分组
|
|
|
|
@PostMapping("/dailyCumulative")
|
|
|
|
public AjaxResult getDailyCumulative(){
|
|
|
|
return AjaxResult.success(perceivedEventsWarningService.selectDailyCumulative());
|
|
|
|
}
|
|
|
|
//查询当前月,月累计感知事件,按照小时段进行分组
|
|
|
|
@PostMapping("/dailyCumulativeMonth")
|
|
|
|
public AjaxResult getDailyCumulativeMonth(){
|
|
|
|
return AjaxResult.success(perceivedEventsWarningService.selectDailyCumulativeMonth());
|
|
|
|
}
|
|
|
|
//按事件源统计感知事件统计信息
|
|
|
|
@PostMapping("/warningSourceGroup")
|
|
|
|
public AjaxResult getWarningSourceGroup(){
|
|
|
|
return AjaxResult.success(perceivedEventsWarningService.selectWarningSourceGroup());
|
|
|
|
}
|
|
|
|
//当日感知事件的处置情况占比
|
|
|
|
@PostMapping("/warningStateDay")
|
|
|
|
public AjaxResult getWarningStateDay(){
|
|
|
|
return AjaxResult.success(perceivedEventsWarningService.selectWarningStateDay());
|
|
|
|
}
|
|
|
|
//感知事件类型占比
|
|
|
|
@PostMapping("/warningTypeDay")
|
|
|
|
public AjaxResult getWarningTypeDay(){
|
|
|
|
return AjaxResult.success(perceivedEventsWarningService.selectWarningTypeDay());
|
|
|
|
}
|
|
|
|
|
|
|
|
//某一路段某一时间段的感知事件趋势
|
|
|
|
@PostMapping("/warningTrend")
|
|
|
|
public AjaxResult getWarningTrend(@RequestBody DcWarning dcWarning){
|
|
|
|
String type = dcWarning.getType();//类型
|
|
|
|
String sectionId = dcWarning.getSectionId();//路段辖区id
|
|
|
|
Date createTime = dcWarning.getCreateTime();//时间参数,参数根据类型配置,比如2022年,传值2022-00-00 00:00:00
|
|
|
|
if (StringUtils.isBlank(type)||StringUtils.isBlank(sectionId)||createTime==null){
|
|
|
|
return AjaxResult.error("参数数据异常");
|
|
|
|
}
|
|
|
|
return AjaxResult.success(perceivedEventsWarningService.selectWarningTrend(dcWarning));
|
|
|
|
}
|
|
|
|
//某一路段某一时间段的感知事件类型占比
|
|
|
|
@PostMapping("/warningSectionType")
|
|
|
|
public AjaxResult getWarningSectionType(@RequestBody DcWarning dcWarning){
|
|
|
|
String type = dcWarning.getType();//类型
|
|
|
|
String sectionId = dcWarning.getSectionId();//路段辖区id
|
|
|
|
Date createTime = dcWarning.getCreateTime();//时间参数,参数根据类型配置,比如2022年,传值2022-00-00 00:00:00
|
|
|
|
if (StringUtils.isBlank(type)||StringUtils.isBlank(sectionId)||createTime==null){
|
|
|
|
return AjaxResult.error("参数数据异常");
|
|
|
|
}
|
|
|
|
return AjaxResult.success(perceivedEventsWarningService.selectWarningSectionType(dcWarning));
|
|
|
|
}
|
|
|
|
//查询某个路段下的全部桩号
|
|
|
|
@PostMapping("/sectionMarkNumber")
|
|
|
|
public AjaxResult getSectionMark(@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.selectSectionMark(dcWarning));
|
|
|
|
}
|
|
|
|
|
|
|
|
//预警事件,事件列表 查询状态为上报的感知事件
|
|
|
|
@PostMapping("/warningEscalation")
|
|
|
|
public TableDataInfo getWarningEscalation(@RequestBody DcWarning dcWarning){
|
|
|
|
startPage();
|
|
|
|
List<HashMap<String, Object>> list = perceivedEventsWarningService.selectWarningEscalation(dcWarning);
|
|
|
|
return getDataTable(list);
|
|
|
|
}
|
|
|
|
//修改感知事件信息
|
|
|
|
@PostMapping("/updateWarning")
|
|
|
|
public AjaxResult updateWarning(@RequestBody DcWarning dcWarning){
|
|
|
|
return toAjax(perceivedEventsWarningService.updateWarning(dcWarning));
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|