Merge remote-tracking branch 'origin/develop' into develop

develop
Angel 10 months ago
commit b7ceac57fd

@ -19,6 +19,7 @@ import java.time.LocalDate;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
/** /**
* *
@ -43,8 +44,14 @@ public class PerceptionDeviceController extends BaseController {
@ApiOperation("人车统计") @ApiOperation("人车统计")
public AjaxResult overviewResources() { public AjaxResult overviewResources() {
try { try {
Integer userCount = devopsDeviceInfoService.lambdaQuery().eq(DevopsDeviceInfo::getDeviceType, 1).count(); Integer userCount = devopsDeviceInfoService.lambdaQuery()
Integer vehicleCount = devopsDeviceInfoService.lambdaQuery().eq(DevopsDeviceInfo::getDeviceType, 2).count(); .eq(DevopsDeviceInfo::getDeviceType, 1)
.eq(DevopsDeviceInfo::getParentMonitoringType,1)
.count();
Integer vehicleCount = devopsDeviceInfoService.lambdaQuery()
.eq(DevopsDeviceInfo::getDeviceType, 2)
.eq(DevopsDeviceInfo::getParentMonitoringType,1)
.count();
Map<String, Integer> map = new HashMap<>(); Map<String, Integer> map = new HashMap<>();
map.put("userCount", userCount); map.put("userCount", userCount);
map.put("vehicleCount", vehicleCount); map.put("vehicleCount", vehicleCount);
@ -177,6 +184,8 @@ public class PerceptionDeviceController extends BaseController {
@ApiOperation("车流量统计前7天(重点人员)") @ApiOperation("车流量统计前7天(重点人员)")
public AjaxResult vehicleTrafficStatistics() { public AjaxResult vehicleTrafficStatistics() {
try { try {
List<DevopsDeviceInfo> deviceInfos = devopsDeviceInfoService.lambdaQuery().eq(DevopsDeviceInfo::getParentMonitoringType, 1).list();
List<String> collect = deviceInfos.stream().map(devopsDeviceInfo -> devopsDeviceInfo.getGbsChannelNo()).collect(Collectors.toList());
// 获取当前日期 // 获取当前日期
LocalDate currentDate = LocalDate.now(); LocalDate currentDate = LocalDate.now();
// 创建一个 TreeMap 用于存储每天的数据量 // 创建一个 TreeMap 用于存储每天的数据量
@ -186,6 +195,7 @@ public class PerceptionDeviceController extends BaseController {
LocalDate date = currentDate.minusDays(i); LocalDate date = currentDate.minusDays(i);
// 构造查询条件 // 构造查询条件
QueryWrapper<TransitImpVehicleRecord> vehicleQueryWrapper = new QueryWrapper<>(); QueryWrapper<TransitImpVehicleRecord> vehicleQueryWrapper = new QueryWrapper<>();
vehicleQueryWrapper.in("device_code",collect);
vehicleQueryWrapper.between("partition_field", date, date.plusDays(1)); vehicleQueryWrapper.between("partition_field", date, date.plusDays(1));
// 查询当前日期的记录数据总数 // 查询当前日期的记录数据总数
long vehicleCount = vehicleRecordService.count(vehicleQueryWrapper); long vehicleCount = vehicleRecordService.count(vehicleQueryWrapper);
@ -204,6 +214,8 @@ public class PerceptionDeviceController extends BaseController {
@ApiOperation("人流量统计前7天(重点人员)") @ApiOperation("人流量统计前7天(重点人员)")
public AjaxResult humanTrafficStatistics() { public AjaxResult humanTrafficStatistics() {
try { try {
List<DevopsDeviceInfo> deviceInfos = devopsDeviceInfoService.lambdaQuery().eq(DevopsDeviceInfo::getParentMonitoringType, 1).list();
List<String> collect = deviceInfos.stream().map(devopsDeviceInfo -> devopsDeviceInfo.getGbsChannelNo()).collect(Collectors.toList());
// 获取当前日期 // 获取当前日期
LocalDate currentDate = LocalDate.now(); LocalDate currentDate = LocalDate.now();
// 创建一个 TreeMap 用于存储每天的数据量 // 创建一个 TreeMap 用于存储每天的数据量
@ -213,6 +225,7 @@ public class PerceptionDeviceController extends BaseController {
LocalDate date = currentDate.minusDays(i); LocalDate date = currentDate.minusDays(i);
// 构造查询条件 // 构造查询条件
QueryWrapper<TransitImpUserRecord> userQueryWrapper = new QueryWrapper<>(); QueryWrapper<TransitImpUserRecord> userQueryWrapper = new QueryWrapper<>();
userQueryWrapper.in("device_code",collect);
userQueryWrapper.between("partition_field", date, date.plusDays(1)); userQueryWrapper.between("partition_field", date, date.plusDays(1));
// 查询当前日期的记录数据总数 // 查询当前日期的记录数据总数
long userCount = userRecordService.count(userQueryWrapper); long userCount = userRecordService.count(userQueryWrapper);

@ -9,7 +9,9 @@ import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.PageUtils; import com.ruoyi.common.utils.PageUtils;
import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.database.domain.DevopsDeviceInfo;
import com.ruoyi.database.domain.TransitImpUserRecord; import com.ruoyi.database.domain.TransitImpUserRecord;
import com.ruoyi.database.service.DevopsDeviceInfoService;
import com.ruoyi.database.service.TransitImpUserRecordService; import com.ruoyi.database.service.TransitImpUserRecordService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
@ -20,10 +22,13 @@ import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Calendar; import java.util.Calendar;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
/** /**
* (TransitImpUserRecord)Controller * (TransitImpUserRecord)Controller
@ -38,21 +43,29 @@ import java.util.List;
public class TransitImpUserRecordController extends BaseController { public class TransitImpUserRecordController extends BaseController {
private final TransitImpUserRecordService transitImpUserRecordService; private final TransitImpUserRecordService transitImpUserRecordService;
private final DevopsDeviceInfoService devopsDeviceInfoService;
@GetMapping @GetMapping
@ApiOperation("查询涉稳列管人员人脸抓拍记录表") @ApiOperation("查询涉稳列管人员人脸抓拍记录表")
public TableDataInfo<TransitImpUserRecord> list(TransitImpUserRecord transitImpUserRecord) throws Exception{ public TableDataInfo<TransitImpUserRecord> list(TransitImpUserRecord transitImpUserRecord) throws Exception{
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
List<DevopsDeviceInfo> deviceInfos = devopsDeviceInfoService.lambdaQuery().eq(DevopsDeviceInfo::getParentMonitoringType, 1).list();
List<String> collect = deviceInfos.stream().map(devopsDeviceInfo -> devopsDeviceInfo.getGbsChannelNo()).collect(Collectors.toList());
QueryWrapper<TransitImpUserRecord> queryWrapper = new QueryWrapper<>(transitImpUserRecord); QueryWrapper<TransitImpUserRecord> queryWrapper = new QueryWrapper<>(transitImpUserRecord);
if (transitImpUserRecord.getFirstTime() != null && transitImpUserRecord.getEndTime() != null) { queryWrapper.in("device_code",collect);
queryWrapper.between("partition_field", transitImpUserRecord.getFirstTime(), transitImpUserRecord.getEndTime());
}
if (transitImpUserRecord.getFirstTime() != null){ if (transitImpUserRecord.getFirstTime() != null){
Calendar calendar = Calendar.getInstance(); Calendar calendar = Calendar.getInstance();
calendar.setTime(simpleDateFormat.parse(transitImpUserRecord.getFirstTime())); calendar.setTime(simpleDateFormat.parse(transitImpUserRecord.getFirstTime()));
calendar.add(Calendar.DAY_OF_MONTH, 1); calendar.add(Calendar.DAY_OF_MONTH, 1);
queryWrapper.between("partition_field", transitImpUserRecord.getFirstTime(),simpleDateFormat.format(calendar.getTime())); queryWrapper.between("partition_field", transitImpUserRecord.getFirstTime(),simpleDateFormat.format(calendar.getTime()));
queryWrapper.orderByDesc("partition_field");
}else {
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
LocalDateTime now = LocalDateTime.now();
LocalDateTime minusDay = now.minusDays(1);
queryWrapper.between("partition_field",formatter.format(minusDay),formatter.format(now));
queryWrapper.orderByDesc("partition_field");
} }
int count = transitImpUserRecordService.count(queryWrapper); int count = transitImpUserRecordService.count(queryWrapper);
PageUtils.startPage(); PageUtils.startPage();

@ -9,8 +9,10 @@ import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.PageUtils; import com.ruoyi.common.utils.PageUtils;
import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.database.domain.DevopsDeviceInfo;
import com.ruoyi.database.domain.TransitImpUserRecord; import com.ruoyi.database.domain.TransitImpUserRecord;
import com.ruoyi.database.domain.TransitImpVehicleRecord; import com.ruoyi.database.domain.TransitImpVehicleRecord;
import com.ruoyi.database.service.DevopsDeviceInfoService;
import com.ruoyi.database.service.TransitImpVehicleRecordService; import com.ruoyi.database.service.TransitImpVehicleRecordService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
@ -20,10 +22,13 @@ import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Calendar; import java.util.Calendar;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
/** /**
* (TransitImpVehicleRecord)Controller * (TransitImpVehicleRecord)Controller
@ -38,32 +43,42 @@ import java.util.List;
public class TransitImpVehicleRecordController extends BaseController { public class TransitImpVehicleRecordController extends BaseController {
private final TransitImpVehicleRecordService transitImpVehicleRecordService; private final TransitImpVehicleRecordService transitImpVehicleRecordService;
private final DevopsDeviceInfoService devopsDeviceInfoService;
@GetMapping @GetMapping
@ApiOperation("查询重点人车辆记录表") @ApiOperation("查询重点人车辆记录表")
public TableDataInfo<TransitImpVehicleRecord> list(TransitImpVehicleRecord transitImpVehicleRecord) throws Exception{ public TableDataInfo<TransitImpVehicleRecord> list(TransitImpVehicleRecord transitImpVehicleRecord) throws Exception{
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
List<DevopsDeviceInfo> deviceInfos = devopsDeviceInfoService.lambdaQuery().eq(DevopsDeviceInfo::getParentMonitoringType, 1).list();
List<String> collect = deviceInfos.stream().map(devopsDeviceInfo -> devopsDeviceInfo.getGbsChannelNo()).collect(Collectors.toList());
QueryWrapper<TransitImpVehicleRecord> queryWrapper = new QueryWrapper<>(transitImpVehicleRecord); QueryWrapper<TransitImpVehicleRecord> queryWrapper = new QueryWrapper<>(transitImpVehicleRecord);
if (transitImpVehicleRecord.getFirstTime() != null && transitImpVehicleRecord.getEndTime() != null) { queryWrapper.in("device_code",collect);
queryWrapper.between("partition_field", transitImpVehicleRecord.getFirstTime(), transitImpVehicleRecord.getEndTime());
}
if (transitImpVehicleRecord.getFirstTime() != null){ if (transitImpVehicleRecord.getFirstTime() != null){
Calendar calendar = Calendar.getInstance(); Calendar calendar = Calendar.getInstance();
calendar.setTime(simpleDateFormat.parse(transitImpVehicleRecord.getFirstTime())); calendar.setTime(simpleDateFormat.parse(transitImpVehicleRecord.getFirstTime()));
calendar.add(Calendar.DAY_OF_MONTH, 1); calendar.add(Calendar.DAY_OF_MONTH, 1);
queryWrapper.between("partition_field", transitImpVehicleRecord.getFirstTime(),simpleDateFormat.format(calendar.getTime())); queryWrapper.between("partition_field", transitImpVehicleRecord.getFirstTime(),simpleDateFormat.format(calendar.getTime()));
queryWrapper.orderByDesc("partition_field");
}else {
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
LocalDateTime now = LocalDateTime.now();
LocalDateTime minusDay = now.minusDays(1);
queryWrapper.between("partition_field",formatter.format(minusDay),formatter.format(now));
queryWrapper.orderByDesc("partition_field");
} }
int count = transitImpVehicleRecordService.count(queryWrapper); int count = transitImpVehicleRecordService.count(queryWrapper);
PageUtils.startPage(); PageUtils.startPage();
List<TransitImpVehicleRecord> list = transitImpVehicleRecordService.list(queryWrapper); List<TransitImpVehicleRecord> list = transitImpVehicleRecordService.list(queryWrapper);
List<TransitImpVehicleRecord> impVehicleRecords = new ArrayList<>(); List<TransitImpVehicleRecord> impVehicleRecords = new ArrayList<>();
for (TransitImpVehicleRecord transitImpVehicleRecord1 : list){ for (TransitImpVehicleRecord transitImpVehicleRecord1 : list){
if (!"unknown".equals(transitImpVehicleRecord1.getPlateNo())) {
Date partitionField = transitImpVehicleRecord1.getPartitionField(); Date partitionField = transitImpVehicleRecord1.getPartitionField();
String format = dateFormat.format(partitionField); String format = dateFormat.format(partitionField);
transitImpVehicleRecord1.setElapsedTime(format); transitImpVehicleRecord1.setElapsedTime(format);
impVehicleRecords.add(transitImpVehicleRecord1); impVehicleRecords.add(transitImpVehicleRecord1);
} }
}
TableDataInfo dataTable = getDataTable(impVehicleRecords); TableDataInfo dataTable = getDataTable(impVehicleRecords);
dataTable.setTotal(count); dataTable.setTotal(count);
return dataTable; return dataTable;

@ -1,6 +1,7 @@
package com.ruoyi.database.controller; package com.ruoyi.database.controller;
import cn.hutool.core.date.DateTime;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ruoyi.common.annotation.Log; import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.controller.BaseController;
@ -15,11 +16,16 @@ import com.ruoyi.database.service.TransitImpUserRecordService;
import com.ruoyi.database.service.TransitUserRecordService; import com.ruoyi.database.service.TransitUserRecordService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.Data;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
@ -42,21 +48,17 @@ public class TransitUserRecordController extends BaseController {
@ApiOperation("查询人脸记录表") @ApiOperation("查询人脸记录表")
public TableDataInfo<TransitUserRecord> list(TransitUserRecord transitUserRecord) { public TableDataInfo<TransitUserRecord> list(TransitUserRecord transitUserRecord) {
startPage(); startPage();
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
LocalDateTime now = LocalDateTime.now();
LocalDateTime minusDay = now.minusDays(1);
QueryWrapper<TransitUserRecord> queryWrapper = new QueryWrapper<>(transitUserRecord); QueryWrapper<TransitUserRecord> queryWrapper = new QueryWrapper<>(transitUserRecord);
// List<TransitImpUserRecord> impUserRecords = transitImpUserRecordService.lambdaQuery().eq(TransitImpUserRecord::getDeviceCode, transitUserRecord.getDeviceCode()).list(); queryWrapper.between("partition_field",formatter.format(minusDay),formatter.format(now));
if (transitUserRecord.getFirstTime() != null && transitUserRecord.getEndTime() != null) { queryWrapper.orderByDesc("partition_field");
queryWrapper.between("partition_field", transitUserRecord.getFirstTime(), transitUserRecord.getEndTime());
}
// if (impUserRecords != null && !impUserRecords.isEmpty()){
// for (TransitImpUserRecord transitImpUserRecord : impUserRecords){
// Date partitionField = transitImpUserRecord.getPartitionField();
// }
// return getDataTable(impUserRecords);
// }
List<TransitUserRecord> list = transitUserRecordService.list(queryWrapper); List<TransitUserRecord> list = transitUserRecordService.list(queryWrapper);
return getDataTable(list); return getDataTable(list);
} }
@PostMapping @PostMapping
@ApiOperation("新增人脸记录表") @ApiOperation("新增人脸记录表")
@Log(title = "人脸记录表", businessType = BusinessType.INSERT) @Log(title = "人脸记录表", businessType = BusinessType.INSERT)

@ -26,6 +26,8 @@ import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
@ -49,15 +51,12 @@ public class TransitVehicleRecordController extends BaseController {
@ApiOperation("查询车辆记录表") @ApiOperation("查询车辆记录表")
public TableDataInfo<TransitVehicleRecord> list(TransitVehicleRecord transitVehicleRecord) { public TableDataInfo<TransitVehicleRecord> list(TransitVehicleRecord transitVehicleRecord) {
startPage(); startPage();
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
LocalDateTime now = LocalDateTime.now();
LocalDateTime minusDay = now.minusDays(1);
QueryWrapper<TransitVehicleRecord> queryWrapper = new QueryWrapper<>(transitVehicleRecord); QueryWrapper<TransitVehicleRecord> queryWrapper = new QueryWrapper<>(transitVehicleRecord);
List<TransitImpVehicleRecord> vehicleRecords = transitImpVehicleRecordService.lambdaQuery().eq(TransitImpVehicleRecord::getDeviceCode, transitVehicleRecord.getDoorwayCode()).list(); queryWrapper.between("partition_field",formatter.format(minusDay),formatter.format(now));
if (transitVehicleRecord.getFirstTime() != null && transitVehicleRecord.getEndTime() != null) { queryWrapper.orderByDesc("partition_field");
queryWrapper.between("partition_field", transitVehicleRecord.getFirstTime(), transitVehicleRecord.getEndTime());
}
if (vehicleRecords != null && !vehicleRecords.isEmpty()){
return getDataTable(vehicleRecords);
}
PageUtils.startPage();
List<TransitVehicleRecord> list = transitVehicleRecordService.list(queryWrapper); List<TransitVehicleRecord> list = transitVehicleRecordService.list(queryWrapper);
return getDataTable(list); return getDataTable(list);
} }

Loading…
Cancel
Save