重点人员人脸,车辆抓拍接口更新,警情信息接口更新

develop
hanrenchun 10 months ago
parent 2d4e297281
commit 41e54f557b

@ -7,14 +7,8 @@ import com.ruoyi.business.domain.vo.HumanVehicleStatisticsVo;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.StringKit;
import com.ruoyi.database.domain.TransitImpUserRecord;
import com.ruoyi.database.domain.TransitImpVehicleRecord;
import com.ruoyi.database.domain.TransitUserRecord;
import com.ruoyi.database.domain.TransitVehicleRecord;
import com.ruoyi.database.service.TransitImpUserRecordService;
import com.ruoyi.database.service.TransitImpVehicleRecordService;
import com.ruoyi.database.service.TransitUserRecordService;
import com.ruoyi.database.service.TransitVehicleRecordService;
import com.ruoyi.database.domain.*;
import com.ruoyi.database.service.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
@ -23,6 +17,7 @@ import org.springframework.web.bind.annotation.*;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.HashMap;
import java.util.Map;
import java.util.TreeMap;
@ -42,27 +37,35 @@ public class PerceptionDeviceController extends BaseController {
private final TransitImpVehicleRecordService vehicleRecordService;
private final TransitVehicleRecordService transitVehicleRecordService;
private final TransitUserRecordService transitUserRecordService;
private final DevopsDeviceInfoService devopsDeviceInfoService;
@PostMapping("/humanVehicleStatistics")
@ApiOperation("人车统计")
public AjaxResult overviewResources() {
try {
// 人流量统计
String todayDateString = DateUtil.today();
QueryWrapper<TransitImpUserRecord> userQueryWrapper = new QueryWrapper<>();
userQueryWrapper.eq("DATE(partition_field)", todayDateString);
int userCount = userRecordService.count(userQueryWrapper);
//车流量统计
QueryWrapper<TransitImpVehicleRecord> vehicleQueryWrapper = new QueryWrapper<>();
vehicleQueryWrapper.eq("DATE(partition_field)", todayDateString);
int vehicleCount = vehicleRecordService.count(vehicleQueryWrapper);
HumanVehicleStatisticsVo bean = new HumanVehicleStatisticsVo();
bean.setUserCount(StringKit.toString(userCount));
bean.setVehicleCount(StringKit.toString(vehicleCount));
return AjaxResult.success(bean);
// // 人流量统计
// String todayDateString = DateUtil.today();
// QueryWrapper<TransitImpUserRecord> userQueryWrapper = new QueryWrapper<>();
// userQueryWrapper.eq("DATE(partition_field)", todayDateString);
// int userCount = userRecordService.count(userQueryWrapper);
// //车流量统计
// QueryWrapper<TransitImpVehicleRecord> vehicleQueryWrapper = new QueryWrapper<>();
// vehicleQueryWrapper.eq("DATE(partition_field)", todayDateString);
// int vehicleCount = vehicleRecordService.count(vehicleQueryWrapper);
//
// HumanVehicleStatisticsVo bean = new HumanVehicleStatisticsVo();
// bean.setUserCount(StringKit.toString(userCount));
// bean.setVehicleCount(StringKit.toString(vehicleCount));
//
// return AjaxResult.success(bean);
Integer userCount = devopsDeviceInfoService.lambdaQuery().eq(DevopsDeviceInfo::getDeviceType, 1).count();
Integer vehicleCount = devopsDeviceInfoService.lambdaQuery().eq(DevopsDeviceInfo::getDeviceType, 2).count();
Map<String, Integer> map = new HashMap<>();
map.put("userCount",userCount);
map.put("vehicleCount",vehicleCount);
return AjaxResult.success(map);
} catch (Exception e) {
logger.info(StringKit.toString(e));
return AjaxResult.error("请求失败,请联系管理员");

@ -1,7 +1,9 @@
package com.ruoyi.database.controller;
import cn.hutool.core.util.PageUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ruoyi.common.utils.PageUtils;
import com.ruoyi.common.utils.StringKit;
import com.ruoyi.database.domain.MetaAlarmInfo;
import com.ruoyi.database.service.MetaAlarmInfoService;
@ -51,8 +53,7 @@ public class MetaAlarmInfoController extends BaseController {
@GetMapping("/time")
@ApiOperation("根据时间查询接警信息")
public TableDataInfo<MetaAlarmInfo> timeList(MetaAlarmInfo metaAlarmInfo) throws Exception {
startPage();
QueryWrapper<MetaAlarmInfo> queryWrapper = new QueryWrapper<>();
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
Date parse = simpleDateFormat.parse(metaAlarmInfo.getInformantTime());
Calendar calendar = Calendar.getInstance();
@ -62,17 +63,22 @@ public class MetaAlarmInfoController extends BaseController {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String resultDateString = outputSdf.format(calendar.getTime());
String format = outputSdf.format(parse);
queryWrapper.between("informant_time", format, resultDateString);
QueryWrapper<MetaAlarmInfo> queryWrapper = new QueryWrapper<>();
queryWrapper.between("alarm_response_time", format, resultDateString);
int count = metaAlarmInfoService.count(queryWrapper);
PageUtils.startPage();
List<MetaAlarmInfo> list = metaAlarmInfoService.list(queryWrapper);
ArrayList<MetaAlarmInfo> alarmInfos = new ArrayList<>();
List<MetaAlarmInfo> alarmInfos = new ArrayList<>();
for (MetaAlarmInfo metaAlarmInfo1 : list){
String informantTime = metaAlarmInfo1.getInformantTime();
Date parse1 = outputSdf.parse(informantTime);
String format1 = dateFormat.format(parse1);
metaAlarmInfo1.setInformantName(format1);
metaAlarmInfo1.setInformantTime(format1);
alarmInfos.add(metaAlarmInfo1);
}
return getDataTable(alarmInfos);
TableDataInfo dataTable = getDataTable(alarmInfos);
dataTable.setTotal(count);
return dataTable;
}
@GetMapping("/filterByLongitude")

@ -7,6 +7,7 @@ import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.PageUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.database.domain.TransitImpUserRecord;
import com.ruoyi.database.service.TransitImpUserRecordService;
@ -41,7 +42,6 @@ public class TransitImpUserRecordController extends BaseController {
@GetMapping
@ApiOperation("查询涉稳列管人员人脸抓拍记录表")
public TableDataInfo<TransitImpUserRecord> list(TransitImpUserRecord transitImpUserRecord) throws Exception{
startPage();
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
QueryWrapper<TransitImpUserRecord> queryWrapper = new QueryWrapper<>(transitImpUserRecord);
@ -54,6 +54,8 @@ public class TransitImpUserRecordController extends BaseController {
calendar.add(Calendar.DAY_OF_MONTH, 1);
queryWrapper.between("partition_field", transitImpUserRecord.getFirstTime(),simpleDateFormat.format(calendar.getTime()));
}
int count = transitImpUserRecordService.count(queryWrapper);
PageUtils.startPage();
List<TransitImpUserRecord> list = transitImpUserRecordService.list(queryWrapper);
List<TransitImpUserRecord> impUserRecords = new ArrayList<>();
for (TransitImpUserRecord transitImpUserRecord1 : list){
@ -62,7 +64,9 @@ public class TransitImpUserRecordController extends BaseController {
transitImpUserRecord1.setElapsedTime(format);
impUserRecords.add(transitImpUserRecord1);
}
return getDataTable(impUserRecords);
TableDataInfo dataTable = getDataTable(impUserRecords);
dataTable.setTotal(count);
return dataTable;
}
@PostMapping

@ -7,6 +7,7 @@ import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.PageUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.database.domain.TransitImpUserRecord;
import com.ruoyi.database.domain.TransitImpVehicleRecord;
@ -41,7 +42,6 @@ public class TransitImpVehicleRecordController extends BaseController {
@GetMapping
@ApiOperation("查询重点人车辆记录表")
public TableDataInfo<TransitImpVehicleRecord> list(TransitImpVehicleRecord transitImpVehicleRecord) throws Exception{
startPage();
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
QueryWrapper<TransitImpVehicleRecord> queryWrapper = new QueryWrapper<>(transitImpVehicleRecord);
@ -54,6 +54,8 @@ public class TransitImpVehicleRecordController extends BaseController {
calendar.add(Calendar.DAY_OF_MONTH, 1);
queryWrapper.between("partition_field", transitImpVehicleRecord.getFirstTime(),simpleDateFormat.format(calendar.getTime()));
}
int count = transitImpVehicleRecordService.count(queryWrapper);
PageUtils.startPage();
List<TransitImpVehicleRecord> list = transitImpVehicleRecordService.list(queryWrapper);
List<TransitImpVehicleRecord> impVehicleRecords = new ArrayList<>();
for (TransitImpVehicleRecord transitImpVehicleRecord1 : list){
@ -62,7 +64,9 @@ public class TransitImpVehicleRecordController extends BaseController {
transitImpVehicleRecord1.setElapsedTime(format);
impVehicleRecords.add(transitImpVehicleRecord1);
}
return getDataTable(impVehicleRecords);
TableDataInfo dataTable = getDataTable(impVehicleRecords);
dataTable.setTotal(count);
return dataTable;
}
@PostMapping

@ -9,6 +9,7 @@ import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.PageUtils;
import com.ruoyi.common.utils.bean.BeanUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.database.domain.BoneVehicle;
@ -49,13 +50,14 @@ public class TransitVehicleRecordController extends BaseController {
public TableDataInfo<TransitVehicleRecord> list(TransitVehicleRecord transitVehicleRecord) {
startPage();
QueryWrapper<TransitVehicleRecord> queryWrapper = new QueryWrapper<>(transitVehicleRecord);
// List<TransitImpVehicleRecord> vehicleRecords = transitImpVehicleRecordService.lambdaQuery().eq(TransitImpVehicleRecord::getDeviceCode, transitVehicleRecord.getDoorwayCode()).list();
List<TransitImpVehicleRecord> vehicleRecords = transitImpVehicleRecordService.lambdaQuery().eq(TransitImpVehicleRecord::getDeviceCode, transitVehicleRecord.getDoorwayCode()).list();
if (transitVehicleRecord.getFirstTime() != null && transitVehicleRecord.getEndTime() != null) {
queryWrapper.between("partition_field", transitVehicleRecord.getFirstTime(), transitVehicleRecord.getEndTime());
}
// if (vehicleRecords != null && !vehicleRecords.isEmpty()){
// return getDataTable(vehicleRecords);
// }
if (vehicleRecords != null && !vehicleRecords.isEmpty()){
return getDataTable(vehicleRecords);
}
PageUtils.startPage();
List<TransitVehicleRecord> list = transitVehicleRecordService.list(queryWrapper);
return getDataTable(list);
}

Loading…
Cancel
Save