From d9002517a9e8c76a9cf01527e022bb535bf4e6d9 Mon Sep 17 00:00:00 2001 From: hanrenchun Date: Mon, 29 Jan 2024 22:06:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MetaImpUserModelInfoController.java | 50 +++++++++++++++---- .../TransitUserRecordController.java | 22 ++++++-- .../TransitVehicleRecordController.java | 22 ++++++-- 3 files changed, 76 insertions(+), 18 deletions(-) diff --git a/gather-app/src/main/java/com/ruoyi/database/controller/MetaImpUserModelInfoController.java b/gather-app/src/main/java/com/ruoyi/database/controller/MetaImpUserModelInfoController.java index b2495a1..3d6c466 100644 --- a/gather-app/src/main/java/com/ruoyi/database/controller/MetaImpUserModelInfoController.java +++ b/gather-app/src/main/java/com/ruoyi/database/controller/MetaImpUserModelInfoController.java @@ -44,16 +44,46 @@ public class MetaImpUserModelInfoController extends BaseController { ImpUserModelVO impUserModelVO = new ImpUserModelVO(); BeanUtils.copyProperties(one, impUserModelVO); Map map = new HashMap<>(); - map.put(one.getKey1(), one.getValue1()); - map.put(one.getKey2(), one.getValue2()); - map.put(one.getKey3(), one.getValue3()); - map.put(one.getKey4(), one.getValue4()); - map.put(one.getKey5(), one.getValue5()); - map.put(one.getKey6(), one.getValue6()); - map.put(one.getKey7(), one.getValue7()); - map.put(one.getKey8(), one.getValue8()); - map.put(one.getKey9(), one.getValue9()); - map.put(one.getKey10(), one.getValue10()); + if (one.getKey1() != null && one.getValue1() != null) { + map.put(one.getKey1(), one.getValue1()); + } + if (one.getKey2() != null && one.getValue2() != null) { + map.put(one.getKey2(), one.getValue2()); + + } + if (one.getKey3() != null && one.getValue3() != null) { + map.put(one.getKey3(), one.getValue3()); + + } + if (one.getKey4() != null && one.getValue4() != null) { + map.put(one.getKey4(), one.getValue4()); + + } + if (one.getKey5() != null && one.getValue5() != null) { + map.put(one.getKey5(), one.getValue5()); + + } + if (one.getKey6() != null && one.getValue6() != null) { + map.put(one.getKey6(), one.getValue6()); + + } + if (one.getKey7() != null && one.getValue7() != null) { + map.put(one.getKey7(), one.getValue7()); + + } + if (one.getKey8() != null && one.getValue8() != null) { + map.put(one.getKey8(), one.getValue8()); + + } + if (one.getKey9() != null && one.getValue9() != null) { + map.put(one.getKey9(), one.getValue9()); + + } + if (one.getKey10() != null && one.getValue10() != null) { + map.put(one.getKey10(), one.getValue10()); + + } + impUserModelVO.setKV(map); return AjaxResult.success(impUserModelVO); } diff --git a/gather-app/src/main/java/com/ruoyi/database/controller/TransitUserRecordController.java b/gather-app/src/main/java/com/ruoyi/database/controller/TransitUserRecordController.java index 96efef7..4ac95f6 100644 --- a/gather-app/src/main/java/com/ruoyi/database/controller/TransitUserRecordController.java +++ b/gather-app/src/main/java/com/ruoyi/database/controller/TransitUserRecordController.java @@ -53,14 +53,28 @@ public class TransitUserRecordController extends BaseController { @GetMapping @ApiOperation("查询人脸记录表") public TableDataInfo list(TransitUserRecord transitUserRecord) throws Exception { - startPage(); + List deviceInfos = devopsDeviceInfoService.lambdaQuery() + .eq(DevopsDeviceInfo::getParentMonitoringType, 1) + .eq(DevopsDeviceInfo::getDeviceType,1).list(); + List collect = deviceInfos.stream().map(devopsDeviceInfo -> + devopsDeviceInfo.getGbsChannelNo()).collect(Collectors.toList()); DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); DateTimeFormatter formatter1 = DateTimeFormatter.ofPattern("yyyy-MM-dd"); QueryWrapper queryWrapper = new QueryWrapper<>(transitUserRecord); - LocalDateTime now = LocalDateTime.now(); - LocalDateTime minusDay = now.minusDays(1); - queryWrapper.between("partition_field", formatter.format(minusDay), formatter.format(now)); + if (transitUserRecord == null) { + LocalDateTime now = LocalDateTime.now(); + LocalDateTime minusDay = now.minusDays(1); + queryWrapper.in("device_code",collect); + queryWrapper.between("partition_field", formatter.format(minusDay), formatter.format(now)); + } + if (transitUserRecord.getFirstTime() != null){ + queryWrapper.in("device_code",collect); + String firstTime = transitUserRecord.getFirstTime(); + LocalDate parse = LocalDate.parse(firstTime, formatter1); + queryWrapper.between("partition_field", firstTime, parse.plusDays(1).format(formatter1)); + } queryWrapper.orderByDesc("partition_field"); + PageUtils.startPage(); List list = transitUserRecordService.list(queryWrapper); return getDataTable(list); diff --git a/gather-app/src/main/java/com/ruoyi/database/controller/TransitVehicleRecordController.java b/gather-app/src/main/java/com/ruoyi/database/controller/TransitVehicleRecordController.java index c1f8fc4..3b1f01c 100644 --- a/gather-app/src/main/java/com/ruoyi/database/controller/TransitVehicleRecordController.java +++ b/gather-app/src/main/java/com/ruoyi/database/controller/TransitVehicleRecordController.java @@ -51,14 +51,28 @@ public class TransitVehicleRecordController extends BaseController { @GetMapping @ApiOperation("查询车辆记录表") public TableDataInfo list(TransitVehicleRecord transitVehicleRecord) { - startPage(); DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); DateTimeFormatter formatter1 = DateTimeFormatter.ofPattern("yyyy-MM-dd"); + List deviceInfos = devopsDeviceInfoService.lambdaQuery() + .eq(DevopsDeviceInfo::getParentMonitoringType, 1) + .eq(DevopsDeviceInfo::getDeviceType,2).list(); + List collect = deviceInfos.stream().map(devopsDeviceInfo -> + devopsDeviceInfo.getGbsChannelNo()).collect(Collectors.toList()); QueryWrapper queryWrapper = new QueryWrapper<>(transitVehicleRecord); - LocalDateTime now = LocalDateTime.now(); - LocalDateTime minusDay = now.minusDays(1); - queryWrapper.between("partition_field", formatter.format(minusDay), formatter.format(now)); + if (transitVehicleRecord == null) { + LocalDateTime now = LocalDateTime.now(); + LocalDateTime minusDay = now.minusDays(1); + queryWrapper.in("doorway_code",collect); + queryWrapper.between("partition_field", formatter.format(minusDay), formatter.format(now)); + } + if (transitVehicleRecord.getFirstTime() != null){ + queryWrapper.in("doorway_code",collect); + String firstTime = transitVehicleRecord.getFirstTime(); + LocalDate parse = LocalDate.parse(firstTime, formatter1); + queryWrapper.between("partition_field", firstTime, parse.plusDays(1).format(formatter1)); + } queryWrapper.orderByDesc("partition_field"); + PageUtils.startPage(); List list = transitVehicleRecordService.list(queryWrapper); return getDataTable(list); }