diff --git a/gather-app/src/main/java/com/ruoyi/business/controller/BigScreenController.java b/gather-app/src/main/java/com/ruoyi/business/controller/BigScreenController.java index 3a3c3ea..08b1c56 100644 --- a/gather-app/src/main/java/com/ruoyi/business/controller/BigScreenController.java +++ b/gather-app/src/main/java/com/ruoyi/business/controller/BigScreenController.java @@ -20,6 +20,7 @@ import lombok.RequiredArgsConstructor; import org.apache.commons.collections4.map.LinkedMap; import org.springframework.web.bind.annotation.*; +import java.text.Collator; import java.text.SimpleDateFormat; import java.util.*; import java.util.regex.Matcher; @@ -627,7 +628,12 @@ public class BigScreenController extends BaseController { )); LinkedMap>> linkedMap = new LinkedMap<>(); - resultMap.entrySet().stream().sorted(Map.Entry.comparingByKey()).forEachOrdered(entry->{linkedMap.put(entry.getKey(), entry.getValue());}); + resultMap.entrySet().stream() + .sorted((entry1, entry2) -> { + Collator collator = Collator.getInstance(java.util.Locale.CHINA); + return collator.compare(entry1.getKey(), entry2.getKey()); + }) + .forEachOrdered(entry -> linkedMap.put(entry.getKey(), entry.getValue())); return AjaxResult.success(linkedMap); } catch (Exception e) { logger.info(StringKit.toString(e)); @@ -672,6 +678,7 @@ public class BigScreenController extends BaseController { QueryWrapper actualQueryWrapper = new QueryWrapper<>(); actualQueryWrapper.eq("habitation_address", estateInfo == null ? null : estateInfo.getRealEstateAddress()); + actualQueryWrapper.groupBy("id_card"); List actualUserInfos = actualUserInfoService.list(actualQueryWrapper); 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 bdd1a6a..b448f60 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 @@ -51,6 +51,7 @@ public class TransitHuntersUserModelRecordController extends BaseController { QueryWrapper queryWrapper = new QueryWrapper<>(transitHuntersUserModelRecord); SimpleDateFormat outputSdf = new SimpleDateFormat("yyyyMMddHHmmss"); SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + queryWrapper.orderByDesc("warning_time"); List list = transitHuntersUserModelRecordService.list(queryWrapper); List listVo = list.stream() .map(record -> { 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 aeefa7e..2f06be7 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 @@ -56,20 +56,11 @@ public class TransitUserRecordController extends BaseController { 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).list(); - List collect = deviceInfos.stream().map(devopsDeviceInfo -> devopsDeviceInfo.getGbsChannelNo()).collect(Collectors.toList()); QueryWrapper queryWrapper = new QueryWrapper<>(transitUserRecord); - queryWrapper.in("device_code",collect); - if (transitUserRecord.getFirstTime() == null) { - LocalDateTime now = LocalDateTime.now(); - LocalDateTime minusDay = now.minusDays(1); - queryWrapper.between("partition_field", formatter.format(minusDay), formatter.format(now)); - }else { - LocalDate date = LocalDate.parse(transitUserRecord.getFirstTime(), formatter1); - LocalDate nextDay = date.plusDays(1); - String nextDayString = nextDay.format(formatter1); - queryWrapper.between("partition_field", transitUserRecord.getFirstTime(), nextDayString); - } + LocalDate date = LocalDate.parse(transitUserRecord.getFirstTime(), formatter1); + LocalDate nextDay = date.plusDays(1); + String nextDayString = nextDay.format(formatter1); + queryWrapper.between("partition_field", transitUserRecord.getFirstTime(), nextDayString); queryWrapper.orderByDesc("partition_field"); 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 d3f9455..4e2df38 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 @@ -54,20 +54,11 @@ public class TransitVehicleRecordController extends BaseController { 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).list(); - List collect = deviceInfos.stream().map(devopsDeviceInfo -> devopsDeviceInfo.getGbsChannelNo()).collect(Collectors.toList()); QueryWrapper queryWrapper = new QueryWrapper<>(transitVehicleRecord); - queryWrapper.in("doorway_code",collect); - if (transitVehicleRecord.getFirstTime() == null) { - LocalDateTime now = LocalDateTime.now(); - LocalDateTime minusDay = now.minusDays(1); - queryWrapper.between("partition_field", formatter.format(minusDay), formatter.format(now)); - }else { - LocalDate date = LocalDate.parse(transitVehicleRecord.getFirstTime(), formatter1); - LocalDate nextDay = date.plusDays(1); - String nextDayString = nextDay.format(formatter1); - queryWrapper.between("partition_field", transitVehicleRecord.getFirstTime(), nextDayString); - } + LocalDate date = LocalDate.parse(transitVehicleRecord.getFirstTime(), formatter1); + LocalDate nextDay = date.plusDays(1); + String nextDayString = nextDay.format(formatter1); + queryWrapper.between("partition_field", transitVehicleRecord.getFirstTime(), nextDayString); queryWrapper.orderByDesc("partition_field"); List list = transitVehicleRecordService.list(queryWrapper); return getDataTable(list);