SNAT地址池管理提交.
This commit is contained in:
37
src/main/java/com/nis/domain/callback/IpAddrPool.java
Normal file
37
src/main/java/com/nis/domain/callback/IpAddrPool.java
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
package com.nis.domain.callback;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.Expose;
|
||||||
|
|
||||||
|
public class IpAddrPool extends InlineIp{
|
||||||
|
|
||||||
|
@Expose
|
||||||
|
private Integer regionId;
|
||||||
|
@Expose
|
||||||
|
private Integer groupId;
|
||||||
|
@Expose
|
||||||
|
private Integer addrPoolId;
|
||||||
|
|
||||||
|
public Integer getRegionId() {
|
||||||
|
return regionId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRegionId(Integer regionId) {
|
||||||
|
this.regionId = regionId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getGroupId() {
|
||||||
|
return groupId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGroupId(Integer groupId) {
|
||||||
|
this.groupId = groupId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getAddrPoolId() {
|
||||||
|
return addrPoolId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAddrPoolId(Integer addrPoolId) {
|
||||||
|
this.addrPoolId = addrPoolId;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,78 @@
|
|||||||
|
package com.nis.domain.configuration;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* IP复用地址池实体
|
||||||
|
* @author dell
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class IpAddrPoolCfg extends BaseCfg<IpAddrPoolCfg>{
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1392197458744667669L;
|
||||||
|
private String indexTable="ip_reuse_addr_pool";
|
||||||
|
|
||||||
|
private Integer addrPoolId; // 地址池ID
|
||||||
|
private String addrPoolName; // 地址池名称
|
||||||
|
private Integer ipTotal; // IP总数
|
||||||
|
private Integer availableIpTotal; // 可用IP总数
|
||||||
|
private String description; // 描述信息
|
||||||
|
|
||||||
|
private List<BaseIpCfg> ipCfgs; // 地址池IP信息
|
||||||
|
|
||||||
|
@SerializedName("cfgId")
|
||||||
|
private Integer compileId;
|
||||||
|
|
||||||
|
public String getIndexTable() {
|
||||||
|
return indexTable;
|
||||||
|
}
|
||||||
|
public void setIndexTable(String indexTable) {
|
||||||
|
this.indexTable = indexTable;
|
||||||
|
}
|
||||||
|
public Integer getAddrPoolId() {
|
||||||
|
return addrPoolId;
|
||||||
|
}
|
||||||
|
public void setAddrPoolId(Integer addrPoolId) {
|
||||||
|
this.addrPoolId = addrPoolId;
|
||||||
|
}
|
||||||
|
public String getAddrPoolName() {
|
||||||
|
return addrPoolName;
|
||||||
|
}
|
||||||
|
public void setAddrPoolName(String addrPoolName) {
|
||||||
|
this.addrPoolName = addrPoolName;
|
||||||
|
}
|
||||||
|
public Integer getIpTotal() {
|
||||||
|
return ipTotal;
|
||||||
|
}
|
||||||
|
public void setIpTotal(Integer ipTotal) {
|
||||||
|
this.ipTotal = ipTotal;
|
||||||
|
}
|
||||||
|
public Integer getAvailableIpTotal() {
|
||||||
|
return availableIpTotal;
|
||||||
|
}
|
||||||
|
public void setAvailableIpTotal(Integer availableIpTotal) {
|
||||||
|
this.availableIpTotal = availableIpTotal;
|
||||||
|
}
|
||||||
|
public String getDescription() {
|
||||||
|
return description;
|
||||||
|
}
|
||||||
|
public void setDescription(String description) {
|
||||||
|
this.description = description;
|
||||||
|
}
|
||||||
|
public List<BaseIpCfg> getIpCfgs() {
|
||||||
|
return ipCfgs;
|
||||||
|
}
|
||||||
|
public void setIpCfgs(List<BaseIpCfg> ipCfgs) {
|
||||||
|
this.ipCfgs = ipCfgs;
|
||||||
|
}
|
||||||
|
public Integer getCompileId() {
|
||||||
|
return compileId;
|
||||||
|
}
|
||||||
|
public void setCompileId(Integer compileId) {
|
||||||
|
this.compileId = compileId;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,163 @@
|
|||||||
|
package com.nis.web.controller.configuration.maintenance;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.ui.Model;
|
||||||
|
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||||
|
|
||||||
|
import com.nis.domain.Page;
|
||||||
|
import com.nis.domain.basics.PolicyGroupInfo;
|
||||||
|
import com.nis.domain.configuration.IpAddrPoolCfg;
|
||||||
|
import com.nis.domain.configuration.IpMultiplexPoolCfg;
|
||||||
|
import com.nis.exceptions.MaatConvertException;
|
||||||
|
import com.nis.util.StringUtil;
|
||||||
|
import com.nis.web.controller.BaseController;
|
||||||
|
import com.nis.web.service.configuration.IpAddrPoolCfgService;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* IP复用地址池配置
|
||||||
|
* @author dell
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("${adminPath}/maintenance/ipMultiplexPoolCfg")
|
||||||
|
public class IpAddrPoolController extends BaseController{
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IpAddrPoolCfgService ipAddrPoolCfgService;
|
||||||
|
|
||||||
|
@RequestMapping(value = {"/snatlist"})
|
||||||
|
public String snatlist(Model model,HttpServletRequest request,HttpServletResponse response,
|
||||||
|
@ModelAttribute("cfg")IpAddrPoolCfg entity){
|
||||||
|
Page<IpAddrPoolCfg> page = ipAddrPoolCfgService.findPage(new Page<IpAddrPoolCfg>(request, response,"r"), entity);
|
||||||
|
model.addAttribute("page", page);
|
||||||
|
initFormCondition(model,entity);
|
||||||
|
return "/cfg/maintenance/ipMultiplexPool/snatlist2";
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping(value = {"/snatform"})
|
||||||
|
@RequiresPermissions(value={"ip:mulitiplex:pool:config"})
|
||||||
|
public String snatfrom(Model model, String ids, HttpServletRequest request, HttpServletResponse response,
|
||||||
|
@ModelAttribute("cfg")IpAddrPoolCfg cfg){
|
||||||
|
if(cfg == null){
|
||||||
|
cfg=new IpAddrPoolCfg();
|
||||||
|
}
|
||||||
|
if(!StringUtil.isEmpty(ids)){
|
||||||
|
cfg = ipAddrPoolCfgService.getIpAddrPoolCfg(Long.valueOf(ids),null);
|
||||||
|
PolicyGroupInfo groupInfo = policyGroupInfoService.getById(cfg.getAddrPoolId());
|
||||||
|
cfg.setAddrPoolName(groupInfo.getGroupName());
|
||||||
|
initUpdateFormCondition(model, cfg);
|
||||||
|
}else{
|
||||||
|
initFormCondition(model, cfg);
|
||||||
|
}
|
||||||
|
|
||||||
|
model.addAttribute("_cfg", cfg);
|
||||||
|
return "/cfg/maintenance/ipMultiplexPool/snatform2";
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping(value = {"/snatSaveOrUpdate"})
|
||||||
|
@RequiresPermissions(value={"ip:mulitiplex:pool:config"})
|
||||||
|
public String snatSaveOrUpdate(Model model,HttpServletRequest request,HttpServletResponse response,RedirectAttributes redirectAttributes,
|
||||||
|
@ModelAttribute("cfg")IpAddrPoolCfg cfg){
|
||||||
|
try{
|
||||||
|
// 保存地址池信息 -> policy_group_info
|
||||||
|
PolicyGroupInfo entity = new PolicyGroupInfo();
|
||||||
|
if(cfg.getAddrPoolId() != null){
|
||||||
|
entity.setGroupId(cfg.getAddrPoolId());
|
||||||
|
}
|
||||||
|
entity.setGroupType(2);
|
||||||
|
entity.setGroupName(cfg.getAddrPoolName());
|
||||||
|
entity.setDescription(cfg.getDescription());
|
||||||
|
policyGroupInfoService.saveOrUpdate(entity);
|
||||||
|
cfg.setAddrPoolId(policyGroupInfoService.getGroupIdByGroupName(cfg.getAddrPoolName()));
|
||||||
|
|
||||||
|
ipAddrPoolCfgService.saveOrUpdate(cfg, request, response);
|
||||||
|
addMessage(redirectAttributes,"success","save_success");
|
||||||
|
}catch(Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
if(e instanceof MaatConvertException) {
|
||||||
|
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||||
|
}else {
|
||||||
|
addMessage(redirectAttributes,"error", "save_failed");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return "redirect:" + adminPath +"/maintenance/ipMultiplexPoolCfg/snatlist?functionId="+cfg.getFunctionId();
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping(value = {"/snatAudit"})
|
||||||
|
@RequiresPermissions(value={"ip:mulitiplex:pool:confirm"})
|
||||||
|
public String snataudit(Integer isAudit,Integer isValid,String ids,Integer functionId,RedirectAttributes redirectAttributes) {
|
||||||
|
if(!StringUtil.isEmpty(ids)){
|
||||||
|
String[] idArray = ids.split(",");
|
||||||
|
Date auditTime=new Date();
|
||||||
|
for(String id :idArray){
|
||||||
|
try {
|
||||||
|
ipAddrPoolCfgService.audit(isAudit,isValid,functionId,id,auditTime);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
logger.error("SNAT地址池配置下发失败:"+e.getMessage());
|
||||||
|
if(e instanceof MaatConvertException) {
|
||||||
|
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||||
|
}else {
|
||||||
|
addMessage(redirectAttributes,"error", "audit_failed");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
return "redirect:" + adminPath +"/maintenance/ipMultiplexPoolCfg/snatlist?functionId="+functionId;
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping(value = {"/snatDelete"})
|
||||||
|
@RequiresPermissions(value={"ip:mulitiplex:pool:config"})
|
||||||
|
public String snatdelete(Integer isAudit,Integer isValid,String ids,Integer functionId,Model model,RedirectAttributes redirectAttributes
|
||||||
|
,HttpServletRequest request,HttpServletResponse response){
|
||||||
|
try{
|
||||||
|
if(!StringUtil.isEmpty(ids)){
|
||||||
|
// ?未被任何策略引用的地址池可删除
|
||||||
|
ipAddrPoolCfgService.delete(isAudit,isValid,ids,functionId);
|
||||||
|
}
|
||||||
|
addMessage(redirectAttributes,"success","delete_success");
|
||||||
|
}catch(Exception e){
|
||||||
|
logger.error(e);
|
||||||
|
addMessage(redirectAttributes,"error","delete_failed");
|
||||||
|
}
|
||||||
|
return "redirect:" + adminPath +"/maintenance/ipMultiplexPoolCfg/snatlist?functionId="+functionId;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验地址池
|
||||||
|
* @param cfg
|
||||||
|
* @param request
|
||||||
|
* @param response
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ResponseBody
|
||||||
|
@RequestMapping(value = {"/checkAddrPool"})
|
||||||
|
public boolean checkAddrPool(IpAddrPoolCfg cfg, HttpServletRequest request, HttpServletResponse response){
|
||||||
|
// 修改
|
||||||
|
if(!StringUtil.isEmpty(cfg.getCfgId())){
|
||||||
|
IpAddrPoolCfg poolCfg = ipAddrPoolCfgService.getCfgInfo(cfg);
|
||||||
|
if(poolCfg != null && poolCfg.getAddrPoolName().equals(cfg.getAddrPoolName())){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
cfg.setCfgId(null);
|
||||||
|
IpAddrPoolCfg poolCfg = ipAddrPoolCfgService.getCfgInfo(cfg);
|
||||||
|
if(poolCfg != null){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -142,7 +142,7 @@ public class IpMultiplexPoolCfgController extends BaseController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = {"/snatlist"})
|
/*@RequestMapping(value = {"/snatlist"})
|
||||||
public String snatlist(Model model,HttpServletRequest request,HttpServletResponse response,@ModelAttribute("cfg")IpMultiplexPoolCfg entity){
|
public String snatlist(Model model,HttpServletRequest request,HttpServletResponse response,@ModelAttribute("cfg")IpMultiplexPoolCfg entity){
|
||||||
//查询时left join policyGroup
|
//查询时left join policyGroup
|
||||||
Page<IpMultiplexPoolCfg> page = ipMultiplexPoolCfgService.findPage(new Page<IpMultiplexPoolCfg>(request, response,"r"), entity);
|
Page<IpMultiplexPoolCfg> page = ipMultiplexPoolCfgService.findPage(new Page<IpMultiplexPoolCfg>(request, response,"r"), entity);
|
||||||
@@ -236,7 +236,7 @@ public class IpMultiplexPoolCfgController extends BaseController {
|
|||||||
addMessage(redirectAttributes,"error","delete_failed");
|
addMessage(redirectAttributes,"error","delete_failed");
|
||||||
}
|
}
|
||||||
return "redirect:" + adminPath +"/maintenance/ipMultiplexPoolCfg/snatlist?functionId="+functionId;
|
return "redirect:" + adminPath +"/maintenance/ipMultiplexPoolCfg/snatlist?functionId="+functionId;
|
||||||
}
|
}*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验IP是否已存在
|
* 校验IP是否已存在
|
||||||
|
|||||||
@@ -20,4 +20,7 @@ public interface PolicyGroupInfoDao extends CrudDao<PolicyGroupInfo> {
|
|||||||
PolicyGroupInfo getInfoByAsnNo(PolicyGroupInfo policyGroupInfo);
|
PolicyGroupInfo getInfoByAsnNo(PolicyGroupInfo policyGroupInfo);
|
||||||
List<PolicyGroupInfo> getHasAreaPolicyGroups(int groupType);
|
List<PolicyGroupInfo> getHasAreaPolicyGroups(int groupType);
|
||||||
int insertBatch(List<PolicyGroupInfo> list);
|
int insertBatch(List<PolicyGroupInfo> list);
|
||||||
|
|
||||||
|
Integer getGroupIdByGroupName(String groupName);
|
||||||
|
PolicyGroupInfo getGroupInfo(PolicyGroupInfo policyGroupInfo);
|
||||||
}
|
}
|
||||||
@@ -213,4 +213,37 @@
|
|||||||
SELECT ga.group_id FROM group_area_info ga WHERE ga.is_valid != -1
|
SELECT ga.group_id FROM group_area_info ga WHERE ga.is_valid != -1
|
||||||
)
|
)
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getGroupIdByGroupName" resultType="java.lang.Integer">
|
||||||
|
SELECT
|
||||||
|
r.group_id
|
||||||
|
FROM
|
||||||
|
policy_group_info r
|
||||||
|
WHERE
|
||||||
|
r.group_name = #{groupName}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getGroupInfo" resultType="com.nis.domain.basics.PolicyGroupInfo">
|
||||||
|
SELECT
|
||||||
|
<include refid="PolicyGroupInfoColumns"/>
|
||||||
|
FROM
|
||||||
|
policy_group_info r
|
||||||
|
<trim prefix="WHERE" prefixOverrides="AND |OR ">
|
||||||
|
<if test="groupName != null and groupName != ''" >
|
||||||
|
AND group_name = #{groupName,jdbcType=VARCHAR}
|
||||||
|
</if>
|
||||||
|
<if test="groupType != null" >
|
||||||
|
AND group_type = #{groupType,jdbcType=INTEGER}
|
||||||
|
</if>
|
||||||
|
<if test="asnNo != null" >
|
||||||
|
AND asn_no = #{asnNo,jdbcType=INTEGER}
|
||||||
|
</if>
|
||||||
|
<if test="isValid != null" >
|
||||||
|
AND is_valid = #{isValid,jdbcType=INTEGER}
|
||||||
|
</if>
|
||||||
|
<if test="isValid == null" >
|
||||||
|
AND is_valid != -1
|
||||||
|
</if>
|
||||||
|
</trim>
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
package com.nis.web.dao.configuration;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import com.nis.domain.configuration.BaseIpCfg;
|
||||||
|
import com.nis.domain.configuration.IpAddrPoolCfg;
|
||||||
|
import com.nis.web.dao.CrudDao;
|
||||||
|
import com.nis.web.dao.MyBatisDao;
|
||||||
|
|
||||||
|
@MyBatisDao
|
||||||
|
public interface IpAddrPoolCfgDao extends CrudDao<IpAddrPoolCfgDao>{
|
||||||
|
|
||||||
|
List<IpAddrPoolCfg> findPage(IpAddrPoolCfg entity);
|
||||||
|
|
||||||
|
List<IpAddrPoolCfg> findList(@Param("cfgId")Long cfgId
|
||||||
|
,@Param("isAudit")Integer isAudit
|
||||||
|
,@Param("isValid")Integer isValid);
|
||||||
|
|
||||||
|
|
||||||
|
void saveAddrPoolCfg(IpAddrPoolCfg cfg);
|
||||||
|
|
||||||
|
void updateAddrPoolCfg(IpAddrPoolCfg entity);
|
||||||
|
|
||||||
|
void saveReuseIpCfgs(BaseIpCfg ipCfg);
|
||||||
|
|
||||||
|
List<BaseIpCfg> getReuseIpCfgs(@Param("addrPoolId")Integer addrPoolId);
|
||||||
|
|
||||||
|
void deleteReuseIpCfgs(@Param("addrPoolId")Integer addrPoolId);
|
||||||
|
|
||||||
|
Integer getAddrPoolId(@Param("cfgId")Long cfgId);
|
||||||
|
|
||||||
|
IpAddrPoolCfg getCfgInfo(IpAddrPoolCfg cfg);
|
||||||
|
|
||||||
|
}
|
||||||
442
src/main/java/com/nis/web/dao/configuration/IpAddrPoolCfgDao.xml
Normal file
442
src/main/java/com/nis/web/dao/configuration/IpAddrPoolCfgDao.xml
Normal file
@@ -0,0 +1,442 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||||
|
<mapper namespace="com.nis.web.dao.configuration.IpAddrPoolCfgDao">
|
||||||
|
|
||||||
|
<resultMap id="addrPoolMap" type="com.nis.domain.configuration.IpAddrPoolCfg" >
|
||||||
|
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
|
||||||
|
<result column="addr_pool_id" property="addrPoolId" jdbcType="INTEGER"/>
|
||||||
|
<result column="addr_pool_name" property="addrPoolName" jdbcType="VARCHAR"/>
|
||||||
|
<result column="ip_total" property="ipTotal" jdbcType="INTEGER"/>
|
||||||
|
<result column="available_ip_total" property="availableIpTotal" 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" />
|
||||||
|
<result column="cfg_type" property="cfgType" jdbcType="VARCHAR" />
|
||||||
|
<result column="service_id" property="serviceId" jdbcType="INTEGER" />
|
||||||
|
<result column="compile_id" property="compileId" jdbcType="INTEGER" />
|
||||||
|
<result column="function_id" property="functionId" jdbcType="INTEGER" />
|
||||||
|
<result column="is_area_effective" property="isAreaEffective" jdbcType="INTEGER" />
|
||||||
|
<result column="area_effective_ids" property="areaEffectiveIds" jdbcType="VARCHAR" />
|
||||||
|
<result column="request_id" property="requestId" jdbcType="INTEGER" />
|
||||||
|
<result column="classify" property="classify" jdbcType="VARCHAR" />
|
||||||
|
<result column="attribute" property="attribute" jdbcType="VARCHAR" />
|
||||||
|
<result column="lable" property="lable" jdbcType="VARCHAR" />
|
||||||
|
|
||||||
|
<result column="creator_id" property="creatorId" jdbcType="INTEGER" />
|
||||||
|
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
|
||||||
|
<result column="editor_id" property="editorId" jdbcType="INTEGER" />
|
||||||
|
<result column="edit_time" property="editTime" jdbcType="TIMESTAMP" />
|
||||||
|
<result column="auditor_id" property="auditorId" jdbcType="INTEGER" />
|
||||||
|
<result column="audit_time" property="auditTime" jdbcType="TIMESTAMP" />
|
||||||
|
<result column="description" property="description" jdbcType="VARCHAR"/>
|
||||||
|
<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" />
|
||||||
|
<result column="cancel_request_id" property="cancelRequestId" jdbcType="INTEGER" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="addrPoolColumns">
|
||||||
|
r.CFG_ID,r.ADDR_POOL_ID,r.IP_TOTAL,r.AVAILABLE_IP_TOTAL,r.ACTION,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.DESCRIPTION,r.CANCEL_REQUEST_ID,r.IS_AREA_EFFECTIVE,r.AREA_EFFECTIVE_IDS,
|
||||||
|
r.USER_REGION1,r.USER_REGION2,r.USER_REGION3,r.USER_REGION4,r.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
|
||||||
|
,a.protocol,a.protocol_id,a.direction,a.cfg_type,a.action,a.dest_port,a.dest_ip_address
|
||||||
|
,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.cfg_region_code
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="findPage" resultMap="addrPoolMap">
|
||||||
|
SELECT
|
||||||
|
<include refid="addrPoolColumns"/>
|
||||||
|
<trim prefix="," prefixOverrides=",">
|
||||||
|
,s.name as creator_name,
|
||||||
|
e.name as editor_name,
|
||||||
|
u.name as auditor_name,
|
||||||
|
a.group_name as addr_pool_name,
|
||||||
|
ri.request_title as requestName
|
||||||
|
</trim>
|
||||||
|
FROM
|
||||||
|
ip_reuse_addr_pool r
|
||||||
|
left join
|
||||||
|
policy_group_info a on r.addr_pool_id = a.group_Id
|
||||||
|
left join
|
||||||
|
sys_user s on r.creator_id = s.id
|
||||||
|
left join
|
||||||
|
sys_user e on r.editor_id = e.id
|
||||||
|
left join
|
||||||
|
sys_user u on r.auditor_id = u.id
|
||||||
|
left join
|
||||||
|
request_info ri on r.request_id = ri.id
|
||||||
|
<trim prefix="WHERE" prefixOverrides="AND |OR ">
|
||||||
|
<if test="page !=null and page.where != null and page.where != ''">
|
||||||
|
AND ${page.where}
|
||||||
|
</if>
|
||||||
|
<if test="cfgId != null">
|
||||||
|
AND r.CFG_ID=#{cfgId,jdbcType=BIGINT}
|
||||||
|
</if>
|
||||||
|
<if test="compileId != null">
|
||||||
|
AND r.compile_id=#{compileId,jdbcType=BIGINT}
|
||||||
|
</if>
|
||||||
|
<if test="addrPoolId != null">
|
||||||
|
AND r.addr_pool_id = #{addrPoolId,jdbcType=INTEGER}
|
||||||
|
</if>
|
||||||
|
<if test="addrPoolName != null and addrPoolName != ''">
|
||||||
|
AND r.addr_pool_name = #{addrPoolName,jdbcType=VARCHAR}
|
||||||
|
</if>
|
||||||
|
<if test="ipTotal != null">
|
||||||
|
AND r.ip_total = #{ipTotal,jdbcType=INTEGER}
|
||||||
|
</if>
|
||||||
|
<if test="availableIpTotal != null">
|
||||||
|
AND r.available_ip_total = #{availableIpTotal,jdbcType=INTEGER}
|
||||||
|
</if>
|
||||||
|
<if test="action != null">
|
||||||
|
AND r.ACTION=#{action,jdbcType=INTEGER}
|
||||||
|
</if>
|
||||||
|
<if test="isValid != null">
|
||||||
|
AND r.IS_VALID=#{isValid,jdbcType=INTEGER}
|
||||||
|
</if>
|
||||||
|
<if test="isValid == null">
|
||||||
|
AND r.IS_VALID != -1
|
||||||
|
</if>
|
||||||
|
<if test="isAudit != null">
|
||||||
|
AND r.IS_AUDIT=#{isAudit,jdbcType=INTEGER}
|
||||||
|
</if>
|
||||||
|
<if test="creatorName != null and creatorName != ''">
|
||||||
|
AND CREATOR_NAME like concat(concat('%',#{creatorName,jdbcType=VARCHAR}),'%')
|
||||||
|
</if>
|
||||||
|
<if test="editorName != null and editorName != ''">
|
||||||
|
AND r.EDITOR_NAME like concat(concat('%',#{editorName,jdbcType=VARCHAR}),'%')
|
||||||
|
</if>
|
||||||
|
<if test="auditorName != null and auditorName != ''">
|
||||||
|
AND AUDITOR_NAME like concat(concat('%',#{auditorName,jdbcType=VARCHAR}),'%')
|
||||||
|
</if>
|
||||||
|
<if test="serviceId != null">
|
||||||
|
AND r.SERVICE_ID=#{serviceId,jdbcType=INTEGER}
|
||||||
|
</if>
|
||||||
|
<if test="requestId != null">
|
||||||
|
AND r.REQUEST_ID=#{requestId,jdbcType=INTEGER}
|
||||||
|
</if>
|
||||||
|
<if test="isAreaEffective != null">
|
||||||
|
AND r.IS_AREA_EFFECTIVE=#{isAreaEffective,jdbcType=INTEGER}
|
||||||
|
</if>
|
||||||
|
<if test="classify != null and classify != ''">
|
||||||
|
AND r.classify like concat(concat('%',#{classify,jdbcType=VARCHAR}),'%')
|
||||||
|
</if>
|
||||||
|
<if test="attribute != null and attribute != ''">
|
||||||
|
AND r.attribute like concat(concat('%',#{attribute,jdbcType=VARCHAR}),'%')
|
||||||
|
</if>
|
||||||
|
<if test="lable != null and lable != ''">
|
||||||
|
AND r.lable like concat(concat('%',#{lable,jdbcType=VARCHAR}),'%')
|
||||||
|
</if>
|
||||||
|
<if test="functionId != null">
|
||||||
|
AND r.function_id=#{functionId,jdbcType=INTEGER}
|
||||||
|
</if>
|
||||||
|
<!-- 数据范围过滤 -->
|
||||||
|
${sqlMap.dsf}
|
||||||
|
</trim>
|
||||||
|
<choose>
|
||||||
|
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
||||||
|
ORDER BY ${page.orderBy}
|
||||||
|
</when>
|
||||||
|
<otherwise>
|
||||||
|
ORDER BY r.CFG_ID DESC
|
||||||
|
</otherwise>
|
||||||
|
</choose>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 获取数据跳转表单 -->
|
||||||
|
<select id="findList" resultMap="addrPoolMap">
|
||||||
|
SELECT
|
||||||
|
<include refid="addrPoolColumns"/>
|
||||||
|
FROM
|
||||||
|
ip_reuse_addr_pool r
|
||||||
|
<where>
|
||||||
|
<if test="isValid !=null">
|
||||||
|
AND r.is_valid = #{isValid,jdbcType=INTEGER}
|
||||||
|
</if>
|
||||||
|
<if test="isValid ==null">
|
||||||
|
AND r.is_valid != -1
|
||||||
|
</if>
|
||||||
|
<if test="isAudit !=null">
|
||||||
|
AND r.is_audit = #{isAudit,jdbcType=INTEGER}
|
||||||
|
</if>
|
||||||
|
<if test="cfgId != null">
|
||||||
|
AND r.cfg_id = #{cfgId,jdbcType=BIGINT}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
ORDER BY cfg_Id
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 保存地址池IP信息 -->
|
||||||
|
<insert id="saveReuseIpCfgs" parameterType="com.nis.domain.configuration.BaseIpCfg">
|
||||||
|
INSERT INTO ip_reuse_ip_cfg (
|
||||||
|
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,
|
||||||
|
ip_type,
|
||||||
|
src_ip_address,
|
||||||
|
ip_pattern,
|
||||||
|
port_pattern,
|
||||||
|
src_port,
|
||||||
|
protocol,
|
||||||
|
protocol_id,
|
||||||
|
direction,
|
||||||
|
dest_port,
|
||||||
|
dest_ip_address,
|
||||||
|
cfg_type,
|
||||||
|
cfg_region_code,
|
||||||
|
user_region1,
|
||||||
|
user_region2,
|
||||||
|
user_region3,
|
||||||
|
user_region4,
|
||||||
|
user_region5
|
||||||
|
)VALUES (
|
||||||
|
#{cfgDesc,jdbcType=VARCHAR},
|
||||||
|
#{action,jdbcType=INTEGER},
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
#{creatorId,jdbcType=INTEGER},
|
||||||
|
#{createTime,jdbcType=TIMESTAMP},
|
||||||
|
#{editorId,jdbcType=INTEGER},
|
||||||
|
#{editTime,jdbcType=TIMESTAMP},
|
||||||
|
#{auditorId,jdbcType=INTEGER},
|
||||||
|
#{auditTime,jdbcType=TIMESTAMP},
|
||||||
|
#{serviceId,jdbcType=INTEGER},
|
||||||
|
#{requestId,jdbcType=INTEGER},
|
||||||
|
#{compileId,jdbcType=INTEGER},
|
||||||
|
#{isAreaEffective,jdbcType=INTEGER},
|
||||||
|
#{classify,jdbcType=VARCHAR},
|
||||||
|
#{attribute,jdbcType=VARCHAR},
|
||||||
|
#{lable,jdbcType=VARCHAR},
|
||||||
|
#{areaEffectiveIds,jdbcType=VARCHAR},
|
||||||
|
#{functionId,jdbcType=INTEGER},
|
||||||
|
#{ipType,jdbcType=INTEGER},
|
||||||
|
#{srcIpAddress,jdbcType=VARCHAR},
|
||||||
|
#{ipPattern,jdbcType=INTEGER},
|
||||||
|
#{portPattern,jdbcType=INTEGER},
|
||||||
|
#{srcPort,jdbcType=VARCHAR},
|
||||||
|
#{protocol,jdbcType=INTEGER},
|
||||||
|
#{protocolId,jdbcType=INTEGER},
|
||||||
|
#{direction,jdbcType=INTEGER},
|
||||||
|
#{destPort,jdbcType=VARCHAR},
|
||||||
|
#{destIpAddress,jdbcType=VARCHAR},
|
||||||
|
#{cfgType,jdbcType=VARCHAR},
|
||||||
|
#{cfgRegionCode,jdbcType=INTEGER},
|
||||||
|
#{userRegion1,jdbcType=VARCHAR},
|
||||||
|
#{userRegion2,jdbcType=VARCHAR},
|
||||||
|
#{userRegion3,jdbcType=VARCHAR},
|
||||||
|
#{userRegion4,jdbcType=VARCHAR},
|
||||||
|
#{userRegion5,jdbcType=VARCHAR}
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<insert id="saveAddrPoolCfg" parameterType="com.nis.domain.configuration.IpAddrPoolCfg">
|
||||||
|
INSERT INTO ip_reuse_addr_pool(
|
||||||
|
addr_pool_id,
|
||||||
|
addr_pool_name,
|
||||||
|
ip_total,
|
||||||
|
available_ip_total,
|
||||||
|
action,
|
||||||
|
is_valid,
|
||||||
|
is_audit,
|
||||||
|
cfg_type,
|
||||||
|
cfg_region_code,
|
||||||
|
function_id,
|
||||||
|
service_id,
|
||||||
|
compile_id,
|
||||||
|
is_area_effective,
|
||||||
|
area_effective_ids,
|
||||||
|
request_id,
|
||||||
|
classify,
|
||||||
|
attribute,
|
||||||
|
lable,
|
||||||
|
creator_id,
|
||||||
|
create_time,
|
||||||
|
editor_id,
|
||||||
|
edit_time,
|
||||||
|
auditor_id,
|
||||||
|
audit_time,
|
||||||
|
description,
|
||||||
|
user_region1,
|
||||||
|
user_region2,
|
||||||
|
user_region3,
|
||||||
|
user_region4,
|
||||||
|
user_region5
|
||||||
|
)VALUES (
|
||||||
|
#{addrPoolId,jdbcType=INTEGER},
|
||||||
|
#{addrPoolName,jdbcType=VARCHAR},
|
||||||
|
#{ipTotal,jdbcType=INTEGER},
|
||||||
|
#{availableIpTotal,jdbcType=INTEGER},
|
||||||
|
#{action,jdbcType=INTEGER},
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
#{cfgType,jdbcType=VARCHAR},
|
||||||
|
#{cfgRegionCode,jdbcType=INTEGER},
|
||||||
|
#{functionId,jdbcType=INTEGER},
|
||||||
|
#{serviceId,jdbcType=INTEGER},
|
||||||
|
#{compileId,jdbcType=INTEGER},
|
||||||
|
#{isAreaEffective,jdbcType=INTEGER},
|
||||||
|
#{areaEffectiveIds,jdbcType=VARCHAR},
|
||||||
|
#{requestId,jdbcType=INTEGER},
|
||||||
|
#{classify,jdbcType=VARCHAR},
|
||||||
|
#{attribute,jdbcType=VARCHAR},
|
||||||
|
#{lable,jdbcType=VARCHAR},
|
||||||
|
#{creatorId,jdbcType=INTEGER},
|
||||||
|
#{createTime,jdbcType=TIMESTAMP},
|
||||||
|
#{editorId,jdbcType=INTEGER},
|
||||||
|
#{editTime,jdbcType=TIMESTAMP},
|
||||||
|
#{auditorId,jdbcType=INTEGER},
|
||||||
|
#{auditTime,jdbcType=TIMESTAMP},
|
||||||
|
#{description,jdbcType=VARCHAR},
|
||||||
|
#{userRegion1,jdbcType=VARCHAR},
|
||||||
|
#{userRegion2,jdbcType=VARCHAR},
|
||||||
|
#{userRegion3,jdbcType=VARCHAR},
|
||||||
|
#{userRegion4,jdbcType=VARCHAR},
|
||||||
|
#{userRegion5,jdbcType=VARCHAR}
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<select id="getReuseIpCfgs" resultType="com.nis.domain.configuration.BaseIpCfg">
|
||||||
|
SELECT
|
||||||
|
<include refid="IpCfg_Column" />
|
||||||
|
FROM
|
||||||
|
ip_reuse_ip_cfg a
|
||||||
|
WHERE
|
||||||
|
a.is_valid != -1 AND a.user_region1 = #{addrPoolId}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getAddrPoolId" resultType="java.lang.Integer">
|
||||||
|
SELECT
|
||||||
|
a.addr_pool_id
|
||||||
|
FROM
|
||||||
|
ip_reuse_addr_pool a
|
||||||
|
WHERE
|
||||||
|
a.is_valid != -1 AND a.cfg_id = #{cfgId}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<delete id="deleteReuseIpCfgs" parameterType="java.lang.Integer">
|
||||||
|
DELETE FROM ip_reuse_ip_cfg WHERE user_region1 = #{addrPoolId}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<update id="updateAddrPoolCfg" parameterType="com.nis.domain.configuration.IpAddrPoolCfg">
|
||||||
|
update ip_reuse_addr_pool
|
||||||
|
<set >
|
||||||
|
<trim suffixOverrides=",">
|
||||||
|
<if test="addrPoolId != null" >
|
||||||
|
addr_pool_id = #{addrPoolId,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
|
<if test="ipTotal != null" >
|
||||||
|
ip_total = #{ipTotal,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
|
<if test="availableIpTotal != null" >
|
||||||
|
available_ip_total = #{availableIpTotal,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
|
<if test="action != null" >
|
||||||
|
action = #{action,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
|
<if test="isValid != null" >
|
||||||
|
is_valid = #{isValid,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
|
<if test="isAudit != null" >
|
||||||
|
is_audit = #{isAudit,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
|
<if test="creatorId != null" >
|
||||||
|
creator_id = #{creatorId,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
|
<if test="createTime != null and createTime != ''" >
|
||||||
|
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||||
|
</if>
|
||||||
|
<if test="editorId != null" >
|
||||||
|
editor_id = #{editorId,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
|
<if test="editTime != null and editTime != ''" >
|
||||||
|
edit_time = #{editTime,jdbcType=TIMESTAMP},
|
||||||
|
</if>
|
||||||
|
<if test="auditorId != null" >
|
||||||
|
auditor_id = #{auditorId,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
|
<if test="auditTime != null and createTime != ''" >
|
||||||
|
audit_time = #{auditTime,jdbcType=TIMESTAMP},
|
||||||
|
</if>
|
||||||
|
<if test="serviceId != null" >
|
||||||
|
service_id = #{serviceId,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
|
<if test="requestId != null" >
|
||||||
|
request_id = #{requestId,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
|
<if test="isAreaEffective != null" >
|
||||||
|
is_area_effective = #{isAreaEffective,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
|
<if test="classify != null and classify != ''" >
|
||||||
|
classify = #{classify,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="attribute != null and attribute != ''" >
|
||||||
|
attribute = #{attribute,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="lable != null and lable != ''" >
|
||||||
|
lable = #{lable,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="areaEffectiveIds != null" >
|
||||||
|
area_effective_ids = #{areaEffectiveIds,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="functionId != null" >
|
||||||
|
function_id = #{functionId,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
|
<if test="description != null and description != ''" >
|
||||||
|
description = #{description,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
</trim>
|
||||||
|
</set>
|
||||||
|
where cfg_id = #{cfgId,jdbcType=BIGINT}
|
||||||
|
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<select id="getCfgInfo" parameterType="com.nis.domain.configuration.IpAddrPoolCfg" resultMap="addrPoolMap">
|
||||||
|
SELECT
|
||||||
|
<include refid="addrPoolColumns"/>
|
||||||
|
FROM ip_reuse_addr_pool r
|
||||||
|
<trim prefix="WHERE" prefixOverrides="AND |OR ">
|
||||||
|
<if test="cfgId != null">
|
||||||
|
AND r.cfg_id=#{cfgId,jdbcType=BIGINT}
|
||||||
|
</if>
|
||||||
|
<if test="isValid !=null">
|
||||||
|
AND r.is_valid =#{isValid,jdbcType=INTEGER}
|
||||||
|
</if>
|
||||||
|
<if test="isValid == null">
|
||||||
|
AND r.is_valid != -1
|
||||||
|
</if>
|
||||||
|
<if test="functionId != null">
|
||||||
|
AND r.function_id=#{functionId,jdbcType=INTEGER}
|
||||||
|
</if>
|
||||||
|
<if test="addrPoolName != null and addrPoolName != ''">
|
||||||
|
AND r.addr_pool_name = #{addrPoolName,jdbcType=VARCHAR}
|
||||||
|
</if>
|
||||||
|
</trim>
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
@@ -4,6 +4,7 @@ import java.util.List;
|
|||||||
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import com.nis.domain.configuration.BaseIpCfg;
|
||||||
import com.nis.domain.configuration.IpMultiplexPoolCfg;
|
import com.nis.domain.configuration.IpMultiplexPoolCfg;
|
||||||
import com.nis.web.dao.CrudDao;
|
import com.nis.web.dao.CrudDao;
|
||||||
import com.nis.web.dao.MyBatisDao;
|
import com.nis.web.dao.MyBatisDao;
|
||||||
@@ -19,4 +20,7 @@ public interface IpMultiplexPoolCfgDao extends CrudDao<IpMultiplexPoolCfg> {
|
|||||||
|
|
||||||
List<IpMultiplexPoolCfg> getIspByGroupId(Integer groupId);
|
List<IpMultiplexPoolCfg> getIspByGroupId(Integer groupId);
|
||||||
|
|
||||||
|
// 保存IP信息
|
||||||
|
void saveReuseIps(BaseIpCfg ipCfg);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -45,6 +45,49 @@
|
|||||||
,r.area_effective_ids,r.function_id,r.cfg_region_code,r.compile_id
|
,r.area_effective_ids,r.function_id,r.cfg_region_code,r.compile_id
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
|
<resultMap id="addrPoolMap" type="com.nis.domain.configuration.IpAddrPoolCfg" >
|
||||||
|
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
|
||||||
|
<result column="addr_pool_id" property="addrPoolId" jdbcType="INTEGER"/>
|
||||||
|
<result column="ip_total" property="ipTotal" jdbcType="INTEGER"/>
|
||||||
|
<result column="available_ip_total" property="availableIpTotal" 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" />
|
||||||
|
<result column="cfg_type" property="cfgType" jdbcType="VARCHAR" />
|
||||||
|
<result column="service_id" property="serviceId" jdbcType="INTEGER" />
|
||||||
|
<result column="compile_id" property="compileId" jdbcType="INTEGER" />
|
||||||
|
<result column="function_id" property="functionId" jdbcType="INTEGER" />
|
||||||
|
<result column="is_area_effective" property="isAreaEffective" jdbcType="INTEGER" />
|
||||||
|
<result column="area_effective_ids" property="areaEffectiveIds" jdbcType="VARCHAR" />
|
||||||
|
<result column="request_id" property="requestId" jdbcType="INTEGER" />
|
||||||
|
<result column="classify" property="classify" jdbcType="VARCHAR" />
|
||||||
|
<result column="attribute" property="attribute" jdbcType="VARCHAR" />
|
||||||
|
<result column="lable" property="lable" jdbcType="VARCHAR" />
|
||||||
|
|
||||||
|
<result column="creator_id" property="creatorId" jdbcType="INTEGER" />
|
||||||
|
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
|
||||||
|
<result column="editor_id" property="editorId" jdbcType="INTEGER" />
|
||||||
|
<result column="edit_time" property="editTime" jdbcType="TIMESTAMP" />
|
||||||
|
<result column="auditor_id" property="auditorId" jdbcType="INTEGER" />
|
||||||
|
<result column="audit_time" property="auditTime" jdbcType="TIMESTAMP" />
|
||||||
|
<result column="description" property="description" jdbcType="VARCHAR"/>
|
||||||
|
<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" />
|
||||||
|
<result column="cancel_request_id" property="cancelRequestId" jdbcType="INTEGER" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="addrPoolColumns">
|
||||||
|
r.CFG_ID,r.ADDR_POOL_ID,r.IP_TOTAL,r.AVAILABLE_IP_TOTAL,r.ACTION,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.IS_AREA_EFFECTIVE,r.AREA_EFFECTIVE_IDS,
|
||||||
|
r.CREATOR_ID,r.CREATE_TIME,r.EDITOR_ID,r.EDIT_TIME,r.AUDITOR_ID,r.AUDIT_TIME,
|
||||||
|
r.DESCRIPTION,r.CANCEL_REQUEST_ID,
|
||||||
|
r.USER_REGION1,r.USER_REGION2,r.USER_REGION3,r.USER_REGION4,r.USER_REGION5
|
||||||
|
</sql>
|
||||||
|
|
||||||
<!-- 查出所有 有效数据-->
|
<!-- 查出所有 有效数据-->
|
||||||
<select id="findPage" resultMap="IpMultiplexPoolCfgMap">
|
<select id="findPage" resultMap="IpMultiplexPoolCfgMap">
|
||||||
SELECT
|
SELECT
|
||||||
@@ -54,7 +97,7 @@
|
|||||||
,ri.request_title as requestName
|
,ri.request_title as requestName
|
||||||
</trim>
|
</trim>
|
||||||
FROM ip_multiplex_pool_cfg r
|
FROM ip_multiplex_pool_cfg r
|
||||||
left join policy_group_info a on r.policy_group=a.group_Id
|
<!-- left join policy_group_info a on r.policy_group=a.group_Id -->
|
||||||
left join sys_user s on r.creator_id=s.id
|
left join sys_user s on r.creator_id=s.id
|
||||||
left join sys_user e on r.editor_id=e.id
|
left join sys_user e on r.editor_id=e.id
|
||||||
left join sys_user u on r.auditor_id=u.id
|
left join sys_user u on r.auditor_id=u.id
|
||||||
@@ -337,4 +380,82 @@
|
|||||||
r.POLICY_GROUP = #{groupId} AND r.IS_VALID != -1
|
r.POLICY_GROUP = #{groupId} AND r.IS_VALID != -1
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<insert id="saveReuseIps" parameterType="com.nis.domain.configuration.BaseIpCfg" >
|
||||||
|
insert into ip_reuse_ip_cfg (
|
||||||
|
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,
|
||||||
|
ip_type,
|
||||||
|
src_ip_address,
|
||||||
|
ip_pattern,
|
||||||
|
port_pattern,
|
||||||
|
src_port,
|
||||||
|
protocol,
|
||||||
|
protocol_id,
|
||||||
|
direction,
|
||||||
|
dest_port,
|
||||||
|
dest_ip_address,
|
||||||
|
cfg_type,
|
||||||
|
cfg_region_code,
|
||||||
|
user_region1,
|
||||||
|
user_region2,
|
||||||
|
user_region3,
|
||||||
|
user_region4,
|
||||||
|
user_region5
|
||||||
|
)values (
|
||||||
|
#{cfgDesc,jdbcType=VARCHAR},
|
||||||
|
#{action,jdbcType=INTEGER},
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
#{creatorId,jdbcType=INTEGER},
|
||||||
|
#{createTime,jdbcType=TIMESTAMP},
|
||||||
|
#{editorId,jdbcType=INTEGER},
|
||||||
|
#{editTime,jdbcType=TIMESTAMP},
|
||||||
|
#{auditorId,jdbcType=INTEGER},
|
||||||
|
#{auditTime,jdbcType=TIMESTAMP},
|
||||||
|
#{serviceId,jdbcType=INTEGER},
|
||||||
|
#{requestId,jdbcType=INTEGER},
|
||||||
|
#{compileId,jdbcType=INTEGER},
|
||||||
|
#{isAreaEffective,jdbcType=INTEGER},
|
||||||
|
#{classify,jdbcType=VARCHAR},
|
||||||
|
#{attribute,jdbcType=VARCHAR},
|
||||||
|
#{lable,jdbcType=VARCHAR},
|
||||||
|
#{areaEffectiveIds,jdbcType=VARCHAR},
|
||||||
|
#{functionId,jdbcType=INTEGER},
|
||||||
|
#{ipType,jdbcType=INTEGER},
|
||||||
|
#{srcIpAddress,jdbcType=VARCHAR},
|
||||||
|
#{ipPattern,jdbcType=INTEGER},
|
||||||
|
#{portPattern,jdbcType=INTEGER},
|
||||||
|
#{srcPort,jdbcType=VARCHAR},
|
||||||
|
#{protocol,jdbcType=INTEGER},
|
||||||
|
#{protocolId,jdbcType=INTEGER},
|
||||||
|
#{direction,jdbcType=INTEGER},
|
||||||
|
#{destPort,jdbcType=VARCHAR},
|
||||||
|
#{destIpAddress,jdbcType=VARCHAR},
|
||||||
|
#{cfgType,jdbcType=VARCHAR},
|
||||||
|
#{cfgRegionCode,jdbcType=INTEGER},
|
||||||
|
#{userRegion1,jdbcType=VARCHAR},
|
||||||
|
#{userRegion2,jdbcType=VARCHAR},
|
||||||
|
#{userRegion3,jdbcType=VARCHAR},
|
||||||
|
#{userRegion4,jdbcType=VARCHAR},
|
||||||
|
#{userRegion5,jdbcType=VARCHAR}
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -15,4 +15,6 @@ public interface UserManageDao extends CrudDao<UserManage>{
|
|||||||
UserManage getUserByLoginName(@Param("userName") String userName);
|
UserManage getUserByLoginName(@Param("userName") String userName);
|
||||||
List<UserManage> findList(UserManage entity);
|
List<UserManage> findList(UserManage entity);
|
||||||
UserManage getUserById(@Param("id") String id);
|
UserManage getUserById(@Param("id") String id);
|
||||||
|
|
||||||
|
List<UserManage> findUsers();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -151,4 +151,10 @@
|
|||||||
<include refid="Columns"/>
|
<include refid="Columns"/>
|
||||||
from user_manage r where r.is_valid !=-1 and r.id=#{id}
|
from user_manage r where r.is_valid !=-1 and r.id=#{id}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="findUsers" resultMap="userManageMap">
|
||||||
|
select
|
||||||
|
<include refid="Columns"/>
|
||||||
|
from user_manage r where r.is_valid !=-1
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -160,4 +160,13 @@ public class PolicyGroupInfoService extends BaseService{
|
|||||||
public List<PolicyGroupInfo> getHasAreaPolicyGroups(int groupType) {
|
public List<PolicyGroupInfo> getHasAreaPolicyGroups(int groupType) {
|
||||||
return policyGroupInfoDao.getHasAreaPolicyGroups(groupType);
|
return policyGroupInfoDao.getHasAreaPolicyGroups(groupType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Integer getGroupIdByGroupName(String groupName){
|
||||||
|
return policyGroupInfoDao.getGroupIdByGroupName(groupName);
|
||||||
|
}
|
||||||
|
|
||||||
|
public PolicyGroupInfo getGroupInfo(PolicyGroupInfo policyGroupInfo){
|
||||||
|
return policyGroupInfoDao.getGroupInfo(policyGroupInfo);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,285 @@
|
|||||||
|
package com.nis.web.service.configuration;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import com.beust.jcommander.internal.Lists;
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import com.google.gson.GsonBuilder;
|
||||||
|
import com.nis.domain.Page;
|
||||||
|
import com.nis.domain.callback.InlineIp;
|
||||||
|
import com.nis.domain.callback.IpAddrPool;
|
||||||
|
import com.nis.domain.configuration.BaseIpCfg;
|
||||||
|
import com.nis.domain.configuration.IpAddrPoolCfg;
|
||||||
|
import com.nis.domain.configuration.IpMultiplexPoolCfg;
|
||||||
|
import com.nis.domain.configuration.IpPortCfg;
|
||||||
|
import com.nis.domain.maat.ToMaatResult;
|
||||||
|
import com.nis.domain.maat.MaatCfg.IpCfg;
|
||||||
|
import com.nis.exceptions.MaatConvertException;
|
||||||
|
import com.nis.util.ConfigServiceUtil;
|
||||||
|
import com.nis.util.StringUtils;
|
||||||
|
import com.nis.util.httpclient.HttpClientUtil;
|
||||||
|
import com.nis.web.dao.configuration.IpAddrPoolCfgDao;
|
||||||
|
import com.nis.web.security.UserUtils;
|
||||||
|
import com.nis.web.service.BaseService;
|
||||||
|
import com.nis.web.service.SpringContextHolder;
|
||||||
|
import com.nis.web.service.basics.PolicyGroupInfoService;
|
||||||
|
|
||||||
|
import jersey.repackaged.com.google.common.collect.Maps;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class IpAddrPoolCfgService extends BaseService{
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IpAddrPoolCfgDao ipAddrPoolCfgDao;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 列表分页查询
|
||||||
|
* @param page
|
||||||
|
* @param entity
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public Page<IpAddrPoolCfg> findPage(Page<IpAddrPoolCfg> page, IpAddrPoolCfg entity) {
|
||||||
|
entity.getSqlMap().put("dsf", configScopeFilter(entity.getCurrentUser(),"r"));
|
||||||
|
entity.setPage(page);
|
||||||
|
List<IpAddrPoolCfg> list=ipAddrPoolCfgDao.findPage(entity);
|
||||||
|
page.setList(list);
|
||||||
|
return page;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取数据跳转表单
|
||||||
|
* @param id
|
||||||
|
* @param isValid
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public IpAddrPoolCfg getIpAddrPoolCfg(Long id, Integer isValid) {
|
||||||
|
// 1.获取地址池配置信息
|
||||||
|
List<IpAddrPoolCfg> list=ipAddrPoolCfgDao.findList(id,isValid,null);
|
||||||
|
IpAddrPoolCfg addrPoolCfg=null;
|
||||||
|
if(list != null && list.size()>0){
|
||||||
|
addrPoolCfg=list.get(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 2.获取地址池内IP信息
|
||||||
|
List<BaseIpCfg> ipCfgs = ipAddrPoolCfgDao.getReuseIpCfgs(addrPoolCfg.getAddrPoolId());
|
||||||
|
if(ipCfgs != null && ipCfgs.size()>0){
|
||||||
|
addrPoolCfg.setIpCfgs(ipCfgs);
|
||||||
|
}
|
||||||
|
return addrPoolCfg;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新配置数据
|
||||||
|
* @param res
|
||||||
|
* @param req
|
||||||
|
* @param cfg
|
||||||
|
*/
|
||||||
|
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||||
|
public void saveOrUpdate(IpAddrPoolCfg entity, HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
|
||||||
|
// 可用IP数(需调用CGI接口查询)
|
||||||
|
/*Map<String, Object> params = new HashMap<String, Object>();
|
||||||
|
params.put("cmd", "IpNumGet");
|
||||||
|
params.put("addr_pool_id", entity.getAddrPoolId());
|
||||||
|
try {
|
||||||
|
String resJson = HttpClientUtil.getMsg("", params, req);
|
||||||
|
} catch (Exception e1) {
|
||||||
|
e1.printStackTrace();
|
||||||
|
}*/
|
||||||
|
|
||||||
|
// 1.更新配置信息
|
||||||
|
Date time = new Date();
|
||||||
|
entity.setIsValid(0);
|
||||||
|
entity.setIsAudit(0);
|
||||||
|
setAreaEffectiveIds(entity);
|
||||||
|
entity.setIpTotal(entity.getIpCfgs().size());
|
||||||
|
if(entity.getCfgId()==null){
|
||||||
|
entity.initDefaultValue();
|
||||||
|
entity.setCreateTime(time);
|
||||||
|
entity.setCreatorId(UserUtils.getUser().getId());
|
||||||
|
//调用服务接口获取compileId
|
||||||
|
try {
|
||||||
|
List<Integer> compileIds = ConfigServiceUtil.getId(1,1);
|
||||||
|
if(compileIds != null && compileIds.size() > 0 ){
|
||||||
|
entity.setCompileId(compileIds.get(0));
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
logger.info("获取编译ID出错");
|
||||||
|
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+e.getMessage());
|
||||||
|
}
|
||||||
|
ipAddrPoolCfgDao.saveAddrPoolCfg(entity);
|
||||||
|
|
||||||
|
}else{
|
||||||
|
entity.setEditorId(UserUtils.getUser().getId());
|
||||||
|
entity.setEditTime(time);
|
||||||
|
ipAddrPoolCfgDao.updateAddrPoolCfg(entity);
|
||||||
|
entity.setCreateTime(new Date());
|
||||||
|
entity.setCreatorId(entity.getCurrentUser().getId());
|
||||||
|
}
|
||||||
|
ipAddrPoolCfgDao.deleteReuseIpCfgs(entity.getAddrPoolId());
|
||||||
|
|
||||||
|
// 2.保存IP信息 -> ip_reuse_ip_cfg(该表user_region1字段 存放 地址池ID)
|
||||||
|
for (BaseIpCfg IpCfg : entity.getIpCfgs()) {
|
||||||
|
BeanUtils.copyProperties(entity, IpCfg);
|
||||||
|
IpCfg.setUserRegion1(entity.getAddrPoolId()+"");
|
||||||
|
ipAddrPoolCfgDao.saveReuseIpCfgs(IpCfg);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||||
|
public void delete(Integer isAudit, Integer isValid, String ids, Integer functionId) {
|
||||||
|
String[] idArray = ids.split(",");
|
||||||
|
String groupIds = "";
|
||||||
|
for(String id :idArray){
|
||||||
|
IpAddrPoolCfg entity = new IpAddrPoolCfg();
|
||||||
|
entity.setCfgId(Long.valueOf(id));
|
||||||
|
entity.setFunctionId(functionId);
|
||||||
|
entity.setIsAudit(isAudit);
|
||||||
|
entity.setIsValid(isValid);
|
||||||
|
entity.setEditorId(UserUtils.getUser().getId());
|
||||||
|
entity.setEditTime(new Date());
|
||||||
|
Integer addrPoolId = ipAddrPoolCfgDao.getAddrPoolId(entity.getCfgId());
|
||||||
|
groupIds += addrPoolId+",";
|
||||||
|
ipAddrPoolCfgDao.deleteReuseIpCfgs(addrPoolId);
|
||||||
|
|
||||||
|
ipAddrPoolCfgDao.updateAddrPoolCfg(entity);
|
||||||
|
|
||||||
|
}
|
||||||
|
PolicyGroupInfoService groupInfoService = SpringContextHolder.getBean(PolicyGroupInfoService.class);
|
||||||
|
groupInfoService.deldete(groupIds, isValid);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 配置审核
|
||||||
|
* @param isAudit
|
||||||
|
* @param isValid
|
||||||
|
* @param functionId
|
||||||
|
* @param id
|
||||||
|
* @param auditTime
|
||||||
|
*/
|
||||||
|
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||||
|
public void audit(Integer isAudit, Integer isValid, Integer functionId, String id, Date auditTime) {
|
||||||
|
IpAddrPoolCfg cfg=new IpAddrPoolCfg();
|
||||||
|
cfg.setCfgId(Long.valueOf(id));
|
||||||
|
cfg.setIsValid(isValid);
|
||||||
|
cfg.setIsAudit(isAudit);
|
||||||
|
cfg.setAuditorId(UserUtils.getUser().getId());
|
||||||
|
cfg.setAuditTime(auditTime);
|
||||||
|
ipAddrPoolCfgDao.updateAddrPoolCfg(cfg);// 更新配置审核状态
|
||||||
|
|
||||||
|
cfg=getIpAddrPoolCfg(cfg.getCfgId(), null);
|
||||||
|
String json="";
|
||||||
|
if(cfg.getIsAudit()==1){
|
||||||
|
List<IpAddrPool> resStrategyList=new ArrayList<IpAddrPool>();
|
||||||
|
for(BaseIpCfg ipcfg : cfg.getIpCfgs()) {
|
||||||
|
IpAddrPool ip = new IpAddrPool();
|
||||||
|
BeanUtils.copyProperties(cfg, ipcfg, new String[]{"cfgId"});
|
||||||
|
List<IpCfg> cfgs = BaseService.ipConvert(new IpCfg(), ipcfg);
|
||||||
|
if (cfgs.size() > 1) {
|
||||||
|
throw new RuntimeException("CallBack IP did not support IP range!");
|
||||||
|
}
|
||||||
|
IpCfg c = cfgs.get(0);
|
||||||
|
ip.setRegionId(ipcfg.getCompileId());
|
||||||
|
//ip.setGroupId(ipcfg.getCompileId());
|
||||||
|
|
||||||
|
ip.setAddrType(ipcfg.getIpType());
|
||||||
|
ip.setSrcIp(c.getSrcIp());
|
||||||
|
ip.setMaskSrcIp(c.getSrcIpMask());
|
||||||
|
ip.setSrcPort(c.getSrcPort());
|
||||||
|
ip.setMaskSrcPort(c.getSrcPortMask());
|
||||||
|
ip.setDstIp(c.getDstIp());
|
||||||
|
ip.setMaskDstIp(c.getDstIpMask());
|
||||||
|
ip.setDstPort(c.getDstPort());
|
||||||
|
ip.setMaskDstPort(c.getDstPortMask());
|
||||||
|
ip.setProtocol(ipcfg.getProtocol());
|
||||||
|
ip.setDirection(ipcfg.getDirection());
|
||||||
|
|
||||||
|
ip.setIsValid(cfg.getIsValid());
|
||||||
|
ip.setAction(ipcfg.getAction());
|
||||||
|
ip.setService(ipcfg.getServiceId());
|
||||||
|
ip.setAddrPoolId(cfg.getAddrPoolId());
|
||||||
|
ip.setOpTime(auditTime);
|
||||||
|
ip.setAreaEffectiveIds(cfg.getAreaEffectiveIds());//添加区域管控
|
||||||
|
|
||||||
|
resStrategyList.add(ip);
|
||||||
|
}
|
||||||
|
//调用服务接口下发配置数据
|
||||||
|
json=gsonToJson(resStrategyList);
|
||||||
|
logger.info("SNAT地址池配置下发配置参数:"+json);
|
||||||
|
//调用服务接口下发配置
|
||||||
|
try {
|
||||||
|
ToMaatResult result = ConfigServiceUtil.postCallbackCfg(json);
|
||||||
|
if(result!=null){
|
||||||
|
logger.info("SNAT地址池配置下发响应信息:"+result.getMsg());
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("SNAT地址池配置下发失败",e);
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
|
||||||
|
}else if(cfg.getIsAudit()==3){
|
||||||
|
List<IpAddrPool> resStrategyList=new ArrayList<IpAddrPool>();
|
||||||
|
for(BaseIpCfg ipcfg : cfg.getIpCfgs()) {
|
||||||
|
IpAddrPool ip = new IpAddrPool();
|
||||||
|
BeanUtils.copyProperties(cfg, ipcfg, new String[]{"cfgId"});
|
||||||
|
List<IpCfg> cfgs = BaseService.ipConvert(new IpCfg(), ipcfg);
|
||||||
|
if (cfgs.size() > 1) {
|
||||||
|
throw new RuntimeException("CallBack IP did not support IP range!");
|
||||||
|
}
|
||||||
|
IpCfg c = cfgs.get(0);
|
||||||
|
ip.setRegionId(ipcfg.getCompileId());
|
||||||
|
ip.setAddrType(ipcfg.getIpType());
|
||||||
|
ip.setSrcIp(c.getSrcIp());
|
||||||
|
ip.setMaskSrcIp(c.getSrcIpMask());
|
||||||
|
ip.setSrcPort(c.getSrcPort());
|
||||||
|
ip.setMaskSrcPort(c.getSrcPortMask());
|
||||||
|
ip.setDstIp(c.getDstIp());
|
||||||
|
ip.setMaskDstIp(c.getDstIpMask());
|
||||||
|
ip.setDstPort(c.getDstPort());
|
||||||
|
ip.setMaskDstPort(c.getDstPortMask());
|
||||||
|
ip.setProtocol(ipcfg.getProtocol());
|
||||||
|
ip.setDirection(ipcfg.getDirection());
|
||||||
|
ip.setIsValid(cfg.getIsValid());
|
||||||
|
ip.setAction(ipcfg.getAction());
|
||||||
|
ip.setService(ipcfg.getServiceId());
|
||||||
|
ip.setAddrPoolId(cfg.getAddrPoolId());
|
||||||
|
ip.setOpTime(auditTime);
|
||||||
|
ip.setAreaEffectiveIds(cfg.getAreaEffectiveIds());
|
||||||
|
resStrategyList.add(ip);
|
||||||
|
}
|
||||||
|
//调用服务接口取消配置
|
||||||
|
json=gsonToJson(resStrategyList);
|
||||||
|
logger.info("SNAT地址池配置配置参数:"+json);
|
||||||
|
//调用服务接口取消配置
|
||||||
|
try {
|
||||||
|
ToMaatResult result = ConfigServiceUtil.put(json, 2);
|
||||||
|
logger.info("SNAT地址池配置响应信息:"+result.getMsg());
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
logger.info("SNAT地址池配置配置失败");
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public IpAddrPoolCfg getCfgInfo(IpAddrPoolCfg cfg) {
|
||||||
|
return ipAddrPoolCfgDao.getCfgInfo(cfg);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -181,4 +181,7 @@ public class UserManageService extends BaseService{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public List<UserManage> findUsers() {
|
||||||
|
return userManageDao.findUsers();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1331,3 +1331,7 @@ incoming_unicast_packets=Incoming Unicast_packets
|
|||||||
incoming_unicast_total_size=Incoming Unicast Total Size
|
incoming_unicast_total_size=Incoming Unicast Total Size
|
||||||
incoming_broadcast_packets=Incoming Broadcast Packets
|
incoming_broadcast_packets=Incoming Broadcast Packets
|
||||||
incoming_broadcast_total_size=Incoming Broadcast Total Size
|
incoming_broadcast_total_size=Incoming Broadcast Total Size
|
||||||
|
address_pool=Address Pool
|
||||||
|
ip_total=IP Total
|
||||||
|
available_ip_total=Available IP Total
|
||||||
|
address_pool_id=Address Pool ID
|
||||||
@@ -1331,3 +1331,7 @@ incoming_unicast_packets=Incoming Unicast_packets
|
|||||||
incoming_unicast_total_size=Incoming Unicast Total Size
|
incoming_unicast_total_size=Incoming Unicast Total Size
|
||||||
incoming_broadcast_packets=Incoming Broadcast Packets
|
incoming_broadcast_packets=Incoming Broadcast Packets
|
||||||
incoming_broadcast_total_size=Incoming Broadcast Total Size
|
incoming_broadcast_total_size=Incoming Broadcast Total Size
|
||||||
|
address_pool=Address Pool
|
||||||
|
ip_total=IP Total
|
||||||
|
available_ip_total=Available IP Total
|
||||||
|
address_pool_id=Address Pool ID
|
||||||
@@ -1327,3 +1327,7 @@ incoming_unicast_packets=\u8F93\u5165\u5355\u5305
|
|||||||
incoming_unicast_total_size=\u8F93\u5165\u5355\u64AD\u603B\u5927\u5C0F
|
incoming_unicast_total_size=\u8F93\u5165\u5355\u64AD\u603B\u5927\u5C0F
|
||||||
incoming_broadcast_packets=\u8F93\u5165\u5E7F\u64AD\u6570\u636E\u5305
|
incoming_broadcast_packets=\u8F93\u5165\u5E7F\u64AD\u6570\u636E\u5305
|
||||||
incoming_broadcast_total_size=\u8F93\u5165\u5E7F\u64AD\u603B\u5927\u5C0F
|
incoming_broadcast_total_size=\u8F93\u5165\u5E7F\u64AD\u603B\u5927\u5C0F
|
||||||
|
address_pool=\u5730\u5740\u6C60
|
||||||
|
ip_total=IP\u603B\u6570
|
||||||
|
available_ip_total=\u53EF\u7528IP\u6570
|
||||||
|
address_pool_id=\u5730\u5740\u6C60ID
|
||||||
@@ -0,0 +1,491 @@
|
|||||||
|
<%@ page contentType="text/html;charset=UTF-8"%>
|
||||||
|
<%@ include file="/WEB-INF/include/taglib.jsp"%>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title><spring:message code="${cfgName}"></spring:message></title>
|
||||||
|
<script type="text/javascript">
|
||||||
|
var ipInfoDiv ;
|
||||||
|
$(function(){
|
||||||
|
// 初始clone
|
||||||
|
ipInfoDiv = $(".ipDiv").clone();
|
||||||
|
if($(".ipDiv").hasClass("hidden")){
|
||||||
|
$(".ipDiv").remove();
|
||||||
|
}
|
||||||
|
if('${fn:length(serviceList)}'>1){
|
||||||
|
$("#serviceId").val($(".action:checked").attr("serviceId"));
|
||||||
|
$("#protocolId").val($(".action:checked").attr("protocolId"));
|
||||||
|
}
|
||||||
|
$("#cfgFrom").validate({
|
||||||
|
errorPlacement: function(error,element){
|
||||||
|
if($(element).parents().hasClass("tagsinput")){
|
||||||
|
$(element).parents(".col-md-6").next("div").append(error);
|
||||||
|
}else{
|
||||||
|
$(element).parents(".form-group").find("div[for='"+element.attr("name")+"']").append(error);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
submitHandler: function(form){
|
||||||
|
loading('onloading...');
|
||||||
|
form.submit();
|
||||||
|
},
|
||||||
|
errorContainer: "#messageBox"
|
||||||
|
});
|
||||||
|
//switchIpInfo($("select[name$='ipType']"));
|
||||||
|
$("select[name$='ipType']").on("change",function(){
|
||||||
|
switchIpInfo(this);
|
||||||
|
});
|
||||||
|
|
||||||
|
ipInfoDiv.removeClass("ipDiv");
|
||||||
|
ipInfoDiv.removeClass("hidden");
|
||||||
|
ipInfoDiv.find("button").each(function(){
|
||||||
|
$(this).removeClass("addDivBut");
|
||||||
|
$(this).children("font").attr("color","#ed6b75").attr("class","fa fa-times");
|
||||||
|
});
|
||||||
|
setFirstIpDiv();
|
||||||
|
resetIndex();
|
||||||
|
});
|
||||||
|
|
||||||
|
var resetDiv = function(obj){
|
||||||
|
// 添加 or 删除
|
||||||
|
if($(obj).hasClass("addDivBut")){
|
||||||
|
$(".ipInfo").last().after(ipInfoDiv.clone());
|
||||||
|
}else{
|
||||||
|
$(obj).parents(".ipInfo:first").remove();
|
||||||
|
}
|
||||||
|
|
||||||
|
$(".selectpicker").selectpicker("render");// 重新渲染页面
|
||||||
|
$("select[name$='ipType']").on("change",function(){
|
||||||
|
switchIpInfo(this);
|
||||||
|
});
|
||||||
|
resetIndex();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 设置第一个div +
|
||||||
|
var setFirstIpDiv = function(){
|
||||||
|
$(".ipInfo").not(".ipDiv").first().find("button").each(function(){
|
||||||
|
$(this).addClass("addDivBut");
|
||||||
|
$(this).children("font").attr("color","#27a4b0").attr("class","fa fa-plus");
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
var resetIndex = function(){
|
||||||
|
// 设置索引
|
||||||
|
$(".ipInfo").not(".hidden").each(function(index,element){
|
||||||
|
var ind = index;
|
||||||
|
$(this).find("input,select").each(function(){
|
||||||
|
var oldName = $(this).attr("name");
|
||||||
|
var newName = oldName.replace(oldName.match(/\[(\S*)\]/)[1],ind);
|
||||||
|
$(this).attr("name",newName);
|
||||||
|
$(this).parents(".form-group").find("div[for='"+oldName+"']").attr("for",newName);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<div class="page-content">
|
||||||
|
<h3 class="page-title">
|
||||||
|
<spring:message code="${_cfg.menuNameCode }"></spring:message>
|
||||||
|
</h3>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12">
|
||||||
|
<div class="portlet box blue">
|
||||||
|
<div class="portlet-title">
|
||||||
|
<div class="caption">
|
||||||
|
<i class="fa fa-gift"></i>
|
||||||
|
<c:if test="${empty _cfg.cfgId}"><spring:message code="add"></spring:message></c:if>
|
||||||
|
<c:if test="${!empty _cfg.cfgId}"><spring:message code="edit"></spring:message></c:if>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="portlet-body form">
|
||||||
|
<!-- BEGIN FORM-->
|
||||||
|
<form:form id="cfgFrom" modelAttribute="_cfg" action="${ctx}/maintenance/ipMultiplexPoolCfg/snatSaveOrUpdate" method="post" class="form-horizontal">
|
||||||
|
<input type="hidden" name="cfgId" value="${_cfg.cfgId}">
|
||||||
|
<input type="hidden" name="functionId" value="${_cfg.functionId}">
|
||||||
|
<input type="hidden" name="addrPoolId" value="${_cfg.addrPoolId}">
|
||||||
|
<input type="hidden" id="compileId" name="compileId" value="${_cfg.compileId}">
|
||||||
|
<c:if test="${fn:length(serviceList)==1}">
|
||||||
|
<c:forEach items="${serviceList}" var="service">
|
||||||
|
<input type="hidden" name="action" serviceId="${service.serviceId }" protocolId="${service.protocolId }" regionCode="${service.regionCode}" value="${service.action }">
|
||||||
|
<input type="hidden" id="protocolId" name="protocolId" value="${service.protocolId}">
|
||||||
|
<input type="hidden" id="serviceId" name="serviceId" value="${service.serviceId}">
|
||||||
|
</c:forEach>
|
||||||
|
</c:if>
|
||||||
|
<c:if test="${fn:length(serviceList)>1}">
|
||||||
|
<input type="hidden" id="protocolId" name="protocolId" value="${_cfg.protocolId}">
|
||||||
|
<input type="hidden" id="serviceId" name="serviceId" value="${_cfg.serviceId}">
|
||||||
|
</c:if>
|
||||||
|
<!-- 配置域类型 -->
|
||||||
|
<c:forEach items="${regionList}" var="region">
|
||||||
|
<c:if test="${_cfg.functionId eq region.functionId}">
|
||||||
|
<input type="hidden" name="cfgType" value="${region.configRegionValue}">
|
||||||
|
<input type="hidden" name="cfgRegionCode"
|
||||||
|
isMaat="${region.isMaat}"
|
||||||
|
serviceType="${region.configServiceType}"
|
||||||
|
ipPortShow="${region.configIpPortShow}"
|
||||||
|
ipType="${region.configIpType}"
|
||||||
|
ipPattern="${region.configIpPattern}"
|
||||||
|
portPattern="${region.configPortPattern}"
|
||||||
|
direction="${region.configDirection}"
|
||||||
|
protocol="${region.configProtocol}"
|
||||||
|
regionType="${region.regionType}"
|
||||||
|
value="${region.configRegionCode}">
|
||||||
|
</c:if>
|
||||||
|
</c:forEach>
|
||||||
|
<div class="form-body">
|
||||||
|
<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="address_pool"/></label>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<!-- 地址池名称 -->
|
||||||
|
<input class="form-control required addrPoolUnique" type="text" name="addrPoolName" value="${_cfg.addrPoolName}" ctx="${ctx}">
|
||||||
|
</div>
|
||||||
|
<div for="addrPoolName"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-6 hidden">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-md-3"><spring:message code="action"/></label>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<c:forEach items="${serviceList}" var="service" varStatus="satus">
|
||||||
|
<label class="radio-inline">
|
||||||
|
<c:if test="${_cfg.functionId eq service.functionId}">
|
||||||
|
<input type="radio" name="action"
|
||||||
|
serviceId="${service.serviceId }"
|
||||||
|
protocolId="${service.protocolId }"
|
||||||
|
value="${service.action }" class="required action"
|
||||||
|
<c:if test="${_cfg.action==service.action || (_cfg.action==null && satus.index==0)}">checked</c:if>>
|
||||||
|
<c:forEach items="${fns:getDictList('SERVICE_ACTION') }" var="dict">
|
||||||
|
<c:if test="${dict.itemCode eq service.action }">
|
||||||
|
<spring:message code="${dict.itemValue }"/>
|
||||||
|
</c:if>
|
||||||
|
</c:forEach>
|
||||||
|
</c:if>
|
||||||
|
</label>
|
||||||
|
</c:forEach>
|
||||||
|
</div>
|
||||||
|
<div for="action"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-md-3 control-label"><spring:message code="desc"/>:</label>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<form:textarea path="description" htmlEscape="false" maxlength="128" class="form-control" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row ipInfo ipDiv <c:if test="${!empty _cfg.ipCfgs}">hidden</c:if>">
|
||||||
|
<input type="hidden" name="ipCfgs[0].protocolId" value="0">
|
||||||
|
<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="ip_type"/></label>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<select name="ipCfgs[0].ipType" class="selectpicker show-tick form-control required">
|
||||||
|
<c:forEach items="${fns:getDictList('IP_TYPE')}" var="ipTypeC">
|
||||||
|
<option value="${ipTypeC.itemCode}" <c:if test="${ipTypeC.itemCode==4 }">selected</c:if> >
|
||||||
|
<spring:message code="${ipTypeC.itemValue}"/>
|
||||||
|
</option>
|
||||||
|
</c:forEach>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div for="ipCfgs[0].ipType"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-6 hidden">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="ip_pattern"/></label>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<select name="ipCfgs[0].ipPattern" class="selectpicker show-tick form-control required">
|
||||||
|
<c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC">
|
||||||
|
<option value="${ipPatternC.itemCode}">
|
||||||
|
<spring:message code="${ipPatternC.itemValue}"/>
|
||||||
|
</option>
|
||||||
|
</c:forEach>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div for="ipCfgs[0].ipPattern"></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="ip"/></label>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="input-group">
|
||||||
|
<input class="form-control required ipCheck" type="text" name="ipCfgs[0].srcIpAddress">
|
||||||
|
<span class="input-group-btn">
|
||||||
|
<button class="btn btn-default addDivBut" onclick="resetDiv(this)" type="button"><font color="#27a4b0" class="fa fa-plus"></font></button>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div for="ipCfgs[0].srcIpAddress"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row port">
|
||||||
|
<div class="col-md-6 hidden">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="port_pattern"/></label>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<select name="ipCfgs[0].portPattern" class="selectpicker show-tick form-control required">
|
||||||
|
<c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC">
|
||||||
|
<option value="${portPatternC.itemCode}">
|
||||||
|
<spring:message code="${portPatternC.itemValue}"/>
|
||||||
|
</option>
|
||||||
|
</c:forEach>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div for="ipCfgs[0].portPattern"></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="client_port"/></label>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<input class="form-control required portCheck" type="text" name="ipCfgs[0].srcPort">
|
||||||
|
</div>
|
||||||
|
<div for="ipCfgs[0].srcPort"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row destPort">
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="form-group ">
|
||||||
|
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="server_ip"/></label>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<input class="form-control required ipCheck" type="text" name="ipCfgs[0].destIpAddress">
|
||||||
|
</div>
|
||||||
|
<div for="ipCfgs[0].destIpAddress"></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="server_port"/></label>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<input class="form-control required portCheck" type="text" name="ipCfgs[0].destPort">
|
||||||
|
</div>
|
||||||
|
<div for="ipCfgs[0].destPort"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row hidden protocol">
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="form-group hidden">
|
||||||
|
<label class="control-label col-md-3"><font color="red">*</font>
|
||||||
|
<spring:message code="protocol" /></label>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<select name="ipCfgs[0].protocol"
|
||||||
|
class="selectpicker show-tick form-control required">
|
||||||
|
<c:forEach items="${fns:getDictList('PROTOCOL')}" var="protocolC">
|
||||||
|
<option value="${protocolC.itemCode}">
|
||||||
|
<spring:message code="${protocolC.itemValue}"/>
|
||||||
|
</option>
|
||||||
|
</c:forEach>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div for="ipCfgs[0].protocol"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="form-group hidden">
|
||||||
|
<label class="control-label col-md-3"><font color="red">*</font>
|
||||||
|
<spring:message code="direction" /></label>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<select name="ipCfgs[0].direction"
|
||||||
|
class="selectpicker show-tick form-control required">
|
||||||
|
<c:forEach items="${fns:getDictList('DIRECTION')}" var="directionC">
|
||||||
|
<option value="${directionC.itemCode}">
|
||||||
|
<spring:message code="${directionC.itemValue}"/>
|
||||||
|
</option>
|
||||||
|
</c:forEach>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div for="ipCfgs[0].direction"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<c:forEach items="${_cfg.ipCfgs }" var="ipCfg" varStatus="index">
|
||||||
|
<div class="row ipInfo">
|
||||||
|
<input type="hidden" name="ipCfgs[0].protocolId" value="0">
|
||||||
|
<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="ip_type"/></label>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<select name="ipCfgs[0].ipType" class="selectpicker show-tick form-control required">
|
||||||
|
<c:forEach items="${fns:getDictList('IP_TYPE')}" var="ipTypeC">
|
||||||
|
<option value="${ipTypeC.itemCode}"
|
||||||
|
<c:if test="${ipCfg.ipType == ipTypeC.itemCode}">
|
||||||
|
selected
|
||||||
|
</c:if>>
|
||||||
|
<spring:message code="${ipTypeC.itemValue}"/>
|
||||||
|
</option>
|
||||||
|
</c:forEach>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div for="ipCfgs[0].ipType"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-6 hidden">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="ip_pattern"/></label>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<select name="ipCfgs[0].ipPattern" class="selectpicker show-tick form-control required">
|
||||||
|
<c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC">
|
||||||
|
<option value="${ipPatternC.itemCode}"
|
||||||
|
<c:if test="${ipCfg.ipPattern == ipPatternC.itemCode}">
|
||||||
|
selected
|
||||||
|
</c:if>>
|
||||||
|
<spring:message code="${ipPatternC.itemValue}"/>
|
||||||
|
</option>
|
||||||
|
</c:forEach>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div for="ipCfgs[0].ipPattern"></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="ip"/></label>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="input-group">
|
||||||
|
<input class="form-control required ipCheck" type="text" name="ipCfgs[0].srcIpAddress" value="${ipCfg.srcIpAddress }">
|
||||||
|
<span class="input-group-btn">
|
||||||
|
<button class="btn btn-default" onclick="resetDiv(this)" type="button"><font color="#ed6b75" class="fa fa-times"></font></button>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div for="ipCfgs[0].srcIpAddress"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row port">
|
||||||
|
<div class="col-md-6 hidden">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="port_pattern"/></label>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<select name="ipCfgs[0].portPattern" class="selectpicker show-tick form-control required">
|
||||||
|
<c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC">
|
||||||
|
<option value="${portPatternC.itemCode}"
|
||||||
|
<c:if test="${ipCfg.portPattern == portPatternC.itemCode}">
|
||||||
|
selected
|
||||||
|
</c:if>>
|
||||||
|
<spring:message code="${portPatternC.itemValue}"/>
|
||||||
|
</option>
|
||||||
|
</c:forEach>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div for="ipCfgs[0].portPattern"></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="client_port"/></label>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<input class="form-control required portCheck" type="text" name="ipCfgs[0].srcPort" value="${ipCfg.srcPort }">
|
||||||
|
</div>
|
||||||
|
<div for="ipCfgs[0].srcPort"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row destPort">
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="form-group ">
|
||||||
|
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="server_ip"/></label>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<input class="form-control required ipCheck" type="text" name="ipCfgs[0].destIpAddress" value="${ipCfg.destIpAddress }">
|
||||||
|
</div>
|
||||||
|
<div for="ipCfgs[0].destIpAddress"></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="server_port"/></label>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<input class="form-control required portCheck" type="text" name="ipCfgs[0].destPort" value="${ipCfg.destPort }">
|
||||||
|
</div>
|
||||||
|
<div for="ipCfgs[0].destPort"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row hidden protocol">
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="form-group hidden">
|
||||||
|
<label class="control-label col-md-3"><font color="red">*</font>
|
||||||
|
<spring:message code="protocol" /></label>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<select name="ipCfgs[0].protocol"
|
||||||
|
class="selectpicker show-tick form-control required">
|
||||||
|
<c:forEach items="${fns:getDictList('PROTOCOL')}" var="protocolC">
|
||||||
|
<option value="${protocolC.itemCode}"
|
||||||
|
<c:if test="${ipCfg.protocol == protocolC.itemCode}">
|
||||||
|
selected
|
||||||
|
</c:if>>
|
||||||
|
<spring:message code="${protocolC.itemValue}"/>
|
||||||
|
</option>
|
||||||
|
</c:forEach>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div for="ipCfgs[0].protocol"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="form-group hidden">
|
||||||
|
<label class="control-label col-md-3"><font color="red">*</font>
|
||||||
|
<spring:message code="direction" /></label>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<select name="ipCfgs[0].direction"
|
||||||
|
class="selectpicker show-tick form-control required">
|
||||||
|
<c:forEach items="${fns:getDictList('DIRECTION')}" var="directionC">
|
||||||
|
<option value="${directionC.itemCode}"
|
||||||
|
<c:if test="${ipCfg.direction == directionC.itemCode}">
|
||||||
|
selected
|
||||||
|
</c:if>>
|
||||||
|
<spring:message code="${directionC.itemValue}"/>
|
||||||
|
</option>
|
||||||
|
</c:forEach>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div for="ipCfgs[0].direction"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</c:forEach>
|
||||||
|
|
||||||
|
<br>
|
||||||
|
<%@include file="/WEB-INF/include/form/areaInfo.jsp"%>
|
||||||
|
<br>
|
||||||
|
<%@include file="/WEB-INF/include/form/basicInfo.jsp" %>
|
||||||
|
</div>
|
||||||
|
<div class="form-actions">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-offset-3 col-md-8">
|
||||||
|
<button id="save" type="submit" class="btn green"><spring:message code="submit"/></button>
|
||||||
|
<button id="cancel" type="button" class="btn default"><spring:message code="cancel"/></button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-6"> </div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form:form>
|
||||||
|
<!-- END FORM-->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,439 @@
|
|||||||
|
<%@ page contentType="text/html;charset=UTF-8"%>
|
||||||
|
<%@ include file="/WEB-INF/include/taglib.jsp"%>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title><spring:message code="${cfgName}"></spring:message></title>
|
||||||
|
<script>
|
||||||
|
$(document).ready(function() {
|
||||||
|
//搜索框提示语初始化
|
||||||
|
if("${cfg.addrPoolId}"){
|
||||||
|
$("#intype").val("${cfg.addrPoolId}");
|
||||||
|
}else{
|
||||||
|
$("#intype").attr("placeholder","<spring:message code='input'/> "+$("#seltype").find("option:selected").text());
|
||||||
|
}
|
||||||
|
$("#seltype").change(function(){
|
||||||
|
$("#intype").attr("placeholder","<spring:message code='input'/> "+$(this).find("option:selected").text());
|
||||||
|
});
|
||||||
|
//筛选功能初始化
|
||||||
|
filterActionInit();
|
||||||
|
$("#isAudit").change(function(){
|
||||||
|
page();
|
||||||
|
});
|
||||||
|
//reset
|
||||||
|
$("#resetBtn").on("click",function(){
|
||||||
|
$("select.selectpicker").each(function(){
|
||||||
|
$(this).selectpicker('val',$(this).find('option:first').val());
|
||||||
|
$(this).find("option").attr("selected",false);
|
||||||
|
$(this).find("option:first").attr("selected",true);
|
||||||
|
});
|
||||||
|
$(".Wdate").attr("value",'');
|
||||||
|
$("#description").attr("value",'');
|
||||||
|
$("#searchForm")[0].reset();
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
if($("#exportType").val() != null && $("#exportType").val() != ""){
|
||||||
|
if($("#intype").val() != null && $("#intype").val() != ""){
|
||||||
|
$("#exportValue").val($("#intype").val());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<div class="page-content">
|
||||||
|
<div class="theme-panel hidden-xs hidden-sm">
|
||||||
|
<shiro:hasPermission name="ip:mulitiplex:pool:config">
|
||||||
|
<button type="button" class="btn btn-primary"
|
||||||
|
onClick="javascript:window.location='${ctx}/maintenance/ipMultiplexPoolCfg/snatform?functionId=${cfg.functionId}'">
|
||||||
|
<i class="fa fa-plus"></i>
|
||||||
|
<spring:message code="add"></spring:message></button>
|
||||||
|
<c:set var="serviceImport" value="false"></c:set>
|
||||||
|
<c:set var="regionImport" value="false"></c:set>
|
||||||
|
<c:forEach items="${serviceList}" var="service" >
|
||||||
|
<c:if test="${(cfg.functionId eq service.functionId) && service.isImport eq 1}">
|
||||||
|
<c:set var="serviceImport" value="true"></c:set>
|
||||||
|
</c:if>
|
||||||
|
</c:forEach>
|
||||||
|
<c:forEach items="${regionList}" var="region" >
|
||||||
|
<c:if test="${(cfg.functionId eq region.functionId) && region.isImport eq 1}">
|
||||||
|
<c:set var="regionImport" value="true"></c:set>
|
||||||
|
</c:if>
|
||||||
|
</c:forEach>
|
||||||
|
<c:if test="${serviceImport eq 'true' && regionImport eq 'true'}">
|
||||||
|
<button type="button" class="btn btn-primary import" >
|
||||||
|
<i class="fa fa-plus"></i>
|
||||||
|
<spring:message code="import"></spring:message></button>
|
||||||
|
</c:if>
|
||||||
|
</shiro:hasPermission>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<h3 class="page-title">
|
||||||
|
<spring:message code="${cfg.menuNameCode }"></spring:message>
|
||||||
|
</h3>
|
||||||
|
<h5 class="page-header"></h5>
|
||||||
|
<div class="col-md-12">
|
||||||
|
<div class="portlet">
|
||||||
|
<div class="portlet-body">
|
||||||
|
<div class="row" >
|
||||||
|
<form:form id="searchForm" modelAttribute="cfg" action="${ctx}/maintenance/ipMultiplexPoolCfg/snatlist?functionId=${cfg.functionId}" method="post" class="form-search">
|
||||||
|
<input id="functionId" name="functionId" type="hidden" value="${cfg.functionId}"/>
|
||||||
|
<input id="audit" name="audit" type="hidden" value="${audit}"/>
|
||||||
|
<input id="exportType" type="hidden" value="${cfg.seltype}"/>
|
||||||
|
<input id="exportValue" type="hidden" value=""/>
|
||||||
|
<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
|
||||||
|
<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
|
||||||
|
<sys:tableSort id="orderBy" name="orderBy" value="${page.orderBy}" callback="page();" />
|
||||||
|
<!-- 筛选按钮展开状态-->
|
||||||
|
<input id="isFilterAction" name="isFilterAction" type="hidden" value="${cfg.isFilterAction }"/>
|
||||||
|
<!-- 搜索内容与操作按钮栏 -->
|
||||||
|
<div class="col-md-12">
|
||||||
|
<div class="pull-left">
|
||||||
|
<c:set var="state"><spring:message code='state'/></c:set>
|
||||||
|
<form:select path="isAudit" class="selectpicker select2 input-small">
|
||||||
|
<form:option value=""><spring:message code="all_states"/></form:option>
|
||||||
|
<form:option value="0"><spring:message code="created"></spring:message></form:option>
|
||||||
|
<form:option value="1"><spring:message code="approved"></spring:message></form:option>
|
||||||
|
<form:option value="2"><spring:message code="unapproved"></spring:message></form:option>
|
||||||
|
<%-- <form:option value="3"><spring:message code="cancel_approved"></spring:message></form:option> --%>
|
||||||
|
</form:select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="pull-left">
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-btn">
|
||||||
|
<form:select path="seltype" class="selectpicker select2 input-small" >
|
||||||
|
<form:option value="addrPoolId"><spring:message code="address_pool_id"></spring:message></form:option>
|
||||||
|
<form:option value="action"><spring:message code="block_type"></spring:message></form:option>
|
||||||
|
<form:option value="isValid"><spring:message code="valid_identifier"></spring:message></form:option>
|
||||||
|
</form:select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<input id="intype" class="form-control input-medium" type="text" value="">
|
||||||
|
<div class="input-group-btn">
|
||||||
|
<form:select id="actionSelect" path="action" class="selectpicker select2 input-small" >
|
||||||
|
<form:option value=""><spring:message code="select"/></form:option>
|
||||||
|
<c:forEach items="${serviceList}" var="service">
|
||||||
|
<form:option value="${service.action }"><spring:message code="action_${service.actionCode }"/></form:option>
|
||||||
|
</c:forEach>
|
||||||
|
</form:select>
|
||||||
|
<form:select path="isValid" class="selectpicker select2 input-small" >
|
||||||
|
<form:option value=""><spring:message code="select"/></form:option>
|
||||||
|
<form:option value="1"><spring:message code="yes"/></form:option>
|
||||||
|
<form:option value="0"><spring:message code="no"/></form:option>
|
||||||
|
</form:select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="pull-left">
|
||||||
|
<button type="button" class="btn blue" onClick="return page()"> <i class="fa fa-search"></i> <spring:message code="search"/> </button>
|
||||||
|
<button type="button" class="btn btn-default" id="resetBtn"> <i class="fa fa-refresh"></i> <spring:message code="reset"/> </button>
|
||||||
|
<button type="button" class="btn btn-default" id="filter-btn"> <spring:message code="filter"/> <i class="fa fa-angle-double-down"></i></button>
|
||||||
|
</div>
|
||||||
|
<div class="pull-right">
|
||||||
|
<shiro:hasPermission name="ip:mulitiplex:pool:config">
|
||||||
|
<sys:delRow url="${ctx}/maintenance/ipMultiplexPoolCfg/snatform" id="contentTable" label="update"></sys:delRow>
|
||||||
|
<sys:delRow url="${ctx}/maintenance/ipMultiplexPoolCfg/snatDelete?isValid=-1&functionId=${cfg.functionId }" id="contentTable" label="delete"></sys:delRow>
|
||||||
|
<%-- <sys:delRow url="${ctx}/maintenance/ipMultiplexPoolCfg/exportSnat?functionId=${cfg.functionId }&audit=${audit}" searchUrl="${ctx}/maintenance/ipMultiplexPoolCfg/snatlist?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="export"></sys:delRow> --%>
|
||||||
|
</shiro:hasPermission>
|
||||||
|
<shiro:hasPermission name="ip:mulitiplex:pool:confirm">
|
||||||
|
<div class="btn-group">
|
||||||
|
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||||
|
<i class="fa fa-wrench"></i> <spring:message code="examine"></spring:message>
|
||||||
|
<i class="fa fa-angle-down"></i>
|
||||||
|
</button>
|
||||||
|
<ul class="dropdown-menu pull-right">
|
||||||
|
<li><sys:delRow url="${ctx}/maintenance/ipMultiplexPoolCfg/snatAudit?isAudit=1&isValid=1&functionId=${cfg.functionId }" id="contentTable" label="approved"></sys:delRow></li>
|
||||||
|
<li><sys:delRow url="${ctx}/maintenance/ipMultiplexPoolCfg/snatAudit?isAudit=2&isValid=0&functionId=${cfg.functionId }" id="contentTable" label="unapproved"></sys:delRow></li>
|
||||||
|
<li><sys:delRow url="${ctx}/maintenance/ipMultiplexPoolCfg/snatAudit?isAudit=3&isValid=0&functionId=${cfg.functionId }" id="contentTable" label="cancelPass"></sys:delRow></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</shiro:hasPermission>
|
||||||
|
<a class="btn btn-icon-only btn-default setfields tooltips"
|
||||||
|
data-container="body" data-placement="top" data-original-title=<spring:message code="custom_columns"/> href="javascript:;">
|
||||||
|
<i class="icon-wrench"></i>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- /搜索内容与操作按钮栏 -->
|
||||||
|
|
||||||
|
<!-- 筛选搜索内容栏默认隐藏-->
|
||||||
|
<div class="col-md-12 filter-action-select-panle hide" >
|
||||||
|
<div class="row">
|
||||||
|
|
||||||
|
<div class="col-md-3">
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label"><spring:message code='letter'/></label>
|
||||||
|
<c:set var="select"><spring:message code='select'/></c:set>
|
||||||
|
<form:select path="requestId" class="selectpicker form-control" data-live-search="true" data-live-search-placeholder="search">
|
||||||
|
<form:option value=""><spring:message code="select"/></form:option>
|
||||||
|
<c:forEach items="${requestInfos}" var="requestInfo" >
|
||||||
|
<form:option value="${requestInfo.id}"><spring:message code="${requestInfo.requestTitle}"></spring:message></form:option>
|
||||||
|
</c:forEach>
|
||||||
|
</form:select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-3">
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label"><spring:message code='classification'/></label>
|
||||||
|
<form:select path="classify" class="selectpicker form-control" data-live-search="true" data-live-search-placeholder="search">
|
||||||
|
<form:option value=""><spring:message code="select"/></form:option>
|
||||||
|
<c:forEach items="${fls}" var="fl" >
|
||||||
|
<form:option value="${fl.serviceDictId}"><spring:message code="${fl.itemValue}"></spring:message></form:option>
|
||||||
|
</c:forEach>
|
||||||
|
</form:select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-3">
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label"><spring:message code='attribute'/></label>
|
||||||
|
<c:set var="select"><spring:message code='select'/></c:set>
|
||||||
|
<form:select path="attribute" class="selectpicker form-control" data-live-search="true" data-live-search-placeholder="search">
|
||||||
|
<form:option value=""><spring:message code="select"/></form:option>
|
||||||
|
<c:forEach items="${xzs}" var="xz" >
|
||||||
|
<form:option value="${xz.serviceDictId}"><spring:message code="${xz.itemValue}"></spring:message></form:option>
|
||||||
|
</c:forEach>
|
||||||
|
</form:select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-3">
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label"><spring:message code='label'/></label>
|
||||||
|
<form:select path="lable" class="selectpicker form-control" data-live-search="true" data-live-search-placeholder="search">
|
||||||
|
<form:option value=""><spring:message code="select"/></form:option>
|
||||||
|
<c:forEach items="${lables}" var="lable" >
|
||||||
|
<form:option value="${lable.serviceDictId}"><spring:message code="${lable.itemValue}"></spring:message></form:option>
|
||||||
|
</c:forEach>
|
||||||
|
</form:select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-2">
|
||||||
|
<div class="form-group">
|
||||||
|
<label><spring:message code="config_time"/>:</label>
|
||||||
|
<input name="search_create_time_start" type="text" readonly="readonly" maxlength="20" class="form-control Wdate"
|
||||||
|
value="<fmt:formatDate value='${cfg.search_create_time_start}' pattern='yyyy-MM-dd HH:mm:ss'/>" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-2">
|
||||||
|
<div class="form-group">
|
||||||
|
<label> </label>
|
||||||
|
<input name="search_create_time_end" type="text" readonly="readonly" maxlength="20" class="form-control Wdate"
|
||||||
|
value="<fmt:formatDate value="${cfg.search_create_time_end}" pattern="yyyy-MM-dd HH:mm:ss"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-2">
|
||||||
|
<div class="form-group">
|
||||||
|
<label><spring:message code="edit_time"/>:</label>
|
||||||
|
<input name="search_edit_time_start" type="text" readonly="readonly" maxlength="20" class="form-control Wdate"
|
||||||
|
value="<fmt:formatDate value="${cfg.search_edit_time_start}" pattern="yyyy-MM-dd HH:mm:ss"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-2">
|
||||||
|
<div class="form-group">
|
||||||
|
<label> </label>
|
||||||
|
<input name="search_edit_time_end" type="text" readonly="readonly" maxlength="20" class="form-control Wdate"
|
||||||
|
value="<fmt:formatDate value="${cfg.search_edit_time_end}" pattern="yyyy-MM-dd HH:mm:ss"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-2">
|
||||||
|
<div class="form-group">
|
||||||
|
<label><spring:message code="audit_time"/>:</label>
|
||||||
|
<input name="search_audit_time_start" type="text" readonly="readonly" maxlength="20" class="form-control Wdate"
|
||||||
|
value="<fmt:formatDate value="${cfg.search_audit_time_start}" pattern="yyyy-MM-dd HH:mm:ss"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-2">
|
||||||
|
<div class="form-group">
|
||||||
|
<label> </label>
|
||||||
|
<input name="search_audit_time_end" type="text" readonly="readonly" maxlength="20" class="form-control Wdate"
|
||||||
|
value="<fmt:formatDate value="${cfg.search_audit_time_end}" pattern="yyyy-MM-dd HH:mm:ss"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- /筛选搜索内容栏 结束-->
|
||||||
|
</form:form>
|
||||||
|
</div>
|
||||||
|
<sys:message content="${message}"/>
|
||||||
|
<div class="table-responsive">
|
||||||
|
<table id="contentTable" class="table table-striped table-bordered table-condensed text-nowrap">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th><input type="checkbox" class="i-checks" id="checkAll"></th>
|
||||||
|
<th class="sort-column r.compile_id"><spring:message code="address_pool_id"/></th>
|
||||||
|
<th><spring:message code="address_pool"/></th>
|
||||||
|
<th class="sort-column r.ipTotal"><spring:message code="ip_total"/></th>
|
||||||
|
<th class="sort-column r.available_ip_total"><spring:message code="available_ip_total"/></th>
|
||||||
|
|
||||||
|
<th><spring:message code="block_type"/></th>
|
||||||
|
<th class="sort-column r.is_valid"><spring:message code="valid_identifier"/></th>
|
||||||
|
<th><spring:message code="is_audit"/></th>
|
||||||
|
<th><spring:message code="whether_area_block"/></th>
|
||||||
|
<th><spring:message code="letter"/></th>
|
||||||
|
<th><spring:message code="classification"/></th>
|
||||||
|
<th><spring:message code="attribute"/></th>
|
||||||
|
<th><spring:message code="label"/></th>
|
||||||
|
<th><spring:message code="operation"/></th>
|
||||||
|
<th><spring:message code="creator"/></th>
|
||||||
|
<th class="sort-column r.create_time"><spring:message code="config_time"/></th>
|
||||||
|
<th><spring:message code="editor"/></th>
|
||||||
|
<th class="sort-column r.edit_time"><spring:message code="edit_time"/></th>
|
||||||
|
<th><spring:message code="auditor"/></th>
|
||||||
|
<th class="sort-column r.audit_time"><spring:message code="audit_time"/></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<c:forEach items="${page.list }" var="cfg" varStatus="status" step="1">
|
||||||
|
<tr>
|
||||||
|
<td><input type="checkbox" class="i-checks" serviceId="${cfg.serviceId}" id="${cfg.cfgId}" value="${cfg.isAudit}"></td>
|
||||||
|
<td>${cfg.addrPoolId }</td>
|
||||||
|
<td>
|
||||||
|
<a href="javascript:;" data-original-title="${cfg.addrPoolName}"
|
||||||
|
class="tooltips" data-flag="false" data-html="true" data-placement="top">
|
||||||
|
${fns:abbr(cfg.addrPoolName,20)}
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td>${cfg.ipTotal }</td>
|
||||||
|
<td>${cfg.availableIpTotal }</td>
|
||||||
|
|
||||||
|
<td>
|
||||||
|
<c:forEach items="${fns:getDictList('SERVICE_ACTION') }" var="dict">
|
||||||
|
<c:if test="${dict.itemCode eq cfg.action }">
|
||||||
|
<spring:message code="${dict.itemValue }"/>
|
||||||
|
</c:if>
|
||||||
|
</c:forEach>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<c:if test="${cfg.isValid==0}"><spring:message code="no"/></c:if>
|
||||||
|
<c:if test="${cfg.isValid==1}"><spring:message code="yes"/></c:if>
|
||||||
|
<c:if test="${cfg.isValid==-1}"><spring:message code="deleted"/></c:if>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<c:choose>
|
||||||
|
<c:when test="${cfg.isAudit eq '0'}"><span class="label label-danger"><spring:message code="created"></spring:message></span></c:when>
|
||||||
|
<c:when test="${cfg.isAudit eq '1'}"><span class="label label-success"><spring:message code="approved"></spring:message></span></c:when>
|
||||||
|
<c:when test="${cfg.isAudit eq '2'}"><span class="label label-warning"><spring:message code="unapproved"></spring:message></span></c:when>
|
||||||
|
<c:when test="${cfg.isAudit eq '3'}"><span indexTable="${cfg.indexTable}" data-placement="right" data-original-title="<spring:message code='letter_cancel_info'/>: " class="label le-ca-fo label-warning tooltips" data-icon=""> <spring:message code="cancel_approved"/></span></c:when>
|
||||||
|
</c:choose>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<c:if test="${cfg.isAreaEffective==0}"><spring:message code="all"/></c:if>
|
||||||
|
<c:if test="${cfg.isAreaEffective==1}">
|
||||||
|
<a href="javascript:viewAreaInfo('${ctx}','${cfg.areaEffectiveIds }','${cfg.compileId }')" >
|
||||||
|
<spring:message code="selective"/>
|
||||||
|
</a>
|
||||||
|
</c:if>
|
||||||
|
</td>
|
||||||
|
<td>${cfg.requestName }</td>
|
||||||
|
<td>
|
||||||
|
<c:set var="classify"></c:set>
|
||||||
|
<c:forEach items="${fn:split(cfg.classify,',')}" var="classifyId" varStatus="status">
|
||||||
|
<c:forEach items="${fls}" var="fl">
|
||||||
|
<c:if test="${classifyId eq fn:trim(fl.serviceDictId)}">
|
||||||
|
<c:if test="${status.index+1 eq 1}">
|
||||||
|
<c:set var="classify" value="${fl.itemValue}"></c:set>
|
||||||
|
</c:if>
|
||||||
|
<c:if test="${status.index+1 ne 1}">
|
||||||
|
<c:set var="classify" value="${classify},${fl.itemValue}"></c:set>
|
||||||
|
</c:if>
|
||||||
|
</c:if>
|
||||||
|
</c:forEach>
|
||||||
|
</c:forEach>
|
||||||
|
<a href="javascript:;" data-original-title="${classify}"
|
||||||
|
class="tooltips" data-flag="false" data-html="true" data-placement="top">
|
||||||
|
${fns:abbr(classify,20)}
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<c:set var="attribute"></c:set>
|
||||||
|
<c:forEach items="${fn:split(cfg.attribute,',')}" var="attributeId" varStatus="status">
|
||||||
|
<c:forEach items="${xzs}" var="xz">
|
||||||
|
<c:if test="${attributeId eq fn:trim(xz.serviceDictId)}">
|
||||||
|
<c:if test="${status.index+1 eq 1}">
|
||||||
|
<c:set var="attribute" value="${xz.itemValue}"></c:set>
|
||||||
|
</c:if>
|
||||||
|
<c:if test="${status.index+1 ne 1}">
|
||||||
|
<c:set var="attribute" value="${attribute},${xz.itemValue}"></c:set>
|
||||||
|
</c:if>
|
||||||
|
</c:if>
|
||||||
|
</c:forEach>
|
||||||
|
</c:forEach>
|
||||||
|
<a href="javascript:;" data-original-title="${attribute}"
|
||||||
|
class="tooltips" data-flag="false" data-html="true" data-placement="top">
|
||||||
|
${fns:abbr(attribute,20)}
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<c:set var="lableInfo"></c:set>
|
||||||
|
<c:forEach items="${fn:split(cfg.lable,',')}" var="lableId" varStatus="status">
|
||||||
|
<c:forEach items="${lables}" var="lable">
|
||||||
|
<c:if test="${lableId eq fn:trim(lable.serviceDictId)}">
|
||||||
|
<c:if test="${status.index+1 eq 1}">
|
||||||
|
<c:set var="lableInfo" value="${lable.itemValue}"></c:set>
|
||||||
|
</c:if>
|
||||||
|
<c:if test="${status.index+1 ne 1}">
|
||||||
|
<c:set var="lableInfo" value="${lableInfo},${lable.itemValue}"></c:set>
|
||||||
|
</c:if>
|
||||||
|
</c:if>
|
||||||
|
</c:forEach>
|
||||||
|
</c:forEach>
|
||||||
|
<a href="javascript:;" data-original-title="${lableInfo}"
|
||||||
|
class="tooltips" data-flag="false" data-html="true" data-placement="top">
|
||||||
|
${fns:abbr(lableInfo,20)}
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<!-- <a href="#">新增IP</a>
|
||||||
|
<a href="#">删除IP</a> -->
|
||||||
|
<a href="#"><spring:message code="show_detail"/></a>
|
||||||
|
</td>
|
||||||
|
<td>${cfg.creatorName }</td>
|
||||||
|
<td><fmt:formatDate value="${cfg.createTime }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
|
||||||
|
<td>${cfg.editorName }</td>
|
||||||
|
<td><fmt:formatDate value="${cfg.editTime }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
|
||||||
|
<td>${cfg.auditorName }</td>
|
||||||
|
<td><fmt:formatDate value="${cfg.auditTime }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
|
||||||
|
</tr>
|
||||||
|
</c:forEach>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<div class="page">${page}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<c:set var="importPath" value="/maintenance/ipMultiplexPoolCfg/snatlist?functionId=${cfg.functionId}"/>
|
||||||
|
<!-- 模板导入,start -->
|
||||||
|
<%@include file="/WEB-INF/include/excel/importModal.jsp" %>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -924,18 +924,18 @@ var fillIp=function (ip){
|
|||||||
}
|
}
|
||||||
return ip;
|
return ip;
|
||||||
}
|
}
|
||||||
// snat复用地址池ip唯一
|
// 地址池校验
|
||||||
jQuery.validator.addMethod("ipUnique",function(value, element) {
|
jQuery.validator.addMethod("addrPoolUnique",function(value, element) {
|
||||||
var ctx=$(element).attr("ctx");
|
var ctx=$(element).attr("ctx");
|
||||||
var cfgId= $("[name='cfgId']").val();
|
var cfgId= $("[name='cfgId']").val();
|
||||||
var functionId= $("[name='functionId']").val();
|
var functionId= $("[name='functionId']").val();
|
||||||
var url = ctx+"/maintenance/ipMultiplexPoolCfg/checkIp";
|
var url = ctx+"/maintenance/ipMultiplexPoolCfg/checkAddrPool";
|
||||||
var result = true;
|
var result = true;
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type:'post',
|
type:'post',
|
||||||
async:false,
|
async:false,
|
||||||
url: url,
|
url: url,
|
||||||
data:{"cfgId":cfgId,"functionId":functionId,"destIpAddress":value},
|
data:{"cfgId":cfgId,"functionId":functionId,"addrPoolName":value},
|
||||||
success:function(data){
|
success:function(data){
|
||||||
result = data;
|
result = data;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -76,7 +76,7 @@
|
|||||||
protocolPort:"TCP protocol or UDP protocol must be chosen when port is greater than 0",
|
protocolPort:"TCP protocol or UDP protocol must be chosen when port is greater than 0",
|
||||||
protocolPort1:"Only when TCP protocol or UDP protocol is chosen can port greater than 0",
|
protocolPort1:"Only when TCP protocol or UDP protocol is chosen can port greater than 0",
|
||||||
netAddress:"The class C type of IP addresses must has the same network number bit field",
|
netAddress:"The class C type of IP addresses must has the same network number bit field",
|
||||||
ipUnique:"IP already exists.",
|
addrPoolUnique:"Address Pool already exists.",
|
||||||
asnNoUnique:"ASN already exists.",
|
asnNoUnique:"ASN already exists.",
|
||||||
areaUnique:"Area already exists."
|
areaUnique:"Area already exists."
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -76,7 +76,7 @@
|
|||||||
protocolPort:"Если порт больше 0, необходимо выбрать протокол TCP или протокол UDP",
|
protocolPort:"Если порт больше 0, необходимо выбрать протокол TCP или протокол UDP",
|
||||||
protocolPort1:"Только при выборе протокола TCP или протокола UDP порт может быть больше 0",
|
protocolPort1:"Только при выборе протокола TCP или протокола UDP порт может быть больше 0",
|
||||||
netAddress:"Тип IP-адресов класса C должен иметь один и тот же номер сети бит поля.",
|
netAddress:"Тип IP-адресов класса C должен иметь один и тот же номер сети бит поля.",
|
||||||
ipUnique:"IP уже существует.",
|
addrPoolUnique:"Address Pool уже существует.",
|
||||||
asnNoUnique:"ASN уже существует.",
|
asnNoUnique:"ASN уже существует.",
|
||||||
areaUnique:"Регион уже существует."
|
areaUnique:"Регион уже существует."
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -76,7 +76,7 @@
|
|||||||
protocolPort:"端口大于0时必须选择TCP协议或者UDP协议",
|
protocolPort:"端口大于0时必须选择TCP协议或者UDP协议",
|
||||||
protocolPort1:"只有tcp,udp协议端口号可以不为0",
|
protocolPort1:"只有tcp,udp协议端口号可以不为0",
|
||||||
netAddress:"C类IP地址网络位必须相同",
|
netAddress:"C类IP地址网络位必须相同",
|
||||||
ipUnique:"IP已存在",
|
addrPoolUnique:"地址池已存在",
|
||||||
asnNoUnique:"ASN号已存在",
|
asnNoUnique:"ASN号已存在",
|
||||||
areaUnique:"该区域已存在"
|
areaUnique:"该区域已存在"
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ $(function(){
|
|||||||
$("form input[name$='cfgKeywords']").attr("maxlength","1024");
|
$("form input[name$='cfgKeywords']").attr("maxlength","1024");
|
||||||
$("form input[class~='domainCheck']").attr("maxlength","1024");
|
$("form input[class~='domainCheck']").attr("maxlength","1024");
|
||||||
//截取过长的文字 使用id选择器;例如:tab对象->tr->td对象. 排除日志table .logTb
|
//截取过长的文字 使用id选择器;例如:tab对象->tr->td对象. 排除日志table .logTb
|
||||||
$("#contentTable").find("td").each(function(i,element){
|
$("#contentTable").find("td").not(":has(a)").each(function(i,element){
|
||||||
//获取td当前对象的文本,如果长度大于25;
|
//获取td当前对象的文本,如果长度大于25;
|
||||||
if(!$(element).find(".tooltips").length>0){
|
if(!$(element).find(".tooltips").length>0){
|
||||||
var tdclass= $(this).attr("class");//no_substr 不进行截取
|
var tdclass= $(this).attr("class");//no_substr 不进行截取
|
||||||
|
|||||||
Reference in New Issue
Block a user