增加APP特征配置功能

This commit is contained in:
zhangwei
2018-06-23 17:29:14 +08:00
parent d630f20b17
commit 5bc4423076
19 changed files with 3131 additions and 103 deletions

View File

@@ -122,6 +122,8 @@ public class AppCfgService extends BaseService {
}else{
entity.setEditorId(entity.getCurrentUser().getId());
entity.setEditTime(new Date());
entity.setIsValid(0);
entity.setIsAudit(0);
return appCfgDao.updateAppPolicyCfg(entity);
}
}
@@ -139,6 +141,8 @@ public class AppCfgService extends BaseService {
entity.setCompileId(compileId);
entity.setCreateTime(new Date());
entity.setCreatorId(entity.getCurrentUser().getId());
entity.setIsValid(0);
entity.setIsAudit(0);
return appCfgDao.insertAppIpCfg(entity);
}catch (Exception e) {
e.printStackTrace();
@@ -148,6 +152,8 @@ public class AppCfgService extends BaseService {
}else{
entity.setEditorId(entity.getCurrentUser().getId());
entity.setEditTime(new Date());
entity.setIsValid(0);
entity.setIsAudit(0);
return appCfgDao.updateAppIpCfg(entity);
}
}
@@ -165,6 +171,8 @@ public class AppCfgService extends BaseService {
entity.setCompileId(compileId);
entity.setCreateTime(new Date());
entity.setCreatorId(entity.getCurrentUser().getId());
entity.setIsValid(0);
entity.setIsAudit(0);
return appCfgDao.insertAppHttpCfg(entity);
}catch (Exception e) {
e.printStackTrace();
@@ -174,6 +182,8 @@ public class AppCfgService extends BaseService {
}else{
entity.setEditorId(entity.getCurrentUser().getId());
entity.setEditTime(new Date());
entity.setIsValid(0);
entity.setIsAudit(0);
return appCfgDao.updateAppHttpCfg(entity);
}
}
@@ -191,6 +201,8 @@ public class AppCfgService extends BaseService {
entity.setCompileId(compileId);
entity.setCreateTime(new Date());
entity.setCreatorId(entity.getCurrentUser().getId());
entity.setIsValid(0);
entity.setIsAudit(0);
return appCfgDao.insertAppDomainCfg(entity);
}catch (Exception e) {
e.printStackTrace();
@@ -200,6 +212,8 @@ public class AppCfgService extends BaseService {
}else{
entity.setEditorId(entity.getCurrentUser().getId());
entity.setEditTime(new Date());
entity.setIsValid(0);
entity.setIsAudit(0);
return appCfgDao.updateAppDomainCfg(entity);
}
}
@@ -217,6 +231,8 @@ public class AppCfgService extends BaseService {
entity.setCompileId(compileId);
entity.setCreateTime(new Date());
entity.setCreatorId(entity.getCurrentUser().getId());
entity.setIsValid(0);
entity.setIsAudit(0);
return appCfgDao.insertAppByteCfg(entity);
}catch (Exception e) {
e.printStackTrace();
@@ -226,6 +242,8 @@ public class AppCfgService extends BaseService {
}else{
entity.setEditorId(entity.getCurrentUser().getId());
entity.setEditTime(new Date());
entity.setIsValid(0);
entity.setIsAudit(0);
return appCfgDao.updateAppByteCfg(entity);
}
}
@@ -238,11 +256,9 @@ public class AppCfgService extends BaseService {
List<StringCfg> strRegionList = new ArrayList();
List<NumBoundaryCfg> numRegionList = new ArrayList();
List<DigestCfg> digestRegionList = new ArrayList();
List<IpCfg> areaIpRegionList = new ArrayList();
List<IpCfg> areaIpRegionList = new ArrayList();
entity.setTableName(AppPolicyCfg.getTablename());
appCfgDao.auditCfg(entity);
entity = this.getAppPolicyCfg(entity.getCfgId());
if(isAudit==1){
entity.setCfgKeywords(entity.getAppCode());
List<AppPolicyCfg> list = new ArrayList();
@@ -332,15 +348,14 @@ public class AppCfgService extends BaseService {
List<NumBoundaryCfg> numRegionList = new ArrayList();
List<DigestCfg> digestRegionList = new ArrayList();
List<IpCfg> areaIpRegionList = new ArrayList();
entity = this.getAppIpCfg(entity.getCfgId());
entity.setTableName(AppPolicyCfg.getTablename());
entity.setTableName(AppIpCfg.getTablename());
appCfgDao.auditCfg(entity);
if(isAudit==1){
List<AppIpCfg> list = new ArrayList();
list.add(entity);
Map<String,List> map = cfgConvert(strRegionList,list,2,entity,groupRelationList);
Map<String,List> map = cfgConvert(ipRegionList,list,1,entity,groupRelationList);
groupRelationList=map.get("groupList");
strRegionList=map.get("dstList");
ipRegionList=map.get("dstList");
}
//保存区域IP信息
List<AreaIpCfg> areaIpCfgList=areaIpCfgDao.getByCompileId(entity.getCompileId());
@@ -373,9 +388,13 @@ public class AppCfgService extends BaseService {
String userRegion = "";
if(!StringUtil.isEmpty(entity.getAppCode())){
userRegion = userRegion+entity.getAppCode()+Constants.USER_REGION_SPLIT;
}else{
userRegion = userRegion+Constants.USER_REGION_SPLIT;
}
if(entity.getRatelimit()!=null){
userRegion = userRegion+entity.getRatelimit()+Constants.USER_REGION_SPLIT;
}else{
userRegion = userRegion+Constants.USER_REGION_SPLIT;
}
maatCfg.setUserRegion(userRegion);
configCompileList.add(maatCfg);
@@ -419,9 +438,9 @@ public class AppCfgService extends BaseService {
List<NumBoundaryCfg> numRegionList = new ArrayList();
List<DigestCfg> digestRegionList = new ArrayList();
List<IpCfg> areaIpRegionList = new ArrayList();
entity = this.getAppHttpCfg(entity.getCfgId());
entity.setTableName(AppPolicyCfg.getTablename());
entity.setTableName(AppHttpCfg.getTablename());
appCfgDao.auditCfg(entity);
if(isAudit==1){
List<AppHttpCfg> list = new ArrayList();
list.add(entity);
@@ -460,9 +479,13 @@ public class AppCfgService extends BaseService {
String userRegion = "";
if(!StringUtil.isEmpty(entity.getAppCode())){
userRegion = userRegion+entity.getAppCode()+Constants.USER_REGION_SPLIT;
}else{
userRegion = userRegion+Constants.USER_REGION_SPLIT;
}
if(entity.getRatelimit()!=null){
userRegion = userRegion+entity.getRatelimit()+Constants.USER_REGION_SPLIT;
}else{
userRegion = userRegion+Constants.USER_REGION_SPLIT;
}
maatCfg.setUserRegion(userRegion);
configCompileList.add(maatCfg);
@@ -506,10 +529,10 @@ public class AppCfgService extends BaseService {
List<NumBoundaryCfg> numRegionList = new ArrayList();
List<DigestCfg> digestRegionList = new ArrayList();
List<IpCfg> areaIpRegionList = new ArrayList();
entity = this.getAppDomainCfg(entity.getCfgId());
entity.setTableName(AppPolicyCfg.getTablename());
entity.setTableName(AppDomainCfg.getTablename());
appCfgDao.auditCfg(entity);
if(isAudit==1){
entity.setCfgKeywords(entity.getDomain());
List<AppDomainCfg> list = new ArrayList();
list.add(entity);
Map<String,List> map = cfgConvert(strRegionList,list,2,entity,groupRelationList);
@@ -547,9 +570,13 @@ public class AppCfgService extends BaseService {
String userRegion = "";
if(!StringUtil.isEmpty(entity.getAppCode())){
userRegion = userRegion+entity.getAppCode()+Constants.USER_REGION_SPLIT;
}else{
userRegion = userRegion+Constants.USER_REGION_SPLIT;
}
if(entity.getRatelimit()!=null){
userRegion = userRegion+entity.getRatelimit()+Constants.USER_REGION_SPLIT;
}else{
userRegion = userRegion+Constants.USER_REGION_SPLIT;
}
maatCfg.setUserRegion(userRegion);
configCompileList.add(maatCfg);
@@ -593,10 +620,11 @@ public class AppCfgService extends BaseService {
List<NumBoundaryCfg> numRegionList = new ArrayList();
List<DigestCfg> digestRegionList = new ArrayList();
List<IpCfg> areaIpRegionList = new ArrayList();
entity = this.getAppByteCfg(entity.getCfgId());
entity.setTableName(AppPolicyCfg.getTablename());
entity.setTableName(AppByteCfg.getTablename());
appCfgDao.auditCfg(entity);
if(isAudit==1){
entity.setCfgKeywords(entity.getBytes());
List<AppByteCfg> list = new ArrayList();
list.add(entity);
Map<String,List> map = cfgConvert(strRegionList,list,2,entity,groupRelationList);
@@ -634,9 +662,13 @@ public class AppCfgService extends BaseService {
String userRegion = "";
if(!StringUtil.isEmpty(entity.getAppCode())){
userRegion = userRegion+entity.getAppCode()+Constants.USER_REGION_SPLIT;
}else{
userRegion = userRegion+Constants.USER_REGION_SPLIT;
}
if(entity.getRatelimit()!=null){
userRegion = userRegion+entity.getRatelimit()+Constants.USER_REGION_SPLIT;
}else{
userRegion = userRegion+Constants.USER_REGION_SPLIT;
}
maatCfg.setUserRegion(userRegion);
configCompileList.add(maatCfg);