P2P配置自定义域保存于cfg_index_info表以及修改改动涉及功能.
This commit is contained in:
@@ -693,13 +693,12 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
|
||||
Map<String, List> dataMap=new HashMap<String, List>();
|
||||
List<IpPortCfg> ipPortList = fileTransferCfgDao.getIpPortList(entity);
|
||||
for (int i = 0; i < ipPortList.size(); i++) {
|
||||
ipPortList.get(i).setUserRegion1(DictUtils.getDictLabel("P2P_IP_TYPE",ipPortList.get(i).getUserRegion1()));
|
||||
ipPortList.get(i).setUserRegion1(DictUtils.getDictLabel("P2P_IP_TYPE",entity.getUserRegion2()));
|
||||
}
|
||||
List<P2pHashCfg> hashList = fileTransferCfgDao.getP2pHashList(entity);
|
||||
for (int i = 0; i < hashList.size(); i++) {
|
||||
BaseStringCfg base =hashList.get(i);
|
||||
if(!StringUtil.isEmpty(base.getUserRegion1()))
|
||||
base.setUserRegion1(DictUtils.getDictLabel("P2P_HASH_TYPE",base.getUserRegion1()));
|
||||
base.setUserRegion1(DictUtils.getDictLabel("P2P_HASH_TYPE",entity.getUserRegion1()));
|
||||
}
|
||||
List<P2pKeywordCfg> keywordList = fileTransferCfgDao.getP2pKeywordList(entity);
|
||||
List<NtcSubscribeIdCfg> subscribeIdList = fileTransferCfgDao.getP2pSubscribeidList(entity);
|
||||
@@ -751,8 +750,7 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
|
||||
// 保存IP域配置信息
|
||||
if(entity.getIpPortList()!=null){
|
||||
for(IpPortCfg cfg:entity.getIpPortList()){
|
||||
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
|
||||
cfg.setUserRegion2(null);
|
||||
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType","userRegion1","userRegion2"});
|
||||
fileTransferCfgDao.saveIpPortCfg(cfg);
|
||||
}
|
||||
}
|
||||
@@ -761,8 +759,6 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
|
||||
for(BaseStringCfg cfg:entity.getP2pHashList()){
|
||||
if(StringUtils.isNotBlank(cfg.getCfgKeywords())){
|
||||
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
|
||||
cfg.setUserRegion1(cfg.getUserRegion2());
|
||||
cfg.setUserRegion2(null);
|
||||
fileTransferCfgDao.saveP2pHashCfg(cfg);
|
||||
}
|
||||
}
|
||||
@@ -1008,6 +1004,18 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
|
||||
String userRegion = "";
|
||||
//存在IP域
|
||||
if(entity != null && entity.getIpPortList() != null && entity.getIpPortList().size() >0){
|
||||
userRegion += Constants.P2P_IP_TYPE_USER_REGION_KEY+"="+entity.getUserRegion2();
|
||||
}
|
||||
//存在hash域
|
||||
if(entity != null && entity.getP2pHashList() != null && entity.getP2pHashList().size() >0){
|
||||
if(!StringUtil.isEmpty(userRegion) && !StringUtil.isEmpty(entity.getUserRegion1())){
|
||||
userRegion = userRegion+Constants.USER_REGION_SPLIT+Constants.P2P_HASH_TYPE_USER_REGION_KEY+"="+entity.getUserRegion1();
|
||||
}else if(!StringUtil.isEmpty(entity.getUserRegion1())){
|
||||
userRegion += Constants.P2P_HASH_TYPE_USER_REGION_KEY+"="+entity.getUserRegion1();
|
||||
}
|
||||
}
|
||||
//存在IP域
|
||||
/*if(entity != null && entity.getIpPortList() != null && entity.getIpPortList().size() >0){
|
||||
IpPortCfg ipport=entity.getIpPortList().get(0);
|
||||
ipport.setUserRegion1(StringUtil.isEmpty(ipport.getUserRegion1()) ? "":ipport.getUserRegion1());
|
||||
userRegion += Constants.P2P_IP_TYPE_USER_REGION_KEY+"="+ipport.getUserRegion1();
|
||||
@@ -1021,7 +1029,7 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
|
||||
}else{
|
||||
userRegion += Constants.P2P_HASH_TYPE_USER_REGION_KEY+"="+hashCfg.getUserRegion1();
|
||||
}
|
||||
}
|
||||
}*/
|
||||
if(!StringUtil.isEmpty(userRegion)){
|
||||
maatCfg.setUserRegion(userRegion);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user