Merge branch 'develop' of http://192.168.10.125/k18_web/NFS.git into develop

This commit is contained in:
zhanghongqing
2018-11-14 11:33:00 +08:00
6 changed files with 28 additions and 6 deletions

View File

@@ -140,6 +140,9 @@ public class AsnIpController extends BaseController{
ConfigGroupInfo info=AsnCacheUtils.get(Long.parseLong(id));
if(info!=null) {
groupMap.put(id, info.getGroupName());
}else {
info=asnIpCfgService.getConfigGroupInfoByAsnNo(Long.parseLong(id));
groupMap.put(id, info.getGroupName());
}
}
return groupMap;

View File

@@ -45,6 +45,12 @@ public interface CrudDao<T> {
* @return
*/
public int insert(T entity);
/**
* 批量插入数据专用,不返回id
* @param entity
* @return
*/
public int insertForBatch(T entity);
/**
* 更新数据

View File

@@ -572,6 +572,13 @@
<include refid="BaseIpCfg_Value_List" />
)
</insert>
<insert id="insertForBatch" parameterType="com.nis.domain.configuration.BaseIpCfg" >
insert into ${tableName} (
<include refid="BaseIpCfg_Column_List" />
)values (
<include refid="BaseIpCfg_Value_List" />
)
</insert>
<update id="update" parameterType="com.nis.domain.configuration.BaseIpCfg" >
update ${tableName}
<set >

View File

@@ -109,7 +109,8 @@ public abstract class CrudService<D extends CrudDao<T>, T extends BaseEntity<T>>
batchSqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, false);
for(int index = 0; index < data.size();index++){
T t = data.get(index);
((CrudDao<T>) batchSqlSession.getMapper(mClass)).insert(t);
//insertForBatch不要带上ID会影响效率
((CrudDao<T>) batchSqlSession.getMapper(mClass)).insertForBatch(t);
// if(index>0&&index%batchSize==0) {
// batchSqlSession.commit();
// batchSqlSession.clearCache();

View File

@@ -243,15 +243,18 @@ public class AsnIpCfgService extends CrudService<CrudDao<AsnIpCfg>, AsnIpCfg> {
}
long end=System.currentTimeMillis();
this.save(cfgs);
splitAndSend(toAddRegionAsnIpCfgs,Constants.VALID_YES);
// splitAndSend(toAddRegionAsnIpCfgs,Constants.VALID_YES);
asnIPRegionSendToMaat(toAddRegionAsnIpCfgs,Constants.VALID_YES);
cfgs.clear();
toAddRegionAsnIpCfgs.clear();
}
/**
* 分割IP region分次下发
* 由于在Controller中分割此方法不需要调用直接使用asnIPRegionSendToMaat方法即可
* @param asnIpCfgs
* @param valid
*/
@Deprecated
public void splitAndSend(List<AsnIpCfg> asnIpCfgs,Integer valid){
if(asnIpCfgs!=null&&asnIpCfgs.size()>0) {
// List<AsnIpCfg> asnIpCfgs=Lists.newArrayList(list.size());
@@ -393,7 +396,8 @@ public class AsnIpCfgService extends CrudService<CrudDao<AsnIpCfg>, AsnIpCfg> {
}
}
this.save(entity.getAsnIpCfgs());
splitAndSend(entity.getAsnIpCfgs(),Constants.VALID_YES);
asnIPRegionSendToMaat(entity.getAsnIpCfgs(),Constants.VALID_YES);
// splitAndSend(entity.getAsnIpCfgs(),Constants.VALID_YES);
}else {
if(entity.getAsnIpCfgs()!=null) {
for(AsnIpCfg cfg:entity.getAsnIpCfgs()) {
@@ -430,7 +434,8 @@ public class AsnIpCfgService extends CrudService<CrudDao<AsnIpCfg>, AsnIpCfg> {
}
asnIpCfgDao.delete(ids);
//已经下发过的,调用分组复用配置删除接口
splitAndSend(issuedList,Constants.VALID_NO);
// splitAndSend(issuedList,Constants.VALID_NO);
asnIPRegionSendToMaat(issuedList,Constants.VALID_NO);
}
// public List<ConfigGroupInfo> findPolicyGroupInfosByType(Integer groupId) {

View File

@@ -1,13 +1,13 @@
#jdbc for oracle
#jdbc.driver=oracle.jdbc.driver.OracleDriver
jdbc.devlop.driver=com.mysql.jdbc.Driver
jdbc.devlop.url=jdbc:mysql://192.168.10.204:3306/gwall_dev?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull
jdbc.devlop.url=jdbc:mysql://192.168.10.204:3306/gwall_dev?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&rewriteBatchedStatements=true
jdbc.devlop.username=root
jdbc.devlop.key=pR3JFt5dsGCW0nZO3TLF7Q==
jdbc.devlop.password=JgW5tsiGBNAtcqCgSQIP0g==
jdbc.product.driver=com.mysql.jdbc.Driver
jdbc.product.url=jdbc:mysql://192.168.10.204:3306/gwall_dev?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull
jdbc.product.url=jdbc:mysql://192.168.10.204:3306/gwall_dev?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&rewriteBatchedStatements=true
jdbc.product.username=root
jdbc.product.key=pR3JFt5dsGCW0nZO3TLF7Q==
jdbc.product.password=JgW5tsiGBNAtcqCgSQIP0g==