P2P配置自定义域保存于cfg_index_info表以及修改改动涉及功能.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -55,14 +55,14 @@
|
||||
<div class="form-group">
|
||||
<label class="control-label col-md-3"><spring:message code="p2p_hash_type"/></label>
|
||||
<div class="col-md-6">
|
||||
<select name="userRegion2" class="selectpicker show-tick form-control">
|
||||
<select name="userRegion1" class="selectpicker show-tick form-control">
|
||||
<option value=""><spring:message code="select"/></option>
|
||||
<c:forEach items="${fns:getDictList('P2P_HASH_TYPE')}" var="hashType">
|
||||
<option value="${hashType.itemCode}" <c:if test="${cfg.userRegion1==hashType.itemCode}">selected</c:if> ><spring:message code="${hashType.itemValue}"/></option>
|
||||
<option value="${hashType.itemCode}" <c:if test="${_cfg.userRegion1==hashType.itemCode}">selected</c:if> ><spring:message code="${hashType.itemValue}"/></option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</div>
|
||||
<div for="userRegion2"></div>
|
||||
<div for="userRegion1"></div>
|
||||
</div>
|
||||
</div>
|
||||
</c:if>
|
||||
|
||||
@@ -112,7 +112,7 @@
|
||||
<label><spring:message code='p2p_ip_config_type'/>:</label>
|
||||
<label>
|
||||
<c:forEach items="${fns:getDictList('P2P_IP_TYPE')}" var="ipType">
|
||||
<c:if test="${_cfg.ipPortList[0].userRegion1==ipType.itemCode}"><spring:message code="${ipType.itemValue}"/></c:if>
|
||||
<c:if test="${_cfg.userRegion2==ipType.itemCode}"><spring:message code="${ipType.itemValue}"/></c:if>
|
||||
</c:forEach>
|
||||
</label>
|
||||
</div>
|
||||
@@ -139,7 +139,7 @@
|
||||
<div class="form-group">
|
||||
<label><spring:message code='p2p_hash_type' />:</label><label>
|
||||
<c:forEach items="${fns:getDictList('P2P_HASH_TYPE')}" var="hashType">
|
||||
<c:if test="${_cfg.p2pHashList[0].userRegion1==hashType.itemCode}"><spring:message code="${hashType.itemValue}"/></c:if>
|
||||
<c:if test="${_cfg.userRegion1==hashType.itemCode}"><spring:message code="${hashType.itemValue}"/></c:if>
|
||||
</c:forEach>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
@@ -38,14 +38,14 @@
|
||||
<div class="form-group">
|
||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="p2p_ip_config_type"/></label>
|
||||
<div class="col-md-6">
|
||||
<select name=userRegion1 class="selectpicker show-tick form-control required">
|
||||
<select name="userRegion2" class="selectpicker show-tick form-control required">
|
||||
<option value=""><spring:message code="select"/></option>
|
||||
<c:forEach items="${fns:getDictList('P2P_IP_TYPE')}" var="ipType">
|
||||
<option value="${ipType.itemCode}" <c:if test="${_cfg.ipPortList[0].userRegion1==ipType.itemCode}">selected</c:if> ><spring:message code="${ipType.itemValue}"/></option>
|
||||
<option value="${ipType.itemCode}" <c:if test="${_cfg.userRegion2==ipType.itemCode}">selected</c:if> ><spring:message code="${ipType.itemValue}"/></option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</div>
|
||||
<div for="userRegion1"></div>
|
||||
<div for="userRegion2"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user