|
|
|
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.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;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @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));
|
|
|
|
}
|
|
|
|
//查询感知数量按照路段数量进行排名
|
|
|
|
@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("参数异常");
|
|
|
|
}
|
|
|
|
return AjaxResult.success(perceivedEventsWarningService.selectSectionMark(dcWarning));
|
|
|
|
}
|
|
|
|
|
|
|
|
//感知事件类型占比
|
|
|
|
@PostMapping("/selectMarkId")
|
|
|
|
public AjaxResult selectMarkId(){
|
|
|
|
return AjaxResult.success(perceivedEventsWarningService.selectMarkId());
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|