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);