APP特征配置导入页修改,app payload增加配置导入功能.

This commit is contained in:
zhangwenqing
2019-01-03 01:11:56 +08:00
parent e6426052cd
commit 8da5a2dc96
15 changed files with 1152 additions and 183 deletions

View File

@@ -1613,6 +1613,8 @@ public abstract class BaseService {
type="DnsResStrategy";
}else if(list.get(0) instanceof AsnIpCfg) {
type="AsnIpCfg";
}else if(list.get(0) instanceof AppComplexFeatureCfg) {
type="AppComplexFeature";
}
if (cfgIndexInfos != null && cfgIndexInfos.size() > 0) {
this.saveCfgIndexOf(cfgIndexInfos);
@@ -1634,6 +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)) {
List<AppComplexFeatureCfg> listPage = (List<AppComplexFeatureCfg>) list;
this.saveAppComplexFeatureBatch(listPage);
}else if("BaseStringCfg".equals(type)) {
List<BaseStringCfg<?>> listPage = (List<BaseStringCfg<?>>) list;
// 调用对应配置的service
@@ -1815,6 +1820,30 @@ public abstract class BaseService {
}
}
/**
* APP Payload导入配置时数据批量入库
* @param data
*/
@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();
}
}
}
/**
* 同一个app下的ip批量保存
* @param cfgs