|
|
|
@ -1,6 +1,7 @@
|
|
|
|
|
package com.ruoyi.database.controller;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
|
import com.ruoyi.common.utils.PageUtils;
|
|
|
|
|
import com.ruoyi.common.utils.StringKit;
|
|
|
|
@ -98,6 +99,15 @@ public class MetaAlarmInfoController extends BaseController {
|
|
|
|
|
return dataTable;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping("/policeName")
|
|
|
|
|
@ApiOperation("查询")
|
|
|
|
|
public AjaxResult selectlist(MetaAlarmInfo metaAlarmInfo) {
|
|
|
|
|
List<MetaAlarmInfo> list = metaAlarmInfoService.lambdaQuery().eq(MetaAlarmInfo::getPoliceReceiverName, metaAlarmInfo.getPoliceReceiverName()).list();
|
|
|
|
|
return AjaxResult.success(list);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping("/filterByLongitude")
|
|
|
|
|
@ApiOperation("根据经度过滤接警信息表")
|
|
|
|
|
public TableDataInfo<MetaAlarmInfo> filterByLongitude() {
|
|
|
|
@ -118,7 +128,7 @@ public class MetaAlarmInfoController extends BaseController {
|
|
|
|
|
// 创建一个 TreeMap 用于存储每天的数据量
|
|
|
|
|
Map<LocalDate, Long> dailyCountsMap = new TreeMap<>();
|
|
|
|
|
// 循环迭代前7天
|
|
|
|
|
for (int i = 0; i < 7 ; i++) {
|
|
|
|
|
for (int i = 0; i < 7; i++) {
|
|
|
|
|
LocalDate date = currentDate.minusDays(i);
|
|
|
|
|
LocalDateTime startDateTime = date.atStartOfDay();
|
|
|
|
|
LocalDateTime endDateTime = date.atTime(LocalTime.MAX);
|
|
|
|
@ -141,6 +151,7 @@ public class MetaAlarmInfoController extends BaseController {
|
|
|
|
|
return AjaxResult.error("请求失败,请联系管理员");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@GetMapping("/filterByHour")
|
|
|
|
|
@ApiOperation("当天接警信息表")
|
|
|
|
|
public AjaxResult filterByHour(MetaAlarmInfo metaAlarmInfo) {
|
|
|
|
@ -160,12 +171,12 @@ public class MetaAlarmInfoController extends BaseController {
|
|
|
|
|
LocalDateTime startOfHour = startOfCurrentHour.minusHours(currentHour - i);
|
|
|
|
|
LocalDateTime endOfHour = startOfHour.plusHours(1);
|
|
|
|
|
QueryWrapper<MetaAlarmInfo> queryWrapper = new QueryWrapper<>(metaAlarmInfo);
|
|
|
|
|
queryWrapper.between("alarm_response_time",startOfHour.format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss")),
|
|
|
|
|
queryWrapper.between("alarm_response_time", startOfHour.format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss")),
|
|
|
|
|
endOfHour.format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss")));
|
|
|
|
|
//查询当前小时的记录数据总数
|
|
|
|
|
long HourCount = metaAlarmInfoService.count(queryWrapper);
|
|
|
|
|
//存
|
|
|
|
|
hourlyCountsMap.put(endOfHour.format(DateTimeFormatter.ofPattern("HH:mm")),HourCount);
|
|
|
|
|
hourlyCountsMap.put(endOfHour.format(DateTimeFormatter.ofPattern("HH:mm")), HourCount);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return AjaxResult.success(hourlyCountsMap);
|
|
|
|
@ -175,6 +186,12 @@ public class MetaAlarmInfoController extends BaseController {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// @PostMapping("/unit")
|
|
|
|
|
// @ApiOperation("根据单位查")
|
|
|
|
|
// public AjaxResult selectUnit(){
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
@PostMapping
|
|
|
|
|
@ApiOperation("新增接警信息表")
|
|
|
|
|
@Log(title = "接警信息表", businessType = BusinessType.INSERT)
|
|
|
|
|