develop
hanrenchun 10 months ago
parent 64ee8a111c
commit bf20aa59fb

@ -315,9 +315,12 @@ public class BigScreenController extends BaseController {
metaAlarmInfoAndHandleAlarmVo.setJjxxAlarmResponseTime(dateFormat.format(jjxxAlarmResponse)); metaAlarmInfoAndHandleAlarmVo.setJjxxAlarmResponseTime(dateFormat.format(jjxxAlarmResponse));
} }
alarmVos.add(metaAlarmInfoAndHandleAlarmVo); alarmVos.add(metaAlarmInfoAndHandleAlarmVo);
Collections.sort(alarmVos,Collections.reverseOrder());
} }
return AjaxResult.success(alarmVos); List<MetaAlarmInfoAndHandleAlarmVo> sortedList = alarmVos.stream()
.sorted(Comparator.comparing(MetaAlarmInfoAndHandleAlarmVo::getJjxxInformantTime))
.collect(Collectors.toList());
return AjaxResult.success(sortedList);
} catch (Exception e) { } catch (Exception e) {
logger.info(StringKit.toString(e)); logger.info(StringKit.toString(e));
return AjaxResult.error("请求失败,请联系管理员"); return AjaxResult.error("请求失败,请联系管理员");

@ -57,10 +57,9 @@ public class TransitUserRecordController extends BaseController {
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);
LocalDate date = LocalDate.parse(transitUserRecord.getFirstTime(), formatter1); LocalDateTime now = LocalDateTime.now();
LocalDate nextDay = date.plusDays(1); LocalDateTime minusDay = now.minusDays(1);
String nextDayString = nextDay.format(formatter1); queryWrapper.between("partition_field", formatter.format(minusDay), formatter.format(now));
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);

@ -55,10 +55,9 @@ public class TransitVehicleRecordController extends BaseController {
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<TransitVehicleRecord> queryWrapper = new QueryWrapper<>(transitVehicleRecord); QueryWrapper<TransitVehicleRecord> queryWrapper = new QueryWrapper<>(transitVehicleRecord);
LocalDate date = LocalDate.parse(transitVehicleRecord.getFirstTime(), formatter1); LocalDateTime now = LocalDateTime.now();
LocalDate nextDay = date.plusDays(1); LocalDateTime minusDay = now.minusDays(1);
String nextDayString = nextDay.format(formatter1); queryWrapper.between("partition_field", formatter.format(minusDay), formatter.format(now));
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