(1)ip导入调整,子类的同名字段覆盖父类的,用于某些字段的注解重写

(2)新建package template,将IP的template入
(3)IP复用策略配置导入模板调整,由于界面只有IP,端口,所以模板的注解进行了响应调整
(4)配置文件加入了IP和端口的默认值设置
(5)导入IP加入了IP复用策略和限速比例的验证
This commit is contained in:
wangxin
2018-07-27 10:16:32 +08:00
parent 86cf92faac
commit 90de79f408
13 changed files with 401 additions and 28 deletions

View File

@@ -22,7 +22,6 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang3.StringUtils;
import org.apache.derby.tools.sysinfo;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.Comment;
@@ -45,7 +44,6 @@ import com.nis.util.DictUtils;
import com.nis.util.Encodes;
import com.nis.util.Reflections;
import com.nis.util.StringUtil;
import com.nis.util.excel.fieldtype.RoleListType;
/**
* 导出Excel文件导出“XLSX”格式支持大数据量导出 @see org.apache.poi.ss.SpreadsheetVersion
@@ -83,15 +81,31 @@ public class ExportExcel {
/**
* //递归获取cls实体对象及父级对象的属性
* wx:修改,子类覆盖父类的同名方法
* @param list
* @param cls
*/
public void getFields(List<Field> list,Class<?> cls) {
Field[] fields=cls.getDeclaredFields();
if(fields != null && fields.length > 0){
List<Field> tempList=new ArrayList<>();
for (Field field : fields) {
list.add(field);
if(list.size()==0) {
tempList.add(field);
}else {
boolean has=false;
for(Field checkF:list) {
if(checkF.getName().equals(field.getName())) {
has=true;
break;
}
}
if(!has) {
tempList.add(field);
}
}
}
list.addAll(tempList);
}
if(cls.getSuperclass() != null){
getFields(list,cls.getSuperclass());
@@ -105,9 +119,24 @@ public class ExportExcel {
public void getMethods(List<Method> list,Class<?> cls) {
Method[] methods=cls.getDeclaredMethods();
if(methods != null && methods.length > 0){
List<Method> tempList=new ArrayList<>();
for (Method method : methods) {
list.add(method);
if(list.size()==0) {
tempList.add(method);
}else {
boolean has=false;
for(Method checkM:list) {
if(checkM.getName().equals(method.getName())) {
has=true;
break;
}
}
if(!has) {
tempList.add(method);
}
}
}
list.addAll(tempList);
}
if(cls.getSuperclass() != null){
getMethods(list,cls.getSuperclass());
@@ -254,6 +283,9 @@ public class ExportExcel {
if(!StringUtil.isEmpty(ms)){
for (Method m : ms){
ExcelField ef = m.getAnnotation(ExcelField.class);
if(m.getName().equals("getSrcIpAddress")) {
System.out.println(ef.title());
}
if (ef != null && (ef.type()==0 || ef.type()==type)){
if (groups!=null && groups.length>0){
boolean inGroup = false;