ASN、Http(s) Url报表时间检索增加限制;app payload、http、dns、ssl配置导入并下发增加userRegion属性

This commit is contained in:
zhangwenqing
2019-01-04 19:15:33 +08:00
parent 23a29ad457
commit 530554ffd1
4 changed files with 68 additions and 26 deletions

View File

@@ -1636,9 +1636,9 @@ public abstract class BaseService {
}else if("AsnIpCfg".equals(type)) {
List<AsnIpCfg> listPage = (List<AsnIpCfg>) list;
this.saveAsnIpBatch(listPage);
}else if("AppComplexFeature".equals(type)) {
}else if("AppComplexFeature".equals(type)) {// APP Payload
List<AppComplexFeatureCfg> listPage = (List<AppComplexFeatureCfg>) list;
this.saveAppComplexFeatureBatch(listPage);
this.saveAppComplexFeatureBatch(regionDict,serviceDict,listPage,send);
}else if("BaseStringCfg".equals(type)) {
List<BaseStringCfg<?>> listPage = (List<BaseStringCfg<?>>) list;
// 调用对应配置的service
@@ -1823,27 +1823,68 @@ public abstract class BaseService {
/**
* APP Payload导入配置时数据批量入库
* @param serviceDict
* @param regionDict
* @param data
* @param send
*/
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
public void saveAppComplexFeatureBatch(List<AppComplexFeatureCfg> data) {
SqlSessionFactory sqlSessionFactory=SpringContextHolder.getBean(SqlSessionFactory.class);
SqlSession batchSqlSession = null;
try{
batchSqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, false);
for(int index = 0; index < data.size();index++){
AppComplexFeatureCfg cfg = data.get(index);
((AppMultiFeatureCfgDao) batchSqlSession.getMapper(AppMultiFeatureCfgDao.class)).insertAppComplexFeatureCfgBatch(cfg);
}
batchSqlSession.commit();
}finally {
if(batchSqlSession != null){
batchSqlSession.close();
}
public void saveAppComplexFeatureBatch(FunctionRegionDict regionDict, FunctionServiceDict serviceDict, List<AppComplexFeatureCfg> data, boolean send) {
if (regionDict != null) {
Integer regionType = regionDict.getRegionType();
if (3 == regionType.intValue()) {
SqlSessionFactory sqlSessionFactory=SpringContextHolder.getBean(SqlSessionFactory.class);
List<MaatCfg> configCompileList = new ArrayList();
SqlSession batchSqlSession = null;
try{
batchSqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, false);
for(int index = 0; index < data.size();index++){
AppComplexFeatureCfg cfg = data.get(index);
((AppMultiFeatureCfgDao) batchSqlSession.getMapper(AppMultiFeatureCfgDao.class)).insertAppComplexFeatureCfgBatch(cfg);
if (send) {
if(regionDict.getIsMaat().intValue()==1) {
MaatCfg maatCfg=convertMaatCfg(cfg,3);
//userRegion处理
if(regionDict.getFunctionId()==563) {
maatCfg.setUserRegion(Constants.APP_ID_REGION+"="+cfg.getAppCode());
}
configCompileList.add(maatCfg);
}
}
}
if (send && configCompileList.size() > 0) {
ToMaatBean maatBean = new ToMaatBean();
maatBean.setConfigCompileList(configCompileList);
maatBean.setAuditTime(new Date());
maatBean.setCreatorName(UserUtils.getUser().getName());
maatBean.setVersion(Constants.MAAT_VERSION);
maatBean.setOpAction(Constants.INSERT_ACTION);
// 调用服务接口下发配置数据
String json = BaseService.gsonToJson(maatBean);
if(configCompileList.size()>10) {
logger.info("APP Feature增强字符串配置下发配置条数" + configCompileList.size());
}else {
logger.info("APP Feature增强字符串配置下发配置参数" + json);
}
// 调用服务接口下发配置
ToMaatResult result = ConfigServiceUtil.postMaatCfg(json);
logger.info("APP Feature增强字符串配置下发响应信息" + result.getMsg());
}
batchSqlSession.commit();
}finally {
if(batchSqlSession != null){
batchSqlSession.close();
}
}
}
}
}
/**
* 同一个app下的ip批量保存
* @param cfgs
@@ -2211,6 +2252,8 @@ public abstract class BaseService {
userRegion = Constants.REPLACE_ZONE_KEY+"="+_cfg.getUserRegion1()+";"+Constants.REPLACE_SUBSTITUTE_KEY+"="+substitute;
}
maatCfg.setUserRegion(userRegion);
}else if(regionDict.getFunctionId()==563 || regionDict.getFunctionId()==565 || regionDict.getFunctionId()==566) {// APP Payload、HTTP、SSL Admin
maatCfg.setUserRegion(Constants.APP_ID_REGION+"="+_cfg.getAppCode());
}
configCompileList.add(maatCfg);
@@ -2417,6 +2460,8 @@ public abstract class BaseService {
userRegion = Constants.REPLACE_ZONE_KEY+"="+cfg.getUserRegion1()+";"+Constants.REPLACE_SUBSTITUTE_KEY+"="+substitute;
}
maatCfg.setUserRegion(userRegion);
}else if(regionDict.getFunctionId()==564 || regionDict.getFunctionId()==565 || regionDict.getFunctionId()==566) {// APP HTTP、DNS、SSL Admin
maatCfg.setUserRegion(Constants.APP_ID_REGION+"="+cfg.getAppCode());
}
configCompileList.add(maatCfg);
}