develop
hanrenchun 10 months ago
parent 5f44b4d75a
commit d9002517a9

@ -44,16 +44,46 @@ public class MetaImpUserModelInfoController extends BaseController {
ImpUserModelVO impUserModelVO = new ImpUserModelVO(); ImpUserModelVO impUserModelVO = new ImpUserModelVO();
BeanUtils.copyProperties(one, impUserModelVO); BeanUtils.copyProperties(one, impUserModelVO);
Map<String, String> map = new HashMap<>(); Map<String, String> map = new HashMap<>();
map.put(one.getKey1(), one.getValue1()); if (one.getKey1() != null && one.getValue1() != null) {
map.put(one.getKey2(), one.getValue2()); map.put(one.getKey1(), one.getValue1());
map.put(one.getKey3(), one.getValue3()); }
map.put(one.getKey4(), one.getValue4()); if (one.getKey2() != null && one.getValue2() != null) {
map.put(one.getKey5(), one.getValue5()); map.put(one.getKey2(), one.getValue2());
map.put(one.getKey6(), one.getValue6());
map.put(one.getKey7(), one.getValue7()); }
map.put(one.getKey8(), one.getValue8()); if (one.getKey3() != null && one.getValue3() != null) {
map.put(one.getKey9(), one.getValue9()); map.put(one.getKey3(), one.getValue3());
map.put(one.getKey10(), one.getValue10());
}
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); impUserModelVO.setKV(map);
return AjaxResult.success(impUserModelVO); return AjaxResult.success(impUserModelVO);
} }

@ -53,14 +53,28 @@ public class TransitUserRecordController extends BaseController {
@GetMapping @GetMapping
@ApiOperation("查询人脸记录表") @ApiOperation("查询人脸记录表")
public TableDataInfo<TransitUserRecord> list(TransitUserRecord transitUserRecord) throws Exception { public TableDataInfo<TransitUserRecord> list(TransitUserRecord transitUserRecord) throws Exception {
startPage(); List<DevopsDeviceInfo> deviceInfos = devopsDeviceInfoService.lambdaQuery()
.eq(DevopsDeviceInfo::getParentMonitoringType, 1)
.eq(DevopsDeviceInfo::getDeviceType,1).list();
List<String> collect = deviceInfos.stream().map(devopsDeviceInfo ->
devopsDeviceInfo.getGbsChannelNo()).collect(Collectors.toList());
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");
QueryWrapper<TransitUserRecord> queryWrapper = new QueryWrapper<>(transitUserRecord); QueryWrapper<TransitUserRecord> queryWrapper = new QueryWrapper<>(transitUserRecord);
LocalDateTime now = LocalDateTime.now(); if (transitUserRecord == null) {
LocalDateTime minusDay = now.minusDays(1); LocalDateTime now = LocalDateTime.now();
queryWrapper.between("partition_field", formatter.format(minusDay), formatter.format(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"); queryWrapper.orderByDesc("partition_field");
PageUtils.startPage();
List<TransitUserRecord> list = transitUserRecordService.list(queryWrapper); List<TransitUserRecord> list = transitUserRecordService.list(queryWrapper);
return getDataTable(list); return getDataTable(list);

@ -51,14 +51,28 @@ public class TransitVehicleRecordController extends BaseController {
@GetMapping @GetMapping
@ApiOperation("查询车辆记录表") @ApiOperation("查询车辆记录表")
public TableDataInfo<TransitVehicleRecord> list(TransitVehicleRecord transitVehicleRecord) { public TableDataInfo<TransitVehicleRecord> list(TransitVehicleRecord transitVehicleRecord) {
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)
.eq(DevopsDeviceInfo::getDeviceType,2).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);
LocalDateTime now = LocalDateTime.now(); if (transitVehicleRecord == null) {
LocalDateTime minusDay = now.minusDays(1); LocalDateTime now = LocalDateTime.now();
queryWrapper.between("partition_field", formatter.format(minusDay), formatter.format(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"); queryWrapper.orderByDesc("partition_field");
PageUtils.startPage();
List<TransitVehicleRecord> list = transitVehicleRecordService.list(queryWrapper); List<TransitVehicleRecord> list = transitVehicleRecordService.list(queryWrapper);
return getDataTable(list); return getDataTable(list);
} }

Loading…
Cancel
Save