权限修改

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--在线") @ApiModelProperty(value = "在线状态", example = "0--掉线1--在线")
private Integer onlinestatus; private Integer onlinestatus;
private Integer termcount;
public Integer getOnlinestatus() { public Integer getOnlinestatus() {
if (lastHeartbeat == null) { if (lastHeartbeat == null) {
return CommonStatus.DELETE.value(); return CommonStatus.DELETE.value();

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

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

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

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

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

@ -94,9 +94,6 @@ public class TerminalAlarmServiceImpl implements TerminalAlarmService {
Integer towerid = vo.getTowerId(); Integer towerid = vo.getTowerId();
Integer label = vo.getLabel(); Integer label = vo.getLabel();
String search = vo.getSearch(); String search = vo.getSearch();
if (StrUtil.isEmpty(search)) {
search = null;
}
List<TerminalImgAlarmParams> labellist = new ArrayList<>(); List<TerminalImgAlarmParams> labellist = new ArrayList<>();
Map<Integer, TerminalImgAlarmParams> alarmParamMap = cacheService.getAlarmParamMap(); Map<Integer, TerminalImgAlarmParams> alarmParamMap = cacheService.getAlarmParamMap();
if (label == null || label == -1) { if (label == null || label == -1) {
@ -140,27 +137,28 @@ public class TerminalAlarmServiceImpl implements TerminalAlarmService {
if (CollectionUtil.isNotEmpty(termpList)) { if (CollectionUtil.isNotEmpty(termpList)) {
criteria.andIdIn(termpList); criteria.andIdIn(termpList);
} }
if (StrUtil.isEmpty(search)) { if (StrUtil.isEmpty(search)) {
search = null; search = null;
} else { } else {
search = "%" + search + "%"; search = "%" + search + "%";
} }
if (StrUtil.isNotBlank(search)) {
View_Dy_Line_Tower_TerminalsExample.Criteria or = example.or(); View_Dy_Line_Tower_TerminalsExample.Criteria or = example.or();
or.andLineNameLike(search); or.andLineNameLike(search);
or.andTowerNameLike(search); or.andTowerNameLike(search);
or.andCmdidLike(search); or.andCmdidLike(search);
}
if (dyid != null && dyid.intValue() == -1) { if (dyid != null && dyid.intValue() == -1) {
View_Dy_Line_Tower_TerminalsExample.Criteria or1 = example.or(); View_Dy_Line_Tower_TerminalsExample.Criteria or1 = example.or();
or1.andDyIdEqualTo(dyid); or1.andDyIdEqualTo(dyid);
} }
if (lineid == null || lineid.intValue() == -1) { if (lineid != null || lineid.intValue() != -1) {
View_Dy_Line_Tower_TerminalsExample.Criteria or2 = example.or(); 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(); 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); List<View_Dy_Line_Tower_Terminals> dtos = view_dy_line_tower_terminalsDao.selectByPermission(example);
if (CollectionUtil.isEmpty(dtos)) { if (CollectionUtil.isEmpty(dtos)) {

@ -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/";
/** /**
* idid * idid
* *
@ -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 {
} }
} }

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

Loading…
Cancel
Save