Commit c3033d29 authored by lupengfei's avatar lupengfei

解决警情开始时间查询和资源管理——任务站添加新站点排在末端的问题

parent 23b04fc8
......@@ -390,6 +390,11 @@ public class AlertCalledController extends BaseController {
setQueryWrapper(alertCalledQueryWrapper, alertCalled, sort);
// 添加接警开始时间的查询条件
if (alertCalledDto.getCallTimeStart() != null) {
alertCalledQueryWrapper.ge("call_time_start", alertCalledDto.getCallTimeStart());
}
if (StringUtils.isBlank(pageNum) || StringUtils.isBlank(pageSize)) {
pageBean = new Page<>(0, Long.MAX_VALUE);
} else {
......@@ -433,13 +438,19 @@ public class AlertCalledController extends BaseController {
if (!ValidationUtil.isEmpty(alertCalled.getIsAuxiliaryScreen())) {
if (!ValidationUtil.isEmpty(alertCalled.getCallTimeStart())
&& !ValidationUtil.isEmpty(alertCalled.getCallTimeEnd())) {
queryWrapper.between("call_time", alertCalled.getCallTimeStart(),
queryWrapper.between("call_time_start", alertCalled.getCallTimeStart(),
alertCalled.getCallTimeEnd());
} else if (!ValidationUtil.isEmpty(alertCalled.getCallTimeStart())) {
queryWrapper.ge("call_time_start", alertCalled.getCallTimeStart());
}
} else {
queryWrapper.between("call_time", DateUtils.stampToDate(System.currentTimeMillis(), DateUtils.DATE_PATTERN),
if (!ValidationUtil.isEmpty(alertCalled.getCallTimeStart())) {
queryWrapper.ge("call_time_start", alertCalled.getCallTimeStart());
} else {
queryWrapper.between("call_time_start", DateUtils.stampToDate(System.currentTimeMillis(), DateUtils.DATE_PATTERN),
DateUtils.stampToDate(DateUtils.dateAddDays(new Date(), 1).getTime(), DateUtils.DATE_PATTERN));
}
}
if (alertCalled.getIsFatherAlert()) { // 0:接警;1:处警
queryWrapper.isNull("father_alert");
......@@ -456,6 +467,7 @@ public class AlertCalledController extends BaseController {
if (!ValidationUtil.isEmpty(alertCalled.getAlertSource())) {
queryWrapper.eq("alert_source", alertCalled.getAlertSource());
}
return queryWrapper;
}
......
......@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.elevator.biz.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.metadata.OrderItem;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.utils.NameUtils;
......@@ -187,6 +188,15 @@ public class RescueStationController extends BaseController {
}
page = iRescueStationService.page(pageBean, rescueStationQueryWrapper);
IPage<RescueStationDto> rescueStationDtoIPage = BeanDtoVoUtils.iPageVoStream(page, RescueStationDto.class);
// 获取查询结果列表
List<RescueStationDto> rescueStationList = rescueStationDtoIPage.getRecords();
// 对救援站列表按照更新时间进行排序,新增的救援站将排在最前面
Collections.sort(rescueStationList, Comparator.comparing(RescueStationDto::getRecDate).reversed());
// 更新排序后的列表
rescueStationDtoIPage.setRecords(rescueStationList);
return ResponseHelper.buildResponse(rescueStationDtoIPage);
}
......@@ -217,12 +227,23 @@ public class RescueStationController extends BaseController {
page.setSize(Integer.parseInt(pageSize));
page.setCurrent(Integer.parseInt(pageNum));
}
page = iRescueStationService.getRescueStationList(page,rescueStationDto);
IPage<RescueStationDto> rescueStationDtoIPage = ObjectUtils.isEmpty(page)? new Page<>(): BeanDtoVoUtils.iPageVoStream(page, RescueStationDto.class);
// 获取查询结果列表
List<RescueStationDto> rescueStationList = rescueStationDtoIPage.getRecords();
// 对救援站列表按照更新时间进行排序,新增的救援站将排在最前面
Collections.sort(rescueStationList, Comparator.comparing(RescueStationDto::getRecDate).reversed());
// 更新排序后的列表
rescueStationDtoIPage.setRecords(rescueStationList);
// // 反转列表顺序
// Collections.reverse(rescueStationList);
return ResponseHelper.buildResponse(rescueStationDtoIPage);
}
/**
* 根据警情id和距离返回救援机构信息
* @param alertId
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment