|
|
@ -88,6 +88,7 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
|
|
|
|
|
|
|
|
|
|
|
|
//服务器中的位置
|
|
|
|
//服务器中的位置
|
|
|
|
private static final String C_PATH = "/home/xymp/photos/";
|
|
|
|
private static final String C_PATH = "/home/xymp/photos/";
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 根据装置id和通道id获取图片
|
|
|
|
* 根据装置id和通道id获取图片
|
|
|
|
*
|
|
|
|
*
|
|
|
@ -240,9 +241,6 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
|
|
|
|
int pageindex = vo.getPageindex();
|
|
|
|
int pageindex = vo.getPageindex();
|
|
|
|
int pagesize = vo.getPagesize();
|
|
|
|
int pagesize = vo.getPagesize();
|
|
|
|
String search = vo.getSearch();
|
|
|
|
String search = vo.getSearch();
|
|
|
|
if (StrUtil.isEmpty(search)) {
|
|
|
|
|
|
|
|
search = null;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
Date starttime = vo.getStarttime();
|
|
|
|
Date starttime = vo.getStarttime();
|
|
|
|
Date endtime = vo.getEndtime();
|
|
|
|
Date endtime = vo.getEndtime();
|
|
|
|
long start = MyDateUtils.TimeMillSecond2Second(DateTime.of(starttime));
|
|
|
|
long start = MyDateUtils.TimeMillSecond2Second(DateTime.of(starttime));
|
|
|
@ -254,78 +252,73 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
|
|
|
|
ArrayList<Integer> channelidlist = new ArrayList<>();
|
|
|
|
ArrayList<Integer> channelidlist = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
|
|
List<DyAndLineAndTowerAndTermDto> dtos = new ArrayList<>();
|
|
|
|
List<DyAndLineAndTowerAndTermDto> dtos = new ArrayList<>();
|
|
|
|
if (dyid == null || dyid.intValue() == -1) {
|
|
|
|
|
|
|
|
if (StrUtil.isEmpty(search)) {
|
|
|
|
|
|
|
|
PageUtils.SetPage(pageindex, pagesize);
|
|
|
|
|
|
|
|
// TerminalPhotoExample example = new TerminalPhotoExample();
|
|
|
|
|
|
|
|
// example.createCriteria().andTermIdIn(termidlist).andChannelIdIn(channelidlist).andPhotoTimeBetween(start,end);
|
|
|
|
|
|
|
|
// terminalPhotoDao.selectByExample(example);
|
|
|
|
|
|
|
|
list = terminalPhotoDao.selectPhotoListByTermList(termidlist, channelidlist, BigInteger.valueOf(start), BigInteger.valueOf(end));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
List<Integer> dypList = new ArrayList<>();
|
|
|
|
// View_Dy_Line_Tower_TerminalsExample example = new View_Dy_Line_Tower_TerminalsExample();
|
|
|
|
List<Integer> linepList = new ArrayList<>();
|
|
|
|
// View_Dy_Line_Tower_TerminalsExample.Criteria criteria = example.createCriteria();
|
|
|
|
List<Integer> towerpList = new ArrayList<>();
|
|
|
|
// criteria.andDyNameLike(search);
|
|
|
|
List<Integer> termpList = new ArrayList<>();
|
|
|
|
// view_dy_line_tower_terminalsDao.selectByExample(example);
|
|
|
|
|
|
|
|
dtos = dyLevelDao.selectDyAndLineAndTowerAnTermList(null, null, null, null, search, CommonStatus.EFFECTIVE.value());
|
|
|
|
PermissionDetail permissionList = userService.getPermissionList();
|
|
|
|
|
|
|
|
if (CommonStatus.DELETE.value().equals(permissionList.getIsSuper())) {
|
|
|
|
if (CollectionUtil.isEmpty(dtos)) {
|
|
|
|
dypList = permissionList.getDypList();
|
|
|
|
list = new ArrayList<>();
|
|
|
|
linepList = permissionList.getLinepList();
|
|
|
|
} else {
|
|
|
|
towerpList = permissionList.getTowerpList();
|
|
|
|
for (DyAndLineAndTowerAndTermDto item1 : dtos) {
|
|
|
|
termpList = permissionList.getTermpList();
|
|
|
|
for (LineAndTowerAndTermDto item2 : item1.getList()) {
|
|
|
|
|
|
|
|
for (TowerAndTermDto item3 : item2.getList()) {
|
|
|
|
|
|
|
|
for (Terminals item4 : item3.getList()) {
|
|
|
|
|
|
|
|
termidlist.add(item4.getId());
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
View_Dy_Line_Tower_TerminalsExample example = new View_Dy_Line_Tower_TerminalsExample();
|
|
|
|
|
|
|
|
View_Dy_Line_Tower_TerminalsExample.Criteria criteria = example.createCriteria();
|
|
|
|
|
|
|
|
if (CollectionUtil.isNotEmpty(dypList)) {
|
|
|
|
|
|
|
|
criteria.andDyIdIn(dypList);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (CollectionUtil.isNotEmpty(linepList)) {
|
|
|
|
|
|
|
|
criteria.andLineIdIn(linepList);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (CollectionUtil.isNotEmpty(towerpList)) {
|
|
|
|
|
|
|
|
criteria.andTowerIdIn(towerpList);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
PageUtils.SetPage(pageindex, pagesize);
|
|
|
|
if (CollectionUtil.isNotEmpty(termpList)) {
|
|
|
|
list = terminalPhotoDao.selectPhotoListByTermList(termidlist, channelidlist, BigInteger.valueOf(start), BigInteger.valueOf(end));
|
|
|
|
criteria.andIdIn(termpList);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (StrUtil.isEmpty(search)) {
|
|
|
|
|
|
|
|
search = null;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
if (lineid == null || lineid.intValue() == -1) {
|
|
|
|
search = "%" + search + "%";
|
|
|
|
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, search, CommonStatus.EFFECTIVE.value());
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
if (termid == null || termid.intValue() == -1) {
|
|
|
|
|
|
|
|
dtos = dyLevelDao.selectDyAndLineAndTowerAnTermList(dyid, lineid, towerid, null, search, CommonStatus.EFFECTIVE.value());
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
dtos = dyLevelDao.selectDyAndLineAndTowerAnTermList(dyid, lineid, towerid, termid, search, CommonStatus.EFFECTIVE.value());
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (StrUtil.isNotBlank(search)) {
|
|
|
|
|
|
|
|
View_Dy_Line_Tower_TerminalsExample.Criteria or = example.or();
|
|
|
|
|
|
|
|
or.andLineNameLike(search);
|
|
|
|
|
|
|
|
or.andTowerNameLike(search);
|
|
|
|
|
|
|
|
or.andCmdidLike(search);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (dyid != null && dyid.intValue() != -1) {
|
|
|
|
|
|
|
|
View_Dy_Line_Tower_TerminalsExample.Criteria or1 = example.or();
|
|
|
|
|
|
|
|
or1.andDyIdEqualTo(dyid);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (CollectionUtil.isEmpty(dtos)) {
|
|
|
|
if (lineid != null && lineid.intValue() != -1) {
|
|
|
|
list = new ArrayList<>();
|
|
|
|
View_Dy_Line_Tower_TerminalsExample.Criteria or2 = example.or();
|
|
|
|
} else {
|
|
|
|
or2.andLineIdEqualTo(lineid);
|
|
|
|
for (DyAndLineAndTowerAndTermDto item1 : dtos) {
|
|
|
|
|
|
|
|
for (LineAndTowerAndTermDto item2 : item1.getList()) {
|
|
|
|
|
|
|
|
for (TowerAndTermDto item3 : item2.getList()) {
|
|
|
|
|
|
|
|
for (Terminals item4 : item3.getList()) {
|
|
|
|
|
|
|
|
termidlist.add(item4.getId());
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (towerid != null && towerid.intValue() != -1) {
|
|
|
|
|
|
|
|
View_Dy_Line_Tower_TerminalsExample.Criteria or3 = example.or();
|
|
|
|
|
|
|
|
or3.andTowerIdEqualTo(towerid);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (termid != null && termid.intValue() != -1) {
|
|
|
|
|
|
|
|
View_Dy_Line_Tower_TerminalsExample.Criteria or3 = example.or();
|
|
|
|
|
|
|
|
or3.andIdEqualTo(termid);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
List<View_Dy_Line_Tower_Terminals> lists = view_dy_line_tower_terminalsDao.selectByPermission(example);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (View_Dy_Line_Tower_Terminals item : lists) {
|
|
|
|
|
|
|
|
termidlist.add(item.getId());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (channelid == null || channelid.intValue() == -1) {
|
|
|
|
if (channelid == null || channelid.intValue() == -1) {
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
channelidlist.add(channelid);
|
|
|
|
channelidlist.add(channelid);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (termidlist.size() == 0) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
PageUtils.SetPage(pageindex, pagesize);
|
|
|
|
PageUtils.SetPage(pageindex, pagesize);
|
|
|
|
list = terminalPhotoDao.selectPhotoListByTermList(termidlist, channelidlist, BigInteger.valueOf(start), BigInteger.valueOf(end));
|
|
|
|
list = terminalPhotoDao.selectPhotoListByTermList(termidlist, channelidlist, BigInteger.valueOf(start), BigInteger.valueOf(end));
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
boolean empty = CollectionUtil.isEmpty(list);
|
|
|
|
boolean empty = CollectionUtil.isEmpty(list);
|
|
|
|
if (empty) {
|
|
|
|
if (empty) {
|
|
|
|
model.setList(new ArrayList<>());
|
|
|
|
model.setList(new ArrayList<>());
|
|
|
@ -798,6 +791,4 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|