权限修改

dev
liuguijing 1 year ago
parent fbcca5d58d
commit 80b8374a1b

@ -99,6 +99,8 @@ public class View_Dy_Line_Tower_Terminals implements Serializable {
@ApiModelProperty(value = "在线状态", example = "0--掉线1--在线")
private Integer onlinestatus;
private Integer termcount;
public Integer getOnlinestatus() {
if (lastHeartbeat == null) {
return CommonStatus.DELETE.value();

@ -47,6 +47,9 @@ public class TowerListModel implements Serializable {
@ApiModelProperty(value = "杆塔排序", example = "123456")
private Integer order;
@ApiModelProperty(value = "装置数量", example = "123456")
private Integer termcount;
}

@ -390,6 +390,7 @@ public class TerminalUtils {
Integer towerid = terminals.getTowerId();
if (towerMap != null) {
TowerDto towerDto = towerMap.get(towerid);
if (towerDto != null) {
Integer lineId = towerDto.getLineId();
photoBean.setLineid(lineId);
if (lineMap != null) {
@ -399,6 +400,7 @@ public class TerminalUtils {
}
}
}
}
Integer channelId = item.getChannelId();
BigInteger picid = item.getId();
photoBean.setPicid(picid);

@ -33,6 +33,7 @@
<result column="phase" jdbcType="VARCHAR" property="phase" />
<result column="equipment_type" jdbcType="VARCHAR" property="equipmentType" />
<result column="last_heartbeat" jdbcType="BIGINT" property="lastHeartbeat" />
<result column="termcount" jdbcType="INTEGER" property="termcount" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
@ -125,7 +126,7 @@
id, dy_id, dy_name, line_id, line_name, line_bs_manufacturer, tower_id, tower_name,
address, `order`, cmdid, org_id, equip_name, display_name, model, essential_info_version,
has_pan, bs_manufacturer, bs_production_date, bs_identifier, latitude, longitude,
status, protocol, sim, working_date, net_type, dev_type, phase, equipment_type, last_heartbeat
status, protocol, sim, working_date, net_type, dev_type, phase, equipment_type, last_heartbeat,count(id) as termcount
</sql>
<select id="selectByExample" parameterType="com.shxy.xymanager_common.entity.View_Dy_Line_Tower_TerminalsExample" resultMap="BaseResultMap">
select

@ -40,10 +40,10 @@
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</exclusion>
<!-- <exclusion>-->
<!-- <groupId>org.springframework.boot</groupId>-->
<!-- <artifactId>spring-boot-starter-tomcat</artifactId>-->
<!-- </exclusion>-->
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- SpringBoot 拦截器 -->

@ -226,54 +226,62 @@ public class LineServiceImpl implements LineService {
//查询所有
if (type == 1) {
DyLevelExample example = new DyLevelExample();
DyLevelExample.Criteria criteria = example.createCriteria();
if (CommonStatus.DELETE.value().equals(aSuper)) {
if (CollectionUtil.isNotEmpty(dypList)) {
example.createCriteria().andIdIn(dypList);
criteria.andIdIn(dypList);
} else {
return Asserts.success(model);
}
}
criteria.andStatusEqualTo(CommonStatus.EFFECTIVE.value());
List<DyLevel> list = dyLevelDao.selectByExample(example);
beans = BeanUtil.copyToList(list, LineAndGtAndChannelListModel.Bean.class);
} else if (type == 2) {
if (id != null) {
LinesExample example = new LinesExample();
LinesExample.Criteria criteria = example.createCriteria();
if (CommonStatus.DELETE.value().equals(aSuper)) {
if (CollectionUtil.isNotEmpty(linepList)) {
example.createCriteria().andIdIn(linepList);
criteria.andIdIn(linepList);
} else {
return Asserts.success(model);
}
}
example.createCriteria().andDyLevelIdEqualTo(id);
criteria.andDyLevelIdEqualTo(id);
criteria.andStatusEqualTo(CommonStatus.EFFECTIVE.value());
List<Lines> list = linesDao.selectByExample(example);
beans = BeanUtil.copyToList(list, LineAndGtAndChannelListModel.Bean.class);
}
} else if (type == 3) {
if (id != null) {
TowersExample example = new TowersExample();
TowersExample.Criteria criteria = example.createCriteria();
if (CommonStatus.DELETE.value().equals(aSuper)) {
if (CollectionUtil.isNotEmpty(towerpList)) {
example.createCriteria().andIdIn(towerpList);
criteria.andIdIn(towerpList);
} else {
return Asserts.success(model);
}
}
example.createCriteria().andLineIdEqualTo(id);
criteria.andLineIdEqualTo(id);
criteria.andStatusEqualTo(CommonStatus.EFFECTIVE.value());
List<Towers> list = towerDao.selectByExample(example);
beans = BeanUtil.copyToList(list, LineAndGtAndChannelListModel.Bean.class);
}
} else if (type == 4) {
if (id != null) {
TerminalsExample example = new TerminalsExample();
TerminalsExample.Criteria criteria = example.createCriteria();
if (CommonStatus.DELETE.value().equals(aSuper)) {
if (CollectionUtil.isNotEmpty(termpList)) {
example.createCriteria().andIdIn(termpList);
criteria.andIdIn(termpList);
} else {
return Asserts.success(model);
}
}
example.createCriteria().andTowerIdEqualTo(id);
criteria.andTowerIdEqualTo(id);
criteria.andStatusEqualTo(CommonStatus.EFFECTIVE.value());
List<Terminals> list = terminalsDao.selectByExample(example);
for (Terminals item : list) {
LineAndGtAndChannelListModel.Bean bean = new LineAndGtAndChannelListModel.Bean();
@ -290,7 +298,8 @@ public class LineServiceImpl implements LineService {
} else if (type == 5) {
if (id != null) {
TerminalChannelMapperExample example = new TerminalChannelMapperExample();
example.createCriteria().andTermIdEqualTo(id);
TerminalChannelMapperExample.Criteria criteria = example.createCriteria();
criteria.andTermIdEqualTo(id);
List<TerminalChannelMapper> list = terminalChannelMapperDao.selectByExample(example);
for (TerminalChannelMapper item : list) {
LineAndGtAndChannelListModel.Bean bean = new LineAndGtAndChannelListModel.Bean();

@ -94,9 +94,6 @@ public class TerminalAlarmServiceImpl implements TerminalAlarmService {
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) {
@ -140,27 +137,28 @@ public class TerminalAlarmServiceImpl implements TerminalAlarmService {
if (CollectionUtil.isNotEmpty(termpList)) {
criteria.andIdIn(termpList);
}
if (StrUtil.isEmpty(search)) {
search = null;
} else {
search = "%" + search + "%";
}
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 (lineid == null || lineid.intValue() == -1) {
if (lineid != null || lineid.intValue() != -1) {
View_Dy_Line_Tower_TerminalsExample.Criteria or2 = example.or();
or2.andLineIdEqualTo(dyid);
or2.andLineIdEqualTo(lineid);
}
if (towerid == null || towerid.intValue() == -1) {
if (towerid != null || towerid.intValue() != -1) {
View_Dy_Line_Tower_TerminalsExample.Criteria or3 = example.or();
or3.andTowerIdEqualTo(dyid);
or3.andTowerIdEqualTo(towerid);
}
List<View_Dy_Line_Tower_Terminals> dtos = view_dy_line_tower_terminalsDao.selectByPermission(example);
if (CollectionUtil.isEmpty(dtos)) {

@ -88,6 +88,7 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
//服务器中的位置
private static final String C_PATH = "/home/xymp/photos/";
/**
* idid
*
@ -240,9 +241,6 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
int pageindex = vo.getPageindex();
int pagesize = vo.getPagesize();
String search = vo.getSearch();
if (StrUtil.isEmpty(search)) {
search = null;
}
Date starttime = vo.getStarttime();
Date endtime = vo.getEndtime();
long start = MyDateUtils.TimeMillSecond2Second(DateTime.of(starttime));
@ -254,78 +252,73 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
ArrayList<Integer> channelidlist = 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 {
// View_Dy_Line_Tower_TerminalsExample example = new View_Dy_Line_Tower_TerminalsExample();
// View_Dy_Line_Tower_TerminalsExample.Criteria criteria = example.createCriteria();
// criteria.andDyNameLike(search);
// view_dy_line_tower_terminalsDao.selectByExample(example);
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());
List<Integer> dypList = new ArrayList<>();
List<Integer> linepList = new ArrayList<>();
List<Integer> towerpList = new ArrayList<>();
List<Integer> termpList = new ArrayList<>();
PermissionDetail permissionList = userService.getPermissionList();
if (CommonStatus.DELETE.value().equals(permissionList.getIsSuper())) {
dypList = permissionList.getDypList();
linepList = permissionList.getLinepList();
towerpList = permissionList.getTowerpList();
termpList = permissionList.getTermpList();
}
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);
list = terminalPhotoDao.selectPhotoListByTermList(termidlist, channelidlist, BigInteger.valueOf(start), BigInteger.valueOf(end));
}
if (CollectionUtil.isNotEmpty(termpList)) {
criteria.andIdIn(termpList);
}
if (StrUtil.isEmpty(search)) {
search = null;
} else {
if (lineid == null || lineid.intValue() == -1) {
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());
search = "%" + search + "%";
}
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)) {
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());
if (lineid != null && lineid.intValue() != -1) {
View_Dy_Line_Tower_TerminalsExample.Criteria or2 = example.or();
or2.andLineIdEqualTo(lineid);
}
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) {
} else {
channelidlist.add(channelid);
}
if (termidlist.size() == 0) {
} else {
PageUtils.SetPage(pageindex, pagesize);
list = terminalPhotoDao.selectPhotoListByTermList(termidlist, channelidlist, BigInteger.valueOf(start), BigInteger.valueOf(end));
}
}
}
boolean empty = CollectionUtil.isEmpty(list);
if (empty) {
model.setList(new ArrayList<>());
@ -798,6 +791,4 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
}
}

@ -104,6 +104,7 @@ public class TowerServiceImpl implements TowerService {
towerBean.setLineName(item.getLineName());
towerBean.setName(item.getTowerName());
towerBean.setOrder(item.getOrder());
towerBean.setTermcount(item.getTermcount());
list1.add(towerBean);
}
model.setList(list1);

Loading…
Cancel
Save