|
|
@ -123,45 +123,69 @@ public class TerminalServiceImpl implements TerminalService {
|
|
|
|
String search = vo.getSearch();
|
|
|
|
String search = vo.getSearch();
|
|
|
|
Integer isonline = vo.getIsonline();
|
|
|
|
Integer isonline = vo.getIsonline();
|
|
|
|
BigInteger time = TerminalUtils.generateOnlineTime();
|
|
|
|
BigInteger time = TerminalUtils.generateOnlineTime();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PermissionDetail permissionListOver = userService.getPermissionList();
|
|
|
|
|
|
|
|
List<Integer> dypList = permissionListOver.getDypList();
|
|
|
|
|
|
|
|
List<Integer> linepList = permissionListOver.getLinepList();
|
|
|
|
|
|
|
|
List<Integer> towerpList = permissionListOver.getTowerpList();
|
|
|
|
|
|
|
|
List<Integer> termpList = permissionListOver.getTermpList();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TerminalStatisticsModel model = new TerminalStatisticsModel();
|
|
|
|
|
|
|
|
View_Dy_Line_Tower_TerminalsExample example = new View_Dy_Line_Tower_TerminalsExample();
|
|
|
|
|
|
|
|
example.setGroupByClause("id");
|
|
|
|
|
|
|
|
example.setOrderByClause("id desc");
|
|
|
|
|
|
|
|
View_Dy_Line_Tower_TerminalsExample.Criteria criteria = example.createCriteria();
|
|
|
|
|
|
|
|
if (CommonStatus.DELETE.value().equals(permissionListOver.getIsSuper())) {
|
|
|
|
|
|
|
|
if (CollectionUtil.isNotEmpty(dypList)) {
|
|
|
|
|
|
|
|
criteria.andDyIdIn(dypList);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (CollectionUtil.isNotEmpty(linepList)) {
|
|
|
|
|
|
|
|
criteria.andLineIdIn(linepList);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (CollectionUtil.isNotEmpty(towerpList)) {
|
|
|
|
|
|
|
|
criteria.andTowerIdIn(towerpList);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (CollectionUtil.isNotEmpty(termpList)) {
|
|
|
|
|
|
|
|
criteria.andLineIdIn(termpList);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
View_Dy_Line_Tower_TerminalsExample.Criteria or1 = example.or();
|
|
|
|
|
|
|
|
or1.andIdIsNotNull();
|
|
|
|
|
|
|
|
View_Dy_Line_Tower_TerminalsExample.Criteria or = example.or();
|
|
|
|
if (StrUtil.isEmpty(search)) {
|
|
|
|
if (StrUtil.isEmpty(search)) {
|
|
|
|
search = null;
|
|
|
|
search = null;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
search = "%" + search + "%";
|
|
|
|
search = "%" + search + "%";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
View_Dy_Line_Tower_TerminalsExample example = new View_Dy_Line_Tower_TerminalsExample();
|
|
|
|
if (StrUtil.isNotEmpty(search)) {
|
|
|
|
example.setOrderByClause("id desc");
|
|
|
|
or.andDyNameLike(search).andLineNameLike(search).andTowerNameLike(search).andCmdidLike(search);
|
|
|
|
View_Dy_Line_Tower_TerminalsExample.Criteria criteria = example.createCriteria();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (BeanUtil.isNotEmpty(dyid) && dyid.intValue() != -1) {
|
|
|
|
if (BeanUtil.isNotEmpty(dyid) && dyid.intValue() != -1) {
|
|
|
|
criteria.andDyIdEqualTo(dyid);
|
|
|
|
View_Dy_Line_Tower_TerminalsExample.Criteria or2 = example.or();
|
|
|
|
|
|
|
|
or2.andDyIdEqualTo(dyid);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (BeanUtil.isNotEmpty(lineid) && lineid.intValue() != -1) {
|
|
|
|
if (BeanUtil.isNotEmpty(lineid) && lineid.intValue() != -1) {
|
|
|
|
criteria.andLineIdEqualTo(lineid);
|
|
|
|
View_Dy_Line_Tower_TerminalsExample.Criteria or2 = example.or();
|
|
|
|
|
|
|
|
or2.andLineIdEqualTo(lineid);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (BeanUtil.isNotEmpty(tower) && tower.intValue() != -1) {
|
|
|
|
if (BeanUtil.isNotEmpty(tower) && tower.intValue() != -1) {
|
|
|
|
criteria.andTowerIdEqualTo(tower);
|
|
|
|
View_Dy_Line_Tower_TerminalsExample.Criteria or2 = example.or();
|
|
|
|
|
|
|
|
or2.andTowerIdEqualTo(tower);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (BeanUtil.isNotEmpty(isonline)) {
|
|
|
|
if (BeanUtil.isNotEmpty(isonline)) {
|
|
|
|
|
|
|
|
View_Dy_Line_Tower_TerminalsExample.Criteria or2= example.or();
|
|
|
|
if (CommonStatus.EFFECTIVE.value().equals(isonline)) {
|
|
|
|
if (CommonStatus.EFFECTIVE.value().equals(isonline)) {
|
|
|
|
criteria.andLastHeartbeatGreaterThanOrEqualTo(time.longValue());
|
|
|
|
or2.andLastHeartbeatGreaterThanOrEqualTo(time.longValue());
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
criteria.andLastHeartbeatLessThanOrEqualTo(time.longValue());
|
|
|
|
or2.andLastHeartbeatLessThanOrEqualTo(time.longValue());
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (StrUtil.isNotEmpty(search)) {
|
|
|
|
|
|
|
|
criteria.andOptionsLikeOr("dy_name like " + search + "or line_name like " + search + " or tower_name like " + search + " or cmdid like" + search);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
PermissionDetail permissionDetail = userService.getPermissionListOver();
|
|
|
|
|
|
|
|
if (CommonStatus.DELETE.value().equals(permissionDetail.getIsSuper())) {
|
|
|
|
|
|
|
|
List<Integer> termpList = permissionDetail.getTermpList();
|
|
|
|
|
|
|
|
if (CollectionUtil.isNotEmpty(termpList)) {
|
|
|
|
|
|
|
|
criteria.andIdIn(termpList);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
int pageindex = vo.getPageindex();
|
|
|
|
int pageindex = vo.getPageindex();
|
|
|
|
int pagesize = vo.getPagesize();
|
|
|
|
int pagesize = vo.getPagesize();
|
|
|
|
PageUtils.SetPage(pageindex, pagesize);
|
|
|
|
PageUtils.SetPage(pageindex, pagesize);
|
|
|
|
List<View_Dy_Line_Tower_Terminals> list = view_dy_line_tower_terminalsDao.selectByExample(example);
|
|
|
|
List<View_Dy_Line_Tower_Terminals> list = view_dy_line_tower_terminalsDao.selectByPermission(example);
|
|
|
|
if (CollectionUtil.isNotEmpty(list)) {
|
|
|
|
if (CollectionUtil.isNotEmpty(list)) {
|
|
|
|
for (View_Dy_Line_Tower_Terminals item : list) {
|
|
|
|
for (View_Dy_Line_Tower_Terminals item : list) {
|
|
|
|
if (BeanUtil.isNotEmpty(item)) {
|
|
|
|
if (BeanUtil.isNotEmpty(item)) {
|
|
|
@ -577,25 +601,25 @@ public class TerminalServiceImpl implements TerminalService {
|
|
|
|
double onlinePercent = 0;
|
|
|
|
double onlinePercent = 0;
|
|
|
|
double offlinePercent = 0;
|
|
|
|
double offlinePercent = 0;
|
|
|
|
View_Dy_Line_Tower_TerminalsExample example = new View_Dy_Line_Tower_TerminalsExample();
|
|
|
|
View_Dy_Line_Tower_TerminalsExample example = new View_Dy_Line_Tower_TerminalsExample();
|
|
|
|
|
|
|
|
example.setGroupByClause("id");
|
|
|
|
|
|
|
|
View_Dy_Line_Tower_TerminalsExample.Criteria criteria = example.createCriteria();
|
|
|
|
if (CommonStatus.DELETE.value().equals(permissionListOver.getIsSuper())) {
|
|
|
|
if (CommonStatus.DELETE.value().equals(permissionListOver.getIsSuper())) {
|
|
|
|
if (CollectionUtil.isNotEmpty(dypList)) {
|
|
|
|
if (CollectionUtil.isNotEmpty(dypList)) {
|
|
|
|
View_Dy_Line_Tower_TerminalsExample.Criteria criteria = example.or();
|
|
|
|
|
|
|
|
criteria.andDyIdIn(dypList);
|
|
|
|
criteria.andDyIdIn(dypList);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (CollectionUtil.isNotEmpty(linepList)) {
|
|
|
|
if (CollectionUtil.isNotEmpty(linepList)) {
|
|
|
|
View_Dy_Line_Tower_TerminalsExample.Criteria criteria = example.or();
|
|
|
|
|
|
|
|
criteria.andLineIdIn(linepList);
|
|
|
|
criteria.andLineIdIn(linepList);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (CollectionUtil.isNotEmpty(towerpList)) {
|
|
|
|
if (CollectionUtil.isNotEmpty(towerpList)) {
|
|
|
|
View_Dy_Line_Tower_TerminalsExample.Criteria criteria = example.or();
|
|
|
|
|
|
|
|
criteria.andTowerIdIn(towerpList);
|
|
|
|
criteria.andTowerIdIn(towerpList);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (CollectionUtil.isNotEmpty(termpList)) {
|
|
|
|
if (CollectionUtil.isNotEmpty(termpList)) {
|
|
|
|
View_Dy_Line_Tower_TerminalsExample.Criteria criteria = example.or();
|
|
|
|
|
|
|
|
criteria.andLineIdIn(termpList);
|
|
|
|
criteria.andLineIdIn(termpList);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
List<View_Dy_Line_Tower_Terminals> list = view_dy_line_tower_terminalsDao.selectByExample(example);
|
|
|
|
View_Dy_Line_Tower_TerminalsExample.Criteria or = example.or();
|
|
|
|
|
|
|
|
or.andIdIsNotNull();
|
|
|
|
|
|
|
|
List<View_Dy_Line_Tower_Terminals> list = view_dy_line_tower_terminalsDao.selectByPermission(example);
|
|
|
|
boolean empty = CollectionUtil.isEmpty(list);
|
|
|
|
boolean empty = CollectionUtil.isEmpty(list);
|
|
|
|
if (!empty) {
|
|
|
|
if (!empty) {
|
|
|
|
totalnum = list.size();
|
|
|
|
totalnum = list.size();
|
|
|
|