develop
hanrenchun 10 months ago
parent 1b07330b49
commit 64ee8a111c

@ -20,6 +20,7 @@ import lombok.RequiredArgsConstructor;
import org.apache.commons.collections4.map.LinkedMap; import org.apache.commons.collections4.map.LinkedMap;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.text.Collator;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
import java.util.regex.Matcher; import java.util.regex.Matcher;
@ -627,7 +628,12 @@ public class BigScreenController extends BaseController {
)); ));
LinkedMap<String, List<Map<String, String>>> linkedMap = new LinkedMap<>(); LinkedMap<String, List<Map<String, String>>> 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); return AjaxResult.success(linkedMap);
} catch (Exception e) { } catch (Exception e) {
logger.info(StringKit.toString(e)); logger.info(StringKit.toString(e));
@ -672,6 +678,7 @@ public class BigScreenController extends BaseController {
QueryWrapper<MetaActualUserInfo> actualQueryWrapper = new QueryWrapper<>(); QueryWrapper<MetaActualUserInfo> actualQueryWrapper = new QueryWrapper<>();
actualQueryWrapper.eq("habitation_address", estateInfo == null ? null : estateInfo.getRealEstateAddress()); actualQueryWrapper.eq("habitation_address", estateInfo == null ? null : estateInfo.getRealEstateAddress());
actualQueryWrapper.groupBy("id_card");
List<MetaActualUserInfo> actualUserInfos = actualUserInfoService.list(actualQueryWrapper); List<MetaActualUserInfo> actualUserInfos = actualUserInfoService.list(actualQueryWrapper);

@ -51,6 +51,7 @@ public class TransitHuntersUserModelRecordController extends BaseController {
QueryWrapper<TransitHuntersUserModelRecord> queryWrapper = new QueryWrapper<>(transitHuntersUserModelRecord); QueryWrapper<TransitHuntersUserModelRecord> queryWrapper = new QueryWrapper<>(transitHuntersUserModelRecord);
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");
queryWrapper.orderByDesc("warning_time");
List<TransitHuntersUserModelRecord> list = transitHuntersUserModelRecordService.list(queryWrapper); List<TransitHuntersUserModelRecord> list = transitHuntersUserModelRecordService.list(queryWrapper);
List<TransitHuntersUserModelRecordVo> listVo = list.stream() List<TransitHuntersUserModelRecordVo> listVo = list.stream()
.map(record -> { .map(record -> {

@ -56,20 +56,11 @@ public class TransitUserRecordController extends BaseController {
startPage(); startPage();
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
DateTimeFormatter formatter1 = DateTimeFormatter.ofPattern("yyyy-MM-dd"); DateTimeFormatter formatter1 = DateTimeFormatter.ofPattern("yyyy-MM-dd");
List<DevopsDeviceInfo> deviceInfos = devopsDeviceInfoService.lambdaQuery().eq(DevopsDeviceInfo::getParentMonitoringType, 1).list();
List<String> collect = deviceInfos.stream().map(devopsDeviceInfo -> devopsDeviceInfo.getGbsChannelNo()).collect(Collectors.toList());
QueryWrapper<TransitUserRecord> queryWrapper = new QueryWrapper<>(transitUserRecord); QueryWrapper<TransitUserRecord> queryWrapper = new QueryWrapper<>(transitUserRecord);
queryWrapper.in("device_code",collect); LocalDate date = LocalDate.parse(transitUserRecord.getFirstTime(), formatter1);
if (transitUserRecord.getFirstTime() == null) { LocalDate nextDay = date.plusDays(1);
LocalDateTime now = LocalDateTime.now(); String nextDayString = nextDay.format(formatter1);
LocalDateTime minusDay = now.minusDays(1); queryWrapper.between("partition_field", transitUserRecord.getFirstTime(), nextDayString);
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);
}
queryWrapper.orderByDesc("partition_field"); queryWrapper.orderByDesc("partition_field");
List<TransitUserRecord> list = transitUserRecordService.list(queryWrapper); List<TransitUserRecord> list = transitUserRecordService.list(queryWrapper);
return getDataTable(list); return getDataTable(list);

@ -54,20 +54,11 @@ public class TransitVehicleRecordController extends BaseController {
startPage(); startPage();
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
DateTimeFormatter formatter1 = DateTimeFormatter.ofPattern("yyyy-MM-dd"); DateTimeFormatter formatter1 = DateTimeFormatter.ofPattern("yyyy-MM-dd");
List<DevopsDeviceInfo> deviceInfos = devopsDeviceInfoService.lambdaQuery().eq(DevopsDeviceInfo::getParentMonitoringType, 1).list();
List<String> collect = deviceInfos.stream().map(devopsDeviceInfo -> devopsDeviceInfo.getGbsChannelNo()).collect(Collectors.toList());
QueryWrapper<TransitVehicleRecord> queryWrapper = new QueryWrapper<>(transitVehicleRecord); QueryWrapper<TransitVehicleRecord> queryWrapper = new QueryWrapper<>(transitVehicleRecord);
queryWrapper.in("doorway_code",collect); LocalDate date = LocalDate.parse(transitVehicleRecord.getFirstTime(), formatter1);
if (transitVehicleRecord.getFirstTime() == null) { LocalDate nextDay = date.plusDays(1);
LocalDateTime now = LocalDateTime.now(); String nextDayString = nextDay.format(formatter1);
LocalDateTime minusDay = now.minusDays(1); queryWrapper.between("partition_field", transitVehicleRecord.getFirstTime(), nextDayString);
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);
}
queryWrapper.orderByDesc("partition_field"); queryWrapper.orderByDesc("partition_field");
List<TransitVehicleRecord> list = transitVehicleRecordService.list(queryWrapper); List<TransitVehicleRecord> list = transitVehicleRecordService.list(queryWrapper);
return getDataTable(list); return getDataTable(list);

Loading…
Cancel
Save