Commit aaffe893 authored by duanruiming's avatar duanruiming

[add] 态势监测-事件告警-历史列表

parent 16424f62
package net.wanji.opt.controllerv2; package net.wanji.opt.controllerv2;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse; import io.swagger.annotations.ApiResponse;
...@@ -57,6 +58,7 @@ public class TrendControllerV2 { ...@@ -57,6 +58,7 @@ public class TrendControllerV2 {
try { try {
list = trendServiceV2.crossOptInfoList(); list = trendServiceV2.crossOptInfoList();
} catch (Exception e) { } catch (Exception e) {
log.error("态势监测-区域体检-路口列表:{}", e);
JsonViewObject.newInstance().success(list); JsonViewObject.newInstance().success(list);
} }
return JsonViewObject.newInstance().success(list); return JsonViewObject.newInstance().success(list);
...@@ -74,6 +76,7 @@ public class TrendControllerV2 { ...@@ -74,6 +76,7 @@ public class TrendControllerV2 {
try { try {
list = trendServiceV2.greenOptInfoList(); list = trendServiceV2.greenOptInfoList();
} catch (Exception e) { } catch (Exception e) {
log.error("态势监测-区域体检-绿波列表", e);
JsonViewObject.newInstance().success(list); JsonViewObject.newInstance().success(list);
} }
return JsonViewObject.newInstance().success(list); return JsonViewObject.newInstance().success(list);
...@@ -153,7 +156,7 @@ public class TrendControllerV2 { ...@@ -153,7 +156,7 @@ public class TrendControllerV2 {
return JsonViewObject.newInstance().success(list); return JsonViewObject.newInstance().success(list);
} }
@ApiOperation(value = "态势监测-区域体检-雷达图绿波事件事件类型过滤", notes = "态势监测-区域体检-雷达图绿波事件事件类型过滤", @ApiOperation(value = "态势监测-区域体检-雷达图绿波类型过滤", notes = "态势监测-区域体检-雷达图绿波类型过滤",
response = JsonViewObject.class, response = JsonViewObject.class,
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON) produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
@PostMapping(value = "/selectGreenEventTypeCountTimeList", @PostMapping(value = "/selectGreenEventTypeCountTimeList",
...@@ -166,13 +169,13 @@ public class TrendControllerV2 { ...@@ -166,13 +169,13 @@ public class TrendControllerV2 {
try { try {
list = trendServiceV2.selectGreenEventTypeCountTimeList(vo); list = trendServiceV2.selectGreenEventTypeCountTimeList(vo);
} catch (Exception e) { } catch (Exception e) {
log.error("态势监测-事件告警-实时列表:", e); log.error("态势监测-区域体检-雷达图绿波类型过滤:", e);
JsonViewObject.newInstance().success(list); JsonViewObject.newInstance().success(list);
} }
return JsonViewObject.newInstance().success(list); return JsonViewObject.newInstance().success(list);
} }
@ApiOperation(value = "态势监测-区域体检-雷达图路口事件事件类型过滤", notes = "态势监测-区域体检-雷达图路口事件事件类型过滤", @ApiOperation(value = "态势监测-区域体检-雷达图路口类型过滤", notes = "态势监测-区域体检-雷达图路口类型过滤",
response = JsonViewObject.class, response = JsonViewObject.class,
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON) produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
@PostMapping(value = "/selectCrossEventTypeCountTimeList", @PostMapping(value = "/selectCrossEventTypeCountTimeList",
...@@ -185,11 +188,27 @@ public class TrendControllerV2 { ...@@ -185,11 +188,27 @@ public class TrendControllerV2 {
try { try {
list = trendServiceV2.selectCrossEventTypeCountTimeList(vo); list = trendServiceV2.selectCrossEventTypeCountTimeList(vo);
} catch (Exception e) { } catch (Exception e) {
log.error("态势监测-事件告警-实时列表:", e); log.error("态势监测-区域体检-雷达图路口类型过滤:", e);
JsonViewObject.newInstance().success(list); JsonViewObject.newInstance().success(list);
} }
return JsonViewObject.newInstance().success(list); return JsonViewObject.newInstance().success(list);
} }
@ApiOperation(value = "态势监测-事件告警-历史列表", notes = "态势监测-事件告警-历史列表",
response = JsonViewObject.class,
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
@GetMapping(value = "/eventAlarmHistList")
@ApiResponses({
@ApiResponse(code = 200, message = "OK", response = OptMonitoringVO.class),
})
public JsonViewObject eventAlarmHistList(int pageNo, int pageSize) throws Exception {
PageInfo<StatisticsEventTypeCountTimeVO> results = new PageInfo<>();
try {
results = trendServiceV2.selectCrossGreenHistList(pageNo, pageSize);
} catch (Exception e) {
log.error("态势监测-事件告警-历史列表:", e);
JsonViewObject.newInstance().success(results);
}
return JsonViewObject.newInstance().success(results);
}
} }
\ No newline at end of file
...@@ -96,4 +96,10 @@ public interface HoloEventMapper extends BaseMapper<HoloEventInfoPO> { ...@@ -96,4 +96,10 @@ public interface HoloEventMapper extends BaseMapper<HoloEventInfoPO> {
List<StatisticsEventTypeCountTimeVO> selectCrossEventTypeCountTimeList(@Param("type") String type, List<StatisticsEventTypeCountTimeVO> selectCrossEventTypeCountTimeList(@Param("type") String type,
@Param("startTime") LocalDateTime startTime, @Param("startTime") LocalDateTime startTime,
@Param("endTime") LocalDateTime endTime); @Param("endTime") LocalDateTime endTime);
/**
* 态势监测-事件告警-历史列表
* @return
*/
List<StatisticsEventTypeCountTimeVO> selectCrossGreenHistList();
} }
package net.wanji.opt.servicev2; package net.wanji.opt.servicev2;
import com.github.pagehelper.PageInfo;
import net.wanji.opt.vo2.*; import net.wanji.opt.vo2.*;
import java.util.List; import java.util.List;
...@@ -25,4 +26,7 @@ public interface TrendServiceV2 { ...@@ -25,4 +26,7 @@ public interface TrendServiceV2 {
List<StatisticsEventTypeCountTimeVO> selectGreenEventTypeCountTimeList(EventTypeCountTimeVO vo) throws Exception; List<StatisticsEventTypeCountTimeVO> selectGreenEventTypeCountTimeList(EventTypeCountTimeVO vo) throws Exception;
List<StatisticsEventTypeCountTimeVO> selectCrossEventTypeCountTimeList(EventTypeCountTimeVO vo) throws Exception; List<StatisticsEventTypeCountTimeVO> selectCrossEventTypeCountTimeList(EventTypeCountTimeVO vo) throws Exception;
PageInfo<StatisticsEventTypeCountTimeVO> selectCrossGreenHistList(int pageNo, int pageSize) throws Exception;
} }
\ No newline at end of file
package net.wanji.opt.servicev2.implv2; package net.wanji.opt.servicev2.implv2;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import net.wanji.common.utils.tool.DateUtil; import net.wanji.common.utils.tool.DateUtil;
import net.wanji.databus.dao.entity.GreenwaveHistPO; import net.wanji.databus.dao.entity.GreenwaveHistPO;
...@@ -294,4 +296,11 @@ public class TrendServiceV2Impl implements TrendServiceV2 { ...@@ -294,4 +296,11 @@ public class TrendServiceV2Impl implements TrendServiceV2 {
setCountDurationRate(currentList, lastDayList); setCountDurationRate(currentList, lastDayList);
return currentList; return currentList;
} }
@Override
public PageInfo<StatisticsEventTypeCountTimeVO> selectCrossGreenHistList(int pageNo, int pageSize) throws Exception {
PageHelper.startPage(pageNo, pageSize);
List<StatisticsEventTypeCountTimeVO> results = holoEventMapper.selectCrossGreenHistList();
return new PageInfo<>(results);
}
} }
\ No newline at end of file
...@@ -319,4 +319,26 @@ ...@@ -319,4 +319,26 @@
order by duration desc order by duration desc
</select> </select>
<!-- 态势监测-事件告警-历史列表 -->
<select id="selectCrossGreenHistList" resultType="net.wanji.opt.vo2.StatisticsEventTypeCountTimeVO">
select t.name, t.id, t.type, t.wkt, t.duration, t.startTime
from
(
select distinct t1.name, t1.id, ifnull(t2.type, '708') type, t1.wkt,
ifnull(TIMESTAMPDIFF(SECOND, t2.start_time, ifnull(t2.end_time,now())), 0) duration,
DATE_FORMAT(ifnull(t2.start_time, curdate()), '%Y年%m月%d日%H:%i') as startTime
from t_greenwave_info t1
left join t_event_info t2 on t1.id = t2.green_id
and t2.type in ('705', '706') and t2.dt = curdate()
union all
select distinct t1.name, t1.id, ifnull(t2.type, '700') type, REPLACE(SUBSTRING(location, 7, 18), ' ', ',') as wkt,
ifnull(TIMESTAMPDIFF(SECOND, t2.start_time, ifnull(t2.end_time,now())), 0) duration,
DATE_FORMAT(ifnull(t2.start_time, curdate()), '%Y年%m月%d日%H:%i') as startTime
from t_base_cross_info t1
left join t_event_info t2 on t1.id = t2.cross_id
and t2.type in ('701', '702', '703', '707') and t2.dt = curdate()
where t1.is_signal = 1
) t order by startTime
</select>
</mapper> </mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment