Commit 8ae87a00 authored by chenzhao's avatar chenzhao

bug2407 筛选参数解析异常 修改筛选条件方法 XML中添加了selectAllPage 方法 data代表排序条件 lift 升降序

parent 5d1ba33a
...@@ -126,6 +126,7 @@ ...@@ -126,6 +126,7 @@
<if test="alertSourceCode!= null "> <if test="alertSourceCode!= null ">
and alert_source_code = #{alertSourceCode} and alert_source_code = #{alertSourceCode}
</if> </if>
</where>
<if test="data != null and lift == 'ascend'"> <if test="data != null and lift == 'ascend'">
order by #{data} ASC limit #{current},#{size} order by #{data} ASC limit #{current},#{size}
</if> </if>
...@@ -135,7 +136,6 @@ ...@@ -135,7 +136,6 @@
<if test="data == null "> <if test="data == null ">
order by call_time DESC limit #{current},#{size} order by call_time DESC limit #{current},#{size}
</if> </if>
</where>
</select> </select>
......
...@@ -132,16 +132,21 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal ...@@ -132,16 +132,21 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
/** /**
* 接警记录 列表分页查询 * 接警记录 列表分页查询
**/ /* bug2407 筛选参数解析异常 修改筛选条件方法 XML中添加了selectAllPage 方法 data代表排序条件 lift 升降序 陈召 2021-09-03 开始*/ **/ /* bug2407 筛选参数解析异常 修改筛选条件方法 XML中添加了selectAllPage 方法 data代表排序条件 lift 升降序 陈召 2021-09-03 开始*/
public IPage<AlertCalled> queryForCalledList(Page pageBean,Integer alertStatus, public IPage<AlertCalled> queryForCalledList(Page pageBean, Integer alertStatus,
String alertTypeCode , String alertTypeCode,
String alertSourceCode, String alertSourceCode,
String startTime, String startTime,
String endTime, String endTime,
String sort) { String sort) {
String data = null;
String lift = null;
if (StringUtils.isNotEmpty(sort)) {
String[] split = sort.split(","); String[] split = sort.split(",");
String data = RedisKey.humpToLine(split[0]); data = RedisKey.humpToLine(split[0]);
String lift =split[1]; lift = split[1];
List<AlertCalled> list = alertCalledMapper.selectAllPage(pageBean.getCurrent(), pageBean.getSize(), alertStatus, alertTypeCode, alertSourceCode, startTime, endTime,data,lift); }
List<AlertCalled> list = alertCalledMapper.selectAllPage(pageBean.getCurrent(), pageBean.getSize(), alertStatus, alertTypeCode, alertSourceCode, startTime, endTime, data, lift);
IPage<AlertCalled> iPage = new Page<>(); IPage<AlertCalled> iPage = new Page<>();
iPage.setRecords(list); iPage.setRecords(list);
iPage.setTotal(list.size()); iPage.setTotal(list.size());
...@@ -150,8 +155,6 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal ...@@ -150,8 +155,6 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
} }
/** /**
* 根据灾情id 查询灾情详情 * 根据灾情id 查询灾情详情
**/ **/
...@@ -417,10 +420,10 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal ...@@ -417,10 +420,10 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
listdate.add(new KeyValueLabel("联系人电话", "contactPhone", alertCalled.getContactPhone())); listdate.add(new KeyValueLabel("联系人电话", "contactPhone", alertCalled.getContactPhone()));
list.stream().forEach(AlertFormValue -> { list.stream().forEach(AlertFormValue -> {
String valueCode = AlertFormValue.getFieldValueCode(); String valueCode = AlertFormValue.getFieldValueCode();
if(null == valueCode) { if (null == valueCode) {
valueCode = AlertFormValue.getFieldValue(); valueCode = AlertFormValue.getFieldValue();
} }
listdate.add(new KeyValueLabel(AlertFormValue.getFieldName(), AlertFormValue.getFieldCode(),valueCode)); listdate.add(new KeyValueLabel(AlertFormValue.getFieldName(), AlertFormValue.getFieldCode(), valueCode));
}); });
map.put("data", listdate); map.put("data", listdate);
return map; return map;
...@@ -476,18 +479,15 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal ...@@ -476,18 +479,15 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
} }
@Transactional(rollbackFor = RuntimeException.class) @Transactional(rollbackFor = RuntimeException.class)
public Boolean controlEquip() throws Exception public Boolean controlEquip() throws Exception {
{
/** /**
* 获取控制器设备 * 获取控制器设备
*/ */
List<ControllerEquipDto> controllerEquipDtoList = controllerEquipService.queryAllForList(); List<ControllerEquipDto> controllerEquipDtoList = controllerEquipService.queryAllForList();
Map<Long, List<String>> controllerEquipMap = new HashMap<>(); Map<Long, List<String>> controllerEquipMap = new HashMap<>();
for (ControllerEquipDto controllerEquipDto : controllerEquipDtoList) for (ControllerEquipDto controllerEquipDto : controllerEquipDtoList) {
{
List<String> numList = controllerEquipMap.get(controllerEquipDto.getControllerSeq()); List<String> numList = controllerEquipMap.get(controllerEquipDto.getControllerSeq());
if (ValidationUtil.isEmpty(numList)) if (ValidationUtil.isEmpty(numList)) {
{
numList = new ArrayList<>(); numList = new ArrayList<>();
} }
numList.add(controllerEquipDto.getNum()); numList.add(controllerEquipDto.getNum());
...@@ -497,30 +497,23 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal ...@@ -497,30 +497,23 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
* 获取联动控制器 * 获取联动控制器
*/ */
List<ControllerDto> controllerDtoList = controllerService.queryAllForList(); List<ControllerDto> controllerDtoList = controllerService.queryAllForList();
StringBuilder bellNumSb =new StringBuilder(); StringBuilder bellNumSb = new StringBuilder();
StringBuilder broadcastNumSb =new StringBuilder(); StringBuilder broadcastNumSb = new StringBuilder();
for (ControllerDto controllerDto : controllerDtoList) for (ControllerDto controllerDto : controllerDtoList) {
{
//消防警铃 //消防警铃
if (controllerDto.getType().equals(ControllerTypeEnum.BELL.getCode())) if (controllerDto.getType().equals(ControllerTypeEnum.BELL.getCode())) {
{
List<String> bellNumList = controllerEquipMap.get(controllerDto.getSequenceNbr()); List<String> bellNumList = controllerEquipMap.get(controllerDto.getSequenceNbr());
if (!ValidationUtil.isEmpty(bellNumList)) if (!ValidationUtil.isEmpty(bellNumList)) {
{ for (String num : bellNumList) {
for (String num : bellNumList)
{
bellNumSb.append(num).append(","); bellNumSb.append(num).append(",");
} }
} }
} }
//广播 //广播
if (controllerDto.getType().equals(ControllerTypeEnum.BROADCAST.getCode())) if (controllerDto.getType().equals(ControllerTypeEnum.BROADCAST.getCode())) {
{
List<String> broadcastList = controllerEquipMap.get(controllerDto.getSequenceNbr()); List<String> broadcastList = controllerEquipMap.get(controllerDto.getSequenceNbr());
if (!ValidationUtil.isEmpty(broadcastList)) if (!ValidationUtil.isEmpty(broadcastList)) {
{ for (String num : broadcastList) {
for (String num : broadcastList)
{
broadcastNumSb.append(num).append(","); broadcastNumSb.append(num).append(",");
} }
} }
...@@ -529,27 +522,24 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal ...@@ -529,27 +522,24 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
/** /**
* 打开消防警铃 * 打开消防警铃
*/ */
if (!ValidationUtil.isEmpty(bellNumSb.toString())) if (!ValidationUtil.isEmpty(bellNumSb.toString())) {
{
String bellNum = bellNumSb.toString(); String bellNum = bellNumSb.toString();
bellNum = bellNum.substring(0, bellNum.length() -1); bellNum = bellNum.substring(0, bellNum.length() - 1);
jcsControlServerClient.sendBellAction(bellNum, "1"); jcsControlServerClient.sendBellAction(bellNum, "1");
} }
/** /**
* 播放广播 * 播放广播
*/ */
if (!ValidationUtil.isEmpty(broadcastNumSb.toString())) if (!ValidationUtil.isEmpty(broadcastNumSb.toString())) {
{
String broadcastNum = broadcastNumSb.toString(); String broadcastNum = broadcastNumSb.toString();
broadcastNum = broadcastNum.substring(0, broadcastNum.length() -1); broadcastNum = broadcastNum.substring(0, broadcastNum.length() - 1);
jcsControlServerClient.sendFileAction(broadcastNum, "1490075199246.mp3"); jcsControlServerClient.sendFileAction(broadcastNum, "1490075199246.mp3");
} }
/** /**
* 打开北站车库门 * 打开北站车库门
*/ */
List<ControllerDto> northDoor = controllerService.queryForList("3", ControllerTypeEnum.DOOR.getCode()); List<ControllerDto> northDoor = controllerService.queryForList("3", ControllerTypeEnum.DOOR.getCode());
if (!ValidationUtil.isEmpty(northDoor)) if (!ValidationUtil.isEmpty(northDoor)) {
{
ControllerDto controllerDto = northDoor.get(0); ControllerDto controllerDto = northDoor.get(0);
//打开北站车库门 //打开北站车库门
jcsControlServerClient.writeStateAction(controllerDto.getIp(), controllerDto.getPort(), 100, "1,1,1,1"); jcsControlServerClient.writeStateAction(controllerDto.getIp(), controllerDto.getPort(), 100, "1,1,1,1");
...@@ -560,8 +550,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal ...@@ -560,8 +550,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
* 打开南站车库门 * 打开南站车库门
*/ */
List<ControllerDto> southDoor = controllerService.queryForList("2", ControllerTypeEnum.DOOR.getCode()); List<ControllerDto> southDoor = controllerService.queryForList("2", ControllerTypeEnum.DOOR.getCode());
if (!ValidationUtil.isEmpty(southDoor)) if (!ValidationUtil.isEmpty(southDoor)) {
{
ControllerDto controllerDto = southDoor.get(0); ControllerDto controllerDto = southDoor.get(0);
//打开南站车库门 //打开南站车库门
jcsControlServerClient.writeStateAction(controllerDto.getIp(), controllerDto.getPort(), 100, "1"); jcsControlServerClient.writeStateAction(controllerDto.getIp(), controllerDto.getPort(), 100, "1");
......
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