|
|
|
@ -18,6 +18,7 @@ import com.shxy.xymanager_common.vo.*;
|
|
|
|
|
import com.shxy.xymanager_dao.dao.*;
|
|
|
|
|
import com.shxy.xymanager_service.service.CacheService;
|
|
|
|
|
import com.shxy.xymanager_service.service.LineService;
|
|
|
|
|
import com.shxy.xymanager_service.service.NewCacheService;
|
|
|
|
|
import com.shxy.xymanager_service.service.UserService;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
@ -57,6 +58,9 @@ public class LineServiceImpl implements LineService {
|
|
|
|
|
@Autowired
|
|
|
|
|
private CacheService cacheService;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private NewCacheService newCacheService;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private UserService userService;
|
|
|
|
|
|
|
|
|
@ -184,41 +188,27 @@ public class LineServiceImpl implements LineService {
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public ServiceBody<LineAndGtAndChannelListModel> getLineAndGt(LineAndGtAndChannelVo vo) {
|
|
|
|
|
// PermissionDetail permissionDetail = new PermissionDetail();
|
|
|
|
|
// try {
|
|
|
|
|
// permissionDetail = userService.getPermissionList();
|
|
|
|
|
// } catch (Exception e) {
|
|
|
|
|
// Asserts.fail("权限解析错误");
|
|
|
|
|
// e.printStackTrace();
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// List<Integer> dypList = permissionDetail.getDypList();
|
|
|
|
|
// List<Integer> linepList = permissionDetail.getLinepList();
|
|
|
|
|
// List<Integer> towerpList = permissionDetail.getTowerpList();
|
|
|
|
|
// List<Integer> termpList = permissionDetail.getTermpList();
|
|
|
|
|
// Integer aSuper = permissionDetail.getIsSuper();
|
|
|
|
|
// Integer uid = permissionDetail.getUid();
|
|
|
|
|
//
|
|
|
|
|
// View_Dy_Line_Tower_TerminalsExample example = new View_Dy_Line_Tower_TerminalsExample();
|
|
|
|
|
// View_Dy_Line_Tower_TerminalsExample.Criteria criteria = example.createCriteria();
|
|
|
|
|
// if (BeanUtil.isNotEmpty(dyid) && dyid.intValue() != -1) {
|
|
|
|
|
// criteria.andDyIdEqualTo(dyid);
|
|
|
|
|
// }
|
|
|
|
|
// if (BeanUtil.isNotEmpty(lineid) && lineid.intValue() != -1) {
|
|
|
|
|
// criteria.andLineIdEqualTo(lineid);
|
|
|
|
|
// }
|
|
|
|
|
// if (BeanUtil.isNotEmpty(tower) && tower.intValue() != -1) {
|
|
|
|
|
// criteria.andTowerIdEqualTo(tower);
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// List<View_Dy_Line_Tower_Terminals> list = view_dy_line_tower_terminalsDao.selectByExample(example);
|
|
|
|
|
// if ((CollectionUtil.isNotEmpty(dypList) || CollectionUtil.isNotEmpty(linepList) || CollectionUtil.isNotEmpty(towerpList) || CollectionUtil.isNotEmpty(termpList)) || CommonStatus.EFFECTIVE.value().equals(aSuper)) {
|
|
|
|
|
// List<DyLevel> list = dyLevelDao.selectTreeList(CommonStatus.EFFECTIVE.value(), dypList, linepList, towerpList, termpList, aSuper);
|
|
|
|
|
// }
|
|
|
|
|
PermissionDetail permissionDetail = new PermissionDetail();
|
|
|
|
|
try {
|
|
|
|
|
permissionDetail = userService.getPermissionListFull();
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
Asserts.fail("权限解析错误");
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Integer aSuper = permissionDetail.getIsSuper();
|
|
|
|
|
Integer type = vo.getType();
|
|
|
|
|
if (BeanUtil.isEmpty(type)) {
|
|
|
|
|
Asserts.fail("请求参数出错");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<Integer> dypList = permissionDetail.getDypList();
|
|
|
|
|
List<Integer> linepList = permissionDetail.getLinepList();
|
|
|
|
|
List<Integer> towerpList = permissionDetail.getTowerpList();
|
|
|
|
|
List<Integer> termpList = permissionDetail.getTermpList();
|
|
|
|
|
|
|
|
|
|
LineAndGtAndChannelListModel model = new LineAndGtAndChannelListModel();
|
|
|
|
|
Integer id = vo.getId();
|
|
|
|
|
Integer type = vo.getType();
|
|
|
|
|
if (id != null && id.intValue() == 0) {
|
|
|
|
|
id = null;
|
|
|
|
|
}
|
|
|
|
@ -226,18 +216,25 @@ public class LineServiceImpl implements LineService {
|
|
|
|
|
//查询所有
|
|
|
|
|
if (type == 1) {
|
|
|
|
|
DyLevelExample example = new DyLevelExample();
|
|
|
|
|
// if (CommonStatus.DELETE.value().equals(aSuper)) {
|
|
|
|
|
// if (CollectionUtil.isNotEmpty(dypList)) {
|
|
|
|
|
// example.createCriteria().andIdIn(dypList);
|
|
|
|
|
// } else {
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
if (CommonStatus.DELETE.value().equals(aSuper)) {
|
|
|
|
|
if (CollectionUtil.isNotEmpty(dypList)) {
|
|
|
|
|
example.createCriteria().andIdIn(dypList);
|
|
|
|
|
} else {
|
|
|
|
|
return Asserts.success(model);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
List<DyLevel> list = dyLevelDao.selectByExample(example);
|
|
|
|
|
beans = BeanUtil.copyToList(list, LineAndGtAndChannelListModel.Bean.class);
|
|
|
|
|
} else if (type == 2) {
|
|
|
|
|
if (id != null) {
|
|
|
|
|
LinesExample example = new LinesExample();
|
|
|
|
|
if (CommonStatus.DELETE.value().equals(aSuper)) {
|
|
|
|
|
if (CollectionUtil.isNotEmpty(linepList)) {
|
|
|
|
|
example.createCriteria().andIdIn(linepList);
|
|
|
|
|
} else {
|
|
|
|
|
return Asserts.success(model);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
example.createCriteria().andDyLevelIdEqualTo(id);
|
|
|
|
|
List<Lines> list = linesDao.selectByExample(example);
|
|
|
|
|
beans = BeanUtil.copyToList(list, LineAndGtAndChannelListModel.Bean.class);
|
|
|
|
|