人口,沿海人车数量

develop
Angel 10 months ago
parent ad13c28931
commit ea1e3ae917

@ -5,7 +5,7 @@ import cn.hutool.core.util.ReflectUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.ruoyi.cache.DictCache; import com.ruoyi.cache.DictCache;
import com.ruoyi.common.exception.ServiceException; import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.StringKit; import com.ruoyi.business.controller.utils.StringKit;
import com.ruoyi.common.utils.bean.BeanValidators; import com.ruoyi.common.utils.bean.BeanValidators;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.aspectj.lang.ProceedingJoinPoint; import org.aspectj.lang.ProceedingJoinPoint;

@ -1,30 +1,25 @@
package com.ruoyi.business.controller; package com.ruoyi.business.controller;
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.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
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.core.page.TableDataInfo;
import com.ruoyi.common.utils.StringKit; import com.ruoyi.business.controller.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.checkerframework.checker.units.qual.A;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.lang.reflect.Field; 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.*;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
/** /**
* *
@ -106,9 +101,10 @@ public class PerceptionDeviceController extends BaseController {
} }
return modifiedDeviceInfo; return modifiedDeviceInfo;
} }
@GetMapping("/allHumanTrafficStatistics") @GetMapping("/allHumanTrafficStatistics")
@ApiOperation("人流量统计前7天(全数)") @ApiOperation("人流量统计前7天(全数)")
public AjaxResult allHumanTrafficStatistics(TransitUserRecord transitUserRecord) { public AjaxResult allHumanTrafficStatistics(TransitUserRecord transitUserRecord, DevopsDeviceInfo devopsDeviceInfo) {
try { try {
// 获取当前日期 // 获取当前日期
LocalDate currentDate = LocalDate.now(); LocalDate currentDate = LocalDate.now();
@ -118,13 +114,59 @@ public class PerceptionDeviceController extends BaseController {
for (int i = 1; i <= 7; i++) { for (int i = 1; i <= 7; i++) {
LocalDate date = currentDate.minusDays(i); LocalDate date = currentDate.minusDays(i);
// 构造查询条件 // 构造查询条件
QueryWrapper<DevopsDeviceInfo> deviceInfoQueryWrapper = new QueryWrapper<>(devopsDeviceInfo);
deviceInfoQueryWrapper.eq("parent_monitoring_type", 1);
List<DevopsDeviceInfo> list = devopsDeviceInfoService.list(deviceInfoQueryWrapper);
long totalUserCount = 0;
for (DevopsDeviceInfo info : list) {
String channelNo = info.getGbsChannelNo();
QueryWrapper<TransitUserRecord> userQueryWrapper = new QueryWrapper<>(transitUserRecord); QueryWrapper<TransitUserRecord> userQueryWrapper = new QueryWrapper<>(transitUserRecord);
userQueryWrapper.between("partition_field", date, date.plusDays(1)); userQueryWrapper.eq("device_code", channelNo)
// 查询当前日期的记录数据总数 .between("partition_field", date, date.plusDays(1));
long userCount = transitUserRecordService.count(userQueryWrapper); long userCount = transitUserRecordService.count(userQueryWrapper);
// 存储结果到 TreeMap 中 // 累加到总数据量
dailyCountsMap.put(date, userCount); totalUserCount += userCount;
}
dailyCountsMap.put(date, totalUserCount);
}
return AjaxResult.success(dailyCountsMap);
} catch (Exception e) {
logger.info(StringKit.toString(e));
return AjaxResult.error("请求失败,请联系管理员");
}
}
@GetMapping("/allVehicleTrafficStatistics")
@ApiOperation("车流量统计前7天(全数)")
public AjaxResult allVehicleTrafficStatistics(TransitVehicleRecord transitVehicleRecord,DevopsDeviceInfo devopsDeviceInfo) {
try {
// 获取当前日期
LocalDate currentDate = LocalDate.now();
// 创建一个 TreeMap 用于存储每天的数据量
Map<LocalDate, Long> dailyCountsMap = new TreeMap<>();
// 循环迭代前7天
for (int i = 1; i <= 7; i++) {
LocalDate date = currentDate.minusDays(i);
// 构造查询条件
QueryWrapper<DevopsDeviceInfo> deviceInfoQueryWrapper = new QueryWrapper<>(devopsDeviceInfo);
deviceInfoQueryWrapper.eq("parent_monitoring_type", 1);
List<DevopsDeviceInfo> list = devopsDeviceInfoService.list(deviceInfoQueryWrapper);
long totalUserCount = 0;
for (DevopsDeviceInfo info:list) {
String channelNo = info.getGbsChannelNo();
QueryWrapper<TransitVehicleRecord> vehicleQueryWrapper = new QueryWrapper<>(transitVehicleRecord);
vehicleQueryWrapper.eq("doorway_code",channelNo)
.between("partition_field", date, date.plusDays(1));
long userCount = transitVehicleRecordService.count(vehicleQueryWrapper);
totalUserCount += userCount;
} }
dailyCountsMap.put(date, totalUserCount);
}
return AjaxResult.success(dailyCountsMap); return AjaxResult.success(dailyCountsMap);
} catch (Exception e) { } catch (Exception e) {
logger.info(StringKit.toString(e)); logger.info(StringKit.toString(e));
@ -186,32 +228,7 @@ public class PerceptionDeviceController extends BaseController {
} }
} }
@GetMapping("/allVehicleTrafficStatistics")
@ApiOperation("车流量统计前7天(全数)")
public AjaxResult allVehicleTrafficStatistics(TransitVehicleRecord transitVehicleRecord) {
try {
// 获取当前日期
LocalDate currentDate = LocalDate.now();
// 创建一个 TreeMap 用于存储每天的数据量
Map<LocalDate, Long> dailyCountsMap = new TreeMap<>();
// 循环迭代前7天
for (int i = 1; i <= 7; i++) {
LocalDate date = currentDate.minusDays(i);
// 构造查询条件
QueryWrapper<TransitVehicleRecord> vehicleQueryWrapper = new QueryWrapper<>(transitVehicleRecord);
vehicleQueryWrapper.between("partition_field", date, date.plusDays(1));
// 查询当前日期的记录数据总数
long vehicleCount = transitVehicleRecordService.count(vehicleQueryWrapper);
// 存储结果到 TreeMap 中
dailyCountsMap.put(date, vehicleCount);
}
return AjaxResult.success(dailyCountsMap);
} catch (Exception e) {
logger.info(StringKit.toString(e));
return AjaxResult.error("请求失败,请联系管理员");
}
}
@GetMapping("/allHumanTrafficStatisticsHour") @GetMapping("/allHumanTrafficStatisticsHour")
@ApiOperation("人流量统计(当天)(全数)") @ApiOperation("人流量统计(当天)(全数)")

@ -6,7 +6,7 @@ import com.ruoyi.business.domain.vo.PersonStatissticsVo;
import com.ruoyi.business.domain.vo.PoachingVo; import com.ruoyi.business.domain.vo.PoachingVo;
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.utils.StringKit; import com.ruoyi.business.controller.utils.StringKit;
import com.ruoyi.database.domain.MetaHuntersInfo; import com.ruoyi.database.domain.MetaHuntersInfo;
import com.ruoyi.database.service.DevopsDeviceInfoService; import com.ruoyi.database.service.DevopsDeviceInfoService;
import com.ruoyi.database.service.MetaHuntersInfoService; import com.ruoyi.database.service.MetaHuntersInfoService;

@ -1,7 +1,8 @@
package com.ruoyi.common.utils; package com.ruoyi.business.controller.utils;
import com.alibaba.fastjson2.JSON; import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONObject; import com.alibaba.fastjson2.JSONObject;
import com.ruoyi.common.utils.StringUtils;
import org.jsoup.Connection; import org.jsoup.Connection;
import org.jsoup.Jsoup; import org.jsoup.Jsoup;
import org.jsoup.nodes.Document; import org.jsoup.nodes.Document;

@ -1,4 +1,4 @@
package com.ruoyi.common.utils; package com.ruoyi.business.controller.utils;
import java.math.BigDecimal; import java.math.BigDecimal;

@ -1,4 +1,4 @@
package com.ruoyi.common.utils; package com.ruoyi.business.controller.utils;
import java.util.*; import java.util.*;

@ -1,4 +1,4 @@
package com.ruoyi.common.utils; package com.ruoyi.business.controller.utils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;

@ -1,4 +1,4 @@
package com.ruoyi.common.utils; package com.ruoyi.business.controller.utils;
import java.io.PrintWriter; import java.io.PrintWriter;
import java.io.StringWriter; import java.io.StringWriter;
@ -8,7 +8,6 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import java.util.stream.Collectors;
public class StringKit { public class StringKit {

@ -1,10 +1,9 @@
package com.ruoyi.database.controller; package com.ruoyi.database.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ruoyi.business.domain.dto.DevopsVideoInfoDto; import com.ruoyi.business.domain.dto.DevopsVideoInfoDto;
import com.ruoyi.common.utils.StringKit; import com.ruoyi.business.controller.utils.StringKit;
import com.ruoyi.database.domain.DevopsVideoInfo; import com.ruoyi.database.domain.DevopsVideoInfo;
import com.ruoyi.database.domain.DevopsVideoStatus; import com.ruoyi.database.domain.DevopsVideoStatus;
import com.ruoyi.database.service.DevopsVideoInfoService; import com.ruoyi.database.service.DevopsVideoInfoService;
@ -18,7 +17,6 @@ import com.ruoyi.database.service.DevopsVideoStatusService;
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.checkerframework.checker.units.qual.A;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;

@ -37,7 +37,9 @@ public class MetaActualUserInfoController extends BaseController {
@ApiOperation("查询实有人口信息表") @ApiOperation("查询实有人口信息表")
public TableDataInfo<MetaActualUserInfo> list(MetaActualUserInfo metaActualUserInfo) { public TableDataInfo<MetaActualUserInfo> list(MetaActualUserInfo metaActualUserInfo) {
startPage(); startPage();
List<MetaActualUserInfo> list = metaActualUserInfoService.list(new QueryWrapper<>(metaActualUserInfo)); QueryWrapper<MetaActualUserInfo> querySyrkWrapper = new QueryWrapper<>();
querySyrkWrapper.ne("actual_user_type", 101);
List<MetaActualUserInfo> list = metaActualUserInfoService.list(querySyrkWrapper);
return getDataTable(list); return getDataTable(list);
} }

@ -3,7 +3,7 @@ package com.ruoyi.database.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ruoyi.common.utils.PageUtils; import com.ruoyi.common.utils.PageUtils;
import com.ruoyi.common.utils.StringKit; import com.ruoyi.business.controller.utils.StringKit;
import com.ruoyi.database.domain.MetaAlarmInfo; import com.ruoyi.database.domain.MetaAlarmInfo;
import com.ruoyi.database.service.MetaAlarmInfoService; import com.ruoyi.database.service.MetaAlarmInfoService;
import com.ruoyi.common.annotation.Log; import com.ruoyi.common.annotation.Log;
@ -19,7 +19,6 @@ 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.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.LocalDateTime; import java.time.LocalDateTime;
@ -57,11 +56,13 @@ public class MetaAlarmInfoController extends BaseController {
Date parse = simpleDateFormat.parse(metaAlarmInfo.getInformantTime()); Date parse = simpleDateFormat.parse(metaAlarmInfo.getInformantTime());
Calendar calendar = Calendar.getInstance(); Calendar calendar = Calendar.getInstance();
calendar.setTime(parse); calendar.setTime(parse);
calendar.add(Calendar.DAY_OF_MONTH, 1); calendar.add(Calendar.DAY_OF_MONTH, 1);
SimpleDateFormat outputSdf = new SimpleDateFormat("yyyyMMddHHmmss"); SimpleDateFormat outputSdf = new SimpleDateFormat("yyyyMMddHHmmss");
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String resultDateString = outputSdf.format(calendar.getTime()); String resultDateString = outputSdf.format(calendar.getTime());
String format = outputSdf.format(parse); String format = outputSdf.format(parse);
QueryWrapper<MetaAlarmInfo> queryWrapper = new QueryWrapper<>(); QueryWrapper<MetaAlarmInfo> queryWrapper = new QueryWrapper<>();
queryWrapper.between("alarm_response_time", format, resultDateString); queryWrapper.between("alarm_response_time", format, resultDateString);
int count = metaAlarmInfoService.count(queryWrapper); int count = metaAlarmInfoService.count(queryWrapper);

@ -3,7 +3,7 @@ package com.ruoyi.database.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
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.utils.StringKit; import com.ruoyi.business.controller.utils.StringKit;
import com.ruoyi.database.domain.PeopleVehicleFlow; import com.ruoyi.database.domain.PeopleVehicleFlow;
import com.ruoyi.database.service.PeopleVehicleFlowService; import com.ruoyi.database.service.PeopleVehicleFlowService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;

@ -3,19 +3,17 @@ package com.ruoyi.database.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
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.utils.StringKit; import com.ruoyi.business.controller.utils.StringKit;
import com.ruoyi.database.domain.PeopleVehicleHourFlow; import com.ruoyi.database.domain.PeopleVehicleHourFlow;
import com.ruoyi.database.service.PeopleVehicleHourFlowService; import com.ruoyi.database.service.PeopleVehicleHourFlowService;
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.springframework.data.auditing.CurrentDateTimeProvider;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.time.LocalDate;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.time.temporal.ChronoUnit; import java.time.temporal.ChronoUnit;

@ -9,13 +9,11 @@ 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.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.NumKit; import com.ruoyi.business.controller.utils.NumKit;
import com.ruoyi.common.utils.StringKit; import com.ruoyi.business.controller.utils.StringKit;
import com.ruoyi.common.utils.bean.BeanUtils; import com.ruoyi.common.utils.bean.BeanUtils;
import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.database.domain.TransitHuntersUserModelRecord; import com.ruoyi.database.domain.TransitHuntersUserModelRecord;
import com.ruoyi.database.domain.TransitHuntersUserRecord;
import com.ruoyi.database.domain.TransitVehicleRecord;
import com.ruoyi.database.service.TransitHuntersUserModelRecordService; import com.ruoyi.database.service.TransitHuntersUserModelRecordService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
@ -26,7 +24,6 @@ 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.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;

@ -10,10 +10,10 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.business.domain.dto.DevopsVideoInfoDto; import com.ruoyi.business.domain.dto.DevopsVideoInfoDto;
import com.ruoyi.business.domain.vo.DevopsVideoInfoVo; import com.ruoyi.business.domain.vo.DevopsVideoInfoVo;
import com.ruoyi.common.exception.ServiceException; import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.JsoupUtils; import com.ruoyi.business.controller.utils.JsoupUtils;
import com.ruoyi.common.utils.NumKit; import com.ruoyi.business.controller.utils.NumKit;
import com.ruoyi.common.utils.PropertiesUtil; import com.ruoyi.business.controller.utils.PropertiesUtil;
import com.ruoyi.common.utils.StringKit; import com.ruoyi.business.controller.utils.StringKit;
import com.ruoyi.common.utils.bean.BeanUtils; import com.ruoyi.common.utils.bean.BeanUtils;
import com.ruoyi.database.domain.DevopsVideoInfo; import com.ruoyi.database.domain.DevopsVideoInfo;
import com.ruoyi.database.domain.DevopsVideoStatus; import com.ruoyi.database.domain.DevopsVideoStatus;

@ -5,7 +5,7 @@ import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ReflectUtil; import cn.hutool.core.util.ReflectUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.ruoyi.cache.DictCache; import com.ruoyi.cache.DictCache;
import com.ruoyi.common.utils.StringKit; import com.ruoyi.business.controller.utils.StringKit;
import org.apache.ibatis.executor.resultset.ResultSetHandler; import org.apache.ibatis.executor.resultset.ResultSetHandler;
import org.apache.ibatis.plugin.*; import org.apache.ibatis.plugin.*;

Loading…
Cancel
Save