APP DNS admin和APP多用途标签配置域导出调整

This commit is contained in:
leijun
2018-11-08 10:30:32 +08:00
parent 0f68d80844
commit b7fc16e681
4 changed files with 79 additions and 20 deletions

View File

@@ -29,7 +29,7 @@ public class AppFeatureIndex extends BaseCfg<AppFeatureIndex> {
private static final long serialVersionUID = -8069201965300255275L;
private static final String tableName="app_feature_index";
private Integer appCode;//specific_service_cfg表一级节点的spec_service_code
@ExcelField(title="social_app",sort=2)
@ExcelField(title="social_app",sort=3)
private String appName;
private Integer specServiceId;
private Integer behavCode;//specific_service_cfg表二级节点的spec_service_code

View File

@@ -26,29 +26,65 @@ public class AppStringFeatureCfg extends BaseCfg<AppStringFeatureCfg> {
private static final long serialVersionUID = 8677301658049443801L;
private static final String tableName="app_string_feature_cfg";
@Expose
@ExcelField(title="cfg_id",sort=0)
private Integer compileId;
private Integer appCode;//specific_service_cfg表一级节点的spec_service_code
private Integer behavCode;//specific_service_cfg表二级节点的spec_service_code
private Integer specServiceId;
private String bytes;
@ExcelField(title="URL",sort=201)
private String cfgKeywords;
private String appName;
/**
* 表达式类型
*/
@Expose
@ExcelField(title="expression_type")
@ExcelField(title="expression_type",dictType="EXPRESSION_TYPE",sort=202)
@SerializedName("exprType")
protected Integer exprType ;
/**
* 匹配方式
*/
@Expose
@ExcelField(title="match_method")
@ExcelField(title="match_method",dictType="MATCH_METHOD",sort=203)
@SerializedName("matchMethod")
protected Integer matchMethod ;
/**
* 是否hex
*/
@ExcelField(title="is_hex",sort=204)
protected Integer isHex;
/**
* 是否hex
*/
@ExcelField(title="is_case_insenstive",sort=205)
protected Integer isCaseInsenstive;
/**
* 是否hex二进制
*/
@Expose
@ExcelField(title="whether_hexbinary")
@SerializedName("isHexbin")
protected Integer isHexbin;
public Integer getIsHex() {
return isHex;
}
public void setIsHex(Integer isHex) {
this.isHex = isHex;
}
public Integer getIsCaseInsenstive() {
return isCaseInsenstive;
}
public void setIsCaseInsenstive(Integer isCaseInsenstive) {
this.isCaseInsenstive = isCaseInsenstive;
}
public Integer getExprType() {
return exprType;
}

View File

@@ -301,45 +301,52 @@ public class AppFeatureCfgController extends BaseController {
noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport);
List<IpPortCfg> ipList=new ArrayList<IpPortCfg>();
List<AppComplexFeatureCfg> keywordList=new ArrayList<AppComplexFeatureCfg>();
List<AppStringFeatureCfg> strList=new ArrayList<AppStringFeatureCfg>();
for (AppFeatureIndex cfg : page.getList()) {
Map<String, List> maps=appMultiFeatureCfgService.exportFeature(cfg);
keywordList.addAll(maps.get("APP_KEYWORDS"));
if(entity.getFunctionId()!=567){
keywordList.addAll(maps.get("APP_KEYWORDS"));
}else{
strList.addAll(maps.get("APP_DK_GL"));
}
ipList.addAll(maps.get("APP_IP_RANGE"));
}
keywordList=replaceKeyList(keywordList);
dataMap.put(entity.getMenuNameCode(), page.getList());
if(entity.getFunctionId()!=564 && entity.getFunctionId()!=567 ){
keywordList=replaceKeyList(keywordList);
titleList.add("APP_IP_RANGE");
classMap.put("APP_IP_RANGE", IpPortCfg.class);
noExportMap.put("APP_IP_RANGE",ipPortInfoNoExport);
dataMap.put("APP_IP_RANGE", ipList);
if(entity.getFunctionId()==563){
}
if(entity.getFunctionId()==563){
titleList.add("APP_PAYLOAD");
classMap.put("APP_PAYLOAD", AppComplexFeatureCfg.class);
noExportMap.put("APP_PAYLOAD",appComplexNoExport);
dataMap.put("APP_PAYLOAD", keywordList);
}else if(entity.getFunctionId()==565){
}else if(entity.getFunctionId()==565){
titleList.add("APP_HTTP");
classMap.put("APP_HTTP", AppComplexFeatureCfg.class);
noExportMap.put("APP_HTTP",appComplexNoExport);
dataMap.put("APP_HTTP", keywordList);
}else if(entity.getFunctionId()==566){
}else if(entity.getFunctionId()==566){
titleList.add("APP_SSL");
classMap.put("APP_SSL", AppComplexFeatureCfg.class);
noExportMap.put("APP_SSL",appComplexNoExport);
dataMap.put("APP_SSL", keywordList);
}else if(entity.getFunctionId()==564){
}else if(entity.getFunctionId()==564){
keywordList=replaceKeyList(keywordList);
titleList.add("APP_DNS");
classMap.put("APP_DNS", AppComplexFeatureCfg.class);
noExportMap.put("APP_DNS",appComplexNoExport);
dataMap.put("APP_DNS", keywordList);
}else if(entity.getFunctionId()==567){
}else if(entity.getFunctionId()==567){
strList=replaceFeatureList(strList);
appComplexNoExport=appComplexNoExport+"district,";
titleList.add("APP_DK_GL");
classMap.put("APP_DK_GL", AppComplexFeatureCfg.class);
noExportMap.put("APP_DK_GL",appComplexNoExport);
dataMap.put("APP_DK_GL", keywordList);
}
titleList.add("APP_DK");
classMap.put("APP_DK", AppStringFeatureCfg.class);
noExportMap.put("APP_DK",appComplexNoExport);
dataMap.put("APP_DK", strList);
}
/*}*/
@@ -361,4 +368,15 @@ public class AppFeatureCfgController extends BaseController {
return list;
}
public static List<AppStringFeatureCfg> replaceFeatureList(List<AppStringFeatureCfg> list){
for (int i = 0; i < list.size(); i++) {
AppStringFeatureCfg base=(AppStringFeatureCfg)list.get(i);
base.setIsHex(base.getIsHexbin());
base.setIsCaseInsenstive(base.getIsHexbin());
base.setCfgKeywords(Functions.replace(base.getCfgKeywords(), "***and***"," "));
}
return list;
}
}

View File

@@ -311,8 +311,13 @@ public class AppMultiFeatureCfgService extends BaseService {
public Map<String, List> exportFeature(AppFeatureIndex entity){
Map<String, List> dataMap=new HashMap<String, List>();
List<AppIpCfg> ipRangeList = appMultiFeatureCfgDao.getAppIpRangeCfg(entity.getCompileId(),entity.getFunctionId());
List<AppComplexFeatureCfg> appKeyList = appMultiFeatureCfgDao.getAppComplexFeatureCfg(entity.getCompileId(),entity.getFunctionId(),null);
dataMap.put("APP_KEYWORDS", appKeyList);
if(entity.getFunctionId()!=567){
List<AppComplexFeatureCfg> appKeyList = appMultiFeatureCfgDao.getAppComplexFeatureCfg(entity.getCompileId(),entity.getFunctionId(),null);
dataMap.put("APP_KEYWORDS", appKeyList);
}else{
List<AppStringFeatureCfg> appKeyList = appMultiFeatureCfgDao.getAppStringFeatureCfg(entity.getCompileId(),entity.getFunctionId(),null);
dataMap.put("APP_DK_GL", appKeyList);
}
dataMap.put("APP_IP_RANGE", ipRangeList);
return dataMap;
}