1、配置列表增加日志总数一列;2、相关业务配置审核时处理用户自定义域信息;3、APP类配置增加behavCode字段,appCode字段由字符串改为Integer
Signed-off-by: zhangwei <zhangwei@intranet.com>
This commit is contained in:
@@ -28,6 +28,7 @@ import com.nis.domain.maat.MaatCfg.StringCfg;
|
||||
import com.nis.exceptions.MaatConvertException;
|
||||
import com.nis.util.ConfigServiceUtil;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.DictUtils;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.web.dao.configuration.AppCfgDao;
|
||||
import com.nis.web.dao.configuration.AreaIpCfgDao;
|
||||
@@ -126,7 +127,7 @@ public class AppCfgService extends BaseService {
|
||||
}catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.info("获取编译ID出错");
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+e.getMessage());
|
||||
throw new MaatConvertException(e.getMessage());
|
||||
}
|
||||
}else{
|
||||
entity.setEditorId(entity.getCurrentUser().getId());
|
||||
@@ -185,7 +186,7 @@ public class AppCfgService extends BaseService {
|
||||
}catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.info("获取编译ID出错");
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+e.getMessage());
|
||||
throw new MaatConvertException(e.getMessage());
|
||||
}
|
||||
}else{
|
||||
entity.setEditorId(entity.getCurrentUser().getId());
|
||||
@@ -242,7 +243,7 @@ public class AppCfgService extends BaseService {
|
||||
}catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.info("获取编译ID出错");
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+e.getMessage());
|
||||
throw new MaatConvertException(e.getMessage());
|
||||
}
|
||||
}else{
|
||||
entity.setEditorId(entity.getCurrentUser().getId());
|
||||
@@ -299,7 +300,7 @@ public class AppCfgService extends BaseService {
|
||||
}catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.info("获取编译ID出错");
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+e.getMessage());
|
||||
throw new MaatConvertException(e.getMessage());
|
||||
}
|
||||
}else{
|
||||
entity.setEditorId(entity.getCurrentUser().getId());
|
||||
@@ -352,7 +353,7 @@ public class AppCfgService extends BaseService {
|
||||
}catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.info("获取编译ID出错");
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+e.getMessage());
|
||||
throw new MaatConvertException(e.getMessage());
|
||||
}
|
||||
}else{
|
||||
entity.setEditorId(entity.getCurrentUser().getId());
|
||||
@@ -390,7 +391,12 @@ public class AppCfgService extends BaseService {
|
||||
entity.setTableName(AppPolicyCfg.getTablename());
|
||||
appCfgDao.auditCfg(entity);
|
||||
if(isAudit==1){
|
||||
entity.setCfgKeywords(entity.getAppCode());
|
||||
if(entity.getBehavCode()!=null){
|
||||
entity.setCfgKeywords(entity.getAppCode()+"&"+entity.getBehavCode());
|
||||
}else{
|
||||
entity.setCfgKeywords(entity.getAppCode()+"");
|
||||
}
|
||||
|
||||
List<AppPolicyCfg> list = new ArrayList();
|
||||
list.add(entity);
|
||||
Map<String,List> map = cfgConvert(strRegionList,list,2,entity,groupRelationList);
|
||||
@@ -424,18 +430,17 @@ public class AppCfgService extends BaseService {
|
||||
maatCfg.setGroupNum(groupRelationList.size());
|
||||
maatCfg.setAreaIpRegionList(areaIpRegionList);
|
||||
maatCfg.setIsValid(entity.getIsValid());
|
||||
//设置用户自定义域
|
||||
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;
|
||||
|
||||
//设置APP自定义域
|
||||
String userRegion = "APP_ID="+entity.getAppCode();
|
||||
//限速业务需要设置
|
||||
String actionCode = DictUtils.getDictCode("SERVICE_ACTION", "action_ratelimit");
|
||||
if(!actionCode.equals("默认")){
|
||||
if(entity.getAction().equals(Integer.parseInt(actionCode))){
|
||||
userRegion += Constants.USER_REGION_SPLIT+"RATE_LIMIT="+entity.getRatelimit();
|
||||
}
|
||||
}
|
||||
|
||||
maatCfg.setUserRegion(userRegion);
|
||||
configCompileList.add(maatCfg);
|
||||
maatBean.setConfigCompileList(configCompileList);
|
||||
@@ -514,18 +519,8 @@ public class AppCfgService extends BaseService {
|
||||
maatCfg.setGroupNum(groupRelationList.size());
|
||||
maatCfg.setAreaIpRegionList(areaIpRegionList);
|
||||
maatCfg.setIsValid(entity.getIsValid());
|
||||
//设置用户自定义域
|
||||
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;
|
||||
}
|
||||
//设置APP自定义域
|
||||
String userRegion = "APP_ID="+entity.getAppCode();
|
||||
maatCfg.setUserRegion(userRegion);
|
||||
configCompileList.add(maatCfg);
|
||||
maatBean.setConfigCompileList(configCompileList);
|
||||
@@ -605,18 +600,8 @@ public class AppCfgService extends BaseService {
|
||||
maatCfg.setGroupNum(groupRelationList.size());
|
||||
maatCfg.setAreaIpRegionList(areaIpRegionList);
|
||||
maatCfg.setIsValid(entity.getIsValid());
|
||||
//设置用户自定义域
|
||||
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;
|
||||
}
|
||||
//设置APP自定义域
|
||||
String userRegion = "APP_ID="+entity.getAppCode();
|
||||
maatCfg.setUserRegion(userRegion);
|
||||
configCompileList.add(maatCfg);
|
||||
maatBean.setConfigCompileList(configCompileList);
|
||||
@@ -696,18 +681,10 @@ public class AppCfgService extends BaseService {
|
||||
maatCfg.setGroupNum(groupRelationList.size());
|
||||
maatCfg.setAreaIpRegionList(areaIpRegionList);
|
||||
maatCfg.setIsValid(entity.getIsValid());
|
||||
//设置用户自定义域
|
||||
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;
|
||||
}
|
||||
//设置APP自定义域
|
||||
String userRegion = "APP_ID="+entity.getAppCode()+Constants.USER_REGION_SPLIT+
|
||||
"DOMAIN_ID="+entity.getCompileId()+Constants.USER_REGION_SPLIT+
|
||||
"DOMAIN_STR="+entity.getDomain();
|
||||
maatCfg.setUserRegion(userRegion);
|
||||
configCompileList.add(maatCfg);
|
||||
maatBean.setConfigCompileList(configCompileList);
|
||||
@@ -789,17 +766,7 @@ public class AppCfgService extends BaseService {
|
||||
maatCfg.setAreaIpRegionList(areaIpRegionList);
|
||||
maatCfg.setIsValid(entity.getIsValid());
|
||||
//设置用户自定义域
|
||||
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;
|
||||
}
|
||||
String userRegion = "APP_ID="+entity.getAppCode();
|
||||
maatCfg.setUserRegion(userRegion);
|
||||
configCompileList.add(maatCfg);
|
||||
maatBean.setConfigCompileList(configCompileList);
|
||||
|
||||
@@ -174,7 +174,7 @@ public class MailCfgService extends CrudService<MailCfgDao,CfgIndexInfo> {
|
||||
if(entity.getAreaCfg()!=null){
|
||||
for(AreaIpCfg cfg:entity.getAreaCfg()){
|
||||
cfg.initDefaultValue();
|
||||
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgDesc","cfgRegionCode","cfgType"});
|
||||
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
|
||||
areaIpCfgDao.saveAreaIpCfg(cfg);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,6 +45,7 @@ import com.nis.domain.maat.MaatCfg.StringCfg;
|
||||
import com.nis.exceptions.MaatConvertException;
|
||||
import com.nis.util.ConfigServiceUtil;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.DictUtils;
|
||||
import com.nis.util.IpUtil;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.web.dao.configuration.AreaIpCfgDao;
|
||||
@@ -413,6 +414,41 @@ public class WebsiteCfgService extends CrudService<WebsiteCfgDao,CfgIndexInfo> {
|
||||
maatCfg.setAreaIpRegionList(areaIpRegionList);
|
||||
maatCfg.setIsValid(entity.getIsValid());
|
||||
|
||||
//判断http配置是否需要设置自定义域参数
|
||||
String actionValue = DictUtils.getDictCode("SERVICE_ACTION", "action_monit");
|
||||
String userRegion = "";
|
||||
//只有监测业务,并且头域的匹配区域不匹配字典中的信息时需要设置
|
||||
if(!actionValue.equals("默认") && entity.getAction().equals(Integer.parseInt(actionValue))){
|
||||
//请求头域
|
||||
if(entity.getHttpReqHdrList()!=null && entity.getHttpReqHdrList().size()>0){
|
||||
for(ComplexkeywordCfg head:entity.getHttpReqHdrList()){
|
||||
String dictValue = DictUtils.getDictCode("REQUEST_HEADER_DISTRICT", head.getDistrict());
|
||||
if(StringUtil.isEmpty(dictValue) || dictValue.equals("默认")){
|
||||
if(userRegion.equals("")){
|
||||
userRegion += "HTTP_HEADER="+head.getDistrict();
|
||||
}else{
|
||||
userRegion += ";"+"HTTP_HEADER="+head.getDistrict();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
//应答头域
|
||||
if(entity.getHttpResHdrList()!=null && entity.getHttpResHdrList().size()>0){
|
||||
for(ComplexkeywordCfg head:entity.getHttpResHdrList()){
|
||||
String dictValue = DictUtils.getDictCode("RESPONSE_HEADER_DISTRICT", head.getDistrict());
|
||||
if(StringUtil.isEmpty(dictValue) || dictValue.equals("默认")){
|
||||
if(userRegion.equals("")){
|
||||
userRegion += "HTTP_HEADER="+head.getDistrict();
|
||||
}else{
|
||||
userRegion += ";"+"HTTP_HEADER="+head.getDistrict();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
maatCfg.setUserRegion(userRegion);
|
||||
}
|
||||
configCompileList.add(maatCfg);
|
||||
maatBean.setConfigCompileList(configCompileList);
|
||||
maatBean.setAuditTime(entity.getAuditTime());
|
||||
@@ -869,7 +905,8 @@ public class WebsiteCfgService extends CrudService<WebsiteCfgDao,CfgIndexInfo> {
|
||||
maatCfg.setIsValid(entity.getIsValid());
|
||||
// dns reject userRegion=;dnsStrategyId;
|
||||
if(!StringUtil.isEmpty(entity.getDnsStrategyId())){
|
||||
maatCfg.setUserRegion(Constants.USER_REGION_SPLIT+entity.getDnsStrategyId()+Constants.USER_REGION_SPLIT);
|
||||
// maatCfg.setUserRegion(Constants.USER_REGION_SPLIT+entity.getDnsStrategyId()+Constants.USER_REGION_SPLIT);
|
||||
maatCfg.setUserRegion("DNS_STRATEGY="+entity.getDnsStrategyId());
|
||||
}
|
||||
configCompileList.add(maatCfg);
|
||||
maatBean.setConfigCompileList(configCompileList);
|
||||
|
||||
Reference in New Issue
Block a user