|
|
|
@ -2,6 +2,7 @@ package com.shxy.xymanager_service.impl;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
|
|
|
import cn.hutool.core.date.DateTime;
|
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
|
|
import com.shxy.xymanager_common.bean.ServiceBody;
|
|
|
|
|
import com.shxy.xymanager_common.dto.*;
|
|
|
|
@ -25,6 +26,7 @@ import org.springframework.beans.factory.annotation.Value;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
|
import java.math.BigInteger;
|
|
|
|
|
import java.sql.Struct;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -70,6 +72,10 @@ public class TerminalAlarmServiceImpl implements TerminalAlarmService {
|
|
|
|
|
Integer lineid = vo.getLineId();
|
|
|
|
|
Integer towerid = vo.getTowerId();
|
|
|
|
|
Integer label = vo.getLabel();
|
|
|
|
|
String search = vo.getSearch();
|
|
|
|
|
if (StrUtil.isEmpty(search)) {
|
|
|
|
|
search = null;
|
|
|
|
|
}
|
|
|
|
|
List<TerminalImgAlarmParams> labellist = new ArrayList<>();
|
|
|
|
|
Map<Integer, TerminalImgAlarmParams> alarmParamMap = cacheService.getAlarmParamMap();
|
|
|
|
|
if (label == null || label == -1) {
|
|
|
|
@ -91,18 +97,40 @@ public class TerminalAlarmServiceImpl implements TerminalAlarmService {
|
|
|
|
|
List<TerminalImgAlarmsDto> list = new ArrayList<>();
|
|
|
|
|
List<Integer> termidlist = new ArrayList<>();
|
|
|
|
|
if (dyid == null || dyid.intValue() == -1) {
|
|
|
|
|
if (StrUtil.isEmpty(search)) {
|
|
|
|
|
PageUtils.SetPage(pageindex, pagesize);
|
|
|
|
|
list = terminalImgAlarmsDao.selectAlarmsDetails(null, labellist, BigInteger.valueOf(start), BigInteger.valueOf(end));
|
|
|
|
|
} else {
|
|
|
|
|
dtos = dyLevelDao.selectDyAndLineAndTowerAnTermList(null, null, null, null, search, CommonStatus.EFFECTIVE.value());
|
|
|
|
|
if (CollectionUtil.isEmpty(dtos)) {
|
|
|
|
|
list = new ArrayList<>();
|
|
|
|
|
} else {
|
|
|
|
|
for (DyAndLineAndTowerAndTermDto item1 : dtos) {
|
|
|
|
|
for (LineAndTowerAndTermDto item2 : item1.getList()) {
|
|
|
|
|
for (TowerAndTermDto item3 : item2.getList()) {
|
|
|
|
|
for (Terminals item4 : item3.getList()) {
|
|
|
|
|
termidlist.add(item4.getId());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
PageUtils.SetPage(pageindex, pagesize);
|
|
|
|
|
list = terminalImgAlarmsDao.selectAlarmsDetails(termidlist, labellist, BigInteger.valueOf(start), BigInteger.valueOf(end));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if (lineid == null || lineid.intValue() == -1) {
|
|
|
|
|
dtos = dyLevelDao.selectDyAndLineAndTowerAnTermList(dyid, null, null, null, CommonStatus.EFFECTIVE.value());
|
|
|
|
|
dtos = dyLevelDao.selectDyAndLineAndTowerAnTermList(dyid, null, null, null, search, CommonStatus.EFFECTIVE.value());
|
|
|
|
|
} else {
|
|
|
|
|
if (towerid == null || towerid.intValue() == -1) {
|
|
|
|
|
dtos = dyLevelDao.selectDyAndLineAndTowerAnTermList(dyid, lineid, null, null, CommonStatus.EFFECTIVE.value());
|
|
|
|
|
dtos = dyLevelDao.selectDyAndLineAndTowerAnTermList(dyid, lineid, null, null, search, CommonStatus.EFFECTIVE.value());
|
|
|
|
|
} else {
|
|
|
|
|
dtos = dyLevelDao.selectDyAndLineAndTowerAnTermList(dyid, lineid, towerid, null, CommonStatus.EFFECTIVE.value());
|
|
|
|
|
dtos = dyLevelDao.selectDyAndLineAndTowerAnTermList(dyid, lineid, towerid, null, search, CommonStatus.EFFECTIVE.value());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (CollectionUtil.isEmpty(dtos)) {
|
|
|
|
|
list = new ArrayList<>();
|
|
|
|
|
} else {
|
|
|
|
|
for (DyAndLineAndTowerAndTermDto item1 : dtos) {
|
|
|
|
|
for (LineAndTowerAndTermDto item2 : item1.getList()) {
|
|
|
|
|
for (TowerAndTermDto item3 : item2.getList()) {
|
|
|
|
@ -115,6 +143,8 @@ public class TerminalAlarmServiceImpl implements TerminalAlarmService {
|
|
|
|
|
PageUtils.SetPage(pageindex, pagesize);
|
|
|
|
|
list = terminalImgAlarmsDao.selectAlarmsDetails(termidlist, labellist, BigInteger.valueOf(start), BigInteger.valueOf(end));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (CollectionUtil.isNotEmpty(list)) {
|
|
|
|
|
|
|
|
|
|
Map<Integer, Terminals> terminalMap = cacheService.getTerminalMap();
|
|
|
|
|