snat策略下发增加action、serivce、doLog.

This commit is contained in:
zhangwq
2018-12-03 13:38:32 +08:00
parent a01811e5bb
commit b8a8923a7e
7 changed files with 73 additions and 30 deletions

View File

@@ -7,7 +7,7 @@ public class IpAddrPool extends InlineIp{
@Expose
private Integer regionId;
@Expose
private Integer groupId;
private Long groupId;
@Expose
private Long addrPoolId;
@@ -19,11 +19,11 @@ public class IpAddrPool extends InlineIp{
this.regionId = regionId;
}
public Integer getGroupId() {
public Long getGroupId() {
return groupId;
}
public void setGroupId(Integer groupId) {
public void setGroupId(Long groupId) {
this.groupId = groupId;
}

View File

@@ -14,7 +14,6 @@ public interface IpMultiplexDao extends CrudDao<IpMultiplexDao>{
List<IpReusePolicyCfg> findPage(IpReusePolicyCfg entity);
List<IpReusePolicyCfg> findList(@Param("cfgId")Long cfgId
,@Param("isAudit")Integer isAudit
,@Param("isValid")Integer isValid);
void savePolicyCfg(IpReusePolicyCfg entity);

View File

@@ -9,6 +9,7 @@
<result column="user_id" property="userId" jdbcType="INTEGER"/>
<result column="user_type" property="userType" jdbcType="VARCHAR"/>
<result column="do_log" property="doLog" jdbcType="INTEGER" />
<result column="is_valid" property="isValid" jdbcType="INTEGER" />
<result column="is_audit" property="isAudit" jdbcType="INTEGER" />
<result column="cfg_region_code" property="cfgRegionCode" jdbcType="INTEGER" />
@@ -38,7 +39,7 @@
<sql id="policyColumns">
r.CFG_ID,r.CFG_DESC,r.ADDR_POOL_ID,r.USER_ID,r.USER_TYPE,
r.ACTION,r.IS_VALID,r.IS_AUDIT,r.CFG_REGION_CODE,r.CFG_TYPE,r.FUNCTION_ID,
r.ACTION,r.DO_LOG,r.IS_VALID,r.IS_AUDIT,r.CFG_REGION_CODE,r.CFG_TYPE,r.FUNCTION_ID,
r.SERVICE_ID,r.COMPILE_ID,r.REQUEST_ID,r.CLASSIFY,r.ATTRIBUTE,r.LABLE,
r.CREATOR_ID,r.CREATE_TIME,r.EDITOR_ID,r.EDIT_TIME,r.AUDITOR_ID,r.AUDIT_TIME,
r.CANCEL_REQUEST_ID,r.IS_AREA_EFFECTIVE,r.AREA_EFFECTIVE_IDS,
@@ -162,9 +163,6 @@
<if test="isValid ==null">
AND r.is_valid != -1
</if>
<if test="isAudit !=null">
AND r.is_audit = #{isAudit,jdbcType=INTEGER}
</if>
</where>
ORDER BY r.cfg_id
</select>
@@ -176,6 +174,7 @@
user_id,
user_type,
action,
do_log,
is_valid,
is_audit,
cfg_type,
@@ -206,6 +205,7 @@
#{userId,jdbcType=INTEGER},
#{userType,jdbcType=VARCHAR},
#{action,jdbcType=INTEGER},
#{doLog,jdbcType=INTEGER},
0,
0,
#{cfgType,jdbcType=VARCHAR},
@@ -261,6 +261,9 @@
<if test="userId != null" >
user_id = #{userId,jdbcType=INTEGER},
</if>
<if test="doLog != null" >
do_log = #{doLog,jdbcType=INTEGER},
</if>
<if test="isValid != null" >
is_valid = #{isValid,jdbcType=INTEGER},
</if>

View File

@@ -176,9 +176,9 @@ public class IpAddrPoolCfgService extends BaseService{
}
IpCfg c = cfgs.get(0);
ip.setRegionId(ipcfg.getCompileId());
//ip.setGroupId(ipcfg.getCompileId());
ip.setGroupId(cfg.getCfgId());
ip.setAddrType(ipcfg.getIpType());
ip.setSrcIp(c.getSrcIp());
ip.setMaskSrcIp(c.getSrcIpMask());
ip.setSrcPort(c.getSrcPort());
@@ -190,13 +190,12 @@ public class IpAddrPoolCfgService extends BaseService{
ip.setProtocol(ipcfg.getProtocol());
ip.setDirection(ipcfg.getDirection());
ip.setAddrPoolId(cfg.getCfgId());
ip.setIsValid(cfg.getIsValid());
ip.setAction(ipcfg.getAction());
ip.setService(ipcfg.getServiceId());
ip.setAddrPoolId(cfg.getCfgId());
ip.setOpTime(auditTime);
ip.setAreaEffectiveIds(cfg.getAreaEffectiveIds());//添加区域管控
ip.setOpTime(auditTime);
resStrategyList.add(ip);
}
//调用服务接口下发配置数据
@@ -224,7 +223,9 @@ public class IpAddrPoolCfgService extends BaseService{
}
IpCfg c = cfgs.get(0);
ip.setRegionId(ipcfg.getCompileId());
ip.setGroupId(cfg.getCfgId());
ip.setAddrType(ipcfg.getIpType());
ip.setSrcIp(c.getSrcIp());
ip.setMaskSrcIp(c.getSrcIpMask());
ip.setSrcPort(c.getSrcPort());
@@ -235,12 +236,13 @@ public class IpAddrPoolCfgService extends BaseService{
ip.setMaskDstPort(c.getDstPortMask());
ip.setProtocol(ipcfg.getProtocol());
ip.setDirection(ipcfg.getDirection());
ip.setAddrPoolId(cfg.getCfgId());
ip.setIsValid(cfg.getIsValid());
ip.setAction(ipcfg.getAction());
ip.setService(ipcfg.getServiceId());
ip.setAddrPoolId(cfg.getCfgId());
ip.setOpTime(auditTime);
ip.setAreaEffectiveIds(cfg.getAreaEffectiveIds());
ip.setOpTime(auditTime);
resStrategyList.add(ip);
}
//调用服务接口取消配置

View File

@@ -40,7 +40,7 @@ public class IpMultiplexService extends BaseService{
}
public IpReusePolicyCfg getPolicyCfg(Long cfgId, Integer isValid) {
List<IpReusePolicyCfg> list=ipMultiplexDao.findList(cfgId,isValid,null);
List<IpReusePolicyCfg> list=ipMultiplexDao.findList(cfgId,isValid);
IpReusePolicyCfg policyCfg=null;
if(list != null && list.size()>0){
policyCfg=list.get(0);
@@ -119,6 +119,7 @@ public class IpMultiplexService extends BaseService{
cfg.setIsAudit(isAudit);
cfg.setAuditorId(UserUtils.getUser().getId());
cfg.setAuditTime(auditTime);
cfg.setDoLog(null);;
ipMultiplexDao.updatePolicyCfg(cfg);
SysDictInfoService sysDictInfoService = SpringContextHolder.getBean(SysDictInfoService.class);
@@ -132,6 +133,9 @@ public class IpMultiplexService extends BaseService{
params.put("addrPoolId", cfg.getAddrPoolId());
params.put("userType", cfg.getUserType());
params.put("userId", cfg.getUserId());
params.put("doLog", cfg.getDoLog());
params.put("action", cfg.getAction());
params.put("service", cfg.getServiceId());
params.put("isValid", 1);
params.put("opTime", auditTime);
params.put("effectiveRange", areaEffectiveIds);
@@ -159,6 +163,9 @@ public class IpMultiplexService extends BaseService{
params.put("addrPoolId", cfg.getAddrPoolId());
params.put("userType", cfg.getUserType());
params.put("userId", cfg.getUserId());
params.put("doLog", cfg.getDoLog());
params.put("action", cfg.getAction());
params.put("service", cfg.getServiceId());
params.put("isValid", 0);
params.put("opTime", auditTime);
params.put("effectiveRange", areaEffectiveIds);

View File

@@ -84,20 +84,30 @@ $(function(){
</div>
</div>
</div>
<!-- dolog begin-->
<!-- <div class="row doLog"> -->
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="user"/></label>
<div class="col-md-6">
<select name="userId" class="selectpicker show-tick form-control required" data-live-search="true" data-live-search-placeholder="search">
<option value="" ><spring:message code="select"/></option>
<c:forEach items="${users }" var="user">
<option value="${user.id}" <c:if test="${_cfg.userId eq user.id }">selected</c:if>><spring:message code="${user.userName}"/></option>
<label class="control-label col-md-3"><spring:message code="do_log" /></label>
<c:forEach items="${fns:getDictList('DO_LOG') }" var="dict">
<c:choose>
<c:when test="${dict.itemCode eq _cfg.doLog}">
<label class="radio-inline">
<input type="radio" name="doLog" checked value="${dict.itemCode}" ><spring:message code="${dict.itemValue}"/>
</label>
</c:when>
<c:otherwise>
<label class="radio-inline">
<input type="radio" name="doLog" value="${dict.itemCode}" ><spring:message code="${dict.itemValue}"/>
</label>
</c:otherwise>
</c:choose>
</c:forEach>
</select>
</div>
<div for="userId"></div>
</div>
</div>
<!-- </div> -->
<!-- dolog end-->
<c:if test="${fn:length(serviceList)>1}">
<div class="col-md-6">
<div class="form-group">
@@ -128,6 +138,20 @@ $(function(){
</c:if>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="user"/></label>
<div class="col-md-6">
<select name="userId" class="selectpicker show-tick form-control required" data-live-search="true" data-live-search-placeholder="search">
<option value="" ><spring:message code="select"/></option>
<c:forEach items="${users }" var="user">
<option value="${user.id}" <c:if test="${_cfg.userId eq user.id }">selected</c:if>><spring:message code="${user.userName}"/></option>
</c:forEach>
</select>
</div>
<div for="userId"></div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="address_pool"/></label>

View File

@@ -293,6 +293,7 @@
<th class="sort-column a.action"><spring:message code="block_type"/></th>
<th class="sort-column a.is_valid"><spring:message code="valid_identifier"/></th>
<th><spring:message code="is_audit"/></th>
<th><spring:message code="do_log"/></th>
<%-- <th><spring:message code="whether_area_block"/></th> --%>
<th><spring:message code="letter"/></th>
<th><spring:message code="classification"/></th>
@@ -349,6 +350,13 @@
<c:when test="${indexCfg.isAudit eq '3'}"><span indexTable="${indexCfg.indexTable}" data-placement="right" data-original-title="<spring:message code='letter_cancel_info'/>: " class="label le-ca-fo label-warning tooltips" data-icon="&#xe01e;"> <spring:message code="cancel_approved"/></span></c:when>
</c:choose>
</td>
<td>
<c:forEach items="${fns:getDictList('DO_LOG') }" var="dict">
<c:if test="${dict.itemCode eq indexCfg.doLog }">
<spring:message code="${dict.itemValue }"/>
</c:if>
</c:forEach>
</td>
<%-- <td>
<c:if test="${indexCfg.isAreaEffective==0}"><spring:message code="all"/></c:if>
<c:if test="${indexCfg.isAreaEffective==1}">