1、增加SubscribeId分组配置功能 2、增加公共分组相关国际化代码及相关sql文件修改
This commit is contained in:
@@ -73,12 +73,14 @@ public class IpCommGroupCfgService extends BaseService {
|
||||
}
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public void update(IpCommCfg entity){
|
||||
List<PolicyGroupInfo> policyGroupInfosOld=policyGroupInfoDao.findPolicyByServiceGroupInfoList(entity.getUserRegion1());
|
||||
List<PolicyGroupInfo> policyGroupInfosNew=policyGroupInfoDao.findPolicyByServiceGroupInfoList(entity.getGroupId().toString());
|
||||
ipCommGroupCfgDao.update(entity);
|
||||
// 更新分组状态
|
||||
groupManageService.updateGroupStatus(policyGroupInfosOld, 5); // old
|
||||
groupManageService.updateGroupStatus(policyGroupInfosNew, 5); // new
|
||||
if(!entity.getUserRegion1().equals(entity.getGroupId().toString())) {
|
||||
List<PolicyGroupInfo> policyGroupInfos = new ArrayList<PolicyGroupInfo>();
|
||||
policyGroupInfos.addAll(policyGroupInfoDao.findPolicyByServiceGroupInfoList(entity.getUserRegion1()));
|
||||
policyGroupInfos.addAll(policyGroupInfoDao.findPolicyByServiceGroupInfoList(entity.getGroupId().toString()));
|
||||
groupManageService.updateGroupStatus(policyGroupInfos, 5);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -138,45 +140,36 @@ public class IpCommGroupCfgService extends BaseService {
|
||||
}
|
||||
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public void saveAndSend(FunctionRegionDict regionDict, FunctionServiceDict serviceDict, List<BaseIpCfg> cfgs,boolean send) {
|
||||
public void saveAndSend(FunctionRegionDict regionDict, FunctionServiceDict serviceDict, List<BaseIpCfg> cfgs) {
|
||||
logger.warn("Start to save IP,size:"+cfgs.size());
|
||||
long start=System.currentTimeMillis();
|
||||
SqlSessionFactory sqlSessionFactory=SpringContextHolder.getBean(SqlSessionFactory.class);
|
||||
SqlSession batchSqlSession = null;
|
||||
//需要通过新增域接口新增的ip集合
|
||||
Map<Integer,Integer> groupCount=Maps.newHashMap();
|
||||
List<IpCommCfg> ipCommCfgs=new ArrayList(cfgs.size());
|
||||
try{
|
||||
String ids = "";
|
||||
batchSqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, false);
|
||||
|
||||
for(BaseIpCfg cfg:cfgs) {
|
||||
if(!ids.contains(cfg.getGroupId()+"")) {
|
||||
ids += ","+cfg.getGroupId();
|
||||
}
|
||||
IpCommCfg ipCommCfg=new IpCommCfg();
|
||||
BeanUtils.copyProperties(cfg, ipCommCfg);
|
||||
ipCommCfgs.add(ipCommCfg);
|
||||
((IpCommGroupCfgDao) batchSqlSession.getMapper(IpCommGroupCfgDao.class)).insertForBatch(ipCommCfg);
|
||||
// if(send) {
|
||||
// if(groupCount.containsKey(ipCommCfg.getGroupId())) {
|
||||
// groupCount.put(ipCommCfg.getGroupId(), groupCount.get(ipCommCfg.getGroupId())+1);
|
||||
// }else {
|
||||
// groupCount.put(ipCommCfg.getGroupId(), 1);
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
||||
// if(send) {
|
||||
// if(groupCount.size()>0) {
|
||||
// for(Entry<Integer, Integer> groupId:groupCount.entrySet()) {
|
||||
// policyGroupInfoDao.updateUdFlag(groupId.getKey(), 1,5);
|
||||
// }
|
||||
//
|
||||
// this.send2Maat(ipCommCfgs, Constants.VALID_YES);
|
||||
// }
|
||||
// }
|
||||
batchSqlSession.commit();
|
||||
|
||||
// 更新分组状态
|
||||
String serviceGroupIds = ids.substring(1);
|
||||
List<PolicyGroupInfo> policyGroupInfos = policyGroupInfoDao.findPolicyByServiceGroupInfoList(serviceGroupIds);
|
||||
groupManageService.updateGroupStatus(policyGroupInfos, 5);
|
||||
|
||||
}finally {
|
||||
if(batchSqlSession != null){
|
||||
batchSqlSession.close();
|
||||
}
|
||||
|
||||
}
|
||||
long end=System.currentTimeMillis();
|
||||
logger.warn("Save IP finish,cost:"+(end-start));
|
||||
|
||||
Reference in New Issue
Block a user