1、修正网站、文件传输提交审核时区域IP列表为空的BUG;

2、修改HTTP的配置域标识,与服务接口端统一。

Signed-off-by: zhangwei <zhangwei@intranet.com>
This commit is contained in:
zhangwei
2018-06-11 17:47:44 +08:00
parent 80381c2eb2
commit d363b0595d
12 changed files with 52 additions and 34 deletions

View File

@@ -63,7 +63,14 @@ public class AreaIpCfg extends BaseIpCfg {
this.srcPort="0";
this.destPort="0";
this.direction=0;
this.destIpAddress="0.0.0.0";
if(this.ipType!=null && (this.ipType==4||this.ipType==46)){
this.destIpAddress="0.0.0.0";
}else if(this.ipType!=null && (this.ipType==6 || this.ipType==64)){
this.destIpAddress="::";
}else{
this.destIpAddress="0.0.0.0";
}
}
/**

View File

@@ -537,6 +537,8 @@ public class MaatCfg implements Serializable {
public void setAreaEffectiveIds(String areaEffectiveIds) {
if(StringUtils.isEmpty(areaEffectiveIds)){
areaEffectiveIds="0";
}else if(areaEffectiveIds.contains(":")){
areaEffectiveIds = areaEffectiveIds.replace(":", "");
}
this.areaEffectiveIds = areaEffectiveIds;
}

View File

@@ -82,63 +82,63 @@ public class SpecificServiceHostCfg extends BaseEntity<SpecificServiceHostCfg>{
public void setSpecServiceId(Integer specServiceId) {
this.specServiceId = specServiceId;
}
@ExcelField(title="ip_type",align=2,sort=20)
@ExcelField(title="ip_type",align=2,sort=20,fieldType=Integer.class)
public Integer getIpType() {
return ipType;
}
public void setIpType(Integer ipType) {
this.ipType = ipType;
}
@ExcelField(title="client_ip",align=2,sort=30)
@ExcelField(title="client_ip",align=2,sort=30,fieldType=String.class)
public String getSrcIp() {
return srcIp;
}
public void setSrcIp(String srcIp) {
this.srcIp = srcIp;
}
@ExcelField(title="client_address_mask",align=2,sort=40)
@ExcelField(title="client_address_mask",align=2,sort=40,fieldType=String.class)
public String getSrcIpMask() {
return srcIpMask;
}
public void setSrcIpMask(String srcIpMask) {
this.srcIpMask = srcIpMask;
}
@ExcelField(title="client_port",align=2,sort=50)
@ExcelField(title="client_port",align=2,sort=50,fieldType=String.class)
public String getSrcPort() {
return srcPort;
}
public void setSrcPort(String srcPort) {
this.srcPort = srcPort;
}
@ExcelField(title="client_port_mask",align=2,sort=60)
@ExcelField(title="client_port_mask",align=2,sort=60,fieldType=String.class)
public String getSrcPortMask() {
return srcPortMask;
}
public void setSrcPortMask(String srcPortMask) {
this.srcPortMask = srcPortMask;
}
@ExcelField(title="server_ip",align=2,sort=70)
@ExcelField(title="server_ip",align=2,sort=70,fieldType=String.class)
public String getDstIp() {
return dstIp;
}
public void setDstIp(String dstIp) {
this.dstIp = dstIp;
}
@ExcelField(title="server_address_mask",align=2,sort=80)
@ExcelField(title="server_address_mask",align=2,sort=80,fieldType=String.class)
public String getDstIpMask() {
return dstIpMask;
}
public void setDstIpMask(String dstIpMask) {
this.dstIpMask = dstIpMask;
}
@ExcelField(title="server_port",align=2,sort=90)
@ExcelField(title="server_port",align=2,sort=90,fieldType=String.class)
public String getDstPort() {
return dstPort;
}
public void setDstPort(String dstPort) {
this.dstPort = dstPort;
}
@ExcelField(title="server_port_mask",align=2,sort=100)
@ExcelField(title="server_port_mask",align=2,sort=100,fieldType=String.class)
public String getDstPortMask() {
return dstPortMask;
}
@@ -159,7 +159,7 @@ public class SpecificServiceHostCfg extends BaseEntity<SpecificServiceHostCfg>{
public void setProtocol(Integer protocol) {
this.protocol = protocol;
}
@ExcelField(title="valid_identifier",type=1,align=2,sort=130)
@ExcelField(title="valid_identifier",type=1,align=2,sort=130,fieldType=Integer.class)
public Integer getIsValid() {
return isValid;
}

View File

@@ -191,7 +191,7 @@ public class SpecificServiceHostCfgController extends BaseController {
if(errorInfos!=null && errorInfos.size()>0){
addMessage(redirectAttributes, msgProp.getProperty("import_failed")+errorInfos);
}else{
addMessage(redirectAttributes, "success");
addMessage(redirectAttributes, "import_success");
}
return "redirect:"+adminPath+"/specific/specificServiceHostCfg/list";
// return renderString(response,errorInfos);

View File

@@ -29,7 +29,7 @@ public interface FileTransferCfgDao extends CrudDao<CfgIndexInfo> {
public void saveFtpKeywordCfg(BaseStringCfg entity);
public void deleteFtpIpCfg(CfgIndexInfo entity);
public void deleteFtpKeywordCfg(CfgIndexInfo entity);
public void deleteFtpFileDigestCfg(CfgIndexInfo entity);
public void deleteFileDigestCfg(CfgIndexInfo entity);
public void updateCfgIndex(CfgIndexInfo entity);
public void updateCfgValid(BaseCfg entity);
public void auditCfg(BaseCfg entity);

View File

@@ -329,12 +329,12 @@
<select id="getHttpReqBodyList" resultMap="stringCfgMap" parameterType="com.nis.domain.configuration.CfgIndexInfo">
SELECT
<include refid="StrCfg_Column" />
FROM http_body_cfg a where compile_id=#{compileId} and cfg_type='http_req_body' and function_id=#{functionId}
FROM http_body_cfg a where compile_id=#{compileId} and cfg_type=#{cfgType} and function_id=#{functionId}
</select>
<select id="getHttpResBodyList" resultMap="stringCfgMap" parameterType="com.nis.domain.configuration.CfgIndexInfo">
SELECT
<include refid="StrCfg_Column" />
FROM http_body_cfg a where compile_id=#{compileId} and cfg_type='http_res_body' and function_id=#{functionId}
FROM http_body_cfg a where compile_id=#{compileId} and cfg_type=#{cfgType} and function_id=#{functionId}
</select>
<select id="getHttpReqHdrList" resultMap="complexCfgMap" parameterType="com.nis.domain.configuration.CfgIndexInfo">
SELECT

View File

@@ -124,7 +124,7 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
//无效子配置后,再新增子配置
fileTransferCfgDao.deleteFtpIpCfg(entity);
fileTransferCfgDao.deleteFtpKeywordCfg(entity);
fileTransferCfgDao.deleteFtpFileDigestCfg(entity);
fileTransferCfgDao.deleteFileDigestCfg(entity);
AreaIpCfg area = new AreaIpCfg();
area.setCompileId(entity.getCompileId());
area.setFunctionId(entity.getFunctionId());
@@ -246,13 +246,14 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
}
}
//保存区域IP信息
if(entity.getAreaCfg()!=null && entity.getAreaCfg().size()>0){
List<AreaIpCfg> areaIpCfgList=areaIpCfgDao.getByCompileId(entity.getCompileId());
if(!StringUtil.isEmpty(areaIpCfgList)){
AreaIpCfg cfg = new AreaIpCfg();
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
cfg.setTableName(AreaIpCfg.getTablename());
fileTransferCfgDao.auditCfg(cfg);
if(isAudit==1){
Map<String,List> map = cfgConvert(areaIpRegionList,entity.getAreaCfg(),1,entity,groupRelationList);
Map<String,List> map = cfgConvert(areaIpRegionList,areaIpCfgList,1,entity,groupRelationList);
groupRelationList=map.get("groupList");
areaIpRegionList=map.get("dstList");
}

View File

@@ -46,6 +46,7 @@ import com.nis.exceptions.MaatConvertException;
import com.nis.util.ConfigServiceUtil;
import com.nis.util.Constants;
import com.nis.util.IpUtil;
import com.nis.util.StringUtil;
import com.nis.web.dao.configuration.AreaIpCfgDao;
import com.nis.web.dao.configuration.IpCfgDao;
import com.nis.web.dao.configuration.StringCfgDao;
@@ -72,7 +73,9 @@ public class WebsiteCfgService extends CrudService<WebsiteCfgDao,CfgIndexInfo> {
List<HttpUrlCfg> httpUrlList = websiteCfgDao.getHttpUrlList(entity);
List<HttpReqHeadCfg> httpReqHdrList = websiteCfgDao.getHttpReqHdrList(entity);
List<HttpResHeadCfg> httpResHdrList = websiteCfgDao.getHttpResHdrList(entity);
entity.setCfgType(Constants.HTTP_REQ_BODY_REGION);
List<HttpBodyCfg> httpReqBodyList = websiteCfgDao.getHttpReqBodyList(entity);
entity.setCfgType(Constants.HTTP_RES_BODY_REGION);
List<HttpBodyCfg> httpResBodyList = websiteCfgDao.getHttpResBodyList(entity);
entity.setIpPortList(ipPortList);
entity.setHttpReqBodyList(httpReqBodyList);
@@ -163,7 +166,8 @@ public class WebsiteCfgService extends CrudService<WebsiteCfgDao,CfgIndexInfo> {
}
}
//保存区域IP信息
if(entity.getAreaCfg()!=null){
List<AreaIpCfg> areaIpCfgList=areaIpCfgDao.getByCompileId(entity.getCompileId());
if(!StringUtil.isEmpty(areaIpCfgList)){
for(AreaIpCfg cfg:entity.getAreaCfg()){
cfg.initDefaultValue();
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
@@ -381,13 +385,14 @@ public class WebsiteCfgService extends CrudService<WebsiteCfgDao,CfgIndexInfo> {
}
}
//保存区域IP信息
if(entity.getAreaCfg()!=null && entity.getAreaCfg().size()>0){
List<AreaIpCfg> areaIpCfgList=areaIpCfgDao.getByCompileId(entity.getCompileId());
if(!StringUtil.isEmpty(areaIpCfgList)){
AreaIpCfg cfg = new AreaIpCfg();
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
cfg.setTableName(AreaIpCfg.getTablename());
websiteCfgDao.auditCfg(cfg);
if(isAudit==1){
Map<String,List> map = cfgConvert(areaIpRegionList,entity.getAreaCfg(),1,entity,groupRelationList);
Map<String,List> map = cfgConvert(areaIpRegionList,areaIpCfgList,1,entity,groupRelationList);
groupRelationList=map.get("groupList");
areaIpRegionList=map.get("dstList");
}
@@ -596,13 +601,14 @@ public class WebsiteCfgService extends CrudService<WebsiteCfgDao,CfgIndexInfo> {
}
}
//保存区域IP信息
if(entity.getAreaCfg()!=null && entity.getAreaCfg().size()>0){
List<AreaIpCfg> areaIpCfgList=areaIpCfgDao.getByCompileId(entity.getCompileId());
if(!StringUtil.isEmpty(areaIpCfgList)){
AreaIpCfg cfg = new AreaIpCfg();
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
cfg.setTableName(AreaIpCfg.getTablename());
websiteCfgDao.auditCfg(cfg);
if(isAudit==1){
Map<String,List> map = cfgConvert(areaIpRegionList,entity.getAreaCfg(),1,entity,groupRelationList);
Map<String,List> map = cfgConvert(areaIpRegionList,areaIpCfgList,1,entity,groupRelationList);
groupRelationList=map.get("groupList");
areaIpRegionList=map.get("dstList");
}
@@ -835,13 +841,14 @@ public class WebsiteCfgService extends CrudService<WebsiteCfgDao,CfgIndexInfo> {
}
}
//保存区域IP信息
if(entity.getAreaCfg()!=null && entity.getAreaCfg().size()>0){
List<AreaIpCfg> areaIpCfgList=areaIpCfgDao.getByCompileId(entity.getCompileId());
if(!StringUtil.isEmpty(areaIpCfgList)){
AreaIpCfg cfg = new AreaIpCfg();
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
cfg.setTableName(AreaIpCfg.getTablename());
websiteCfgDao.auditCfg(cfg);
if(isAudit==1){
Map<String,List> map = cfgConvert(areaIpRegionList,entity.getAreaCfg(),1,entity,groupRelationList);
Map<String,List> map = cfgConvert(areaIpRegionList,areaIpCfgList,1,entity,groupRelationList);
groupRelationList=map.get("groupList");
areaIpRegionList=map.get("dstList");
}

View File

@@ -267,9 +267,9 @@ area_region=NTC_IP_RANGE
protocol_num_region=NTC_UNIVERSAL_PROTO_TYPE
http_ip_region=http_ip
http_req_hdr_region=http_req_hdr
http_req_body_region=http_req_body
http_req_body_region=NTC_HTTP_REQ_BODY
http_res_hdr_region=http_res_hdr
http_res_body_region=http_res_body
http_res_body_region=NTC_HTTP_RES_BODY
http_url_region=http_url
voip_ip=av_voip_ip
voip_account=av_voip_account

View File

@@ -38,7 +38,8 @@
<a id="uploadSrc" class="btn btn-default btn-search" href="javascript:" style=""><i class="fa fa-search"></i></a>
</div>
</div>
<input id="rawLen" name="rawLen" type="hidden" value="${digestCfg.rawLen }"/>
<input id="rawLen" name="${cfgName}.rawLen" type="hidden" value="${digestCfg.rawLen }"/>
<input id="digest" name="${cfgName}.digest" type="hidden" value="${digestCfg.digest }"/>
</div>
<div for="fileInfo"></div>
</div>

View File

@@ -233,7 +233,7 @@
</c:if>
<c:if test="${region.regionType eq 2 }">
<c:if test="${region.configRegionValue eq 'http_url' }">
<c:if test="${region.configRegionValue eq 'NTC_HTTP_URL' }">
<!--url info-->
<div class="httpReqCfg">
<c:set var="tabName" value="httpUrlTab"></c:set>
@@ -256,7 +256,7 @@
</div>
<!--/url info-->
</c:if>
<c:if test="${region.configRegionValue eq 'http_req_body' }">
<c:if test="${region.configRegionValue eq 'NTC_HTTP_REQ_BODY' }">
<!--request body info-->
<div class="httpReqCfg">
<c:set var="tabName" value="httpReqBodyTab"></c:set>
@@ -278,7 +278,7 @@
</div>
<!--/request body info-->
</c:if>
<c:if test="${region.configRegionValue eq 'http_res_body' }">
<c:if test="${region.configRegionValue eq 'NTC_HTTP_RES_BODY' }">
<!--response body info-->
<div class="httpResCfg">
<c:set var="tabName" value="httpResBodyTab"></c:set>
@@ -301,7 +301,7 @@
</c:if>
</c:if>
<c:if test="${region.regionType eq 3 }">
<c:if test="${region.configRegionValue eq 'http_req_hdr' }">
<c:if test="${region.configRegionValue eq 'NTC_HTTP_REQ_HDR' }">
<!--request header info-->
<div class="httpReqCfg">
<c:set var="tabName" value="httpReqHdrTab"></c:set>
@@ -323,7 +323,7 @@
</div>
<!--/request header info-->
</c:if>
<c:if test="${region.configRegionValue eq 'http_res_hdr' }">
<c:if test="${region.configRegionValue eq 'NTC_HTTP_RES_HDR' }">
<!--response header info-->
<div class="httpResCfg">
<c:set var="tabName" value="httpResHdrTab"></c:set>

View File

@@ -35,7 +35,7 @@
<c:if test="${fn:length(_cfg.httpReqBodyList)>0}">
<div id="reqBodyTitle${index}" onclick="switchSubCfgTabInfo('reqBody',${index})"
class="col-md-1 tabInfo" name="tabTitle${index }">
<spring:message code='http_req_hdr_title' />
<spring:message code='http_req_body_title' />
<i id="reqBody${index}" class="fa" name="tabFlag${index}"></i>
</div>
</c:if>