|
|
@ -3,21 +3,26 @@ package com.ruoyi.business.controller;
|
|
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
|
|
|
|
import com.ruoyi.business.domain.vo.HumanVehicleStatisticsVo;
|
|
|
|
import com.ruoyi.business.domain.vo.HumanVehicleStatisticsVo;
|
|
|
|
import com.ruoyi.common.core.controller.BaseController;
|
|
|
|
import com.ruoyi.common.core.controller.BaseController;
|
|
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
|
|
|
|
|
import com.ruoyi.common.core.page.TableDataInfo;
|
|
|
|
import com.ruoyi.common.utils.StringKit;
|
|
|
|
import com.ruoyi.common.utils.StringKit;
|
|
|
|
import com.ruoyi.database.domain.*;
|
|
|
|
import com.ruoyi.database.domain.*;
|
|
|
|
import com.ruoyi.database.service.*;
|
|
|
|
import com.ruoyi.database.service.*;
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
|
|
|
|
|
import org.aspectj.weaver.loadtime.Aj;
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.lang.reflect.Field;
|
|
|
|
import java.time.LocalDate;
|
|
|
|
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.HashMap;
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.Map;
|
|
|
|
import java.util.Map;
|
|
|
|
import java.util.TreeMap;
|
|
|
|
import java.util.TreeMap;
|
|
|
|
|
|
|
|
|
|
|
@ -44,22 +49,6 @@ public class PerceptionDeviceController extends BaseController {
|
|
|
|
@ApiOperation("人车统计")
|
|
|
|
@ApiOperation("人车统计")
|
|
|
|
public AjaxResult overviewResources() {
|
|
|
|
public AjaxResult overviewResources() {
|
|
|
|
try {
|
|
|
|
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);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Integer userCount = devopsDeviceInfoService.lambdaQuery().eq(DevopsDeviceInfo::getDeviceType, 1).count();
|
|
|
|
Integer userCount = devopsDeviceInfoService.lambdaQuery().eq(DevopsDeviceInfo::getDeviceType, 1).count();
|
|
|
|
Integer vehicleCount = devopsDeviceInfoService.lambdaQuery().eq(DevopsDeviceInfo::getDeviceType, 2).count();
|
|
|
|
Integer vehicleCount = devopsDeviceInfoService.lambdaQuery().eq(DevopsDeviceInfo::getDeviceType, 2).count();
|
|
|
|
Map<String, Integer> map = new HashMap<>();
|
|
|
|
Map<String, Integer> map = new HashMap<>();
|
|
|
@ -72,6 +61,51 @@ public class PerceptionDeviceController extends BaseController {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping("/peoplelist")
|
|
|
|
|
|
|
|
@ApiOperation("人设备列表")
|
|
|
|
|
|
|
|
public TableDataInfo<DevopsDeviceInfo> PeopleList() {
|
|
|
|
|
|
|
|
startPage();
|
|
|
|
|
|
|
|
List<DevopsDeviceInfo> list = devopsDeviceInfoService.lambdaQuery().eq(DevopsDeviceInfo::getDeviceType, 1).list();
|
|
|
|
|
|
|
|
return getDataTable(list);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping("/vehiclelist")
|
|
|
|
|
|
|
|
@ApiOperation("车设备列表")
|
|
|
|
|
|
|
|
public TableDataInfo<DevopsDeviceInfo> VehicleList() {
|
|
|
|
|
|
|
|
startPage();
|
|
|
|
|
|
|
|
List<DevopsDeviceInfo> list = devopsDeviceInfoService.lambdaQuery().eq(DevopsDeviceInfo::getDeviceType, 2).list();
|
|
|
|
|
|
|
|
return getDataTable(list);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping("/PeopleOrVehiclelist")
|
|
|
|
|
|
|
|
@ApiOperation("人车设备列表")
|
|
|
|
|
|
|
|
public TableDataInfo<DevopsDeviceInfo> OVehicleList(DevopsDeviceInfo devopsDeviceInfo) {
|
|
|
|
|
|
|
|
startPage();
|
|
|
|
|
|
|
|
DevopsDeviceInfo filteredDeviceInfo = removeEmptyFields(devopsDeviceInfo);
|
|
|
|
|
|
|
|
LambdaQueryChainWrapper<DevopsDeviceInfo> lambdaQueryWrapper = devopsDeviceInfoService.lambdaQuery()
|
|
|
|
|
|
|
|
.eq(DevopsDeviceInfo::getDeviceType, filteredDeviceInfo.getDeviceType());
|
|
|
|
|
|
|
|
List<DevopsDeviceInfo> list = lambdaQueryWrapper
|
|
|
|
|
|
|
|
.eq(DevopsDeviceInfo::getDeviceType, filteredDeviceInfo.getDeviceType())
|
|
|
|
|
|
|
|
.list();
|
|
|
|
|
|
|
|
return getDataTable(list);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private DevopsDeviceInfo removeEmptyFields(DevopsDeviceInfo deviceInfo) {
|
|
|
|
|
|
|
|
DevopsDeviceInfo modifiedDeviceInfo = new DevopsDeviceInfo();
|
|
|
|
|
|
|
|
Field[] fields = DevopsDeviceInfo.class.getDeclaredFields();
|
|
|
|
|
|
|
|
for (Field field : fields) {
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
field.setAccessible(true);
|
|
|
|
|
|
|
|
Object value = field.get(deviceInfo);
|
|
|
|
|
|
|
|
if (value != null && !(value instanceof String && ((String) value).isEmpty())) {
|
|
|
|
|
|
|
|
field.set(modifiedDeviceInfo, value);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} catch (IllegalAccessException e) {
|
|
|
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return modifiedDeviceInfo;
|
|
|
|
|
|
|
|
}
|
|
|
|
@GetMapping("/allHumanTrafficStatistics")
|
|
|
|
@GetMapping("/allHumanTrafficStatistics")
|
|
|
|
@ApiOperation("人流量统计(前7天)(全数)")
|
|
|
|
@ApiOperation("人流量统计(前7天)(全数)")
|
|
|
|
public AjaxResult allHumanTrafficStatistics(TransitUserRecord transitUserRecord) {
|
|
|
|
public AjaxResult allHumanTrafficStatistics(TransitUserRecord transitUserRecord) {
|
|
|
|