|
|
@ -1,6 +1,8 @@
|
|
|
|
package com.shxy.xymanager_service.impl;
|
|
|
|
package com.shxy.xymanager_service.impl;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
|
|
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
|
import com.shxy.xymanager_common.bean.PermissionDetail;
|
|
|
|
import com.shxy.xymanager_common.bean.PermissionDetail;
|
|
|
|
import com.shxy.xymanager_common.bean.ServiceBody;
|
|
|
|
import com.shxy.xymanager_common.bean.ServiceBody;
|
|
|
@ -11,9 +13,12 @@ import com.shxy.xymanager_common.exception.Asserts;
|
|
|
|
import com.shxy.xymanager_common.model.DyLineTreeListModel;
|
|
|
|
import com.shxy.xymanager_common.model.DyLineTreeListModel;
|
|
|
|
import com.shxy.xymanager_common.model.TerminalPhotosModel;
|
|
|
|
import com.shxy.xymanager_common.model.TerminalPhotosModel;
|
|
|
|
import com.shxy.xymanager_common.page.PageUtils;
|
|
|
|
import com.shxy.xymanager_common.page.PageUtils;
|
|
|
|
|
|
|
|
import com.shxy.xymanager_common.page.TableDataInfo;
|
|
|
|
import com.shxy.xymanager_common.util.xinyin.TerminalUtils;
|
|
|
|
import com.shxy.xymanager_common.util.xinyin.TerminalUtils;
|
|
|
|
import com.shxy.xymanager_common.vo.DyTreeListVo;
|
|
|
|
import com.shxy.xymanager_common.vo.DyTreeListVo;
|
|
|
|
import com.shxy.xymanager_common.vo.LastTowerVo;
|
|
|
|
import com.shxy.xymanager_common.vo.LastTowerVo;
|
|
|
|
|
|
|
|
import com.shxy.xymanager_common.vo.LineIdVo;
|
|
|
|
|
|
|
|
import com.shxy.xymanager_common.vo.SelectVo;
|
|
|
|
import com.shxy.xymanager_dao.dao.*;
|
|
|
|
import com.shxy.xymanager_dao.dao.*;
|
|
|
|
import com.shxy.xymanager_service.service.CacheService;
|
|
|
|
import com.shxy.xymanager_service.service.CacheService;
|
|
|
|
import com.shxy.xymanager_service.service.DyLevelService;
|
|
|
|
import com.shxy.xymanager_service.service.DyLevelService;
|
|
|
@ -25,6 +30,7 @@ import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
|
|
|
import java.math.BigInteger;
|
|
|
|
import java.math.BigInteger;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
|
|
|
import java.util.Date;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.Map;
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
|
|
@ -304,13 +310,21 @@ public class DyLevelServiceImpl implements DyLevelService {
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public ServiceBody<String> add(DyLevel vo) {
|
|
|
|
public ServiceBody<String> add(DyLevel vo) {
|
|
|
|
|
|
|
|
vo.setCreateTime(new Date());
|
|
|
|
dyLevelDao.insertSelective(vo);
|
|
|
|
dyLevelDao.insertSelective(vo);
|
|
|
|
return Asserts.success("success");
|
|
|
|
return Asserts.success("success");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public ServiceBody<String> delete(Integer vo) {
|
|
|
|
public ServiceBody<String> delete(LineIdVo vo) {
|
|
|
|
dyLevelDao.deleteByPrimaryKey(vo);
|
|
|
|
List<Integer> list = vo.getList();
|
|
|
|
|
|
|
|
if (CollectionUtil.isNotEmpty(list)) {
|
|
|
|
|
|
|
|
DyLevelExample example = new DyLevelExample();
|
|
|
|
|
|
|
|
example.createCriteria().andIdIn(list);
|
|
|
|
|
|
|
|
dyLevelDao.deleteByExample(example);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
Asserts.fail("删除编号不能缺少");
|
|
|
|
|
|
|
|
}
|
|
|
|
return Asserts.success("success");
|
|
|
|
return Asserts.success("success");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -321,10 +335,76 @@ public class DyLevelServiceImpl implements DyLevelService {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public ServiceBody<List<DyLevel>> listAll() {
|
|
|
|
public ServiceBody<TableDataInfo<DyLevel>> listAll(SelectVo vo) {
|
|
|
|
DyLevelExample example = new DyLevelExample();
|
|
|
|
TableDataInfo<DyLevel> model = new TableDataInfo<>();
|
|
|
|
List<DyLevel> dyLevels = dyLevelDao.selectByExample(example);
|
|
|
|
String search = vo.getSearch();
|
|
|
|
return Asserts.success(dyLevels);
|
|
|
|
int pageindex = vo.getPageindex();
|
|
|
|
|
|
|
|
int pagesize = vo.getPagesize();
|
|
|
|
|
|
|
|
Integer dyid = vo.getDyId();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PermissionDetail permissionListOver = userService.getPermissionList();
|
|
|
|
|
|
|
|
List<Integer> dypList = permissionListOver.getDypList();
|
|
|
|
|
|
|
|
List<Integer> linepList = permissionListOver.getLinepList();
|
|
|
|
|
|
|
|
List<Integer> towerpList = permissionListOver.getTowerpList();
|
|
|
|
|
|
|
|
List<Integer> termpList = permissionListOver.getTermpList();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
View_Dy_Line_Tower_TerminalsExample example = new View_Dy_Line_Tower_TerminalsExample();
|
|
|
|
|
|
|
|
example.setGroupByClause("dy_id");
|
|
|
|
|
|
|
|
example.setOrderByClause("dy_id desc");
|
|
|
|
|
|
|
|
if (CommonStatus.DELETE.value().equals(permissionListOver.getIsSuper())) {
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (CollectionUtil.isNotEmpty(termpList)) {
|
|
|
|
|
|
|
|
criteria.andLineIdIn(termpList);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (StrUtil.isEmpty(search)) {
|
|
|
|
|
|
|
|
search = null;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
search = "%" + search + "%";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (StrUtil.isNotEmpty(search)) {
|
|
|
|
|
|
|
|
View_Dy_Line_Tower_TerminalsExample.Criteria or = example.or();
|
|
|
|
|
|
|
|
or.andDyNameLike(search);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (BeanUtil.isNotEmpty(dyid) && dyid.intValue() != -1) {
|
|
|
|
|
|
|
|
View_Dy_Line_Tower_TerminalsExample.Criteria or2 = example.or();
|
|
|
|
|
|
|
|
or2.andDyIdEqualTo(dyid);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PageUtils.SetPage(pageindex, pagesize);
|
|
|
|
|
|
|
|
List<View_Dy_Line_Tower_Terminals> list = view_dy_line_tower_terminalsDao.selectByPermission(example);
|
|
|
|
|
|
|
|
ArrayList<DyLevel> dylist = new ArrayList<>();
|
|
|
|
|
|
|
|
if (CollectionUtil.isNotEmpty(list)) {
|
|
|
|
|
|
|
|
for (View_Dy_Line_Tower_Terminals item : list) {
|
|
|
|
|
|
|
|
DyLevel bean = new DyLevel();
|
|
|
|
|
|
|
|
bean.setId(item.getDyId());
|
|
|
|
|
|
|
|
bean.setName(item.getDyName());
|
|
|
|
|
|
|
|
bean.setCreateTime(item.getDyCreateTime());
|
|
|
|
|
|
|
|
bean.setUpdateTime(item.getDyUpdateTime());
|
|
|
|
|
|
|
|
dylist.add(bean);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
model.setList(dylist);
|
|
|
|
|
|
|
|
TableDataInfo pageData = PageUtils.getDataTable(list);
|
|
|
|
|
|
|
|
int currentpage = pageData.getCurrentpage();
|
|
|
|
|
|
|
|
model.setCurrentpage(currentpage);
|
|
|
|
|
|
|
|
long total = pageData.getTotal();
|
|
|
|
|
|
|
|
model.setTotal(total);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int pageSize = pageData.getPagesize();
|
|
|
|
|
|
|
|
model.setPagesize(pageSize);
|
|
|
|
|
|
|
|
int pages = pageData.getTotalpage();
|
|
|
|
|
|
|
|
model.setTotalpage(pages);
|
|
|
|
|
|
|
|
return Asserts.success(model);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|