diff --git a/gather-app/src/main/java/com/ruoyi/aspect/ImportAspect.java b/gather-app/src/main/java/com/ruoyi/aspect/ImportAspect.java index 7d4bd5a..e24e9f4 100644 --- a/gather-app/src/main/java/com/ruoyi/aspect/ImportAspect.java +++ b/gather-app/src/main/java/com/ruoyi/aspect/ImportAspect.java @@ -5,7 +5,7 @@ import cn.hutool.core.util.ReflectUtil; import cn.hutool.core.util.StrUtil; import com.ruoyi.cache.DictCache; 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 lombok.RequiredArgsConstructor; import org.aspectj.lang.ProceedingJoinPoint; diff --git a/gather-app/src/main/java/com/ruoyi/business/controller/PerceptionDeviceController.java b/gather-app/src/main/java/com/ruoyi/business/controller/PerceptionDeviceController.java index fff7d5e..b8e4fad 100644 --- a/gather-app/src/main/java/com/ruoyi/business/controller/PerceptionDeviceController.java +++ b/gather-app/src/main/java/com/ruoyi/business/controller/PerceptionDeviceController.java @@ -1,30 +1,25 @@ package com.ruoyi.business.controller; -import cn.hutool.core.date.DateUtil; 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.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; 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.service.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; -import org.aspectj.weaver.loadtime.Aj; +import org.checkerframework.checker.units.qual.A; import org.springframework.web.bind.annotation.*; import java.lang.reflect.Field; import java.time.LocalDate; import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.TreeMap; +import java.util.*; /** * 大屏感知设备查询接口 @@ -106,9 +101,10 @@ public class PerceptionDeviceController extends BaseController { } return modifiedDeviceInfo; } + @GetMapping("/allHumanTrafficStatistics") @ApiOperation("人流量统计(前7天)(全数)") - public AjaxResult allHumanTrafficStatistics(TransitUserRecord transitUserRecord) { + public AjaxResult allHumanTrafficStatistics(TransitUserRecord transitUserRecord, DevopsDeviceInfo devopsDeviceInfo) { try { // 获取当前日期 LocalDate currentDate = LocalDate.now(); @@ -118,12 +114,23 @@ public class PerceptionDeviceController extends BaseController { for (int i = 1; i <= 7; i++) { LocalDate date = currentDate.minusDays(i); // 构造查询条件 - QueryWrapper userQueryWrapper = new QueryWrapper<>(transitUserRecord); - userQueryWrapper.between("partition_field", date, date.plusDays(1)); - // 查询当前日期的记录数据总数 - long userCount = transitUserRecordService.count(userQueryWrapper); - // 存储结果到 TreeMap 中 - dailyCountsMap.put(date, userCount); + QueryWrapper deviceInfoQueryWrapper = new QueryWrapper<>(devopsDeviceInfo); + deviceInfoQueryWrapper.eq("parent_monitoring_type", 1); + List list = devopsDeviceInfoService.list(deviceInfoQueryWrapper); + + + long totalUserCount = 0; + + for (DevopsDeviceInfo info : list) { + String channelNo = info.getGbsChannelNo(); + QueryWrapper userQueryWrapper = new QueryWrapper<>(transitUserRecord); + userQueryWrapper.eq("device_code", channelNo) + .between("partition_field", date, date.plusDays(1)); + long userCount = transitUserRecordService.count(userQueryWrapper); + // 累加到总数据量 + totalUserCount += userCount; + } + dailyCountsMap.put(date, totalUserCount); } return AjaxResult.success(dailyCountsMap); } catch (Exception e) { @@ -131,6 +138,41 @@ public class PerceptionDeviceController extends BaseController { return AjaxResult.error("请求失败,请联系管理员"); } } + @GetMapping("/allVehicleTrafficStatistics") + @ApiOperation("车流量统计(前7天)(全数)") + public AjaxResult allVehicleTrafficStatistics(TransitVehicleRecord transitVehicleRecord,DevopsDeviceInfo devopsDeviceInfo) { + try { + // 获取当前日期 + LocalDate currentDate = LocalDate.now(); + // 创建一个 TreeMap 用于存储每天的数据量 + Map dailyCountsMap = new TreeMap<>(); + // 循环迭代前7天 + for (int i = 1; i <= 7; i++) { + LocalDate date = currentDate.minusDays(i); + // 构造查询条件 + QueryWrapper deviceInfoQueryWrapper = new QueryWrapper<>(devopsDeviceInfo); + deviceInfoQueryWrapper.eq("parent_monitoring_type", 1); + List list = devopsDeviceInfoService.list(deviceInfoQueryWrapper); + + long totalUserCount = 0; + + for (DevopsDeviceInfo info:list) { + String channelNo = info.getGbsChannelNo(); + QueryWrapper 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); + } catch (Exception e) { + logger.info(StringKit.toString(e)); + return AjaxResult.error("请求失败,请联系管理员"); + } + } @PostMapping("/vehicleTrafficStatistics") @ApiOperation("车流量统计(前7天)(重点人员)") @@ -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 dailyCountsMap = new TreeMap<>(); - // 循环迭代前7天 - for (int i = 1; i <= 7; i++) { - LocalDate date = currentDate.minusDays(i); - // 构造查询条件 - QueryWrapper 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") @ApiOperation("人流量统计(当天)(全数)") diff --git a/gather-app/src/main/java/com/ruoyi/business/controller/PoachingController.java b/gather-app/src/main/java/com/ruoyi/business/controller/PoachingController.java index eae5768..dbf3a74 100644 --- a/gather-app/src/main/java/com/ruoyi/business/controller/PoachingController.java +++ b/gather-app/src/main/java/com/ruoyi/business/controller/PoachingController.java @@ -6,7 +6,7 @@ import com.ruoyi.business.domain.vo.PersonStatissticsVo; import com.ruoyi.business.domain.vo.PoachingVo; import com.ruoyi.common.core.controller.BaseController; 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.service.DevopsDeviceInfoService; import com.ruoyi.database.service.MetaHuntersInfoService; diff --git a/gather-app/src/main/java/com/ruoyi/common/utils/JsoupUtils.java b/gather-app/src/main/java/com/ruoyi/business/controller/utils/JsoupUtils.java similarity index 98% rename from gather-app/src/main/java/com/ruoyi/common/utils/JsoupUtils.java rename to gather-app/src/main/java/com/ruoyi/business/controller/utils/JsoupUtils.java index 9ff21fd..bd3da45 100644 --- a/gather-app/src/main/java/com/ruoyi/common/utils/JsoupUtils.java +++ b/gather-app/src/main/java/com/ruoyi/business/controller/utils/JsoupUtils.java @@ -1,7 +1,8 @@ -package com.ruoyi.common.utils; +package com.ruoyi.business.controller.utils; import com.alibaba.fastjson2.JSON; import com.alibaba.fastjson2.JSONObject; +import com.ruoyi.common.utils.StringUtils; import org.jsoup.Connection; import org.jsoup.Jsoup; import org.jsoup.nodes.Document; diff --git a/gather-app/src/main/java/com/ruoyi/common/utils/NumKit.java b/gather-app/src/main/java/com/ruoyi/business/controller/utils/NumKit.java similarity index 95% rename from gather-app/src/main/java/com/ruoyi/common/utils/NumKit.java rename to gather-app/src/main/java/com/ruoyi/business/controller/utils/NumKit.java index 82662f7..9e13ff7 100644 --- a/gather-app/src/main/java/com/ruoyi/common/utils/NumKit.java +++ b/gather-app/src/main/java/com/ruoyi/business/controller/utils/NumKit.java @@ -1,4 +1,4 @@ -package com.ruoyi.common.utils; +package com.ruoyi.business.controller.utils; import java.math.BigDecimal; diff --git a/gather-app/src/main/java/com/ruoyi/common/utils/OrderedProperties.java b/gather-app/src/main/java/com/ruoyi/business/controller/utils/OrderedProperties.java similarity index 94% rename from gather-app/src/main/java/com/ruoyi/common/utils/OrderedProperties.java rename to gather-app/src/main/java/com/ruoyi/business/controller/utils/OrderedProperties.java index 058d8e0..c138722 100644 --- a/gather-app/src/main/java/com/ruoyi/common/utils/OrderedProperties.java +++ b/gather-app/src/main/java/com/ruoyi/business/controller/utils/OrderedProperties.java @@ -1,4 +1,4 @@ -package com.ruoyi.common.utils; +package com.ruoyi.business.controller.utils; import java.util.*; diff --git a/gather-app/src/main/java/com/ruoyi/common/utils/PropertiesUtil.java b/gather-app/src/main/java/com/ruoyi/business/controller/utils/PropertiesUtil.java similarity index 97% rename from gather-app/src/main/java/com/ruoyi/common/utils/PropertiesUtil.java rename to gather-app/src/main/java/com/ruoyi/business/controller/utils/PropertiesUtil.java index acb56f9..013ae15 100644 --- a/gather-app/src/main/java/com/ruoyi/common/utils/PropertiesUtil.java +++ b/gather-app/src/main/java/com/ruoyi/business/controller/utils/PropertiesUtil.java @@ -1,4 +1,4 @@ -package com.ruoyi.common.utils; +package com.ruoyi.business.controller.utils; import org.apache.commons.lang3.StringUtils; diff --git a/gather-app/src/main/java/com/ruoyi/common/utils/StringKit.java b/gather-app/src/main/java/com/ruoyi/business/controller/utils/StringKit.java similarity index 99% rename from gather-app/src/main/java/com/ruoyi/common/utils/StringKit.java rename to gather-app/src/main/java/com/ruoyi/business/controller/utils/StringKit.java index c1cffc0..6f493c8 100644 --- a/gather-app/src/main/java/com/ruoyi/common/utils/StringKit.java +++ b/gather-app/src/main/java/com/ruoyi/business/controller/utils/StringKit.java @@ -1,4 +1,4 @@ -package com.ruoyi.common.utils; +package com.ruoyi.business.controller.utils; import java.io.PrintWriter; import java.io.StringWriter; @@ -8,7 +8,6 @@ import java.util.ArrayList; import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; -import java.util.stream.Collectors; public class StringKit { diff --git a/gather-app/src/main/java/com/ruoyi/database/controller/DevopsVideoInfoController.java b/gather-app/src/main/java/com/ruoyi/database/controller/DevopsVideoInfoController.java index 28459d5..f9d0500 100644 --- a/gather-app/src/main/java/com/ruoyi/database/controller/DevopsVideoInfoController.java +++ b/gather-app/src/main/java/com/ruoyi/database/controller/DevopsVideoInfoController.java @@ -1,10 +1,9 @@ package com.ruoyi.database.controller; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 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.DevopsVideoStatus; 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.ApiOperation; import lombok.RequiredArgsConstructor; -import org.checkerframework.checker.units.qual.A; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; diff --git a/gather-app/src/main/java/com/ruoyi/database/controller/MetaActualUserInfoController.java b/gather-app/src/main/java/com/ruoyi/database/controller/MetaActualUserInfoController.java index 8a0d3c3..920d3ed 100644 --- a/gather-app/src/main/java/com/ruoyi/database/controller/MetaActualUserInfoController.java +++ b/gather-app/src/main/java/com/ruoyi/database/controller/MetaActualUserInfoController.java @@ -37,7 +37,9 @@ public class MetaActualUserInfoController extends BaseController { @ApiOperation("查询实有人口信息表") public TableDataInfo list(MetaActualUserInfo metaActualUserInfo) { startPage(); - List list = metaActualUserInfoService.list(new QueryWrapper<>(metaActualUserInfo)); + QueryWrapper querySyrkWrapper = new QueryWrapper<>(); + querySyrkWrapper.ne("actual_user_type", 101); + List list = metaActualUserInfoService.list(querySyrkWrapper); return getDataTable(list); } diff --git a/gather-app/src/main/java/com/ruoyi/database/controller/MetaAlarmInfoController.java b/gather-app/src/main/java/com/ruoyi/database/controller/MetaAlarmInfoController.java index 50fa4c4..ad5f751 100644 --- a/gather-app/src/main/java/com/ruoyi/database/controller/MetaAlarmInfoController.java +++ b/gather-app/src/main/java/com/ruoyi/database/controller/MetaAlarmInfoController.java @@ -3,7 +3,7 @@ package com.ruoyi.database.controller; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 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.service.MetaAlarmInfoService; import com.ruoyi.common.annotation.Log; @@ -19,7 +19,6 @@ import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import javax.servlet.http.HttpServletResponse; -import java.text.ParseException; import java.text.SimpleDateFormat; import java.time.LocalDate; import java.time.LocalDateTime; @@ -57,11 +56,13 @@ public class MetaAlarmInfoController extends BaseController { Date parse = simpleDateFormat.parse(metaAlarmInfo.getInformantTime()); Calendar calendar = Calendar.getInstance(); calendar.setTime(parse); + calendar.add(Calendar.DAY_OF_MONTH, 1); SimpleDateFormat outputSdf = new SimpleDateFormat("yyyyMMddHHmmss"); SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String resultDateString = outputSdf.format(calendar.getTime()); String format = outputSdf.format(parse); + QueryWrapper queryWrapper = new QueryWrapper<>(); queryWrapper.between("alarm_response_time", format, resultDateString); int count = metaAlarmInfoService.count(queryWrapper); diff --git a/gather-app/src/main/java/com/ruoyi/database/controller/PeopleVehicleFlowController.java b/gather-app/src/main/java/com/ruoyi/database/controller/PeopleVehicleFlowController.java index 7d86b10..aa9e7ff 100644 --- a/gather-app/src/main/java/com/ruoyi/database/controller/PeopleVehicleFlowController.java +++ b/gather-app/src/main/java/com/ruoyi/database/controller/PeopleVehicleFlowController.java @@ -3,7 +3,7 @@ package com.ruoyi.database.controller; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.ruoyi.common.core.controller.BaseController; 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.service.PeopleVehicleFlowService; import io.swagger.annotations.Api; diff --git a/gather-app/src/main/java/com/ruoyi/database/controller/PeopleVehicleHourFlowController.java b/gather-app/src/main/java/com/ruoyi/database/controller/PeopleVehicleHourFlowController.java index 3a132b3..038a3db 100644 --- a/gather-app/src/main/java/com/ruoyi/database/controller/PeopleVehicleHourFlowController.java +++ b/gather-app/src/main/java/com/ruoyi/database/controller/PeopleVehicleHourFlowController.java @@ -3,19 +3,17 @@ package com.ruoyi.database.controller; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.ruoyi.common.core.controller.BaseController; 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.service.PeopleVehicleHourFlowService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; -import org.springframework.data.auditing.CurrentDateTimeProvider; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; -import java.time.LocalDate; import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; import java.time.temporal.ChronoUnit; diff --git a/gather-app/src/main/java/com/ruoyi/database/controller/TransitHuntersUserModelRecordController.java b/gather-app/src/main/java/com/ruoyi/database/controller/TransitHuntersUserModelRecordController.java index 3ca3616..d7833b0 100644 --- a/gather-app/src/main/java/com/ruoyi/database/controller/TransitHuntersUserModelRecordController.java +++ b/gather-app/src/main/java/com/ruoyi/database/controller/TransitHuntersUserModelRecordController.java @@ -9,13 +9,11 @@ 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.NumKit; -import com.ruoyi.common.utils.StringKit; +import com.ruoyi.business.controller.utils.NumKit; +import com.ruoyi.business.controller.utils.StringKit; import com.ruoyi.common.utils.bean.BeanUtils; import com.ruoyi.common.utils.poi.ExcelUtil; 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 io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -26,7 +24,6 @@ import org.springframework.web.multipart.MultipartFile; import javax.servlet.http.HttpServletResponse; import java.text.ParseException; import java.text.SimpleDateFormat; -import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.stream.Collectors; diff --git a/gather-app/src/main/java/com/ruoyi/database/service/impl/DevopsVideoInfoServiceImpl.java b/gather-app/src/main/java/com/ruoyi/database/service/impl/DevopsVideoInfoServiceImpl.java index 1adce8e..c0a8a80 100644 --- a/gather-app/src/main/java/com/ruoyi/database/service/impl/DevopsVideoInfoServiceImpl.java +++ b/gather-app/src/main/java/com/ruoyi/database/service/impl/DevopsVideoInfoServiceImpl.java @@ -10,10 +10,10 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.business.domain.dto.DevopsVideoInfoDto; import com.ruoyi.business.domain.vo.DevopsVideoInfoVo; import com.ruoyi.common.exception.ServiceException; -import com.ruoyi.common.utils.JsoupUtils; -import com.ruoyi.common.utils.NumKit; -import com.ruoyi.common.utils.PropertiesUtil; -import com.ruoyi.common.utils.StringKit; +import com.ruoyi.business.controller.utils.JsoupUtils; +import com.ruoyi.business.controller.utils.NumKit; +import com.ruoyi.business.controller.utils.PropertiesUtil; +import com.ruoyi.business.controller.utils.StringKit; import com.ruoyi.common.utils.bean.BeanUtils; import com.ruoyi.database.domain.DevopsVideoInfo; import com.ruoyi.database.domain.DevopsVideoStatus; diff --git a/gather-app/src/main/java/com/ruoyi/interceptor/DictionaryInterceptor.java b/gather-app/src/main/java/com/ruoyi/interceptor/DictionaryInterceptor.java index cdb213a..6a9c762 100644 --- a/gather-app/src/main/java/com/ruoyi/interceptor/DictionaryInterceptor.java +++ b/gather-app/src/main/java/com/ruoyi/interceptor/DictionaryInterceptor.java @@ -5,7 +5,7 @@ import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.ReflectUtil; import cn.hutool.core.util.StrUtil; 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.plugin.*;