|
|
|
@ -12,10 +12,7 @@ import com.google.common.collect.Lists;
|
|
|
|
|
import com.shxy.xymanager_common.bean.ServiceBody;
|
|
|
|
|
import com.shxy.xymanager_common.constant.Constants;
|
|
|
|
|
import com.shxy.xymanager_common.dto.*;
|
|
|
|
|
import com.shxy.xymanager_common.entity.Lines;
|
|
|
|
|
import com.shxy.xymanager_common.entity.TerminalChannels;
|
|
|
|
|
import com.shxy.xymanager_common.entity.TerminalPhoto;
|
|
|
|
|
import com.shxy.xymanager_common.entity.Terminals;
|
|
|
|
|
import com.shxy.xymanager_common.entity.*;
|
|
|
|
|
import com.shxy.xymanager_common.enums.CommonStatus;
|
|
|
|
|
import com.shxy.xymanager_common.exception.Asserts;
|
|
|
|
|
import com.shxy.xymanager_common.model.*;
|
|
|
|
@ -24,10 +21,7 @@ import com.shxy.xymanager_common.util.MyDateUtils;
|
|
|
|
|
import com.shxy.xymanager_common.util.ProcessExecUtils;
|
|
|
|
|
import com.shxy.xymanager_common.util.StringUtils;
|
|
|
|
|
import com.shxy.xymanager_common.vo.*;
|
|
|
|
|
import com.shxy.xymanager_dao.dao.LinesDao;
|
|
|
|
|
import com.shxy.xymanager_dao.dao.TerminalChannelsDao;
|
|
|
|
|
import com.shxy.xymanager_dao.dao.TerminalPhotoDao;
|
|
|
|
|
import com.shxy.xymanager_dao.dao.TerminalsDao;
|
|
|
|
|
import com.shxy.xymanager_dao.dao.*;
|
|
|
|
|
import com.shxy.xymanager_service.cache.XyCache;
|
|
|
|
|
import com.shxy.xymanager_service.service.TerminalPhotoService;
|
|
|
|
|
import com.shxy.xymanager_service.service.TerminalScheduleRuleService;
|
|
|
|
@ -59,6 +53,9 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
|
|
|
|
|
@Autowired
|
|
|
|
|
LinesDao linesDao;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
TowerDao towerDao;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
TerminalChannelsDao terminalChannelsDao;
|
|
|
|
|
|
|
|
|
@ -143,6 +140,7 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
|
|
|
|
|
List<TerminalPhotoSelectListModel.PhotoBean> beans = new ArrayList<>();
|
|
|
|
|
Integer dyid = vo.getDyid();
|
|
|
|
|
Integer lineid = vo.getLineid();
|
|
|
|
|
Integer termid = vo.getTermid();
|
|
|
|
|
Integer towerid = vo.getTowerid();
|
|
|
|
|
Integer channelid = vo.getChannelid();
|
|
|
|
|
int pageindex = vo.getPageindex();
|
|
|
|
@ -155,18 +153,58 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
|
|
|
|
|
if (BeanUtil.isEmpty(dyid) || BeanUtil.isEmpty(lineid) || BeanUtil.isEmpty(towerid) || BeanUtil.isEmpty(channelid)) {
|
|
|
|
|
model.setList(beans);
|
|
|
|
|
} else {
|
|
|
|
|
Integer termid = null;
|
|
|
|
|
List<Integer> termidlist = new ArrayList<>();
|
|
|
|
|
ArrayList<Integer> channelidlist = new ArrayList<>();
|
|
|
|
|
if (dyid == null || dyid.intValue() == 0) {
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
ArrayList<Integer> lineidlist = new ArrayList<>();
|
|
|
|
|
ArrayList<Integer> toweridlist = new ArrayList<>();
|
|
|
|
|
if (dyid == null || dyid.intValue() == 0) {//电压选择全部
|
|
|
|
|
|
|
|
|
|
} else {//电压选择某一个
|
|
|
|
|
if (lineid == null || lineid.intValue() == 0) {//线路选择全部
|
|
|
|
|
List<Lines> lines = linesDao.selectLineByDyId(dyid, CommonStatus.EFFECTIVE.value());
|
|
|
|
|
for (Lines item : lines) {
|
|
|
|
|
lineidlist.add(item.getId());
|
|
|
|
|
}
|
|
|
|
|
List<Tower> towers = towerDao.selectAllByLineidList(lineidlist, CommonStatus.EFFECTIVE.value());
|
|
|
|
|
for (Tower item : towers) {
|
|
|
|
|
toweridlist.add(item.getId());
|
|
|
|
|
}
|
|
|
|
|
List<Terminals> terminals = terminalsDao.selectByToweridAndLineid(toweridlist, CommonStatus.EFFECTIVE.value());
|
|
|
|
|
for (Terminals item : terminals) {
|
|
|
|
|
termidlist.add(item.getId());
|
|
|
|
|
}
|
|
|
|
|
} else {//线路选择某一个
|
|
|
|
|
if (towerid == null || towerid.intValue() == 0) {//杆塔选择全部
|
|
|
|
|
List<Tower> towers = towerDao.selectAllByLineid(lineid, CommonStatus.EFFECTIVE.value());
|
|
|
|
|
for (Tower item : towers) {
|
|
|
|
|
toweridlist.add(item.getId());
|
|
|
|
|
}
|
|
|
|
|
List<Terminals> terminals = terminalsDao.selectByToweridAndLineid(toweridlist, CommonStatus.EFFECTIVE.value());
|
|
|
|
|
for (Terminals item : terminals) {
|
|
|
|
|
termidlist.add(item.getId());
|
|
|
|
|
}
|
|
|
|
|
} else {//杆塔选择一个
|
|
|
|
|
if (termid == null || termid.intValue() == 0) {//装置选择全部
|
|
|
|
|
toweridlist.add(towerid);
|
|
|
|
|
List<Terminals> terminals = terminalsDao.selectByToweridAndLineid(toweridlist, CommonStatus.EFFECTIVE.value());
|
|
|
|
|
for (Terminals item : terminals) {
|
|
|
|
|
termidlist.add(item.getId());
|
|
|
|
|
}
|
|
|
|
|
} else {//装置选择一个
|
|
|
|
|
if (channelid == null || channelid.intValue() == 0) {//通道选择全部
|
|
|
|
|
List<TermChannelAndMapperDto> dtos = terminalChannelsDao.selectByTermid(termid, CommonStatus.EFFECTIVE.value());
|
|
|
|
|
for (TermChannelAndMapperDto item : dtos) {
|
|
|
|
|
channelidlist.add(item.getChannelid());
|
|
|
|
|
}
|
|
|
|
|
} else {//通道选择某一个
|
|
|
|
|
channelidlist.add(channelid);
|
|
|
|
|
Terminals terminals = terminalsDao.selectByToweridAndLineid(lineid, towerid, CommonStatus.EFFECTIVE.value());
|
|
|
|
|
if (BeanUtil.isEmpty(terminals)) {
|
|
|
|
|
return Asserts.error("没有该装置信息");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
list = terminalPhotoDao.selectPhotoList(termid, channelidlist, start, end);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
list = terminalPhotoDao.selectPhotoListByTermList(termidlist, channelidlist, start, end);
|
|
|
|
|
boolean empty = CollectionUtil.isEmpty(list);
|
|
|
|
|
if (empty) {
|
|
|
|
|
model.setList(new ArrayList<>());
|
|
|
|
|