Merge branch 'develop' of http://192.168.10.125/k18_web/NFS.git into develop
This commit is contained in:
@@ -230,15 +230,15 @@ public class BaseCfg<T> extends BaseEntity<T> implements Cloneable{
|
||||
|
||||
protected Integer groupId;//仅用于copy属性使用
|
||||
protected Integer regionId;//仅用于copy属性使用
|
||||
protected Integer numberRegionGroupId;//仅用于copy属性使用
|
||||
// protected Integer numberRegionGroupId;//仅用于copy属性使用
|
||||
protected Integer numberRegionRegionId;//仅用于copy属性使用
|
||||
|
||||
public Integer getNumberRegionGroupId() {
|
||||
return numberRegionGroupId;
|
||||
}
|
||||
public void setNumberRegionGroupId(Integer numberRegionGroupId) {
|
||||
this.numberRegionGroupId = numberRegionGroupId;
|
||||
}
|
||||
// public Integer getNumberRegionGroupId() {
|
||||
// return numberRegionGroupId;
|
||||
// }
|
||||
// public void setNumberRegionGroupId(Integer numberRegionGroupId) {
|
||||
// this.numberRegionGroupId = numberRegionGroupId;
|
||||
// }
|
||||
public Integer getNumberRegionRegionId() {
|
||||
return numberRegionRegionId;
|
||||
}
|
||||
|
||||
@@ -8,13 +8,13 @@ import com.nis.util.excel.ExcelField;
|
||||
*/
|
||||
public class P2pIpTemplate extends IpAllTemplate {
|
||||
|
||||
private String userRegion1;
|
||||
private String userRegion2;
|
||||
|
||||
@ExcelField(title="p2p_ip_config_type",dictType="P2P_IP_TYPE",align=2,sort=2)
|
||||
public String getUserRegion1() {
|
||||
return userRegion1;
|
||||
public String getUserRegion2() {
|
||||
return userRegion2;
|
||||
}
|
||||
public void setUserRegion1(String userRegion1) {
|
||||
this.userRegion1 = userRegion1;
|
||||
public void setUserRegion2(String userRegion2) {
|
||||
this.userRegion2 = userRegion2;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -140,7 +140,7 @@ public class MultipartFileIntercepter extends CommonsMultipartResolver{
|
||||
fileTypes=Constants.LOGO_FILE_TYPE;
|
||||
fileMaxSize=Constants.LOGO_SINGLE_FILE_MAX_SIZE;
|
||||
}else if(functionId.equals(632)){ //人脸识别
|
||||
fileTypes=Constants.FACE_FILE_TYPE;
|
||||
fileTypes=Constants.PICTURE_FILE_TYPE;//同图片类型
|
||||
fileMaxSize=Constants.FACE_SINGLE_FILE_MAX_SIZE;
|
||||
}else if(functionId.equals(570)){ //证书管理
|
||||
fileTypes=Constants.PUBLIC_FILE_TYPE;
|
||||
|
||||
@@ -6,6 +6,7 @@ import java.util.Map.Entry;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.beust.jcommander.internal.Lists;
|
||||
import com.nis.domain.specific.ConfigGroupInfo;
|
||||
import com.nis.web.dao.specific.ConfigGroupInfoDao;
|
||||
import com.nis.web.service.SpringContextHolder;
|
||||
@@ -48,8 +49,21 @@ public class AsnCacheUtils{
|
||||
return (Map<Long,ConfigGroupInfo>)element.getObjectValue();
|
||||
}
|
||||
public static void clearCache() {
|
||||
logger.warn("clear cache!");
|
||||
CacheUtils.getCacheManager().removeCache(ASN_NO_CACHE);
|
||||
}
|
||||
public static List<ConfigGroupInfo> getAllAsnGroup(){
|
||||
List<ConfigGroupInfo> configGroupInfos=Lists.newArrayList();
|
||||
Cache cache=getCache(ASN_NO_CACHE);
|
||||
for(Object key:cache.getKeys()) {
|
||||
Element element = getCache(ASN_NO_CACHE).get(key);
|
||||
if(element!=null) {
|
||||
Map<Long,ConfigGroupInfo> map=(Map<Long,ConfigGroupInfo>)element.getObjectValue();
|
||||
configGroupInfos.addAll(map.values());
|
||||
}
|
||||
}
|
||||
return configGroupInfos;
|
||||
}
|
||||
/**
|
||||
* 初始化缓存
|
||||
*/
|
||||
@@ -147,4 +161,9 @@ public class AsnCacheUtils{
|
||||
}
|
||||
return cache;
|
||||
}
|
||||
public static String getCacheName() {
|
||||
return ASN_NO_CACHE;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -14,6 +14,7 @@ import java.util.Comparator;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Properties;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.ArrayBlockingQueue;
|
||||
import java.util.concurrent.BlockingQueue;
|
||||
|
||||
@@ -76,7 +77,7 @@ public class ImportBigExcel extends XLSXCovertCSVReader{
|
||||
*/
|
||||
public ImportBigExcel(MultipartFile multipartFile, Integer headerNum, int sheetIndex)
|
||||
throws InvalidFormatException, IOException {
|
||||
File upFile=new File(System.currentTimeMillis()+multipartFile.getOriginalFilename());
|
||||
File upFile=new File(UUID.randomUUID()+"_"+multipartFile.getOriginalFilename());
|
||||
upFile.mkdirs();
|
||||
multipartFile.transferTo(upFile);
|
||||
if (!upFile.exists()){
|
||||
|
||||
@@ -116,7 +116,7 @@ public class CheckIpFormatThread implements Callable<String>{
|
||||
}
|
||||
if (!has) {
|
||||
errInfo.append(prop.getProperty("ratelimit") + "."
|
||||
+ String.format(prop.getProperty("must_between"), 0.001, 0.009) + ";");
|
||||
+ String.format(prop.getProperty("must_between"), 0.1, 0.9) + ";");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// TODO: handle exception
|
||||
@@ -198,11 +198,11 @@ public class CheckIpFormatThread implements Callable<String>{
|
||||
//p2p ip
|
||||
if (regionDict.getFunctionId().equals(510) && "p2p_ip".equals(regionDict.getConfigServiceType())) { // P2p
|
||||
// IP
|
||||
String userRegion1 = baseIpCfg.getUserRegion1();
|
||||
String userRegion2 = baseIpCfg.getUserRegion2();
|
||||
List<SysDataDictionaryItem> ipTypes = DictUtils.getDictList("P2P_IP_TYPE");
|
||||
boolean has = false;
|
||||
for (SysDataDictionaryItem type : ipTypes) {
|
||||
if (type.getItemCode().equals(userRegion1)) {
|
||||
if (type.getItemCode().equals(userRegion2)) {
|
||||
has = true;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -247,7 +247,7 @@ public class HttpClientUtil {
|
||||
* @param params 参数列表
|
||||
* @return 查询结果数据json
|
||||
*/
|
||||
public static String getMsg(String destUrl, Map<String, Object> params, HttpServletRequest req) {
|
||||
public static String getMsg(String destUrl, Map<String, Object> params, HttpServletRequest req) throws IOException {
|
||||
// RequestContext requestContext = new RequestContext(req);
|
||||
|
||||
// CloseableHttpResponse response = null;
|
||||
@@ -296,7 +296,11 @@ public class HttpClientUtil {
|
||||
logger.error("获取消息失败,相应内容如下: " + result);
|
||||
logger.error("获取消息失败 ", e);
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:");
|
||||
}
|
||||
}finally {
|
||||
if (response != null) {
|
||||
response.close();
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -1417,7 +1417,7 @@ public class BaseController {
|
||||
List<Integer> compileIds=Lists.newArrayList();
|
||||
List<Integer> regionIds=Lists.newArrayList();
|
||||
List<Integer> groupIds=Lists.newArrayList();
|
||||
List<Integer> numRegionGroupIds=Lists.newArrayList();
|
||||
// List<Integer> numRegionGroupIds=Lists.newArrayList();
|
||||
List<Integer> numRegionRegionIds=Lists.newArrayList();
|
||||
if(!regionDict.getFunctionId().equals(405)) {//app ip compileId 从config_group_info中取
|
||||
try {
|
||||
@@ -1428,7 +1428,7 @@ public class BaseController {
|
||||
}
|
||||
//需要获取数值域的id
|
||||
if(serviceDict!=null&&serviceDict.getProtocolId()!=null) {
|
||||
numRegionGroupIds = ConfigServiceUtil.getId(2,_ipPortCfgs.size());
|
||||
// numRegionGroupIds = ConfigServiceUtil.getId(2,_ipPortCfgs.size());
|
||||
numRegionRegionIds = ConfigServiceUtil.getId(3,_ipPortCfgs.size());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
@@ -1468,9 +1468,9 @@ public class BaseController {
|
||||
cfg.setRegionId(regionIds.get(ind));
|
||||
}
|
||||
if(serviceDict!=null&&serviceDict.getProtocolId()!=null) {
|
||||
if(numRegionGroupIds!=null&&numRegionGroupIds.size()==_ipPortCfgs.size()) {
|
||||
cfg.setNumberRegionGroupId(numRegionGroupIds.get(ind));
|
||||
}
|
||||
// if(numRegionGroupIds!=null&&numRegionGroupIds.size()==_ipPortCfgs.size()) {
|
||||
// cfg.setNumberRegionGroupId(numRegionGroupIds.get(ind));
|
||||
// }
|
||||
if(numRegionRegionIds!=null&&numRegionRegionIds.size()==_ipPortCfgs.size()) {
|
||||
cfg.setNumberRegionRegionId(numRegionRegionIds.get(ind));
|
||||
}
|
||||
@@ -1788,7 +1788,7 @@ public class BaseController {
|
||||
}
|
||||
}
|
||||
if(e instanceof MaatConvertException||e instanceof ServiceException) {
|
||||
addMessage(redirectAttributes,"error", e.getMessage());
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error", "import_failed");
|
||||
}
|
||||
|
||||
@@ -50,6 +50,9 @@ public class AsnIpController extends BaseController{
|
||||
|
||||
// List<PolicyGroupInfo> policyGroups=policyGroupInfoService.findPolicyGroupInfosByType(4);
|
||||
// model.addAttribute("policyGroups", policyGroups);
|
||||
AsnCacheUtils.init();
|
||||
List<ConfigGroupInfo> policyGroups=AsnCacheUtils.getAllAsnGroup();
|
||||
model.addAttribute("policyGroups", policyGroups);
|
||||
return "/basics/asnIpCfgList";
|
||||
}
|
||||
@RequestMapping(value = {"/addForm"})
|
||||
|
||||
@@ -224,7 +224,6 @@ public class AvController extends BaseController {
|
||||
||Constants.VIDEO_FILE_TYPE.contains(FileUtils.getSuffix(uploadSrcFile.getName(),false))
|
||||
||Constants.VOIP_FILE_TYPE.contains(FileUtils.getSuffix(uploadSrcFile.getName(),false))
|
||||
||Constants.SPEAKER_FILE_TYPE.contains(FileUtils.getSuffix(uploadSrcFile.getName(),false))
|
||||
||Constants.FACE_FILE_TYPE.contains(FileUtils.getSuffix(uploadSrcFile.getName(),false))
|
||||
){
|
||||
if(!validateAvDuration(uploadSrcFile)){
|
||||
addMessage(redirectAttributes,"exceeds_duration_limit");
|
||||
@@ -616,7 +615,55 @@ public class AvController extends BaseController {
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传图片文件,调用脚本压缩图片,返回图片保存路径
|
||||
* @param cfg
|
||||
* @param functionId
|
||||
* @param redirectAttributes
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping(value = {"/sample/faceToPicture"})
|
||||
public Map faceToPicture(Model model,@RequestParam("srcFile") CommonsMultipartFile[] srcFile){
|
||||
String sep = System.getProperty("file.separator");
|
||||
String random = UUID.randomUUID()+"";
|
||||
// String srcFilePath = Constants.AV_FILE_PATH+"face"+random+sep+"srcFile";//视频源文件保存路径
|
||||
String srcFilePath = StringUtils.getUserfilesBaseDir()+"face"+sep+"picFile"+sep+random+sep;//视频生成的关键帧图片文件保存路径
|
||||
|
||||
FileUtils.createDirectory(srcFilePath);
|
||||
//保存源文件
|
||||
for (CommonsMultipartFile sinFile : srcFile) {
|
||||
String srcFileAllPath = srcFilePath+sep+random+FileUtils.getSuffix(sinFile.getOriginalFilename(), true);//新的文件名
|
||||
File uploadSrcFile = new File(srcFileAllPath);
|
||||
try {
|
||||
FileCopyUtils.copy(sinFile.getBytes(), uploadSrcFile);
|
||||
} catch (IOException e) {
|
||||
logger.error(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Map map = new HashMap();
|
||||
map.put("picFilePath", srcFilePath);
|
||||
|
||||
//获取图片列表
|
||||
Collection<File> files = FileUtils.listFiles(new File(srcFilePath), null, true);
|
||||
String srcPath = null;
|
||||
for(File f:files){
|
||||
if(srcPath==null){
|
||||
srcPath = f.getName();
|
||||
}else{
|
||||
srcPath += "|"+f.getName();
|
||||
}
|
||||
}
|
||||
//将图片文件列表赋值给生成样例的源文件路径参数
|
||||
map.put("srcPath", srcPath);
|
||||
map.put("status", 1);
|
||||
map.put("msg", "success");
|
||||
|
||||
return map;
|
||||
}
|
||||
@RequestMapping(value = {"/sample/selectVedioPicture"})
|
||||
public String selectVedioPicture(Model model,HttpServletRequest request,String picFilePath,String srcPath){
|
||||
Collection<File> files = FileUtils.listFiles(new File(picFilePath), null, true);
|
||||
|
||||
@@ -24,7 +24,7 @@ import com.nis.domain.configuration.ComplexkeywordCfg;
|
||||
import com.nis.domain.configuration.IpPortCfg;
|
||||
import com.nis.domain.configuration.NtcBgpAsCfg;
|
||||
import com.nis.domain.configuration.NtcSubscribeIdCfg;
|
||||
import com.nis.exception.MaatConvertException;
|
||||
import com.nis.exceptions.MaatConvertException;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.StringUtils;
|
||||
import com.nis.web.controller.BaseController;
|
||||
|
||||
@@ -14,6 +14,7 @@ import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.SysDataDictionaryName;
|
||||
import com.nis.util.AsnCacheUtils;
|
||||
import com.nis.util.CacheUtils;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.StringUtil;
|
||||
@@ -104,8 +105,12 @@ public class DictController extends BaseController {
|
||||
@ResponseBody
|
||||
@RequestMapping(value = {"refreshCache"})
|
||||
public String refreshCache(String cacheName){
|
||||
//删除字典缓存
|
||||
CacheUtils.remove(cacheName);
|
||||
if(cacheName.equals(AsnCacheUtils.getCacheName())) {
|
||||
AsnCacheUtils.clearCache();
|
||||
}else {
|
||||
//删除字典缓存
|
||||
CacheUtils.remove(cacheName);
|
||||
}
|
||||
return "success";
|
||||
}
|
||||
|
||||
|
||||
@@ -24,6 +24,11 @@
|
||||
<result column="area_effective_ids" property="areaEffectiveIds" jdbcType="VARCHAR" />
|
||||
<result column="function_id" property="functionId" jdbcType="INTEGER" />
|
||||
<result column="do_log" property="doLog" jdbcType="INTEGER" />
|
||||
<result column="user_region1" property="userRegion1" jdbcType="VARCHAR" />
|
||||
<result column="user_region2" property="userRegion2" jdbcType="VARCHAR" />
|
||||
<result column="user_region3" property="userRegion3" jdbcType="VARCHAR" />
|
||||
<result column="user_region4" property="userRegion4" jdbcType="VARCHAR" />
|
||||
<result column="user_region5" property="userRegion5" jdbcType="VARCHAR" />
|
||||
</resultMap>
|
||||
<resultMap id="ipPortMap" type="com.nis.domain.configuration.IpPortCfg" >
|
||||
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
|
||||
@@ -161,7 +166,8 @@
|
||||
a.CFG_ID,a.CFG_DESC,a.ACTION,a.IS_VALID,a.IS_AUDIT,
|
||||
a.CREATOR_ID,a.CREATE_TIME,a.EDITOR_ID,a.EDIT_TIME,a.AUDITOR_ID,a.AUDIT_TIME,
|
||||
a.SERVICE_ID,a.REQUEST_ID,a.COMPILE_ID,a.IS_AREA_EFFECTIVE,a.CLASSIFY,
|
||||
a.ATTRIBUTE,a.LABLE,a.AREA_EFFECTIVE_IDS,a.function_id,a.do_log
|
||||
a.ATTRIBUTE,a.LABLE,a.AREA_EFFECTIVE_IDS,a.function_id,a.do_log,
|
||||
a.user_region1,a.user_region2,a.user_region3,a.user_region4,a.user_region5
|
||||
</sql>
|
||||
<sql id="IpCfg_Column" >
|
||||
a.cfg_id,a.cfg_desc,a.ip_type,a.src_ip_address,a.ip_pattern,a.port_pattern,a.src_port
|
||||
@@ -337,26 +343,31 @@
|
||||
SELECT LAST_INSERT_ID()
|
||||
</selectKey>
|
||||
insert into cfg_index_info(
|
||||
CFG_DESC,
|
||||
ACTION,
|
||||
IS_VALID,
|
||||
IS_AUDIT,
|
||||
CREATOR_ID,
|
||||
CREATE_TIME,
|
||||
EDITOR_ID,
|
||||
EDIT_TIME,
|
||||
AUDITOR_ID,
|
||||
AUDIT_TIME,
|
||||
SERVICE_ID,
|
||||
REQUEST_ID,
|
||||
COMPILE_ID,
|
||||
IS_AREA_EFFECTIVE,
|
||||
CLASSIFY,
|
||||
ATTRIBUTE,
|
||||
LABLE,
|
||||
AREA_EFFECTIVE_IDS,
|
||||
function_id,
|
||||
do_log
|
||||
CFG_DESC,
|
||||
ACTION,
|
||||
IS_VALID,
|
||||
IS_AUDIT,
|
||||
CREATOR_ID,
|
||||
CREATE_TIME,
|
||||
EDITOR_ID,
|
||||
EDIT_TIME,
|
||||
AUDITOR_ID,
|
||||
AUDIT_TIME,
|
||||
SERVICE_ID,
|
||||
REQUEST_ID,
|
||||
COMPILE_ID,
|
||||
IS_AREA_EFFECTIVE,
|
||||
CLASSIFY,
|
||||
ATTRIBUTE,
|
||||
LABLE,
|
||||
AREA_EFFECTIVE_IDS,
|
||||
function_id,
|
||||
do_log,
|
||||
user_region1,
|
||||
user_region2,
|
||||
user_region3,
|
||||
user_region4,
|
||||
user_region5
|
||||
)values (
|
||||
#{cfgDesc,jdbcType=VARCHAR},
|
||||
#{action,jdbcType=INTEGER},
|
||||
@@ -377,7 +388,12 @@
|
||||
#{lable,jdbcType=VARCHAR},
|
||||
#{areaEffectiveIds,jdbcType=VARCHAR},
|
||||
#{functionId,jdbcType=INTEGER},
|
||||
#{doLog,jdbcType=INTEGER}
|
||||
#{doLog,jdbcType=INTEGER},
|
||||
#{userRegion1,jdbcType=VARCHAR},
|
||||
#{userRegion2,jdbcType=VARCHAR},
|
||||
#{userRegion3,jdbcType=VARCHAR},
|
||||
#{userRegion4,jdbcType=VARCHAR},
|
||||
#{userRegion5,jdbcType=VARCHAR}
|
||||
)
|
||||
</insert>
|
||||
<!-- insert ip_port_cfg表信息 -->
|
||||
@@ -799,13 +815,8 @@
|
||||
cfg_region_code,
|
||||
expr_type,
|
||||
match_method,
|
||||
is_hexbin,
|
||||
user_region1,
|
||||
user_region2,
|
||||
user_region3,
|
||||
user_region4,
|
||||
user_region5
|
||||
)values (
|
||||
is_hexbin
|
||||
)values (
|
||||
#{cfgDesc,jdbcType=VARCHAR},
|
||||
#{action,jdbcType=INTEGER},
|
||||
0,
|
||||
@@ -830,12 +841,7 @@
|
||||
#{cfgRegionCode,jdbcType=INTEGER},
|
||||
#{exprType,jdbcType=INTEGER},
|
||||
#{matchMethod,jdbcType=INTEGER},
|
||||
#{isHexbin,jdbcType=INTEGER},
|
||||
#{userRegion1,jdbcType=VARCHAR},
|
||||
#{userRegion2,jdbcType=VARCHAR},
|
||||
#{userRegion3,jdbcType=VARCHAR},
|
||||
#{userRegion4,jdbcType=VARCHAR},
|
||||
#{userRegion5,jdbcType=VARCHAR}
|
||||
#{isHexbin,jdbcType=INTEGER}
|
||||
)
|
||||
</insert>
|
||||
|
||||
|
||||
@@ -597,11 +597,7 @@ public abstract class BaseService {
|
||||
if (baseIpCfg.getProtocolId() != null && baseIpCfg.getProtocolId() != 0) {
|
||||
if (numGroupId == 0) {
|
||||
GroupCfg group1 = new GroupCfg();
|
||||
if(baseIpCfg.getNumberRegionGroupId()!=null) {
|
||||
group1.setGroupId(baseIpCfg.getNumberRegionGroupId());
|
||||
}else {
|
||||
group1.setGroupId(ConfigServiceUtil.getId(2, 1).get(0));
|
||||
}
|
||||
group1.setGroupId(groupId);
|
||||
group1.setCompileId(baseIpCfg.getCompileId());
|
||||
group1.setAuditTime(baseIpCfg.getAuditTime());
|
||||
group1.setIsValid(baseIpCfg.getIsValid());
|
||||
@@ -1779,7 +1775,7 @@ public abstract class BaseService {
|
||||
logger.info("IP配置下发配置参数:"+json);
|
||||
//调用服务接口下发配置
|
||||
try {
|
||||
ToMaatResult result = ConfigServiceUtil.put(json, 2);
|
||||
ToMaatResult result = ConfigServiceUtil.postCallbackCfg(json);
|
||||
if(result!=null){
|
||||
logger.info("IP配置配置下发响应信息:"+result.getMsg());
|
||||
}
|
||||
|
||||
@@ -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