APP特征配置导入页修改,app payload增加配置导入功能.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user