分类性质标签、地域运营商作用域:融合自定义显示,添加排序,优化代码,

特定服务器管理:修正列表分页显示,条件查询,添加自定义显示,添加排序,新增修改页面添加表单校验,
协议ip配置:修正条件查询,添加自定义显示,添加排序,新增修改页面添加表单校验(ipV4\ipV6地址及掩码校验,端口校验)
This commit is contained in:
zhangshilin
2018-03-21 13:43:43 +08:00
parent d5d708a492
commit f92ae2dda4
28 changed files with 710 additions and 1000 deletions

View File

@@ -25,7 +25,7 @@ public class ServiceDictInfoService extends BaseService{
private ServiceDictInfoDao serviceDictInfoDao;
/**
* 查询业务字典分页(无条件查询)
* 查询业务字典顶层分页
* @param page
* @param serviceDictInfo
* @return
@@ -61,11 +61,67 @@ public class ServiceDictInfoService extends BaseService{
}
}
ServiceDictInfo sd = new ServiceDictInfo();
sd.setServiceDictId(0);
for(ServiceDictInfo se:parentList){
se.setParent(sd);
}
if(tempType!=0){
serviceDictInfo.setItemType(tempType);
}else{
serviceDictInfo.setItemType(null);
}
page.setList(parentList);
return page;
}
/**
* 查询所有数据
* @param serviceDictInfo
* @param itType
* @return
*/
public List<ServiceDictInfo> findAllServiceDictInfo(ServiceDictInfo serviceDictInfo,Integer[] itType,String orderBy){
List<ServiceDictInfo> list = Lists.newArrayList();
Integer tempType = 0;
if(serviceDictInfo.getItemType()!=null){
tempType = serviceDictInfo.getItemType();
}
if(itType.length==1){
serviceDictInfo.setItemType(itType[0]);
list = serviceDictInfoDao.findAllServiceDictInfo(serviceDictInfo,orderBy);
}
if(itType.length==2){
if(tempType!=0){
list = serviceDictInfoDao.findAllServiceDictInfo(serviceDictInfo,orderBy);
}else{
List<Integer> tempIntegerList = Lists.newArrayList();
tempIntegerList.add(1);tempIntegerList.add(2);tempIntegerList.add(3);
//Map<String,String> map = DictUtils.getDictOption("SERVICE_DICT_ITM_TYPE");
if(tempIntegerList.contains(itType[0])){
tempIntegerList.remove(itType[0]);
}
if(tempIntegerList.contains(itType[1])){
tempIntegerList.remove(itType[1]);
}
serviceDictInfo.setItemType(tempIntegerList.get(0));
list = serviceDictInfoDao.findAllServiceDictInfoN(serviceDictInfo,orderBy);
}
}
if(tempType!=0){
serviceDictInfo.setItemType(tempType);
}else{
serviceDictInfo.setItemType(null);
}
return list;
}
/**
* 查询所有有效字典配置
* @return
@@ -91,178 +147,6 @@ public class ServiceDictInfoService extends BaseService{
}
return list;
}
/**
* 查询条件查询顶层分页(含条件查询,考虑排序接入可行性)
* @param page
* @param serviceDictInfo
* @param itType
* @return
*/
public Page<ServiceDictInfo> findDictTopSearchList(Page<ServiceDictInfo> page, ServiceDictInfo serviceDictInfo, Integer[] itType) {
// 设置分页参数
serviceDictInfo.setPage(page);
//根据条件查询符合数据
List<ServiceDictInfo> allList = Lists.newArrayList();
List<ServiceDictInfo> list = Lists.newArrayList();
Integer tempType = 0;
if(serviceDictInfo.getItemType()!=null){
tempType = serviceDictInfo.getItemType();
}
if(itType.length==1){
serviceDictInfo.setItemType(itType[0]);
allList = serviceDictInfoDao.findDictTopSearchList(serviceDictInfo);
}
if(itType.length==2){
if(tempType!=0){
allList = serviceDictInfoDao.findDictTopSearchList(serviceDictInfo);
}else{
List<Integer> tempIntegerList = Lists.newArrayList();
tempIntegerList.add(1);tempIntegerList.add(2);tempIntegerList.add(3);
//Map<String,String> map = DictUtils.getDictOption("SERVICE_DICT_ITM_TYPE");
if(tempIntegerList.contains(itType[0])){
tempIntegerList.remove(itType[0]);
}
if(tempIntegerList.contains(itType[1])){
tempIntegerList.remove(itType[1]);
}
serviceDictInfo.setItemType(tempIntegerList.get(0));
allList = serviceDictInfoDao.findDictTopSearchListN(serviceDictInfo);
}
}
ServiceDictInfo tempSe = new ServiceDictInfo();
tempSe.setServiceDictId(0);
for(ServiceDictInfo se:allList){
se.setParent(tempSe);
}
page.setList(allList);
/*//根据条件查询符合数据
List<ServiceDictInfo> allList = Lists.newArrayList();
List<Integer> tempList = Lists.newArrayList();
List<ServiceDictInfo> list = Lists.newArrayList();
List<ServiceDictInfo> listChild = Lists.newArrayList();
List<ServiceDictInfo> listParent = Lists.newArrayList();
Integer tempType = 0;
Integer total = 0;
Integer pageCount = 0;
Integer lostCount = 0;
if(serviceDictInfo.getItemType()!=null){
tempType = serviceDictInfo.getItemType();
}
if(itType.length==1){
serviceDictInfo.setItemType(itType[0]);
allList = serviceDictInfoDao.findDictSearchList(serviceDictInfo);
}
if(itType.length==2){
if(tempType!=0){
allList = serviceDictInfoDao.findDictSearchList(serviceDictInfo);
}else{
List<Integer> tempIntegerList = Lists.newArrayList();
tempIntegerList.add(1);tempIntegerList.add(2);tempIntegerList.add(3);
//Map<String,String> map = DictUtils.getDictOption("SERVICE_DICT_ITM_TYPE");
if(tempIntegerList.contains(itType[0])){
tempIntegerList.remove(itType[0]);
}
if(tempIntegerList.contains(itType[1])){
tempIntegerList.remove(itType[1]);
}
serviceDictInfo.setItemType(tempIntegerList.get(0));
allList = serviceDictInfoDao.findDictSearchListN(serviceDictInfo);
}
}
//处理数据
//page.list中有多少个不是page.list中的顶层(其上级在page.list)
ServiceDictInfo tempSe = new ServiceDictInfo();
tempSe.setServiceDictId(0);
//取出主键优化处理
for(ServiceDictInfo se:allList){
if(se!=null&&se.getServiceDictId()!=null){
tempList.add(se.getServiceDictId());
}
}
for(ServiceDictInfo se:allList){
if(se!=null&&se.getParent()!=null&&se.getParent().getServiceDictId()!=null){
//ServiceDictInfo temp = serviceDictInfoDao.getDictById(se.getParent().getServiceDictId());
if(tempList.contains(se.getParent().getServiceDictId())){
listChild.add(se);
lostCount+=lostCount;
}else{
se.setParent(tempSe);
listParent.add(se);
}
}
}
//确定总页数
total = allList.size() - lostCount;
pageCount = total%page.getPageSize()==0?total%page.getPageSize():(total%page.getPageSize()+1);
if(pageCount==0){
pageCount=1;
}
//取出所有的顶层
//获取分页 每页数量pageSize、、当前页数pageNo (排序,,,) 每页第一个(pageNo-1)*pageSize+1 最后一个pageNo*pageSize
List<ServiceDictInfo> parentShow = Lists.newArrayList();
for(int i=0;i<listParent.size();i++){
if(i>=((page.getPageNo()-1)*page.getPageSize())&&i<page.getPageNo()*page.getPageSize()){
parentShow.add(listParent.get(i));
}
}
parentShow.addAll(listChild);
ServiceDictInfo.sortList(list,parentShow,0,true);
page.setList(list);*/
return page;
}
/**
* 条件查询所有数据
* @param serviceDictInfo
* @param itType
* @return
*/
public List<ServiceDictInfo> findAllDictSearchList(ServiceDictInfo serviceDictInfo,Integer[] itType){
List<ServiceDictInfo> list = Lists.newArrayList();
Integer tempType = 0;
if(serviceDictInfo.getItemType()!=null){
tempType = serviceDictInfo.getItemType();
}
if(itType.length==1){
serviceDictInfo.setItemType(itType[0]);
list = serviceDictInfoDao.findAllDictSearchList(serviceDictInfo);
}
if(itType.length==2){
if(tempType!=0){
list = serviceDictInfoDao.findAllDictSearchList(serviceDictInfo);
}else{
List<Integer> tempIntegerList = Lists.newArrayList();
tempIntegerList.add(1);tempIntegerList.add(2);tempIntegerList.add(3);
//Map<String,String> map = DictUtils.getDictOption("SERVICE_DICT_ITM_TYPE");
if(tempIntegerList.contains(itType[0])){
tempIntegerList.remove(itType[0]);
}
if(tempIntegerList.contains(itType[1])){
tempIntegerList.remove(itType[1]);
}
serviceDictInfo.setItemType(tempIntegerList.get(0));
list = serviceDictInfoDao.findAllDictSearchListN(serviceDictInfo);
}
}
if(tempType!=0){
serviceDictInfo.setItemType(tempType);
}else{
serviceDictInfo.setItemType(null);
}
return list;
}
/**
* 根据主键查询字典详细信息
* @param serviceDictId