@@ -43,9 +43,9 @@ import com.nis.web.dao.configuration.StringCfgDao;
import com.nis.web.security.UserUtils ;
import com.nis.web.security.UserUtils ;
import com.nis.web.service.BaseService ;
import com.nis.web.service.BaseService ;
/**
/**
* 特定协议相关配置事务类
* 特定协议相关配置事务类
*
* @author dell
* @author dell
*
*
*/
*/
@@ -58,7 +58,6 @@ public class AppCfgService extends BaseService {
@Autowired
@Autowired
protected StringCfgDao stringcfgDao ;
protected StringCfgDao stringcfgDao ;
public Page < AppPolicyCfg > findAppPolicyList ( Page < AppPolicyCfg > page , AppPolicyCfg entity ) {
public Page < AppPolicyCfg > findAppPolicyList ( Page < AppPolicyCfg > page , AppPolicyCfg entity ) {
entity . getSqlMap ( ) . put ( " dsf " , configScopeFilter ( entity . getCurrentUser ( ) , " r " ) ) ;
entity . getSqlMap ( ) . put ( " dsf " , configScopeFilter ( entity . getCurrentUser ( ) , " r " ) ) ;
entity . setPage ( page ) ;
entity . setPage ( page ) ;
@@ -66,6 +65,7 @@ public class AppCfgService extends BaseService {
page . setList ( list ) ;
page . setList ( list ) ;
return page ;
return page ;
}
}
public Page < AppIpCfg > findAppIpList ( Page < AppIpCfg > page , AppIpCfg entity ) {
public Page < AppIpCfg > findAppIpList ( Page < AppIpCfg > page , AppIpCfg entity ) {
entity . getSqlMap ( ) . put ( " dsf " , configScopeFilter ( entity . getCurrentUser ( ) , " r " ) ) ;
entity . getSqlMap ( ) . put ( " dsf " , configScopeFilter ( entity . getCurrentUser ( ) , " r " ) ) ;
entity . setPage ( page ) ;
entity . setPage ( page ) ;
@@ -73,6 +73,7 @@ public class AppCfgService extends BaseService {
page . setList ( list ) ;
page . setList ( list ) ;
return page ;
return page ;
}
}
public Page < AppHttpCfg > findAppHttpList ( Page < AppHttpCfg > page , AppHttpCfg entity ) {
public Page < AppHttpCfg > findAppHttpList ( Page < AppHttpCfg > page , AppHttpCfg entity ) {
entity . getSqlMap ( ) . put ( " dsf " , configScopeFilter ( entity . getCurrentUser ( ) , " r " ) ) ;
entity . getSqlMap ( ) . put ( " dsf " , configScopeFilter ( entity . getCurrentUser ( ) , " r " ) ) ;
entity . setPage ( page ) ;
entity . setPage ( page ) ;
@@ -80,6 +81,7 @@ public class AppCfgService extends BaseService {
page . setList ( list ) ;
page . setList ( list ) ;
return page ;
return page ;
}
}
public Page < AppDomainCfg > findAppDomainList ( Page < AppDomainCfg > page , AppDomainCfg entity ) {
public Page < AppDomainCfg > findAppDomainList ( Page < AppDomainCfg > page , AppDomainCfg entity ) {
entity . getSqlMap ( ) . put ( " dsf " , configScopeFilter ( entity . getCurrentUser ( ) , " r " ) ) ;
entity . getSqlMap ( ) . put ( " dsf " , configScopeFilter ( entity . getCurrentUser ( ) , " r " ) ) ;
entity . setPage ( page ) ;
entity . setPage ( page ) ;
@@ -87,6 +89,7 @@ public class AppCfgService extends BaseService {
page . setList ( list ) ;
page . setList ( list ) ;
return page ;
return page ;
}
}
// 主题网站列表
// 主题网站列表
public Page < AppTopicDomainCfg > findAppTopicDomainList ( Page < AppTopicDomainCfg > page , AppTopicDomainCfg entity ) {
public Page < AppTopicDomainCfg > findAppTopicDomainList ( Page < AppTopicDomainCfg > page , AppTopicDomainCfg entity ) {
entity . getSqlMap ( ) . put ( " dsf " , configScopeFilter ( entity . getCurrentUser ( ) , " r " ) ) ;
entity . getSqlMap ( ) . put ( " dsf " , configScopeFilter ( entity . getCurrentUser ( ) , " r " ) ) ;
@@ -95,6 +98,7 @@ public class AppCfgService extends BaseService {
page . setList ( list ) ;
page . setList ( list ) ;
return page ;
return page ;
}
}
public Page < AppByteCfg > findAppByteList ( Page < AppByteCfg > page , AppByteCfg entity ) {
public Page < AppByteCfg > findAppByteList ( Page < AppByteCfg > page , AppByteCfg entity ) {
entity . getSqlMap ( ) . put ( " dsf " , configScopeFilter ( entity . getCurrentUser ( ) , " r " ) ) ;
entity . getSqlMap ( ) . put ( " dsf " , configScopeFilter ( entity . getCurrentUser ( ) , " r " ) ) ;
entity . setPage ( page ) ;
entity . setPage ( page ) ;
@@ -102,6 +106,7 @@ public class AppCfgService extends BaseService {
page . setList ( list ) ;
page . setList ( list ) ;
return page ;
return page ;
}
}
public Page < AppSslCertCfg > findAppSslList ( Page < AppSslCertCfg > page , AppSslCertCfg entity ) {
public Page < AppSslCertCfg > findAppSslList ( Page < AppSslCertCfg > page , AppSslCertCfg entity ) {
entity . getSqlMap ( ) . put ( " dsf " , configScopeFilter ( entity . getCurrentUser ( ) , " r " ) ) ;
entity . getSqlMap ( ) . put ( " dsf " , configScopeFilter ( entity . getCurrentUser ( ) , " r " ) ) ;
entity . setPage ( page ) ;
entity . setPage ( page ) ;
@@ -110,7 +115,6 @@ public class AppCfgService extends BaseService {
return page ;
return page ;
}
}
public Page < AppTcpCfg > findAppTcpList ( Page < AppTcpCfg > page , AppTcpCfg entity ) {
public Page < AppTcpCfg > findAppTcpList ( Page < AppTcpCfg > page , AppTcpCfg entity ) {
entity . getSqlMap ( ) . put ( " dsf " , configScopeFilter ( entity . getCurrentUser ( ) , " r " ) ) ;
entity . getSqlMap ( ) . put ( " dsf " , configScopeFilter ( entity . getCurrentUser ( ) , " r " ) ) ;
entity . setPage ( page ) ;
entity . setPage ( page ) ;
@@ -123,7 +127,6 @@ public class AppCfgService extends BaseService {
return appCfgDao . getAppTcpCfg ( cfgId ) ;
return appCfgDao . getAppTcpCfg ( cfgId ) ;
}
}
public AppPolicyCfg getAppPolicyCfg ( Long cfgId ) {
public AppPolicyCfg getAppPolicyCfg ( Long cfgId ) {
AppPolicyCfg policy = appCfgDao . getAppPolicyCfg ( cfgId ) ;
AppPolicyCfg policy = appCfgDao . getAppPolicyCfg ( cfgId ) ;
List < IpPortCfg > ipPortList = appCfgDao . getAppPolicyIpList ( policy ) ;
List < IpPortCfg > ipPortList = appCfgDao . getAppPolicyIpList ( policy ) ;
@@ -138,25 +141,32 @@ public class AppCfgService extends BaseService {
policy . setIpPortList ( ipPortList ) ;
policy . setIpPortList ( ipPortList ) ;
return policy ;
return policy ;
}
}
public AppIpCfg getAppIpCfg ( Long cfgId ) {
public AppIpCfg getAppIpCfg ( Long cfgId ) {
return appCfgDao . getAppIpCfg ( cfgId ) ;
return appCfgDao . getAppIpCfg ( cfgId ) ;
}
}
public AppHttpCfg getAppHttpCfg ( Long cfgId ) {
public AppHttpCfg getAppHttpCfg ( Long cfgId ) {
return appCfgDao . getAppHttpCfg ( cfgId ) ;
return appCfgDao . getAppHttpCfg ( cfgId ) ;
}
}
public AppDomainCfg getAppDomainCfg ( Long cfgId ) {
public AppDomainCfg getAppDomainCfg ( Long cfgId ) {
return appCfgDao . getAppDomainCfg ( cfgId ) ;
return appCfgDao . getAppDomainCfg ( cfgId ) ;
}
}
// 主题网站form
// 主题网站form
public AppTopicDomainCfg getAppTopicDomainCfg ( Long cfgId ) {
public AppTopicDomainCfg getAppTopicDomainCfg ( Long cfgId ) {
return appCfgDao . getAppTopicDomainCfg ( cfgId ) ;
return appCfgDao . getAppTopicDomainCfg ( cfgId ) ;
}
}
public AppByteCfg getAppByteCfg ( Long cfgId ) {
public AppByteCfg getAppByteCfg ( Long cfgId ) {
return appCfgDao . getAppByteCfg ( cfgId ) ;
return appCfgDao . getAppByteCfg ( cfgId ) ;
}
}
public AppSslCertCfg getAppSslCfg ( Long cfgId ) {
public AppSslCertCfg getAppSslCfg ( Long cfgId ) {
return appCfgDao . getAppSslCfg ( cfgId ) ;
return appCfgDao . getAppSslCfg ( cfgId ) ;
}
}
@Transactional ( readOnly = false , rollbackFor = RuntimeException . class )
@Transactional ( readOnly = false , rollbackFor = RuntimeException . class )
public void saveOrUpdateAppPolicyCfg ( AppPolicyCfg entity ) throws Exception {
public void saveOrUpdateAppPolicyCfg ( AppPolicyCfg entity ) throws Exception {
// 设置区域运营商信息
// 设置区域运营商信息
@@ -169,11 +179,26 @@ public class AppCfgService extends BaseService {
if ( idList ! = null & & idList . size ( ) > 0 ) {
if ( idList ! = null & & idList . size ( ) > 0 ) {
compileId = idList . get ( 0 ) ;
compileId = idList . get ( 0 ) ;
}
}
} catch ( Exception e ) {
e . printStackTrace ( ) ;
logger . info ( " 获取编译ID出错 " ) ;
throw new MaatConvertException ( e . getMessage ( ) ) ;
}
entity . setCompileId ( compileId ) ;
entity . setCompileId ( compileId ) ;
entity . setCreateTime ( new Date ( ) ) ;
entity . setCreateTime ( new Date ( ) ) ;
entity . setCreatorId ( entity . getCurrentUser ( ) . getId ( ) ) ;
entity . setCreatorId ( entity . getCurrentUser ( ) . getId ( ) ) ;
entity . setIsValid ( 0 ) ;
entity . setIsValid ( 0 ) ;
entity . setIsAudit ( 0 ) ;
entity . setIsAudit ( 0 ) ;
// 设置SubscribeID域配置参数
if ( entity ! = null & & entity . getNtcSubscribeIdCfgList ( ) ! = null ) {
for ( NtcSubscribeIdCfg cfg : entity . getNtcSubscribeIdCfgList ( ) ) {
entity . setExprType ( cfg . getExprType ( ) ) ;
entity . setIsHexbin ( cfg . getIsHexbin ( ) ) ;
entity . setMatchMethod ( cfg . getMatchMethod ( ) ) ;
entity . setCfgKeywords ( cfg . getCfgKeywords ( ) ) ;
}
}
entity . initDefaultValue ( ) ;
appCfgDao . insertAppPolicyCfg ( entity ) ;
appCfgDao . insertAppPolicyCfg ( entity ) ;
// 保存策略IP配置
// 保存策略IP配置
if ( entity ! = null & & entity . getIpPortList ( ) ! = null ) {
if ( entity ! = null & & entity . getIpPortList ( ) ! = null ) {
@@ -200,20 +225,25 @@ public class AppCfgService extends BaseService {
areaIpCfgDao . saveAreaIpCfg ( cfg ) ;
areaIpCfgDao . saveAreaIpCfg ( cfg ) ;
}
}
}
}
} catch ( Exception e ) {
e . printStackTrace ( ) ;
logger . info ( " 获取编译ID出错 " ) ;
throw new MaatConvertException ( e . getMessage ( ) ) ;
}
} else {
} else {
entity . setEditorId ( entity . getCurrentUser ( ) . getId ( ) ) ;
entity . setEditorId ( entity . getCurrentUser ( ) . getId ( ) ) ;
entity . setEditTime ( new Date ( ) ) ;
entity . setEditTime ( new Date ( ) ) ;
entity . setIsValid ( 0 ) ;
entity . setIsValid ( 0 ) ;
entity . setIsAudit ( 0 ) ;
entity . setIsAudit ( 0 ) ;
// 设置SubscribeID域配置参数
if ( entity ! = null & & entity . getNtcSubscribeIdCfgList ( ) ! = null ) {
for ( NtcSubscribeIdCfg cfg : entity . getNtcSubscribeIdCfgList ( ) ) {
entity . setExprType ( cfg . getExprType ( ) ) ;
entity . setIsHexbin ( cfg . getIsHexbin ( ) ) ;
entity . setMatchMethod ( cfg . getMatchMethod ( ) ) ;
}
}
appCfgDao . updateAppPolicyCfg ( entity ) ;
appCfgDao . updateAppPolicyCfg ( entity ) ;
appCfgDao . deleteAppPolicyIpCfg ( entity ) ;
appCfgDao . deleteAppPolicyIpCfg ( entity ) ;
if ( entity ! = null & & entity . getNtcSubscribeIdCfgList ( ) ! = null & & entity . getNtcSubscribeIdCfgList ( ) . size ( ) > 0 ) {
if ( entity ! = null & & entity . getNtcSubscribeIdCfgList ( ) ! = null
& & entity . getNtcSubscribeIdCfgList ( ) . size ( ) > 0 ) {
for ( NtcSubscribeIdCfg ntcSubscribeIdCfg : entity . getNtcSubscribeIdCfgList ( ) ) {
for ( NtcSubscribeIdCfg ntcSubscribeIdCfg : entity . getNtcSubscribeIdCfgList ( ) ) {
ntcSubscribeIdCfg . setCompileId ( entity . getCompileId ( ) ) ;
ntcSubscribeIdCfg . setCompileId ( entity . getCompileId ( ) ) ;
stringcfgDao . deleteSubscribeIdCfg ( ntcSubscribeIdCfg ) ;
stringcfgDao . deleteSubscribeIdCfg ( ntcSubscribeIdCfg ) ;
@@ -238,7 +268,8 @@ public class AppCfgService extends BaseService {
for ( NtcSubscribeIdCfg cfg : entity . getNtcSubscribeIdCfgList ( ) ) {
for ( NtcSubscribeIdCfg cfg : entity . getNtcSubscribeIdCfgList ( ) ) {
if ( StringUtils . isNotBlank ( cfg . getCfgKeywords ( ) ) ) {
if ( StringUtils . isNotBlank ( cfg . getCfgKeywords ( ) ) ) {
entity . setCfgKeywords ( cfg . getCfgKeywords ( ) ) ;
entity . setCfgKeywords ( cfg . getCfgKeywords ( ) ) ;
BeanUtils . copyProperties ( entity , cfg , new String [ ] { " cfgRegionCode " , " cfgType " , " exprType " , " matchMethod " , " isHexbin " } ) ;
BeanUtils . copyProperties ( entity , cfg ,
new String [ ] { " cfgRegionCode " , " cfgType " , " exprType " , " matchMethod " , " isHexbin " } ) ;
stringcfgDao . saveSubscribeIdCfg ( cfg ) ;
stringcfgDao . saveSubscribeIdCfg ( cfg ) ;
}
}
}
}
@@ -254,6 +285,7 @@ public class AppCfgService extends BaseService {
}
}
}
}
}
}
@Transactional ( readOnly = false , rollbackFor = RuntimeException . class )
@Transactional ( readOnly = false , rollbackFor = RuntimeException . class )
public void saveOrUpdateAppIpCfg ( AppIpCfg entity ) throws Exception {
public void saveOrUpdateAppIpCfg ( AppIpCfg entity ) throws Exception {
// 设置区域运营商信息
// 设置区域运营商信息
@@ -279,8 +311,8 @@ public class AppCfgService extends BaseService {
cfg . initDefaultValue ( ) ;
cfg . initDefaultValue ( ) ;
BeanUtils . copyProperties ( entity , cfg ,
BeanUtils . copyProperties ( entity , cfg ,
new String [ ] { " cfgRegionCode " , " cfgType " , " ipType " , " isAreaEffective " ,
new String [ ] { " cfgRegionCode " , " cfgType " , " ipType " , " isAreaEffective " ,
" areaEffectiveIds " , " protocol " , " portPattern " , " srcPort " , " destPort " , " direction " ,
" areaEffectiveIds " , " protocol " , " portPattern " , " srcPort " , " destPort " ,
" destIpAddress " , " srcIpAddress " , " ipPattern " } ) ;
" direction " , " destIpAddress " , " srcIpAddress " , " ipPattern " } ) ;
areaIpCfgDao . saveAreaIpCfg ( cfg ) ;
areaIpCfgDao . saveAreaIpCfg ( cfg ) ;
}
}
}
}
@@ -306,14 +338,16 @@ public class AppCfgService extends BaseService {
if ( entity . getAreaCfg ( ) ! = null ) {
if ( entity . getAreaCfg ( ) ! = null ) {
for ( AreaIpCfg cfg : entity . getAreaCfg ( ) ) {
for ( AreaIpCfg cfg : entity . getAreaCfg ( ) ) {
cfg . initDefaultValue ( ) ;
cfg . initDefaultValue ( ) ;
BeanUtils . copyProperties ( entity , cfg , new String [ ] { " cfgRegionCode " , " cfgType " , " ipType " , " isAreaEffective " ,
BeanUtils . copyProperties ( entity , cfg ,
" areaEffectiveIds " , " protocol " , " portPattern " , " srcPort " , " destPort " , " direction " ,
new String [ ] { " cfgRegionCode " , " cfgType " , " ipType " , " isAreaEffective " , " areaEffectiveIds " ,
" destIpAddress " , " srcIpAddress " , " ipPattern " } ) ;
" protocol " , " portPattern " , " srcPort " , " destPort " , " direction " , " destIpAddress " ,
" srcIpAddress " , " ipPattern " } ) ;
areaIpCfgDao . saveAreaIpCfg ( cfg ) ;
areaIpCfgDao . saveAreaIpCfg ( cfg ) ;
}
}
}
}
}
}
}
}
@Transactional ( readOnly = false , rollbackFor = RuntimeException . class )
@Transactional ( readOnly = false , rollbackFor = RuntimeException . class )
public void saveOrUpdateAppHttpCfg ( AppHttpCfg entity ) throws Exception {
public void saveOrUpdateAppHttpCfg ( AppHttpCfg entity ) throws Exception {
// 设置区域运营商信息
// 设置区域运营商信息
@@ -372,6 +406,7 @@ public class AppCfgService extends BaseService {
}
}
}
}
@Transactional ( readOnly = false , rollbackFor = RuntimeException . class )
@Transactional ( readOnly = false , rollbackFor = RuntimeException . class )
public void saveOrUpdateAppDomainCfg ( AppDomainCfg entity ) throws Exception {
public void saveOrUpdateAppDomainCfg ( AppDomainCfg entity ) throws Exception {
// 设置区域运营商信息
// 设置区域运营商信息
@@ -426,6 +461,7 @@ public class AppCfgService extends BaseService {
}
}
}
}
}
}
// 主题网站新增 修改
// 主题网站新增 修改
public void saveOrUpdateAppTopicDomainCfg ( AppTopicDomainCfg entity ) throws Exception {
public void saveOrUpdateAppTopicDomainCfg ( AppTopicDomainCfg entity ) throws Exception {
// 设置区域运营商信息
// 设置区域运营商信息
@@ -481,7 +517,6 @@ public class AppCfgService extends BaseService {
}
}
}
}
@Transactional ( readOnly = false , rollbackFor = RuntimeException . class )
@Transactional ( readOnly = false , rollbackFor = RuntimeException . class )
public void saveOrUpdateAppByteCfg ( AppByteCfg entity ) throws Exception {
public void saveOrUpdateAppByteCfg ( AppByteCfg entity ) throws Exception {
// 设置区域运营商信息
// 设置区域运营商信息
@@ -535,6 +570,7 @@ public class AppCfgService extends BaseService {
}
}
}
}
}
}
@Transactional ( readOnly = false , rollbackFor = RuntimeException . class )
@Transactional ( readOnly = false , rollbackFor = RuntimeException . class )
public void saveOrUpdateAppSslCfg ( AppSslCertCfg entity ) throws Exception {
public void saveOrUpdateAppSslCfg ( AppSslCertCfg entity ) throws Exception {
// 设置区域运营商信息
// 设置区域运营商信息
@@ -667,19 +703,17 @@ public class AppCfgService extends BaseService {
groupRelationList = map . get ( " groupList " ) ;
groupRelationList = map . get ( " groupList " ) ;
numRegionList = map . get ( " dstList " ) ;
numRegionList = map . get ( " dstList " ) ;
}
}
/* //保存区域IP信息
/*
List<AreaIpCfg> areaIpCfgList=areaIpCfgDao.getByCompileId(entity.getCompileId());
* //保存区域IP信息 List<AreaIpCfg>
if(!StringUtil.isEmpty(areaIpCfgList )){
* areaIpCfgList=areaIpCfgDao.getByCompileId(entity.getCompileId( ));
AreaIpCfg cfg = new AreaIpCfg();
* if(!StringUtil.isEmpty(areaIpCfgList)){ AreaIpCfg cfg = new AreaIpCfg();
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
* BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
cfg.setTableName(AreaIpCfg.getTablename());
* cfg.setTableName(AreaIpCfg.getTablename()); appCfgDao.auditCfg(cfg);
appCfgDao.auditCfg(cfg);
* if(isAudit==1){ Map<String,List> map =
if(isAudit==1){
* cfgConvert(areaIpRegionList,areaIpCfgList,4,entity,groupRelationList);
Map<String, List> map = cfgConvert(areaIpRegionList,areaIpCfgList,4,entity,groupRelation List);
* groupRelation List= map.get("groupList"); areaIpRegionList=map.get("dst List" );
groupRelationList=map.get("groupList");
* } }
areaIpRegionList=map.get("dstList");
*/
}
}*/
// 构造提交综合服务参数格式,一条配置提交一次综合服务
// 构造提交综合服务参数格式,一条配置提交一次综合服务
if ( isAudit = = 1 ) {
if ( isAudit = = 1 ) {
maatCfg . initDefaultValue ( ) ;
maatCfg . initDefaultValue ( ) ;
@@ -759,7 +793,8 @@ public class AppCfgService extends BaseService {
if ( entity . getBehavCode ( ) ! = null ) {
if ( entity . getBehavCode ( ) ! = null ) {
if ( Constants . SPECIFIC_SERVICE_CFG_TYPE_APP . equalsIgnoreCase ( configType ) ) {
if ( Constants . SPECIFIC_SERVICE_CFG_TYPE_APP . equalsIgnoreCase ( configType ) ) {
cfgKeywords . append ( Constants . APP_ID_REGION + " = " + entity . getAppCode ( ) ) ;
cfgKeywords . append ( Constants . APP_ID_REGION + " = " + entity . getAppCode ( ) ) ;
} else if ( Constants . SPECIFIC_SERVICE_CFG_TYPE_ENCRYPTED_TUNNEL_BEHAVIOR . equalsIgnoreCase ( configType ) | | Constants . SPECIFIC_SERVICE_CFG_TYPE_BASIC_PROTOCOL . equalsIgnoreCase ( configType ) ) {
} else if ( Constants . SPECIFIC_SERVICE_CFG_TYPE_ENCRYPTED_TUNNEL_BEHAVIOR . equalsIgnoreCase ( configType )
| | Constants . SPECIFIC_SERVICE_CFG_TYPE_BASIC_PROTOCOL . equalsIgnoreCase ( configType ) ) {
cfgKeywords . append ( Constants . PROTO_ID_REGION + " = " + entity . getAppCode ( ) ) ;
cfgKeywords . append ( Constants . PROTO_ID_REGION + " = " + entity . getAppCode ( ) ) ;
}
}
cfgKeywords . append ( Constants . KEYWORD_EXPR ) ;
cfgKeywords . append ( Constants . KEYWORD_EXPR ) ;
@@ -768,7 +803,8 @@ public class AppCfgService extends BaseService {
} else {
} else {
if ( Constants . SPECIFIC_SERVICE_CFG_TYPE_APP . equalsIgnoreCase ( configType ) ) {
if ( Constants . SPECIFIC_SERVICE_CFG_TYPE_APP . equalsIgnoreCase ( configType ) ) {
cfgKeywords . append ( Constants . APP_ID_REGION + " = " + entity . getAppCode ( ) ) ;
cfgKeywords . append ( Constants . APP_ID_REGION + " = " + entity . getAppCode ( ) ) ;
} else if ( Constants . SPECIFIC_SERVICE_CFG_TYPE_ENCRYPTED_TUNNEL_BEHAVIOR . equalsIgnoreCase ( configType ) | | Constants . SPECIFIC_SERVICE_CFG_TYPE_BASIC_PROTOCOL . equalsIgnoreCase ( configType ) ) {
} else if ( Constants . SPECIFIC_SERVICE_CFG_TYPE_ENCRYPTED_TUNNEL_BEHAVIOR . equalsIgnoreCase ( configType )
| | Constants . SPECIFIC_SERVICE_CFG_TYPE_BASIC_PROTOCOL . equalsIgnoreCase ( configType ) ) {
cfgKeywords . append ( Constants . PROTO_ID_REGION + " = " + entity . getAppCode ( ) ) ;
cfgKeywords . append ( Constants . PROTO_ID_REGION + " = " + entity . getAppCode ( ) ) ;
}
}
// entity.setCfgKeywords(entity.getAppCode()+"");
// entity.setCfgKeywords(entity.getAppCode()+"");
@@ -799,7 +835,8 @@ public class AppCfgService extends BaseService {
}
}
if ( entity . getNtcSubscribeIdCfgList ( ) ! = null & & entity . getNtcSubscribeIdCfgList ( ) . size ( ) > 0 ) {
if ( entity . getNtcSubscribeIdCfgList ( ) ! = null & & entity . getNtcSubscribeIdCfgList ( ) . size ( ) > 0 ) {
if ( isAudit = = 1 ) {
if ( isAudit = = 1 ) {
Map < String , List > ntcMap = cfgConvert ( strRegionList , entity . getNtcSubscribeIdCfgList ( ) , 2 , entity , groupRelationList ) ;
Map < String , List > ntcMap = cfgConvert ( strRegionList , entity . getNtcSubscribeIdCfgList ( ) , 2 , entity ,
groupRelationList ) ;
groupRelationList = ntcMap . get ( " groupList " ) ;
groupRelationList = ntcMap . get ( " groupList " ) ;
strRegionList = ntcMap . get ( " dstList " ) ;
strRegionList = ntcMap . get ( " dstList " ) ;
}
}
@@ -852,7 +889,8 @@ public class AppCfgService extends BaseService {
String actionCode = DictUtils . getDictCode ( " SERVICE_ACTION " , " action_ratelimit " ) ;
String actionCode = DictUtils . getDictCode ( " SERVICE_ACTION " , " action_ratelimit " ) ;
if ( ! actionCode . equals ( " 默认 " ) ) {
if ( ! actionCode . equals ( " 默认 " ) ) {
if ( entity . getAction ( ) . equals ( Integer . parseInt ( actionCode ) ) ) {
if ( entity . getAction ( ) . equals ( Integer . parseInt ( actionCode ) ) ) {
userRegion + = Constants . USER_REGION_SPLIT + Constants . RATE_LIMIT_REGION + " = " + entity . getRatelimit ( ) ;
userRegion + = Constants . USER_REGION_SPLIT + Constants . RATE_LIMIT_REGION + " = "
+ entity . getRatelimit ( ) ;
}
}
}
}
maatCfg . setUserRegion ( userRegion ) ;
maatCfg . setUserRegion ( userRegion ) ;
@@ -887,6 +925,7 @@ public class AppCfgService extends BaseService {
logger . info ( " app策略配置取消配置响应信息: " + result . getMsg ( ) ) ;
logger . info ( " app策略配置取消配置响应信息: " + result . getMsg ( ) ) ;
}
}
}
}
public void auditAppIpCfg ( AppIpCfg entity , Integer isAudit ) {
public void auditAppIpCfg ( AppIpCfg entity , Integer isAudit ) {
ToMaatBean maatBean = new ToMaatBean ( ) ;
ToMaatBean maatBean = new ToMaatBean ( ) ;
MaatCfg maatCfg = new MaatCfg ( ) ;
MaatCfg maatCfg = new MaatCfg ( ) ;
@@ -967,6 +1006,7 @@ public class AppCfgService extends BaseService {
logger . info ( " app协议IP配置取消配置响应信息: " + result . getMsg ( ) ) ;
logger . info ( " app协议IP配置取消配置响应信息: " + result . getMsg ( ) ) ;
}
}
}
}
public void auditAppHttpCfg ( AppHttpCfg entity , Integer isAudit ) {
public void auditAppHttpCfg ( AppHttpCfg entity , Integer isAudit ) {
ToMaatBean maatBean = new ToMaatBean ( ) ;
ToMaatBean maatBean = new ToMaatBean ( ) ;
MaatCfg maatCfg = new MaatCfg ( ) ;
MaatCfg maatCfg = new MaatCfg ( ) ;
@@ -1048,6 +1088,7 @@ public class AppCfgService extends BaseService {
logger . info ( " app HTTP配置取消配置响应信息: " + result . getMsg ( ) ) ;
logger . info ( " app HTTP配置取消配置响应信息: " + result . getMsg ( ) ) ;
}
}
}
}
public void auditAppDomainCfg ( AppDomainCfg entity , Integer isAudit ) {
public void auditAppDomainCfg ( AppDomainCfg entity , Integer isAudit ) {
ToMaatBean maatBean = new ToMaatBean ( ) ;
ToMaatBean maatBean = new ToMaatBean ( ) ;
MaatCfg maatCfg = new MaatCfg ( ) ;
MaatCfg maatCfg = new MaatCfg ( ) ;
@@ -1096,9 +1137,9 @@ public class AppCfgService extends BaseService {
maatCfg . setAreaIpRegionList ( areaIpRegionList ) ;
maatCfg . setAreaIpRegionList ( areaIpRegionList ) ;
maatCfg . setIsValid ( entity . getIsValid ( ) ) ;
maatCfg . setIsValid ( entity . getIsValid ( ) ) ;
// 设置APP自定义域
// 设置APP自定义域
String userRegion = " APP_ID= " + entity . getAppCode ( ) + Constants . USER_REGION_SPLIT +
String userRegion = " APP_ID= " + entity . getAppCode ( ) + Constants . USER_REGION_SPLIT + " DOMAIN_ID= "
" DOMAIN_ID= " + entity . getCompileId ( ) + Constants . USER_REGION_SPLIT +
+ entity . getCompileId ( ) + Constants . USER_REGION_SPLIT + " DOMAIN_STR= "
" DOMAIN_STR= " + keywordsEscape ( entity . getDomain ( ) ) ;
+ keywordsEscape ( entity . getDomain ( ) ) ;
maatCfg . setUserRegion ( userRegion ) ;
maatCfg . setUserRegion ( userRegion ) ;
configCompileList . add ( maatCfg ) ;
configCompileList . add ( maatCfg ) ;
maatBean . setConfigCompileList ( configCompileList ) ;
maatBean . setConfigCompileList ( configCompileList ) ;
@@ -1184,12 +1225,11 @@ public class AppCfgService extends BaseService {
// 设置APP自定义域
// 设置APP自定义域
// "APP_ID="+entity.getAppCode()+Constants.USER_REGION_SPLIT+
// "APP_ID="+entity.getAppCode()+Constants.USER_REGION_SPLIT+
String userRegion = " DOMAIN_ID= " + entity . getCompileId ( ) + Constants . USER_REGION_SPLIT +
String userRegion = " DOMAIN_ID= " + entity . getCompileId ( ) + Constants . USER_REGION_SPLIT + " DOMAIN_STR= "
" DOMAIN_STR= " + keywordsEscape ( entity . getDomain ( ) ) ;
+ keywordsEscape ( entity . getDomain ( ) ) ;
maatCfg . setUserRegion ( userRegion ) ;
maatCfg . setUserRegion ( userRegion ) ;
configCompileList . add ( maatCfg ) ;
configCompileList . add ( maatCfg ) ;
maatBean . setConfigCompileList ( configCompileList ) ;
maatBean . setConfigCompileList ( configCompileList ) ;
maatBean . setAuditTime ( entity . getAuditTime ( ) ) ;
maatBean . setAuditTime ( entity . getAuditTime ( ) ) ;
@@ -1222,7 +1262,6 @@ public class AppCfgService extends BaseService {
}
}
}
}
public void auditAppByteCfg ( AppByteCfg entity , Integer isAudit ) {
public void auditAppByteCfg ( AppByteCfg entity , Integer isAudit ) {
ToMaatBean maatBean = new ToMaatBean ( ) ;
ToMaatBean maatBean = new ToMaatBean ( ) ;
MaatCfg maatCfg = new MaatCfg ( ) ;
MaatCfg maatCfg = new MaatCfg ( ) ;
@@ -1305,6 +1344,7 @@ public class AppCfgService extends BaseService {
logger . info ( " app字节配置取消配置响应信息: " + result . getMsg ( ) ) ;
logger . info ( " app字节配置取消配置响应信息: " + result . getMsg ( ) ) ;
}
}
}
}
public void auditAppSslCfg ( AppSslCertCfg entity , Integer isAudit ) {
public void auditAppSslCfg ( AppSslCertCfg entity , Integer isAudit ) {
ToMaatBean maatBean = new ToMaatBean ( ) ;
ToMaatBean maatBean = new ToMaatBean ( ) ;
MaatCfg maatCfg = new MaatCfg ( ) ;
MaatCfg maatCfg = new MaatCfg ( ) ;
@@ -1386,6 +1426,7 @@ public class AppCfgService extends BaseService {
logger . info ( " app SSL配置取消配置响应信息: " + result . getMsg ( ) ) ;
logger . info ( " app SSL配置取消配置响应信息: " + result . getMsg ( ) ) ;
}
}
}
}
public void updateAppPolicyCfgValid ( Integer isValid , String ids , Integer functionId ) {
public void updateAppPolicyCfgValid ( Integer isValid , String ids , Integer functionId ) {
AppPolicyCfg entity = new AppPolicyCfg ( ) ;
AppPolicyCfg entity = new AppPolicyCfg ( ) ;
String [ ] idArray = ids . split ( " , " ) ;
String [ ] idArray = ids . split ( " , " ) ;
@@ -1423,6 +1464,7 @@ public class AppCfgService extends BaseService {
}
}
}
}
public void updateAppIpCfgValid ( Integer isValid , String ids , Integer functionId ) {
public void updateAppIpCfgValid ( Integer isValid , String ids , Integer functionId ) {
AppIpCfg entity = new AppIpCfg ( ) ;
AppIpCfg entity = new AppIpCfg ( ) ;
String [ ] idArray = ids . split ( " , " ) ;
String [ ] idArray = ids . split ( " , " ) ;
@@ -1491,6 +1533,7 @@ public class AppCfgService extends BaseService {
}
}
}
}
public void updateAppDomainCfgValid ( Integer isValid , String ids , Integer functionId ) {
public void updateAppDomainCfgValid ( Integer isValid , String ids , Integer functionId ) {
AppDomainCfg entity = new AppDomainCfg ( ) ;
AppDomainCfg entity = new AppDomainCfg ( ) ;
String [ ] idArray = ids . split ( " , " ) ;
String [ ] idArray = ids . split ( " , " ) ;
@@ -1513,6 +1556,7 @@ public class AppCfgService extends BaseService {
}
}
}
}
// 主题网站配置删除
// 主题网站配置删除
public void updateAppTopicDomainCfgValid ( Integer isValid , String ids , Integer functionId ) {
public void updateAppTopicDomainCfgValid ( Integer isValid , String ids , Integer functionId ) {
AppTopicDomainCfg entity = new AppTopicDomainCfg ( ) ;
AppTopicDomainCfg entity = new AppTopicDomainCfg ( ) ;
@@ -1559,6 +1603,7 @@ public class AppCfgService extends BaseService {
}
}
}
}
public void updateAppSslCfgValid ( Integer isValid , String ids , Integer functionId ) {
public void updateAppSslCfgValid ( Integer isValid , String ids , Integer functionId ) {
AppSslCertCfg entity = new AppSslCertCfg ( ) ;
AppSslCertCfg entity = new AppSslCertCfg ( ) ;
String [ ] idArray = ids . split ( " , " ) ;
String [ ] idArray = ids . split ( " , " ) ;
@@ -1581,6 +1626,7 @@ public class AppCfgService extends BaseService {
}
}
}
}
public void updateAppHeaderCfgValid ( Integer isValid , String ids , Integer functionId ) {
public void updateAppHeaderCfgValid ( Integer isValid , String ids , Integer functionId ) {
AppHeaderCfg entity = new AppHeaderCfg ( ) ;
AppHeaderCfg entity = new AppHeaderCfg ( ) ;
String [ ] idArray = ids . split ( " , " ) ;
String [ ] idArray = ids . split ( " , " ) ;
@@ -1603,6 +1649,7 @@ public class AppCfgService extends BaseService {
}
}
}
}
public Page < AppHeaderCfg > findAppHeaderList ( Page < AppHeaderCfg > page , AppHeaderCfg entity ) {
public Page < AppHeaderCfg > findAppHeaderList ( Page < AppHeaderCfg > page , AppHeaderCfg entity ) {
entity . getSqlMap ( ) . put ( " dsf " , configScopeFilter ( entity . getCurrentUser ( ) , " r " ) ) ;
entity . getSqlMap ( ) . put ( " dsf " , configScopeFilter ( entity . getCurrentUser ( ) , " r " ) ) ;
entity . setPage ( page ) ;
entity . setPage ( page ) ;
@@ -1610,9 +1657,11 @@ public class AppCfgService extends BaseService {
page . setList ( list ) ;
page . setList ( list ) ;
return page ;
return page ;
}
}
public AppHeaderCfg getAppHeaderCfg ( Long cfgId ) {
public AppHeaderCfg getAppHeaderCfg ( Long cfgId ) {
return appCfgDao . getAppHeaderCfg ( cfgId ) ;
return appCfgDao . getAppHeaderCfg ( cfgId ) ;
}
}
@Transactional ( readOnly = false , rollbackFor = RuntimeException . class )
@Transactional ( readOnly = false , rollbackFor = RuntimeException . class )
public void saveOrUpdateAppHeaderCfg ( AppHeaderCfg entity ) throws Exception {
public void saveOrUpdateAppHeaderCfg ( AppHeaderCfg entity ) throws Exception {
// 设置区域运营商信息
// 设置区域运营商信息
@@ -1670,6 +1719,7 @@ public class AppCfgService extends BaseService {
}
}
}
}
public void auditAppHeaderCfg ( AppHeaderCfg entity , Integer isAudit ) {
public void auditAppHeaderCfg ( AppHeaderCfg entity , Integer isAudit ) {
ToMaatBean maatBean = new ToMaatBean ( ) ;
ToMaatBean maatBean = new ToMaatBean ( ) ;
MaatCfg maatCfg = new MaatCfg ( ) ;
MaatCfg maatCfg = new MaatCfg ( ) ;