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

特定服务器管理:修正列表分页显示,条件查询,添加自定义显示,添加排序,新增修改页面添加表单校验,
协议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

@@ -24,126 +24,32 @@ public class SysDictInfoService extends BaseService{
/**
* 查询顶层分页(条件查询)
* 查询顶层分页(条件查询,考虑排序接入可行性)
* @param page
* @param sysDictInfo
* @param itType
* @return
*/
public Page<SysDictInfo> findTopDictList(Page<SysDictInfo> page, SysDictInfo sysDictInfo, Integer[] itType) {
// 设置分页参数
sysDictInfo.setPage(page);
List<SysDictInfo> parentList = Lists.newArrayList();
Integer tempType = 0;
//预留以后分开用
if(sysDictInfo.getItemType()!=null){
tempType = sysDictInfo.getItemType();
}
//查出顶层分页查询
if(itType.length==1){
sysDictInfo.setItemType(itType[0]);
parentList = sysDictInfoDao.findTopDictList(sysDictInfo);
}
if(itType.length==2){
if(tempType!=0){
parentList = sysDictInfoDao.findTopDictList(sysDictInfo);
}else{
List<Integer> tempList = Lists.newArrayList();
tempList.add(1);tempList.add(2);tempList.add(3);
//Map<String,String> map = DictUtils.getDictOption("SERVICE_DICT_ITM_TYPE");
if(tempList.contains(itType[0])){
tempList.remove(itType[0]);
}
if(tempList.contains(itType[1])){
tempList.remove(itType[1]);
}
sysDictInfo.setItemType(tempList.get(0));
parentList = sysDictInfoDao.findTopDictListN(sysDictInfo);
}
}
page.setList(parentList);
return page;
}
/**
* 查询所有有效字典配置
*/
public List<SysDictInfo> findAllDictList() {
return sysDictInfoDao.findAllDictList(new SysDictInfo());
}
/**
* 条件查询所有数据
* @param page
* @param sysDictInfo
* @param intArr
* @return
*/
public List<SysDictInfo> findAllDictSearchList(SysDictInfo sysDictInfo, Integer[] itType) {
List<SysDictInfo> list = Lists.newArrayList();
Integer tempType = 0;
if(sysDictInfo.getItemType()!=null){
tempType = sysDictInfo.getItemType();
}
if(itType.length==1){
sysDictInfo.setItemType(itType[0]);
list = sysDictInfoDao.findAllDictSearchList(sysDictInfo);
}
if(itType.length==2){
if(tempType!=0){
list = sysDictInfoDao.findAllDictSearchList(sysDictInfo);
}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]);
}
sysDictInfo.setItemType(tempIntegerList.get(0));
list = sysDictInfoDao.findAllDictSearchListN(sysDictInfo);
}
}
if(tempType!=0){
sysDictInfo.setItemType(tempType);
}else{
sysDictInfo.setItemType(null);
}
return list;
}
/**
* 查询条件查询顶层分页(含条件查询,考虑排序接入可行性)
* @param page
* @param sysDictInfo
* @param itType
* @return
*/
public Page<SysDictInfo> findDictTopSearchList(Page<SysDictInfo> page, SysDictInfo sysDictInfo, Integer[] itType) {
// 设置分页参数
sysDictInfo.setPage(page);
//根据条件查询符合数据
List<SysDictInfo> allList = Lists.newArrayList();
List<SysDictInfo> list = Lists.newArrayList();
Integer tempType = 0;
if(sysDictInfo.getItemType()!=null){
tempType = sysDictInfo.getItemType();
}
if(itType.length==1){
sysDictInfo.setItemType(itType[0]);
allList = sysDictInfoDao.findDictTopSearchList(sysDictInfo);
allList = sysDictInfoDao.findTopDictList(sysDictInfo);
}
if(itType.length==2){
if(tempType!=0){
allList = sysDictInfoDao.findDictTopSearchList(sysDictInfo);
allList = sysDictInfoDao.findTopDictList(sysDictInfo);
}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]);
}
@@ -151,11 +57,16 @@ public class SysDictInfoService extends BaseService{
tempIntegerList.remove(itType[1]);
}
sysDictInfo.setItemType(tempIntegerList.get(0));
allList = sysDictInfoDao.findDictTopSearchListN(sysDictInfo);
allList = sysDictInfoDao.findTopDictListN(sysDictInfo);
}
}
allList = sysDictInfoDao.findDictTopSearchList(sysDictInfo);
//allList = sysDictInfoDao.findDictTopSearchList(sysDictInfo);
if(tempType!=0){
sysDictInfo.setItemType(tempType);
}else{
sysDictInfo.setItemType(null);
}
SysDictInfo tempSe = new SysDictInfo();
tempSe.setSysDictId(0);
for(SysDictInfo se:allList){
@@ -166,6 +77,60 @@ public class SysDictInfoService extends BaseService{
return page;
}
/**
* 查询所有数据
* @param page
* @param sysDictInfo
* @param intArr
* @return
*/
public List<SysDictInfo> findAllSysDictInfo(SysDictInfo sysDictInfo, Integer[] itType,String orderBy) {
List<SysDictInfo> list = Lists.newArrayList();
Integer tempType = 0;
if(sysDictInfo.getItemType()!=null){
tempType = sysDictInfo.getItemType();
}
if(itType.length==1){
sysDictInfo.setItemType(itType[0]);
list = sysDictInfoDao.findAllSysDictInfo(sysDictInfo,orderBy);
}
if(itType.length==2){
if(tempType!=0){
list = sysDictInfoDao.findAllSysDictInfo(sysDictInfo,orderBy);
}else{
List<Integer> tempIntegerList = Lists.newArrayList();
tempIntegerList.add(1);tempIntegerList.add(2);tempIntegerList.add(3);
if(tempIntegerList.contains(itType[0])){
tempIntegerList.remove(itType[0]);
}
if(tempIntegerList.contains(itType[1])){
tempIntegerList.remove(itType[1]);
}
sysDictInfo.setItemType(tempIntegerList.get(0));
list = sysDictInfoDao.findAllSysDictInfoN(sysDictInfo,orderBy);
}
}
if(tempType!=0){
sysDictInfo.setItemType(tempType);
}else{
sysDictInfo.setItemType(null);
}
return list;
}
/**
* 查询所有有效字典配置
*/
public List<SysDictInfo> findAllDictList() {
return sysDictInfoDao.findAllDictList(new SysDictInfo());
}
/**
* 根据主键查询生效范围字典详细信息