(1)ASN IP配置提交
(2)ASN 策略提交
This commit is contained in:
136
src/main/java/com/nis/domain/basics/AsnIpCfg.java
Normal file
136
src/main/java/com/nis/domain/basics/AsnIpCfg.java
Normal file
@@ -0,0 +1,136 @@
|
||||
package com.nis.domain.basics;
|
||||
|
||||
import com.google.gson.annotations.Expose;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.nis.domain.configuration.BaseCfg;
|
||||
|
||||
public class AsnIpCfg extends BaseCfg<AsnIpCfg> {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 398247881810945300L;
|
||||
private static final String tableName="asn_ip_cfg";
|
||||
@Expose
|
||||
private Integer regionId;
|
||||
@Expose
|
||||
private String ratelimit;
|
||||
@Expose
|
||||
@SerializedName("ipType")
|
||||
private Integer ipType;
|
||||
private Integer ipPattern;
|
||||
private String srcIpAddress;
|
||||
private String destIpAddress;
|
||||
private Integer portPattern;
|
||||
private String srcPort;
|
||||
private String destPort;
|
||||
private String asnIpGroupName;//asn组名
|
||||
private Integer asnIpGroup;//asn号
|
||||
/**
|
||||
* 方向
|
||||
*/
|
||||
@Expose
|
||||
@SerializedName("direction")
|
||||
private Integer direction ;
|
||||
/**
|
||||
* 方向
|
||||
*/
|
||||
@Expose
|
||||
@SerializedName("protocol")
|
||||
private Integer protocol ;
|
||||
private Integer protocolId;
|
||||
private Integer compileId=0;
|
||||
|
||||
public Integer getCompileId() {
|
||||
return compileId;
|
||||
}
|
||||
public Integer getProtocolId() {
|
||||
return protocolId;
|
||||
}
|
||||
public void setProtocolId(Integer protocolId) {
|
||||
this.protocolId = protocolId;
|
||||
}
|
||||
|
||||
public String getAsnIpGroupName() {
|
||||
return asnIpGroupName;
|
||||
}
|
||||
public void setAsnIpGroupName(String asnIpGroupName) {
|
||||
this.asnIpGroupName = asnIpGroupName;
|
||||
}
|
||||
public Integer getAsnIpGroup() {
|
||||
return asnIpGroup;
|
||||
}
|
||||
public void setAsnIpGroup(Integer asnIpGroup) {
|
||||
this.asnIpGroup = asnIpGroup;
|
||||
}
|
||||
public String getRatelimit() {
|
||||
return ratelimit;
|
||||
}
|
||||
public void setRatelimit(String ratelimit) {
|
||||
this.ratelimit = ratelimit;
|
||||
}
|
||||
public Integer getIpType() {
|
||||
return ipType;
|
||||
}
|
||||
public void setIpType(Integer ipType) {
|
||||
this.ipType = ipType;
|
||||
}
|
||||
public Integer getIpPattern() {
|
||||
return ipPattern;
|
||||
}
|
||||
public void setIpPattern(Integer ipPattern) {
|
||||
this.ipPattern = ipPattern;
|
||||
}
|
||||
public String getSrcIpAddress() {
|
||||
return srcIpAddress;
|
||||
}
|
||||
public void setSrcIpAddress(String srcIpAddress) {
|
||||
this.srcIpAddress = srcIpAddress;
|
||||
}
|
||||
public String getDestIpAddress() {
|
||||
return destIpAddress;
|
||||
}
|
||||
public void setDestIpAddress(String destIpAddress) {
|
||||
this.destIpAddress = destIpAddress;
|
||||
}
|
||||
public Integer getPortPattern() {
|
||||
return portPattern;
|
||||
}
|
||||
public void setPortPattern(Integer portPattern) {
|
||||
this.portPattern = portPattern;
|
||||
}
|
||||
public String getSrcPort() {
|
||||
return srcPort;
|
||||
}
|
||||
public void setSrcPort(String srcPort) {
|
||||
this.srcPort = srcPort;
|
||||
}
|
||||
public String getDestPort() {
|
||||
return destPort;
|
||||
}
|
||||
public void setDestPort(String destPort) {
|
||||
this.destPort = destPort;
|
||||
}
|
||||
public Integer getDirection() {
|
||||
return direction;
|
||||
}
|
||||
public void setDirection(Integer direction) {
|
||||
this.direction = direction;
|
||||
}
|
||||
public Integer getProtocol() {
|
||||
return protocol;
|
||||
}
|
||||
public void setProtocol(Integer protocol) {
|
||||
this.protocol = protocol;
|
||||
}
|
||||
public static String getTablename() {
|
||||
return tableName;
|
||||
}
|
||||
public Integer getRegionId() {
|
||||
return regionId;
|
||||
}
|
||||
public void setRegionId(Integer regionId) {
|
||||
this.regionId = regionId;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -10,6 +10,8 @@ package com.nis.domain.configuration;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.nis.domain.basics.AsnIpCfg;
|
||||
|
||||
|
||||
/**
|
||||
* @ClassName: CfgIndexInfo.java
|
||||
@@ -26,6 +28,7 @@ public class CfgIndexInfo extends BaseCfg<CfgIndexInfo> {
|
||||
private static final long serialVersionUID = 2796500715438264119L;
|
||||
private static final String tableName="cfg_index_info";
|
||||
private List<AvVoipAccountCfg> voipAccounts;//Add表单使用
|
||||
private List<AsnIpCfg> asnIpCfgs;//Add表单使用
|
||||
private List<AvVoipIpCfg> voipIps; //Add表单使用
|
||||
private AvVoipAccountCfg voipAccount;//Search使用
|
||||
private AvVoipIpCfg voipIp;//Search使用
|
||||
@@ -56,7 +59,8 @@ public class CfgIndexInfo extends BaseCfg<CfgIndexInfo> {
|
||||
|
||||
private Long dnsStrategyId;
|
||||
private String dnsStrategyName;
|
||||
|
||||
private Integer asnIpGroup;//asn ip使用的组,仅用来帮助asnIpCfgs中的 ip保存组名,数据库并不需要新增字段
|
||||
private String asnIpGroupName;
|
||||
private P2pHashCfg p2pHash;
|
||||
private P2pKeywordCfg p2pKeyword;
|
||||
private List<P2pHashCfg> p2pHashList;
|
||||
@@ -65,6 +69,24 @@ public class CfgIndexInfo extends BaseCfg<CfgIndexInfo> {
|
||||
|
||||
|
||||
|
||||
public Integer getAsnIpGroup() {
|
||||
return asnIpGroup;
|
||||
}
|
||||
public void setAsnIpGroup(Integer asnIpGroup) {
|
||||
this.asnIpGroup = asnIpGroup;
|
||||
}
|
||||
public String getAsnIpGroupName() {
|
||||
return asnIpGroupName;
|
||||
}
|
||||
public void setAsnIpGroupName(String asnIpGroupName) {
|
||||
this.asnIpGroupName = asnIpGroupName;
|
||||
}
|
||||
public List<AsnIpCfg> getAsnIpCfgs() {
|
||||
return asnIpCfgs;
|
||||
}
|
||||
public void setAsnIpCfgs(List<AsnIpCfg> asnIpCfgs) {
|
||||
this.asnIpCfgs = asnIpCfgs;
|
||||
}
|
||||
public NtcBgpAsCfg getNtcBgpAsCfg() {
|
||||
return ntcBgpAsCfg;
|
||||
}
|
||||
|
||||
93
src/main/java/com/nis/domain/maat/GroupReuseAddBean.java
Normal file
93
src/main/java/com/nis/domain/maat/GroupReuseAddBean.java
Normal file
@@ -0,0 +1,93 @@
|
||||
/**
|
||||
*@Title: ToMaatBean.java
|
||||
*@Package com.nis.domain.configuration
|
||||
*@Description TODO
|
||||
*@author dell
|
||||
*@date 2018年2月28日 下午2:03:08
|
||||
*@version 版本号
|
||||
*/
|
||||
package com.nis.domain.maat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.google.gson.annotations.Expose;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
/**
|
||||
* @ClassName: ToMaatBean.java
|
||||
* @Description: TODO
|
||||
* @author (dell)
|
||||
* @date 2018年2月28日 下午2:03:08
|
||||
* @version V1.0
|
||||
*/
|
||||
public class GroupReuseAddBean implements Serializable{
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = -3468862666445104490L;
|
||||
/**
|
||||
* @Fields serialVersionUID:TODO(转换为maat格式的java bean)
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Expose
|
||||
private String version;
|
||||
@Expose
|
||||
@SerializedName("operator")
|
||||
private String creatorName;
|
||||
@Expose
|
||||
@SerializedName("opTime")
|
||||
private Date auditTime;
|
||||
@Expose
|
||||
private Integer opAction;
|
||||
@Expose
|
||||
@SerializedName("groupReuseList")
|
||||
private List<GroupReuseCfg> groupReuseCfgList;
|
||||
|
||||
public String getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
public void setVersion(String version) {
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public String getCreatorName() {
|
||||
return creatorName;
|
||||
}
|
||||
|
||||
public void setCreatorName(String creatorName) {
|
||||
this.creatorName = creatorName;
|
||||
}
|
||||
|
||||
public Date getAuditTime() {
|
||||
return auditTime;
|
||||
}
|
||||
|
||||
public void setAuditTime(Date auditTime) {
|
||||
this.auditTime = auditTime;
|
||||
}
|
||||
|
||||
public List<GroupReuseCfg> getGroupReuseCfgList() {
|
||||
return groupReuseCfgList;
|
||||
}
|
||||
|
||||
public void setGroupReuseCfgList(List<GroupReuseCfg> groupReuseCfgList) {
|
||||
this.groupReuseCfgList = groupReuseCfgList;
|
||||
}
|
||||
|
||||
public Integer getOpAction() {
|
||||
return opAction;
|
||||
}
|
||||
|
||||
public void setOpAction(Integer opAction) {
|
||||
this.opAction = opAction;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
}
|
||||
}
|
||||
46
src/main/java/com/nis/domain/maat/GroupReuseCfg.java
Normal file
46
src/main/java/com/nis/domain/maat/GroupReuseCfg.java
Normal file
@@ -0,0 +1,46 @@
|
||||
package com.nis.domain.maat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import com.google.gson.annotations.Expose;
|
||||
import com.nis.domain.maat.MaatCfg.IpCfg;
|
||||
import com.nis.domain.maat.MaatCfg.NumBoundaryCfg;
|
||||
import com.nis.domain.maat.MaatCfg.StringCfg;
|
||||
/**
|
||||
* 组复用配置
|
||||
* @author dell
|
||||
*
|
||||
*/
|
||||
public class GroupReuseCfg implements Serializable {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1830956100866313836L;
|
||||
@Expose
|
||||
private List<StringCfg> strRegionList;
|
||||
@Expose
|
||||
private List<IpCfg> ipRegionList;
|
||||
@Expose
|
||||
private List<NumBoundaryCfg> numRegionList;
|
||||
public List<StringCfg> getStrRegionList() {
|
||||
return strRegionList;
|
||||
}
|
||||
public void setStrRegionList(List<StringCfg> strRegionList) {
|
||||
this.strRegionList = strRegionList;
|
||||
}
|
||||
public List<IpCfg> getIpRegionList() {
|
||||
return ipRegionList;
|
||||
}
|
||||
public void setIpRegionList(List<IpCfg> ipRegionList) {
|
||||
this.ipRegionList = ipRegionList;
|
||||
}
|
||||
public List<NumBoundaryCfg> getNumRegionList() {
|
||||
return numRegionList;
|
||||
}
|
||||
public void setNumRegionList(List<NumBoundaryCfg> numRegionList) {
|
||||
this.numRegionList = numRegionList;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -41,6 +41,14 @@ public class ToMaatResult implements Serializable{
|
||||
private String digest;
|
||||
private List configCompileList;
|
||||
private List updateStatCfgList;
|
||||
private List groupReuseList;
|
||||
|
||||
public List getGroupReuseList() {
|
||||
return groupReuseList;
|
||||
}
|
||||
public void setGroupReuseList(List groupReuseList) {
|
||||
this.groupReuseList = groupReuseList;
|
||||
}
|
||||
public List getUpdateStatCfgList() {
|
||||
return updateStatCfgList;
|
||||
}
|
||||
|
||||
@@ -19,11 +19,13 @@ import org.glassfish.jersey.media.multipart.FormDataMultiPart;
|
||||
import org.glassfish.jersey.media.multipart.file.FileDataBodyPart;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.nis.domain.basics.AsnIpCfg;
|
||||
import com.nis.domain.configuration.BaseIpCfg;
|
||||
import com.nis.domain.log.SearchReport;
|
||||
import com.nis.domain.maat.ToMaatResult;
|
||||
import com.nis.domain.report.ReportResult;
|
||||
import com.nis.domain.maat.MaatCfg.IpCfg;
|
||||
import com.nis.exceptions.MaatConvertException;
|
||||
import com.nis.util.httpclient.ClientUtil;
|
||||
|
||||
@@ -250,7 +252,7 @@ public class ConfigServiceUtil {
|
||||
/**
|
||||
* 配置状态修改
|
||||
* @param params
|
||||
* @param type,1表示maat配置取消,2表示回调配置取消
|
||||
* @param type,1表示maat配置取消,2表示回调配置取消,3,分组复用删除域
|
||||
* @return
|
||||
*/
|
||||
public static ToMaatResult put(String params,Integer type) throws MaatConvertException{
|
||||
@@ -261,6 +263,8 @@ public class ConfigServiceUtil {
|
||||
url = url+Constants.MAAT_CFG;
|
||||
}else if(type==2){
|
||||
url = url+Constants.CALLBACK_CFG;
|
||||
}else if(type==3) {
|
||||
url = url+Constants.GROUP_REUSE_SOURCES;
|
||||
}
|
||||
//创建连接
|
||||
WebTarget wt = ClientUtil.getWebTarger(url);
|
||||
@@ -305,6 +309,33 @@ public class ConfigServiceUtil {
|
||||
}
|
||||
return bean;
|
||||
}
|
||||
/**
|
||||
* 分组复用域配置新增
|
||||
* @param params
|
||||
* @return
|
||||
* @throws MaatConvertException
|
||||
*/
|
||||
public static ToMaatResult postGroupReuseSources(String params) throws MaatConvertException{
|
||||
String result = null;
|
||||
ToMaatResult bean = null;
|
||||
String url = Constants.SERVICE_URL+Constants.GROUP_REUSE_SOURCES;
|
||||
//创建连接
|
||||
WebTarget wt = ClientUtil.getWebTarger(url);
|
||||
logger.info("postGroupReuseSources url:"+url);
|
||||
//获取响应结果
|
||||
Builder header = wt.request(MediaType.APPLICATION_JSON).header("Content-Type", MediaType.APPLICATION_JSON);
|
||||
Response response= header.post(Entity.entity(params, MediaType.APPLICATION_JSON));
|
||||
if( response.getStatus() == 200){
|
||||
result= response.readEntity(String.class);
|
||||
JsonConfig config=new JsonConfig();
|
||||
config.setExcludes(new String[]{"configCompileList"});
|
||||
JSONObject resObject = JSONObject.fromObject(result,config);
|
||||
bean = (ToMaatResult) JSONObject.toBean(resObject,ToMaatResult.class);
|
||||
}else{
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+response.readEntity(String.class));
|
||||
}
|
||||
return bean;
|
||||
}
|
||||
/**
|
||||
*
|
||||
* getReport(配置日志总量统计查询)
|
||||
|
||||
@@ -7,6 +7,7 @@ import java.util.Map;
|
||||
import com.google.gson.GsonBuilder;
|
||||
|
||||
public final class Constants {
|
||||
public static final String GROUP_REUSE_SOURCES=Configurations.getStringProperty("groupReuseSources","groupReuseSources");
|
||||
public static Integer APP_SPEC_SERVICE_CODE_MIN_VAL=Configurations.getIntProperty("app_spec_service_code_min_val", 300001);
|
||||
public static Integer APP_SPEC_SERVICE_CODE_MAX_VAL=Configurations.getIntProperty("app_spec_service_code_max_val", 268435455);
|
||||
public static String APP_CFG_USERREGION_SPLITOR=Configurations.getStringProperty("app_cfg_userregion_splitor", "&");
|
||||
|
||||
@@ -35,7 +35,6 @@ import com.nis.domain.SysDataDictionaryItem;
|
||||
import com.nis.domain.basics.PolicyGroupInfo;
|
||||
import com.nis.domain.basics.ServiceDictInfo;
|
||||
import com.nis.domain.basics.SysDictInfo;
|
||||
import com.nis.domain.configuration.AppBuiltInFeatureFile;
|
||||
import com.nis.domain.configuration.AreaBean;
|
||||
import com.nis.domain.configuration.AreaIpCfg;
|
||||
import com.nis.domain.configuration.BaseCfg;
|
||||
@@ -64,11 +63,13 @@ import com.nis.web.service.OfficeService;
|
||||
import com.nis.web.service.RoleService;
|
||||
import com.nis.web.service.SystemService;
|
||||
import com.nis.web.service.UserService;
|
||||
import com.nis.web.service.basics.AsnIpCfgService;
|
||||
import com.nis.web.service.basics.PolicyGroupInfoService;
|
||||
import com.nis.web.service.basics.ServiceDictInfoService;
|
||||
import com.nis.web.service.basics.SysDictInfoService;
|
||||
import com.nis.web.service.configuration.AppBuiltInFeatureService;
|
||||
import com.nis.web.service.configuration.AppCfgService;
|
||||
import com.nis.web.service.configuration.AsnPolicyCfgService;
|
||||
import com.nis.web.service.configuration.AvCfgService;
|
||||
import com.nis.web.service.configuration.AvContentCfgService;
|
||||
import com.nis.web.service.configuration.BgpCfgService;
|
||||
@@ -195,7 +196,10 @@ public class BaseController {
|
||||
protected PxyObjKeyringService pxyObjKeyringService;//拦截策略service
|
||||
@Autowired
|
||||
protected AppBuiltInFeatureService appBuiltInFeatureService;//拦截策略service
|
||||
|
||||
@Autowired
|
||||
protected AsnIpCfgService asnIpCfgService;//asn ip service
|
||||
@Autowired
|
||||
protected AsnPolicyCfgService asnPolicyCfgService;//asn 策略 service
|
||||
/**
|
||||
* 管理基础路径
|
||||
*/
|
||||
@@ -477,14 +481,17 @@ public class BaseController {
|
||||
model.addAttribute("isps", isps);
|
||||
|
||||
//查询配置对应的地域ip
|
||||
List<AreaIpCfg> areaCfgs=ipCfgService.getAreaCfgByCompileId(cfg.getCompileId());
|
||||
model.addAttribute("areaCfgs", areaCfgs);
|
||||
StringBuffer areaCfgIds=new StringBuffer();
|
||||
for(AreaIpCfg areaCfg:areaCfgs){
|
||||
areaCfgIds.append(areaCfg.getCfgId()+",");
|
||||
if(cfg.getCompileId()!=null) {
|
||||
List<AreaIpCfg> areaCfgs=ipCfgService.getAreaCfgByCompileId(cfg.getCompileId());
|
||||
model.addAttribute("areaCfgs", areaCfgs);
|
||||
|
||||
StringBuffer areaCfgIds=new StringBuffer();
|
||||
for(AreaIpCfg areaCfg:areaCfgs){
|
||||
areaCfgIds.append(areaCfg.getCfgId()+",");
|
||||
}
|
||||
//update时判断是否有删除地域ip
|
||||
model.addAttribute("areaCfgIds", areaCfgIds.toString());
|
||||
}
|
||||
//update时判断是否有删除地域ip
|
||||
model.addAttribute("areaCfgIds", areaCfgIds.toString());
|
||||
//初始化一个默认的地域ip给界面
|
||||
AreaIpCfg areaIpCfg=new AreaIpCfg();
|
||||
areaIpCfg.initDefaultValue();
|
||||
|
||||
119
src/main/java/com/nis/web/controller/basics/AsnIpController.java
Normal file
119
src/main/java/com/nis/web/controller/basics/AsnIpController.java
Normal file
@@ -0,0 +1,119 @@
|
||||
package com.nis.web.controller.basics;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
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.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
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.AsnIpCfg;
|
||||
import com.nis.domain.basics.PolicyGroupInfo;
|
||||
import com.nis.domain.configuration.CfgIndexInfo;
|
||||
import com.nis.exceptions.MaatConvertException;
|
||||
import com.nis.web.controller.BaseController;
|
||||
@Controller
|
||||
@RequestMapping(value = "${adminPath}/basics/asn")
|
||||
public class AsnIpController extends BaseController{
|
||||
@RequestMapping(value = {"/list"})
|
||||
public String list(Model model,HttpServletRequest request
|
||||
,HttpServletResponse response,@ModelAttribute("cfg")AsnIpCfg entity
|
||||
,RedirectAttributes redirectAttributes){
|
||||
Page<AsnIpCfg> page = asnIpCfgService.findPage(new Page<AsnIpCfg>(request, response,"r"), entity);
|
||||
model.addAttribute("page", page);
|
||||
initPageCondition(model);
|
||||
return "/basics/asnIpCfgList";
|
||||
}
|
||||
@RequestMapping(value = {"/addForm"})
|
||||
public String addForm(Model model,HttpServletRequest request
|
||||
,HttpServletResponse response,@ModelAttribute("cfg")CfgIndexInfo cfg
|
||||
,RedirectAttributes redirectAttributes){
|
||||
initFormCondition(model,cfg);
|
||||
List<PolicyGroupInfo> policyGroups=policyGroupInfoService.findPolicyGroupInfosByType(4);
|
||||
model.addAttribute("policyGroups", policyGroups);
|
||||
model.addAttribute("_cfg", cfg);
|
||||
return "/basics/asnIpCfgFormAdd";
|
||||
}
|
||||
@RequestMapping(value = {"/updateForm"})
|
||||
public String updateForm(Model model,HttpServletRequest request
|
||||
,HttpServletResponse response,String ids,@ModelAttribute("cfg")AsnIpCfg cfg
|
||||
,RedirectAttributes redirectAttributes){
|
||||
cfg = asnIpCfgService.get(Long.parseLong(ids));
|
||||
initUpdateFormCondition(model, cfg);
|
||||
List<PolicyGroupInfo> policyGroups=policyGroupInfoService.findPolicyGroupInfosByType(4);
|
||||
model.addAttribute("policyGroups", policyGroups);
|
||||
model.addAttribute("_cfg", cfg);
|
||||
return "/basics/asnIpCfgFormUpdate";
|
||||
}
|
||||
@RequestMapping(value = {"/save"})
|
||||
@RequiresPermissions(value={"asn:ip:config"})
|
||||
public String save(Model model,HttpServletRequest request,HttpServletResponse response,@ModelAttribute("cfg")CfgIndexInfo cfg,RedirectAttributes redirectAttributes){
|
||||
try{
|
||||
asnIpCfgService.saveAsnIpCfg(cfg);
|
||||
addMessage(redirectAttributes,"save_success");
|
||||
}catch(Exception e){
|
||||
logger.error("信息保存失败",e);
|
||||
e.printStackTrace();
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,e.getMessage());
|
||||
}else {
|
||||
addMessage(redirectAttributes,"save_failed");
|
||||
}
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath +"/basics/asn/list?functionId="+cfg.getFunctionId();
|
||||
}
|
||||
@RequestMapping(value = {"/update"})
|
||||
@RequiresPermissions(value={"asn:ip:config"})
|
||||
public String update(Model model,HttpServletRequest request,HttpServletResponse response,@ModelAttribute("cfg")AsnIpCfg cfg,RedirectAttributes redirectAttributes){
|
||||
try{
|
||||
|
||||
asnIpCfgService.update(cfg);
|
||||
addMessage(redirectAttributes,"save_success");
|
||||
}catch(Exception e){
|
||||
logger.error("信息保存失败",e);
|
||||
e.printStackTrace();
|
||||
addMessage(redirectAttributes,"save_failed");
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath +"/basics/asn/list?functionId="+cfg.getFunctionId();
|
||||
}
|
||||
@RequestMapping(value = {"/delete"})
|
||||
@RequiresPermissions(value={"asn:ip:config"})
|
||||
public String delete(Integer isValid
|
||||
,String ids,Integer functionId
|
||||
,RedirectAttributes redirectAttributes){
|
||||
try{
|
||||
asnIpCfgService.delete(functionId,isValid,ids);
|
||||
addMessage(redirectAttributes,"delete_success");
|
||||
}catch(Exception e){
|
||||
logger.error("信息保存失败",e);
|
||||
e.printStackTrace();
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,e.getMessage());
|
||||
}else {
|
||||
addMessage(redirectAttributes,"delete_failed");
|
||||
}
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath +"/basics/asn/list?functionId="+functionId;
|
||||
}
|
||||
@RequestMapping(value="ajaxServiceIdState",method=RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public boolean ajaxServiceIdState(Model model,@RequestParam(required=true,value="serviceGroupIds")String serviceGroupIds){
|
||||
if(StringUtils.isNotBlank(serviceGroupIds)) {
|
||||
return policyGroupInfoService.checkIsIssued(serviceGroupIds);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
package com.nis.web.controller.configuration.ntc;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
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.servlet.mvc.support.RedirectAttributes;
|
||||
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.configuration.CfgIndexInfo;
|
||||
import com.nis.domain.specific.ConfigGroupInfo;
|
||||
import com.nis.exceptions.MaatConvertException;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.web.controller.BaseController;
|
||||
@Controller
|
||||
@RequestMapping("${adminPath}/cfg/asnPolicy")
|
||||
public class AsnPolicyCfgController extends BaseController {
|
||||
@RequestMapping(value = {"/list"})
|
||||
public String list(Model model,HttpServletRequest request
|
||||
,HttpServletResponse response,@ModelAttribute("cfg")CfgIndexInfo entity
|
||||
,RedirectAttributes redirectAttributes){
|
||||
Page<CfgIndexInfo> page = asnPolicyCfgService.findPage(new Page<CfgIndexInfo>(request, response,"r"), entity);
|
||||
model.addAttribute("page", page);
|
||||
initPageCondition(model);
|
||||
return "/cfg/asnPolicyCfgList";
|
||||
}
|
||||
@RequestMapping(value = {"/form"})
|
||||
@RequiresPermissions(value={"asn:policy:config"})
|
||||
public String form(Model model,HttpServletRequest request
|
||||
,HttpServletResponse response,String ids,@ModelAttribute("cfg")CfgIndexInfo entity
|
||||
,RedirectAttributes redirectAttributes){
|
||||
if(!StringUtil.isEmpty(ids)){
|
||||
entity = asnPolicyCfgService.get(Long.parseLong(ids));
|
||||
initUpdateFormCondition(model, entity);
|
||||
}else{
|
||||
initFormCondition(model,entity);
|
||||
}
|
||||
List<ConfigGroupInfo> policyGroups=asnPolicyCfgService.getConfigGroupInfoList(4);
|
||||
model.addAttribute("policyGroups", policyGroups);
|
||||
model.addAttribute("_cfg", entity);
|
||||
return "/cfg/asnPolicyCfgForm";
|
||||
}
|
||||
@RequestMapping(value = {"/saveOrUpdate"})
|
||||
@RequiresPermissions(value={"asn:policy:config"})
|
||||
public String saveOrUpdate(Model model,HttpServletRequest request
|
||||
,HttpServletResponse response,
|
||||
@ModelAttribute("cfg")CfgIndexInfo cfg
|
||||
,RedirectAttributes redirectAttributes){
|
||||
try{
|
||||
asnPolicyCfgService.saveOrUpdate(cfg);
|
||||
addMessage(redirectAttributes,"save_success");
|
||||
}catch(Exception e){
|
||||
logger.error("信息保存失败",e);
|
||||
e.printStackTrace();
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,e.getMessage());
|
||||
}else {
|
||||
addMessage(redirectAttributes,"save_failed");
|
||||
}
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath +"/cfg/asnPolicy/list?functionId="+cfg.getFunctionId();
|
||||
}
|
||||
@RequestMapping(value = {"/delete"})
|
||||
@RequiresPermissions(value={"asn:policy:config"})
|
||||
public String delete(Integer isAudit,Integer isValid
|
||||
,String ids,Integer functionId
|
||||
,RedirectAttributes redirectAttributes){
|
||||
asnPolicyCfgService.delete(functionId, isValid, ids);
|
||||
return "redirect:" + adminPath +"/cfg/asnPolicy/list?functionId="+functionId;
|
||||
}
|
||||
@RequestMapping(value = {"/audit"})
|
||||
@RequiresPermissions(value={"asn:policy:confirm"})
|
||||
public String audit(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 {
|
||||
asnPolicyCfgService.audit(isAudit,isValid,functionId,id,auditTime);
|
||||
} catch (MaatConvertException e) {
|
||||
e.printStackTrace();
|
||||
logger.info("dns fake ip配置下发失败:"+e.getMessage());
|
||||
addMessage(redirectAttributes, e.getMessage());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
return "redirect:" + adminPath +"/cfg/asnPolicy/list?functionId="+functionId;
|
||||
}
|
||||
}
|
||||
20
src/main/java/com/nis/web/dao/basics/AsnIpCfgDao.java
Normal file
20
src/main/java/com/nis/web/dao/basics/AsnIpCfgDao.java
Normal file
@@ -0,0 +1,20 @@
|
||||
package com.nis.web.dao.basics;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import com.nis.domain.basics.AsnIpCfg;
|
||||
import com.nis.domain.specific.ConfigGroupInfo;
|
||||
import com.nis.web.dao.CrudDao;
|
||||
import com.nis.web.dao.MyBatisDao;
|
||||
@MyBatisDao
|
||||
public interface AsnIpCfgDao extends CrudDao<AsnIpCfg>{
|
||||
public List<AsnIpCfg> findPage(AsnIpCfg cfg);
|
||||
public void updateValid(@Param("isValid")Integer isValid,@Param("ids")String ids);
|
||||
public void updateIssued(AsnIpCfg cfg);
|
||||
public List<AsnIpCfg> getByIds(@Param("ids")String ids);
|
||||
public List<AsnIpCfg> findAllList(AsnIpCfg cfg);
|
||||
public List<ConfigGroupInfo> findPolicyGroupInfosByType(@Param("groupId")Integer groupId);
|
||||
public List<Integer> findOtherIps(@Param("groupId")Integer groupId,@Param("cfgId")Integer cfgId);
|
||||
}
|
||||
387
src/main/java/com/nis/web/dao/basics/AsnIpCfgDao.xml
Normal file
387
src/main/java/com/nis/web/dao/basics/AsnIpCfgDao.xml
Normal file
@@ -0,0 +1,387 @@
|
||||
<?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.basics.AsnIpCfgDao">
|
||||
<resultMap id="asnIpCfgMap" type="com.nis.domain.basics.AsnIpCfg">
|
||||
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
|
||||
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
|
||||
<result column="ip_type" property="ipType" jdbcType="INTEGER" />
|
||||
<result column="ip_pattern" property="ipPattern" jdbcType="INTEGER" />
|
||||
<result column="dest_ip_address" property="destIpAddress" jdbcType="VARCHAR" />
|
||||
<result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" />
|
||||
<result column="dest_port" property="destPort" jdbcType="VARCHAR" />
|
||||
<result column="src_port" property="srcPort" jdbcType="VARCHAR" />
|
||||
<result column="port_pattern" property="portPattern" jdbcType="INTEGER" />
|
||||
<result column="direction" property="direction" jdbcType="INTEGER" />
|
||||
<result column="protocol" property="protocol" jdbcType="INTEGER" />
|
||||
<result column="protocol_id" property="protocolId" jdbcType="INTEGER" />
|
||||
<result column="action" property="action" jdbcType="INTEGER" />
|
||||
<result column="is_valid" property="isValid" jdbcType="INTEGER" />
|
||||
<result column="is_audit" property="isAudit" jdbcType="INTEGER" />
|
||||
<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="service_id" property="serviceId" jdbcType="INTEGER" />
|
||||
<result column="request_id" property="requestId" jdbcType="INTEGER" />
|
||||
<result column="region_id" property="regionId" jdbcType="INTEGER" />
|
||||
<result column="is_area_effective" property="isAreaEffective" 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="area_effective_ids" property="areaEffectiveIds" jdbcType="VARCHAR" />
|
||||
<result column="function_id" property="functionId" jdbcType="INTEGER" />
|
||||
<result column="cfg_region_code" property="cfgRegionCode" jdbcType="INTEGER" />
|
||||
<result column="cfg_type" property="cfgType" jdbcType="VARCHAR" />
|
||||
<result column="asn_ip_group" property="asnIpGroup" jdbcType="INTEGER" />
|
||||
<result column="asn_ip_group_name" property="asnIpGroupName" jdbcType="VARCHAR" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="columns">
|
||||
r.cfg_id,r.cfg_desc,r.ip_type,r.src_ip_address,r.ip_pattern,r.port_pattern,r.src_port
|
||||
,r.protocol,r.protocol_id,r.direction,r.cfg_type,r.action,r.dest_port,r.dest_ip_address
|
||||
,r.is_valid,r.is_audit,r.creator_id,r.create_time,r.editor_id
|
||||
,r.edit_time,r.auditor_id,r.audit_time,r.service_id,r.request_id,
|
||||
r.region_id,r.is_area_effective,r.classify,r.attribute,r.lable
|
||||
,r.area_effective_ids,r.function_id,r.cfg_region_code,r.asn_ip_group
|
||||
</sql>
|
||||
|
||||
<select id="findPage" resultMap="asnIpCfgMap">
|
||||
select
|
||||
<include refid="columns"></include>
|
||||
<trim prefix="," prefixOverrides=",">
|
||||
,s.name as creator_name,e.name as editor_name,u.name as auditor_name
|
||||
,asn.group_name as asn_ip_group_name
|
||||
</trim>
|
||||
from asn_ip_cfg r
|
||||
left join config_group_info asn on asn.group_id=r.asn_ip_group
|
||||
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
|
||||
<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="cfgDesc != null and cfgDesc != ''">
|
||||
AND r.CFG_DESC like concat(concat('%',#{cfgDesc,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="asnIpGroupName != null and asnIpGroupName != ''">
|
||||
AND dns.group_name like concat(concat('%',#{asnIpGroupName,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="cfgRegionCode != null">
|
||||
AND r.CFG_REGION_CODE=#{cfgRegionCode,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="cfgType != null and cfgType != ''">
|
||||
AND r.CFG_TYPE like concat(concat('%',#{CFG_TYPE,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="ipType != null">
|
||||
AND r.IP_TYPE=#{ipType,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="ipPattern != null">
|
||||
AND r.IP_PATTERN=#{ipPattern,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="srcIpAddress != null and srcIpAddress != ''">
|
||||
AND r.SRC_IP_ADDRESS=#{srcIpAddress,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="destIpAddress != null and destIpAddress != ''">
|
||||
AND r.DEST_IP_ADDRESS=#{destIpAddress,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="portPattern != null">
|
||||
AND r.PORT_PATTERN=#{portPattern,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="srcPort != null and srcPort !=''">
|
||||
AND r.SRC_PORT=#{srcPort,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="destPort != null and destPort !=''">
|
||||
AND r.DEST_PORT=#{destPort,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="direction != null">
|
||||
AND r.DIRECTION=#{direction,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="protocol != null">
|
||||
AND r.PROTOCOL=#{protocol,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="protocolId != null">
|
||||
AND r.PROTOCOL_ID=#{protocolId,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="createTime != null and createTime !=''">
|
||||
AND r.CREATE_TIME=#{createTime,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
<if test="editorName != null and editorName !=''">
|
||||
AND EDITOR_NAME like concat(concat('%',#{editorName,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="editTime != null and editTime !='' ">
|
||||
AND r.EDIT_TIME=#{editTime,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
<if test="auditorName != null and auditorName !=''">
|
||||
AND AUDITOR_NAME like concat(concat('%',#{auditorName,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="auditTime != null and auditTime !=''">
|
||||
AND r.AUDIT_TIME=#{auditTime,jdbcType=TIMESTAMP}
|
||||
</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="regionId != null">
|
||||
AND r.region_id=#{regionId,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="areaEffectiveIds != null and areaEffectiveIds !=''">
|
||||
AND r.AREA_EFFECTIVE_IDS like concat(concat('%',#{areaEffectiveIds,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="get" resultMap="asnIpCfgMap">
|
||||
select
|
||||
<include refid="columns"></include>
|
||||
from asn_ip_cfg r
|
||||
where r.cfg_id=#{cfgId}
|
||||
</select>
|
||||
<select id="findAllList" resultMap="asnIpCfgMap">
|
||||
select
|
||||
<include refid="columns"></include>
|
||||
from asn_ip_cfg r
|
||||
where r.is_valid !=-1
|
||||
<if test="asnIpGroup != null">
|
||||
AND r.asn_ip_group =#{asnIpGroup}
|
||||
</if>
|
||||
</select>
|
||||
<select id="getByIds" resultMap="asnIpCfgMap">
|
||||
select
|
||||
<include refid="columns"></include>
|
||||
from asn_ip_cfg r
|
||||
where r.cfg_id in (#{ids})
|
||||
</select>
|
||||
|
||||
<insert id="insert" parameterType="com.nis.domain.basics.AsnIpCfg" >
|
||||
insert into asn_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,
|
||||
region_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,
|
||||
asn_ip_group
|
||||
)values (
|
||||
#{cfgDesc,jdbcType=VARCHAR},
|
||||
#{action,jdbcType=INTEGER},
|
||||
#{isValid,jdbcType=INTEGER},
|
||||
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},
|
||||
#{regionId,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},
|
||||
#{asnIpGroup,jdbcType=INTEGER}
|
||||
)
|
||||
</insert>
|
||||
<update id="updateIssued" parameterType="com.nis.domain.basics.AsnIpCfg" >
|
||||
update asn_ip_cfg set is_valid=#{isValid} where asn_ip_group =#{asnIpGroup}
|
||||
</update>
|
||||
<update id="update" parameterType="com.nis.domain.basics.AsnIpCfg" >
|
||||
update asn_ip_cfg
|
||||
<set >
|
||||
<trim suffixOverrides=",">
|
||||
<if test="cfgDesc != null and cfgDesc != ''" >
|
||||
cfg_desc = #{cfgDesc,jdbcType=VARCHAR},
|
||||
</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="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 auditTime != ''" >
|
||||
AUDIT_TIME = #{auditTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="regionId != null" >
|
||||
region_id = #{regionId,jdbcType=TIMESTAMP},
|
||||
</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="serviceId != null" >
|
||||
service_id = #{serviceId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="ipType != null" >
|
||||
ip_type = #{ipType,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="srcIpAddress != null and srcIpAddress != ''" >
|
||||
src_ip_address = #{srcIpAddress,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="ipPattern != null" >
|
||||
ip_pattern = #{ipPattern,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="portPattern != null" >
|
||||
port_pattern = #{portPattern,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="srcPort != null and srcPort != ''" >
|
||||
src_port = #{srcPort,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="protocol != null" >
|
||||
protocol = #{protocol,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="protocolId != null" >
|
||||
protocol_id = #{protocolId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="direction != null" >
|
||||
direction = #{direction,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="destPort != null and destPort != ''" >
|
||||
dest_port = #{destPort,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="destIpAddress != null and destIpAddress != ''" >
|
||||
dest_ip_address = #{destIpAddress,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="cfgType != null and cfgType != ''" >
|
||||
cfg_type = #{cfgType,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="cfgRegionCode != null " >
|
||||
cfg_region_code = #{cfgRegionCode,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="asnIpGroup != null " >
|
||||
asn_ip_group = #{asnIpGroup,jdbcType=INTEGER},
|
||||
</if>
|
||||
</trim>
|
||||
</set>
|
||||
<where>
|
||||
and cfg_id = #{cfgId,jdbcType=INTEGER}
|
||||
</where>
|
||||
</update>
|
||||
<update id="updateValid" parameterType="com.nis.domain.basics.AsnIpCfg" >
|
||||
update asn_ip_cfg set is_valid=#{isValid} where cfg_id in (#{ids})
|
||||
</update>
|
||||
<select id="findPolicyGroupInfosByType" resultType="com.nis.domain.specific.ConfigGroupInfo" parameterType="java.lang.Integer">
|
||||
select id,group_id,group_name,is_issued,insert_time,update_time,group_type
|
||||
from config_group_info c where c.group_type= #{groupId}
|
||||
</select>
|
||||
<select id="findOtherIps" resultType="java.lang.Integer" parameterType="java.lang.Integer">
|
||||
select 1 from asn_ip_cfg where is_valid=1 and asn_ip_group=#{groupId} and cfg_id !=#{cfgId} limit 2
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -12,6 +12,7 @@ public interface PolicyGroupInfoDao extends CrudDao<PolicyGroupInfo> {
|
||||
List<PolicyGroupInfo> findPolicyGroupInfoList(PolicyGroupInfo policyGroupInfo);
|
||||
List<PolicyGroupInfo> findPolicyGroupInfos();
|
||||
List<PolicyGroupInfo> findPolicyGroupInfosByType(int groupType);
|
||||
List<PolicyGroupInfo> findPolicyGroupInfosHasIpRegionByType(int groupType);
|
||||
PolicyGroupInfo getById(int id);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.nis.web.dao.configuration;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import com.nis.domain.configuration.CfgIndexInfo;
|
||||
import com.nis.domain.specific.ConfigGroupInfo;
|
||||
import com.nis.web.dao.CrudDao;
|
||||
import com.nis.web.dao.MyBatisDao;
|
||||
@MyBatisDao
|
||||
public interface AsnPolicyCfgDao extends CrudDao<CfgIndexInfo>{
|
||||
public List<CfgIndexInfo> findPage(CfgIndexInfo cfg);
|
||||
public void updateValid(@Param("isValid")Integer isValid,@Param("ids")String ids);
|
||||
public List<CfgIndexInfo> getByIds(@Param("ids")String ids);
|
||||
public void save(CfgIndexInfo entity);
|
||||
public void updateCfgIndexInfo(CfgIndexInfo entity);
|
||||
public List<ConfigGroupInfo> getConfigGroupInfoList(@Param("groupType")Integer groupType);
|
||||
}
|
||||
264
src/main/java/com/nis/web/dao/configuration/AsnPolicyCfgDao.xml
Normal file
264
src/main/java/com/nis/web/dao/configuration/AsnPolicyCfgDao.xml
Normal file
@@ -0,0 +1,264 @@
|
||||
<?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.AsnPolicyCfgDao">
|
||||
<resultMap id="CfgIndexInfoMap" type="com.nis.domain.configuration.CfgIndexInfo" >
|
||||
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
|
||||
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
|
||||
<result column="action" property="action" jdbcType="INTEGER" />
|
||||
<result column="is_valid" property="isValid" jdbcType="INTEGER" />
|
||||
<result column="is_audit" property="isAudit" jdbcType="INTEGER" />
|
||||
<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="service_id" property="serviceId" jdbcType="INTEGER" />
|
||||
<result column="request_id" property="requestId" jdbcType="INTEGER" />
|
||||
<result column="compile_id" property="compileId" jdbcType="INTEGER" />
|
||||
<result column="is_area_effective" property="isAreaEffective" 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="area_effective_ids" property="areaEffectiveIds" jdbcType="VARCHAR" />
|
||||
<result column="function_id" property="functionId" jdbcType="INTEGER" />
|
||||
<result column="do_log" property="doLog" jdbcType="INTEGER" />
|
||||
<result column="user_region1" property="userRegion1" jdbcType="VARCHAR" />
|
||||
<result column="user_region2" property="userRegion2" jdbcType="VARCHAR" />
|
||||
<result column="user_region3" property="userRegion3" jdbcType="VARCHAR" />
|
||||
<result column="user_region4" property="userRegion4" jdbcType="VARCHAR" />
|
||||
<result column="user_region5" property="userRegion5" jdbcType="VARCHAR" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="ConfigIndex_Column" >
|
||||
r.CFG_ID,r.CFG_DESC,r.ACTION,r.IS_VALID,r.IS_AUDIT,
|
||||
r.CREATOR_ID,r.CREATE_TIME,r.EDITOR_ID,r.EDIT_TIME,r.AUDITOR_ID,r.AUDIT_TIME,
|
||||
r.SERVICE_ID,r.REQUEST_ID,r.COMPILE_ID,r.IS_AREA_EFFECTIVE,r.CLASSIFY,
|
||||
r.ATTRIBUTE,r.LABLE,r.AREA_EFFECTIVE_IDS,r.function_id,r.user_region1,
|
||||
r.user_region2,r.user_region3,r.user_region4,r.user_region5,r.do_log
|
||||
</sql>
|
||||
|
||||
<select id="findPage" resultMap="CfgIndexInfoMap">
|
||||
select
|
||||
<include refid="ConfigIndex_Column"></include>
|
||||
<trim prefix="," prefixOverrides=",">
|
||||
,s.name as creator_name,e.name as editor_name,u.name as auditor_name
|
||||
,ri.request_title as requestName,asn.group_name as asnIpGroupName
|
||||
</trim>
|
||||
from cfg_index_info r
|
||||
left join policy_group_info asn on asn.service_group_id=r.user_region1
|
||||
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="cfgDesc != null and cfgDesc != ''">
|
||||
AND r.CFG_DESC like concat(concat('%',#{cfgDesc,jdbcType=VARCHAR}),'%')
|
||||
</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 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="compileId != null">
|
||||
AND r.COMPILE_ID=#{compileId,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="areaEffectiveIds != null and areaEffectiveIds != ''">
|
||||
AND r.AREA_EFFECTIVE_IDS like concat(concat('%',#{areaEffectiveIds,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="userRegion1 != null and userRegion1 !=''">
|
||||
AND r.user_region1=#{userRegion1,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="get" resultMap="CfgIndexInfoMap" parameterType="java.lang.Long">
|
||||
SELECT
|
||||
<include refid="ConfigIndex_Column" />
|
||||
FROM cfg_index_info r where cfg_id=#{cfgId}
|
||||
</select>
|
||||
<insert id="save" parameterType="com.nis.domain.configuration.CfgIndexInfo" >
|
||||
<selectKey resultType="java.lang.Long" order="AFTER" keyProperty="cfgId">
|
||||
SELECT LAST_INSERT_ID()
|
||||
</selectKey>
|
||||
insert into cfg_index_info(
|
||||
CFG_DESC,
|
||||
ACTION,
|
||||
IS_VALID,
|
||||
IS_AUDIT,
|
||||
CREATOR_ID,
|
||||
CREATE_TIME,
|
||||
EDITOR_ID,
|
||||
EDIT_TIME,
|
||||
AUDITOR_ID,
|
||||
AUDIT_TIME,
|
||||
SERVICE_ID,
|
||||
REQUEST_ID,
|
||||
COMPILE_ID,
|
||||
IS_AREA_EFFECTIVE,
|
||||
CLASSIFY,
|
||||
ATTRIBUTE,
|
||||
LABLE,
|
||||
AREA_EFFECTIVE_IDS,
|
||||
function_id,
|
||||
dns_strategy_id,
|
||||
user_region1,
|
||||
user_region2,
|
||||
user_region3,
|
||||
user_region4,
|
||||
user_region5,
|
||||
do_log
|
||||
)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},
|
||||
#{dnsStrategyId,jdbcType=INTEGER},
|
||||
#{userRegion1,jdbcType=VARCHAR},
|
||||
#{userRegion2,jdbcType=VARCHAR},
|
||||
#{userRegion3,jdbcType=VARCHAR},
|
||||
#{userRegion4,jdbcType=VARCHAR},
|
||||
#{userRegion5,jdbcType=VARCHAR},
|
||||
#{doLog,jdbcType=INTEGER}
|
||||
)
|
||||
</insert>
|
||||
<update id="updateCfgIndexInfo" parameterType="com.nis.domain.configuration.CfgIndexInfo" >
|
||||
update cfg_index_info
|
||||
<set >
|
||||
<trim suffixOverrides=",">
|
||||
<if test="cfgDesc != null and cfgDesc != ''" >
|
||||
cfg_desc = #{cfgDesc,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="action != null" >
|
||||
action = #{action,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="doLog != null" >
|
||||
do_log = #{doLog,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>
|
||||
edit_time = #{editTime,jdbcType=TIMESTAMP},
|
||||
<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>
|
||||
user_region1 = #{userRegion1,jdbcType=VARCHAR},
|
||||
user_region2 = #{userRegion2,jdbcType=VARCHAR},
|
||||
user_region3 = #{userRegion3,jdbcType=VARCHAR},
|
||||
user_region4 = #{userRegion4,jdbcType=VARCHAR},
|
||||
user_region5 = #{userRegion5,jdbcType=VARCHAR},
|
||||
dns_strategy_id = #{dnsStrategyId,jdbcType=INTEGER},
|
||||
</trim>
|
||||
</set>
|
||||
where cfg_id = #{cfgId,jdbcType=BIGINT}
|
||||
</update>
|
||||
<update id="updateValid" parameterType="com.nis.domain.configuration.CfgIndexInfo" >
|
||||
update cfg_index_info set is_valid=#{isValid} where cfg_id in (#{ids})
|
||||
</update>
|
||||
<select id="getConfigGroupInfoList" resultType="com.nis.domain.specific.ConfigGroupInfo" parameterType="java.lang.Integer">
|
||||
SELECT c.id,c.group_id,c.group_name,c.is_issued,c.insert_time,c.update_time,c.group_type FROM (
|
||||
SELECT DISTINCT asn_ip_group FROM asn_ip_cfg WHERE is_valid !=-1) a
|
||||
LEFT JOIN config_group_info c ON a.asn_ip_group=c.group_id where c.group_type=#{groupType}
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -28,6 +28,7 @@ import com.googlecode.ipv6.IPv6Address;
|
||||
import com.googlecode.ipv6.IPv6Network;
|
||||
import com.nis.domain.SysRole;
|
||||
import com.nis.domain.SysUser;
|
||||
import com.nis.domain.basics.AsnIpCfg;
|
||||
import com.nis.domain.callback.InlineIp;
|
||||
import com.nis.domain.callback.NtcDnsResStrategy;
|
||||
import com.nis.domain.callback.ProxyObjKeyring;
|
||||
@@ -41,6 +42,7 @@ import com.nis.domain.maat.MaatCfg.GroupCfg;
|
||||
import com.nis.domain.maat.MaatCfg.IpCfg;
|
||||
import com.nis.domain.maat.MaatCfg.NumBoundaryCfg;
|
||||
import com.nis.domain.maat.MaatCfg.StringCfg;
|
||||
import com.nis.domain.specific.ConfigGroupInfo;
|
||||
import com.nis.util.ConfigServiceUtil;
|
||||
import com.nis.util.Configurations;
|
||||
import com.nis.util.Constants;
|
||||
@@ -735,4 +737,20 @@ public abstract class BaseService {
|
||||
}
|
||||
return replaceContent;
|
||||
}
|
||||
//asn IP 复用转换
|
||||
public List<IpCfg> groupReuseCfgAddRemoveConvert(List<AsnIpCfg> ipCfgList,Integer isValid) {
|
||||
List<IpCfg> maatIpList=new ArrayList<>();
|
||||
for(AsnIpCfg asnIpCfg:ipCfgList) {
|
||||
BaseIpCfg baseIpCfg = new BaseIpCfg();
|
||||
BeanUtils.copyProperties(asnIpCfg, baseIpCfg);
|
||||
IpCfg cfg = new IpCfg();
|
||||
BeanUtils.copyProperties(baseIpCfg, cfg);
|
||||
cfg.setGroupId(asnIpCfg.getAsnIpGroup());
|
||||
cfg.setRegionId(asnIpCfg.getRegionId());
|
||||
cfg.setIsValid(isValid);
|
||||
cfg = ipConvert(cfg,baseIpCfg);
|
||||
maatIpList.add(cfg);
|
||||
}
|
||||
return maatIpList;
|
||||
}
|
||||
}
|
||||
|
||||
174
src/main/java/com/nis/web/service/basics/AsnIpCfgService.java
Normal file
174
src/main/java/com/nis/web/service/basics/AsnIpCfgService.java
Normal file
@@ -0,0 +1,174 @@
|
||||
package com.nis.web.service.basics;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
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.nis.domain.Page;
|
||||
import com.nis.domain.basics.AsnIpCfg;
|
||||
import com.nis.domain.configuration.CfgIndexInfo;
|
||||
import com.nis.domain.maat.GroupReuseAddBean;
|
||||
import com.nis.domain.maat.GroupReuseCfg;
|
||||
import com.nis.domain.maat.MaatCfg.IpCfg;
|
||||
import com.nis.domain.maat.MaatCfg.NumBoundaryCfg;
|
||||
import com.nis.domain.maat.MaatCfg.StringCfg;
|
||||
import com.nis.domain.maat.ToMaatResult;
|
||||
import com.nis.domain.specific.ConfigGroupInfo;
|
||||
import com.nis.util.ConfigServiceUtil;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.web.dao.CrudDao;
|
||||
import com.nis.web.dao.basics.AsnIpCfgDao;
|
||||
import com.nis.web.dao.specific.SpecificServiceCfgDao;
|
||||
import com.nis.web.service.CrudService;
|
||||
@Service
|
||||
public class AsnIpCfgService extends CrudService<CrudDao<AsnIpCfg>, AsnIpCfg> {
|
||||
@Autowired
|
||||
private AsnIpCfgDao asnIpCfgDao;
|
||||
@Autowired
|
||||
private SpecificServiceCfgDao specificServiceCfgDao;
|
||||
/**
|
||||
* @param page
|
||||
* @param entity
|
||||
* @return
|
||||
*/
|
||||
public Page<AsnIpCfg> findPage(Page<AsnIpCfg> page, AsnIpCfg entity) {
|
||||
entity.getSqlMap().put("dsf", configScopeFilter(entity.getCurrentUser(),"r"));
|
||||
entity.setPage(page);
|
||||
List<AsnIpCfg> list=asnIpCfgDao.findPage(entity);
|
||||
page.setList(list);
|
||||
return page;
|
||||
}
|
||||
public AsnIpCfg get(Long id ) {
|
||||
return asnIpCfgDao.get(id);
|
||||
}
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public void save(List<AsnIpCfg> entitys){
|
||||
Date createTime=new Date();
|
||||
for(AsnIpCfg entity:entitys) {
|
||||
entity.setCreateTime(createTime);
|
||||
entity.setCreatorId(entity.getCurrentUser().getId());
|
||||
entity.setRegionId(ConfigServiceUtil.getId(3, 1).get(0));
|
||||
}
|
||||
this.saveBatch(entitys, AsnIpCfgDao.class);
|
||||
}
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public void update(AsnIpCfg entity){
|
||||
Date editTime=new Date();
|
||||
entity.setEditTime(editTime);
|
||||
entity.setEditorId(entity.getCurrentUser().getId());
|
||||
if(entity.getAsnIpGroup()==null) {
|
||||
throw new RuntimeException("asn group name not found!");
|
||||
}
|
||||
ConfigGroupInfo groupInfo=specificServiceCfgDao.getConfigGroupInfoByGroupId(entity.getAsnIpGroup());
|
||||
if(groupInfo.getIsIssued()==0) {//未下发,可修改
|
||||
asnIpCfgDao.update(entity);
|
||||
}else {
|
||||
throw new RuntimeException("asn group is issued, cannot update asn ip!");
|
||||
}
|
||||
|
||||
}
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public void saveAsnIpCfg(CfgIndexInfo entity) {
|
||||
Date crateTime=new Date();
|
||||
ConfigGroupInfo groupInfo=specificServiceCfgDao.getConfigGroupInfoByGroupId(entity.getAsnIpGroup().intValue());
|
||||
|
||||
if(groupInfo.getIsIssued()==1) {//如果已经下发,则需要下到综合服务中
|
||||
if(entity.getAsnIpCfgs()!=null) {
|
||||
for(AsnIpCfg cfg:entity.getAsnIpCfgs()) {
|
||||
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
|
||||
cfg.setCreateTime(crateTime);
|
||||
cfg.setCreatorId(entity.getCurrentUser().getId());
|
||||
cfg.setAsnIpGroup(entity.getAsnIpGroup());
|
||||
cfg.setIsValid(Constants.VALID_YES);
|
||||
}
|
||||
}
|
||||
this.save(entity.getAsnIpCfgs());
|
||||
GroupReuseAddBean maatBean = new GroupReuseAddBean();
|
||||
List<GroupReuseCfg> groupReuseList=new ArrayList<>();
|
||||
GroupReuseCfg groupReuseCfg=new GroupReuseCfg();
|
||||
List<IpCfg> ipRegionList = groupReuseCfgAddRemoveConvert(entity.getAsnIpCfgs(),Constants.VALID_YES);
|
||||
List<StringCfg> strRegionList = new ArrayList<>();
|
||||
List<NumBoundaryCfg> numRegionList = new ArrayList<>();
|
||||
groupReuseCfg.setIpRegionList(ipRegionList);
|
||||
groupReuseCfg.setStrRegionList(strRegionList);
|
||||
groupReuseCfg.setNumRegionList(numRegionList);
|
||||
groupReuseList.add(groupReuseCfg);
|
||||
maatBean.setGroupReuseCfgList(groupReuseList);
|
||||
maatBean.setAuditTime(crateTime);
|
||||
maatBean.setCreatorName(entity.getCurrentUser().getName());
|
||||
maatBean.setVersion(Constants.MAAT_VERSION);
|
||||
maatBean.setOpAction(Constants.INSERT_ACTION);
|
||||
//调用服务接口下发配置数据
|
||||
String json=gsonToJson(maatBean);
|
||||
logger.info("asn ip复用域新增配置下发配置参数:"+json);
|
||||
//调用服务接口下发配置
|
||||
ToMaatResult result = ConfigServiceUtil.postGroupReuseSources(json);
|
||||
logger.info("asn ip复用域新增配置响应信息:"+result.getMsg());
|
||||
}else {
|
||||
if(entity.getAsnIpCfgs()!=null) {
|
||||
for(AsnIpCfg cfg:entity.getAsnIpCfgs()) {
|
||||
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
|
||||
cfg.setCreateTime(crateTime);
|
||||
cfg.setCreatorId(entity.getCurrentUser().getId());
|
||||
cfg.setAsnIpGroup(entity.getAsnIpGroup().intValue());
|
||||
cfg.setIsValid(Constants.VALID_NO);
|
||||
}
|
||||
}
|
||||
this.save(entity.getAsnIpCfgs());
|
||||
}
|
||||
}
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public void delete(Integer functionId,Integer isValid,String ids) {
|
||||
for(String id:ids.split(",")) {
|
||||
Long.parseLong(id);
|
||||
}
|
||||
List<AsnIpCfg> issuedList=new ArrayList<>();
|
||||
List<AsnIpCfg> asnIpCfgList= asnIpCfgDao.getByIds(ids);
|
||||
|
||||
for(AsnIpCfg asnIpCfg:asnIpCfgList) {
|
||||
if(asnIpCfg.getIsValid()==Constants.VALID_YES) {//代表下发过了
|
||||
asnIpCfg.setIsValid(isValid);
|
||||
issuedList.add(asnIpCfg);
|
||||
Integer groupId=asnIpCfg.getAsnIpGroup();
|
||||
List result=asnIpCfgDao.findOtherIps(groupId, asnIpCfg.getCfgId().intValue());
|
||||
if(result==null||result.size()==0) {
|
||||
throw new RuntimeException("Cant not delete ip from asn group, there is only one ip left in the group!");
|
||||
}
|
||||
}
|
||||
}
|
||||
if(issuedList.size()>0) {
|
||||
//已经下发过的,调用分组复用配置删除接口
|
||||
GroupReuseAddBean maatBean = new GroupReuseAddBean();
|
||||
List<GroupReuseCfg> groupReuseList=new ArrayList<>();
|
||||
GroupReuseCfg groupReuseCfg=new GroupReuseCfg();
|
||||
List<IpCfg> ipRegionList = groupReuseCfgAddRemoveConvert(issuedList,Constants.VALID_NO);
|
||||
List<StringCfg> strRegionList = new ArrayList<>();
|
||||
List<NumBoundaryCfg> numRegionList = new ArrayList<>();
|
||||
groupReuseCfg.setIpRegionList(ipRegionList);
|
||||
groupReuseCfg.setStrRegionList(strRegionList);
|
||||
groupReuseCfg.setNumRegionList(numRegionList);
|
||||
groupReuseList.add(groupReuseCfg);
|
||||
maatBean.setGroupReuseCfgList(groupReuseList);
|
||||
maatBean.setAuditTime(new Date());
|
||||
maatBean.setCreatorName(new AsnIpCfg().getCurrentUser().getName());
|
||||
maatBean.setVersion(Constants.MAAT_VERSION);
|
||||
maatBean.setOpAction(Constants.UPDATE_ACTION);
|
||||
//调用服务接口下发配置数据
|
||||
String json=gsonToJson(maatBean);
|
||||
logger.info("asn ip复用域删除配置下发配置参数:"+json);
|
||||
//调用服务接口下发配置
|
||||
ToMaatResult result = ConfigServiceUtil.put(json,3);
|
||||
logger.info("asn ip复用域删除配置响应信息:"+result.getMsg());
|
||||
}
|
||||
asnIpCfgDao.updateValid(isValid, ids);
|
||||
}
|
||||
public List<ConfigGroupInfo> findPolicyGroupInfosByType(Integer groupId) {
|
||||
// TODO Auto-generated method stub
|
||||
return asnIpCfgDao.findPolicyGroupInfosByType(groupId);
|
||||
}
|
||||
}
|
||||
@@ -46,6 +46,10 @@ public class PolicyGroupInfoService extends BaseService{
|
||||
List<PolicyGroupInfo> list=policyGroupInfoDao.findPolicyGroupInfosByType(type);
|
||||
return list;
|
||||
}
|
||||
public List<PolicyGroupInfo> findPolicyGroupInfosHasIpRegionByType(int type) {
|
||||
List<PolicyGroupInfo> list=policyGroupInfoDao.findPolicyGroupInfosByType(type);
|
||||
return list;
|
||||
}
|
||||
|
||||
public PolicyGroupInfo getById(int id) {
|
||||
PolicyGroupInfo policyGroupInfo=policyGroupInfoDao.getById(id);
|
||||
|
||||
@@ -0,0 +1,219 @@
|
||||
package com.nis.web.service.configuration;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
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.nis.domain.Page;
|
||||
import com.nis.domain.basics.AsnIpCfg;
|
||||
import com.nis.domain.configuration.CfgIndexInfo;
|
||||
import com.nis.domain.maat.MaatCfg;
|
||||
import com.nis.domain.maat.MaatCfg.DigestCfg;
|
||||
import com.nis.domain.maat.MaatCfg.GroupCfg;
|
||||
import com.nis.domain.maat.MaatCfg.IpCfg;
|
||||
import com.nis.domain.maat.MaatCfg.NumBoundaryCfg;
|
||||
import com.nis.domain.maat.MaatCfg.StringCfg;
|
||||
import com.nis.domain.maat.ToMaatBean;
|
||||
import com.nis.domain.maat.ToMaatResult;
|
||||
import com.nis.domain.specific.ConfigGroupInfo;
|
||||
import com.nis.exceptions.MaatConvertException;
|
||||
import com.nis.util.ConfigServiceUtil;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.web.dao.basics.AsnIpCfgDao;
|
||||
import com.nis.web.dao.configuration.AsnPolicyCfgDao;
|
||||
import com.nis.web.dao.specific.SpecificServiceCfgDao;
|
||||
import com.nis.web.security.UserUtils;
|
||||
import com.nis.web.service.BaseService;
|
||||
@Service
|
||||
public class AsnPolicyCfgService extends BaseService {
|
||||
@Autowired
|
||||
private AsnPolicyCfgDao asnPolicyCfgDao;
|
||||
@Autowired
|
||||
private AsnIpCfgDao asnIpCfgDao;
|
||||
@Autowired
|
||||
private SpecificServiceCfgDao specificServiceCfgDao;
|
||||
/**
|
||||
* @param page
|
||||
* @param entity
|
||||
* @return
|
||||
*/
|
||||
public Page<CfgIndexInfo> findPage(Page<CfgIndexInfo> page, CfgIndexInfo entity) {
|
||||
entity.getSqlMap().put("dsf", configScopeFilter(entity.getCurrentUser(),"r"));
|
||||
entity.setPage(page);
|
||||
List<CfgIndexInfo> list=asnPolicyCfgDao.findPage(entity);
|
||||
page.setList(list);
|
||||
return page;
|
||||
}
|
||||
public CfgIndexInfo get(Long id ) {
|
||||
return asnPolicyCfgDao.get(id);
|
||||
}
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public void saveOrUpdate(CfgIndexInfo entity){
|
||||
Date time=new Date();
|
||||
if(entity.getCfgId()==null) {//新增,获取compileId
|
||||
entity.setCreateTime(time);
|
||||
entity.setCreatorId(entity.getCurrentUser().getId());
|
||||
//调用服务接口获取compileId
|
||||
List<Integer> compileIds = new ArrayList<Integer>();
|
||||
try {
|
||||
compileIds = ConfigServiceUtil.getId(1,1);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.info("获取编译ID出错");
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+e.getMessage());
|
||||
}
|
||||
if(compileIds != null && compileIds.size() >0 && compileIds.get(0) != 0){
|
||||
entity.setCompileId(compileIds.get(0));
|
||||
asnPolicyCfgDao.save(entity);
|
||||
}else{
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>");
|
||||
}
|
||||
}else {
|
||||
entity.setEditTime(time);
|
||||
entity.setEditorId(entity.getCurrentUser().getId());
|
||||
asnPolicyCfgDao.updateCfgIndexInfo(entity);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public void delete(Integer functionId,Integer isValid,String ids) {
|
||||
asnPolicyCfgDao.updateValid(isValid, ids);
|
||||
}
|
||||
public List<ConfigGroupInfo> getConfigGroupInfoList(Integer groupType) {
|
||||
// TODO Auto-generated method stub
|
||||
return asnPolicyCfgDao.getConfigGroupInfoList(groupType);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param isAudit
|
||||
* @param isValid
|
||||
* @param ids cfgId
|
||||
* @param functionId
|
||||
*/
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public void audit(Integer isAudit,Integer isValid,Integer functionId,String id,Date auditTime){
|
||||
CfgIndexInfo entity=asnPolicyCfgDao.get(Long.valueOf(id));
|
||||
entity.setIsAudit(isAudit);
|
||||
entity.setIsValid(isValid);
|
||||
entity.setAuditorId(UserUtils.getUser().getId());
|
||||
entity.setAuditTime(auditTime);
|
||||
asnPolicyCfgDao.updateCfgIndexInfo(entity);
|
||||
ToMaatBean maatBean = new ToMaatBean();
|
||||
MaatCfg maatCfg = new MaatCfg();
|
||||
List<MaatCfg> configCompileList = new ArrayList<>();
|
||||
List<GroupCfg> groupRelationList = new ArrayList<>();
|
||||
List<IpCfg> ipRegionList = new ArrayList<>();
|
||||
List<StringCfg> strRegionList = new ArrayList<>();
|
||||
List<NumBoundaryCfg> numRegionList = new ArrayList<>();
|
||||
List<DigestCfg> digestRegionList = new ArrayList<>();
|
||||
List<IpCfg> areaIpRegionList = new ArrayList<>();
|
||||
if(isAudit==Constants.AUDIT_YES) {
|
||||
ConfigGroupInfo group=specificServiceCfgDao.getConfigGroupInfoByGroupId(Integer.parseInt(entity.getUserRegion1()));
|
||||
if(group.getIsIssued()==1) {//复用,值下编译跟分组
|
||||
maatCfg.initDefaultValue();
|
||||
BeanUtils.copyProperties(entity, maatCfg);
|
||||
maatCfg.setAction(entity.getAction());
|
||||
maatCfg.setAuditTime(entity.getAuditTime());
|
||||
maatCfg.setIpRegionList(ipRegionList);
|
||||
maatCfg.setStrRegionList(strRegionList);
|
||||
maatCfg.setNumRegionList(numRegionList);
|
||||
maatCfg.setDigestRegionList(digestRegionList);
|
||||
maatCfg.setGroupRelationList(groupRelationList);
|
||||
maatCfg.setAreaIpRegionList(areaIpRegionList);
|
||||
maatCfg.setIsValid(entity.getIsValid());
|
||||
//group
|
||||
GroupCfg groupCfg=new GroupCfg();
|
||||
groupCfg.setCompileId(entity.getCompileId());
|
||||
groupCfg.setGroupId(Integer.parseInt(entity.getUserRegion1()));
|
||||
groupCfg.setIsValid(Constants.VALID_YES);
|
||||
groupCfg.setAuditTime(auditTime);
|
||||
groupRelationList.add(groupCfg);
|
||||
maatCfg.setGroupNum(groupRelationList.size());
|
||||
configCompileList.add(maatCfg);
|
||||
maatBean.setConfigCompileList(configCompileList);
|
||||
maatBean.setAuditTime(entity.getAuditTime());
|
||||
maatBean.setCreatorName(entity.getCurrentUser().getName());
|
||||
maatBean.setVersion(Constants.MAAT_VERSION);
|
||||
maatBean.setOpAction(Constants.INSERT_ACTION);
|
||||
//调用服务接口下发配置数据
|
||||
String json=gsonToJson(maatBean);
|
||||
logger.info("asn策略组复用配置下发配置参数:"+json);
|
||||
//调用服务接口下发配置
|
||||
ToMaatResult result = ConfigServiceUtil.postMaatCfg(json);
|
||||
logger.info("asn策略组复用配置下发响应信息:"+result.getMsg());
|
||||
}else {//首次下发
|
||||
maatCfg.initDefaultValue();
|
||||
BeanUtils.copyProperties(entity, maatCfg);
|
||||
maatCfg.setAction(entity.getAction());
|
||||
maatCfg.setAuditTime(entity.getAuditTime());
|
||||
maatCfg.setStrRegionList(strRegionList);
|
||||
maatCfg.setNumRegionList(numRegionList);
|
||||
maatCfg.setDigestRegionList(digestRegionList);
|
||||
maatCfg.setGroupRelationList(groupRelationList);
|
||||
maatCfg.setAreaIpRegionList(areaIpRegionList);
|
||||
maatCfg.setIsValid(entity.getIsValid());
|
||||
//group
|
||||
GroupCfg groupCfg=new GroupCfg();
|
||||
groupCfg.setCompileId(entity.getCompileId());
|
||||
groupCfg.setGroupId(Integer.parseInt(entity.getUserRegion1()));
|
||||
groupCfg.setIsValid(Constants.VALID_YES);
|
||||
groupCfg.setAuditTime(auditTime);
|
||||
groupRelationList.add(groupCfg);
|
||||
maatCfg.setGroupNum(groupRelationList.size());
|
||||
//region
|
||||
//查询asn group id下所有的 ip
|
||||
AsnIpCfg asnIpCfg=new AsnIpCfg();
|
||||
asnIpCfg.setAsnIpGroup(Integer.parseInt(entity.getUserRegion1()));
|
||||
List<AsnIpCfg> allAsnIpCfgs=asnIpCfgDao.findAllList(asnIpCfg);
|
||||
ipRegionList.addAll(groupReuseCfgAddRemoveConvert(allAsnIpCfgs,Constants.VALID_YES));
|
||||
maatCfg.setIpRegionList(ipRegionList);
|
||||
configCompileList.add(maatCfg);
|
||||
maatBean.setConfigCompileList(configCompileList);
|
||||
maatBean.setAuditTime(entity.getAuditTime());
|
||||
maatBean.setCreatorName(entity.getCurrentUser().getName());
|
||||
maatBean.setVersion(Constants.MAAT_VERSION);
|
||||
maatBean.setOpAction(Constants.INSERT_ACTION);
|
||||
|
||||
//调用服务接口下发配置数据
|
||||
String json=gsonToJson(maatBean);
|
||||
logger.info("asn策略配置下发配置参数:"+json);
|
||||
//调用服务接口下发配置
|
||||
ToMaatResult result = ConfigServiceUtil.postMaatCfg(json);
|
||||
logger.info("asn策略配置下发响应信息:"+result.getMsg());
|
||||
ConfigGroupInfo info=new ConfigGroupInfo();
|
||||
info.setIsIssued(1);
|
||||
info.setGroupId(Integer.parseInt(entity.getUserRegion1()));
|
||||
specificServiceCfgDao.updateConfigGroupInfobyGroupId(info);
|
||||
AsnIpCfg cfg=new AsnIpCfg();
|
||||
cfg.setIsValid(Constants.VALID_YES);
|
||||
cfg.setAsnIpGroup(Integer.parseInt(entity.getUserRegion1()));
|
||||
asnIpCfgDao.updateIssued(cfg);
|
||||
}
|
||||
}else if(isAudit==Constants.AUDIT_NOT_YES) {//取消审核通过
|
||||
maatCfg.setCompileId(entity.getCompileId());
|
||||
maatCfg.setServiceId(entity.getServiceId());
|
||||
maatCfg.setIsValid(0);//无效
|
||||
configCompileList.add(maatCfg);
|
||||
maatBean.setConfigCompileList(configCompileList);
|
||||
maatBean.setAuditTime(entity.getAuditTime());
|
||||
maatBean.setCreatorName(entity.getCurrentUser().getName());
|
||||
maatBean.setVersion(Constants.MAAT_VERSION);
|
||||
maatBean.setOpAction(Constants.UPDATE_ACTION);
|
||||
//调用服务接口取消配置
|
||||
String json=gsonToJson(maatBean);
|
||||
logger.info("asn策略取消下发配置参数:"+json);
|
||||
//调用服务接口下发配置
|
||||
ToMaatResult result = ConfigServiceUtil.put(json,1);
|
||||
logger.info("asn策略取消配置响应信息:"+result.getMsg());
|
||||
}else {
|
||||
throw new RuntimeException("unknown isAudit value "+isAudit);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1132,4 +1132,8 @@ topic=Topic
|
||||
website_server=Website Server
|
||||
domain_existed=Domain Has Existed
|
||||
app_ssl_cert_feature_monit=APP SSL Cert Feature Monitoring
|
||||
app_header_feature_monit=APP Header Feature Monitoring
|
||||
app_header_feature_monit=APP Header Feature Monitoring
|
||||
can_not_edit_issued_ans_ip=Can not edit issued ASN IP
|
||||
is_issued=Is Issued
|
||||
asn_ip_configuration=ASN IP Configuration
|
||||
asn_policy=ASN Policy
|
||||
@@ -1129,4 +1129,8 @@ topic=\u4E3B\u9898
|
||||
website_server=\u7F51\u7AD9
|
||||
domain_existed=\u57DF\u540D\u5DF2\u7ECF\u5B58\u5728
|
||||
app_ssl_cert_feature_monit=APP SSL\u8BC1\u4E66\u7279\u5F81\u76D1\u6D4B
|
||||
app_header_feature_monit=APP\u5C42\u5934\u7279\u5F81\u76D1\u6D4B
|
||||
app_header_feature_monit=APP\u5C42\u5934\u7279\u5F81\u76D1\u6D4B
|
||||
can_not_edit_issued_ans_ip=\u4E0D\u80FD\u4FEE\u6539\u5DF2\u7ECF\u4E0B\u53D1\u8FC7\u7684ASN IP
|
||||
is_issued=\u662F\u5426\u4E0B\u53D1
|
||||
asn_ip_configuration=ASN IP\u914D\u7F6E
|
||||
asn_policy=ASN\u7B56\u7565
|
||||
@@ -442,7 +442,7 @@ specific_service_cfg_type_encrypted_tunnel_behavior=encrypted_tunnel_behavior
|
||||
specific_service_cfg_type_basic_protocol=basic_protocol
|
||||
#\u57fa\u7840\u534f\u8bae\u81ea\u5b9a\u4e49\u57df
|
||||
proto_id_region=PROTO_ID
|
||||
#拦截IP自定义域key
|
||||
#\u62e6\u622aIP\u81ea\u5b9a\u4e49\u57dfkey
|
||||
keyring_id=keyring_id
|
||||
droprate=Droprate
|
||||
bandwidth=Bandwidth
|
||||
@@ -465,4 +465,5 @@ app_cfg_userregion_splitor=&
|
||||
app_id_region=APP_ID
|
||||
#application spec service code scope
|
||||
app_spec_service_code_max_val=310000
|
||||
app_spec_service_code_min_val=300001
|
||||
app_spec_service_code_min_val=300001
|
||||
groupReuseSources=groupReuseSources
|
||||
@@ -23,7 +23,7 @@ CREATE TABLE `asn_ip_cfg` (
|
||||
`audit_time` DATETIME DEFAULT NULL,
|
||||
`service_id` INT(11) NOT NULL COMMENT '参考系统业务类型管理表',
|
||||
`request_id` INT(11) NOT NULL COMMENT '取自request_info.id',
|
||||
`compile_id` INT(11) NOT NULL COMMENT '取自服务接口返回的maat配置的编译id,配置初始入库时获取。',
|
||||
`region_id` INT(11) NOT NULL COMMENT '取自服务接口返回的maat配置的域id,配置初始入库时获取。',
|
||||
`is_area_effective` INT(11) NOT NULL COMMENT '0否,1是',
|
||||
`classify` VARCHAR(128) DEFAULT NULL COMMENT '分类id,多个用英文逗号分隔',
|
||||
`attribute` VARCHAR(128) DEFAULT NULL COMMENT '性质id,多个用英文逗号分隔',
|
||||
@@ -39,8 +39,7 @@ CREATE TABLE `asn_ip_cfg` (
|
||||
`dest_ip_address` VARCHAR (128) DEFAULT NULL,
|
||||
`dest_port` VARCHAR(16) DEFAULT NULL,
|
||||
`ratelimit` VARCHAR(10) DEFAULT NULL,
|
||||
`dns_strategy_id` INT(11) DEFAULT NULL,
|
||||
`IR_TYPE` INT (11) DEFAULT NULL,
|
||||
`asn_ip_group` INT(11) DEFAULT NULL,
|
||||
`user_region1` VARCHAR(1024) DEFAULT '' COMMENT '预留自定义域1',
|
||||
`user_region2` VARCHAR(1024) DEFAULT '' COMMENT '预留自定义域2',
|
||||
`user_region3` VARCHAR(1024) DEFAULT '' COMMENT '预留自定义域3',
|
||||
|
||||
@@ -68,8 +68,16 @@ UPDATE function_region_dict SET config_ip_port_show='1,2' ,config_ip_type='4,6,4
|
||||
#voip ip
|
||||
UPDATE function_service_dict SET region_code='1,2' WHERE function_id=24 AND ACTION IN(1,16);
|
||||
UPDATE function_region_dict SET config_ip_port_show='1,2' ,config_ip_type='4,6,46,64,10',config_ip_pattern='1,2,3',config_port_pattern='1,2',config_direction='0,1',config_protocol='0,6,17' WHERE dict_id=8;
|
||||
|
||||
|
||||
|
||||
|
||||
#asn ip
|
||||
INSERT INTO function_region_dict
|
||||
(function_id,config_region_code,config_region_value,config_desc,is_maat,region_type,config_ip_type,config_ip_pattern,config_port_pattern,config_direction,config_protocol,config_ip_port_show,config_region_sort,is_valid) VALUE
|
||||
(600,1,'NTC_ASN_IP','asn ip池',1,1,'4,6','1,2,3','1,2','0','0','2',1,1)
|
||||
#asn 策略
|
||||
INSERT INTO function_region_dict
|
||||
(function_id,config_region_code,config_region_value,config_desc,is_maat,region_type,config_region_sort,is_valid) VALUE
|
||||
(601,1,'NTC_ASN_IP','asn策略',1,1,1,1)
|
||||
INSERT INTO function_service_dict (function_id,protocol_id,ACTION,action_code,service_id,service_name,service_desc,is_valid,region_code)
|
||||
VALUES(601,0,1,'monit',149,'ANS_POLICY_REJECT','ANS_POLICY_REJECT',1,1)
|
||||
INSERT INTO function_service_dict (function_id,protocol_id,ACTION,action_code,service_id,service_name,service_desc,is_valid,region_code)
|
||||
VALUES(601,0,16,'reject',37,'ANS_POLICY_REJECT','ANS_POLICY_REJECT',1,1)
|
||||
|
||||
|
||||
@@ -69,6 +69,15 @@ function update(url){
|
||||
top.$.jBox.tip("<spring:message code='cancel_approved'/>", "<spring:message code='info'/>");
|
||||
return;
|
||||
}
|
||||
//处理asnIp,asn组下发过的ip配置不允许修改
|
||||
if(cked.attr("serviceGroupId")&&cked.attr("isValid")){
|
||||
var serviceGroupId=cked.attr("serviceGroupId");
|
||||
var _isValid=cked.attr("isValid");
|
||||
if(_isValid==1){
|
||||
top.$.jBox.tip("<spring:message code='can_not_edit_issued_ans_ip'/>", "<spring:message code='info'/>");
|
||||
return;
|
||||
}
|
||||
}
|
||||
doAll(checkboxes,url);
|
||||
}else{
|
||||
top.$.jBox.tip("<spring:message code='check_one'/>", "<spring:message code='info'/>");
|
||||
|
||||
238
src/main/webapp/WEB-INF/views/basics/asnIpCfgFormAdd.jsp
Normal file
238
src/main/webapp/WEB-INF/views/basics/asnIpCfgFormAdd.jsp
Normal file
@@ -0,0 +1,238 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8"%>
|
||||
<%@ include file="/WEB-INF/include/taglib.jsp"%>
|
||||
<html>
|
||||
<head>
|
||||
<title><spring:message code="asn_ip_configuration"></spring:message></title>
|
||||
<script type="text/javascript">
|
||||
var defaultIpInfo;
|
||||
$(function(){
|
||||
defaultIpInfo=$(".ipInfo").clone();
|
||||
$("#cfgFrom").validate({
|
||||
errorPlacement: function(error,element){
|
||||
$(element).parents(".form-group").find("div[for='"+element.attr("name")+"']").append(error);
|
||||
},
|
||||
submitHandler: function(form){
|
||||
loading('onloading...');
|
||||
form.submit();
|
||||
},
|
||||
errorContainer: "#messageBox",
|
||||
});
|
||||
});
|
||||
//业务窗口打开
|
||||
var addContent = function(obj, contentClassName) {
|
||||
var showDiv = $(obj).parent().parent().siblings("."+contentClassName).last();
|
||||
if(showDiv.hasClass("hidden")){
|
||||
$(showDiv).removeClass("hidden").removeClass(
|
||||
"disabled");
|
||||
}else{
|
||||
var additional=defaultIpInfo.clone();
|
||||
additional.removeClass("hidden").removeClass(
|
||||
"disabled");
|
||||
showDiv.after(additional);
|
||||
}
|
||||
var index=0;
|
||||
$("."+contentClassName).each(function(){
|
||||
reSort($(this),index);
|
||||
index++;
|
||||
});
|
||||
//$(obj).addClass("hidden");
|
||||
}
|
||||
|
||||
//业务窗口关闭
|
||||
var delContent = function(obj,contentClassName) {
|
||||
$(obj).parents("."+contentClassName).remove();
|
||||
var index=0;
|
||||
$("."+contentClassName).each(function(){
|
||||
reSort($(this),index);
|
||||
index++;
|
||||
});
|
||||
}
|
||||
var reSort=function(obj,index){
|
||||
$(obj).find("input,select").each(function(){
|
||||
var name=$(this).attr("name");
|
||||
if(name.indexOf("asnIpCfgs[")>-1){
|
||||
var namePrefix="asnIpCfgs[";
|
||||
var nameSubfix=name.substring(name.indexOf("]"));
|
||||
var nameNew=namePrefix+index+nameSubfix;
|
||||
if(nameNew!=name){
|
||||
$(this).attr("name",nameNew);
|
||||
$(this).parents(".form-group").find("div[for='"+name+"']").attr("for",nameNew);
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="page-content">
|
||||
|
||||
<h3 class="page-title">
|
||||
<spring:message code="asn_ip_configuration"></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>
|
||||
<spring:message code="add"></spring:message>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body form">
|
||||
<!-- BEGIN FORM-->
|
||||
<form id="cfgFrom" action="${ctx}/basics/asn/save" method="post" class="form-horizontal">
|
||||
<input type="hidden" name="functionId" value="${_cfg.functionId}">
|
||||
<input type="hidden" id="serviceId" name="serviceId" value="0">
|
||||
<input type="hidden" id="isAreaEffective" name="isAreaEffective" value="0">
|
||||
<input type="hidden" id="action" name="action" value="0">
|
||||
<input type="hidden" id="compileId" name="compileId" value="0">
|
||||
<input type="hidden" id="requestId" name="requestId" value="0">
|
||||
<!-- 配置域类型 -->
|
||||
<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" value="${region.configRegionCode}">
|
||||
</c:if>
|
||||
</c:forEach>
|
||||
<div class="form-body">
|
||||
<!-- desc and action -->
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-md-3"><spring:message code="config_describe"/></label>
|
||||
<div class="col-md-6">
|
||||
<input class="form-control" type="text" name="cfgDesc" value="${_cfg.cfgDesc}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-md-3"><spring:message code="group"/></label>
|
||||
<div class="col-md-6">
|
||||
<select name="asnIpGroup" class="selectpicker show-tick form-control required">
|
||||
<%-- <option value="0" ><spring:message code="default_group"/></option>--%>
|
||||
<c:forEach items="${policyGroups }" var="policyGroup">
|
||||
<option value="${policyGroup.serviceGroupId}" <c:if test="${_cfg.asnIpGroup==policyGroup.serviceGroupId }">selected</c:if>><spring:message code="${policyGroup.groupName}"/></option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- desc and action -->
|
||||
<h4 class="form-section">
|
||||
<spring:message code="asn_ip_configuration" />
|
||||
<small> <span
|
||||
class="glyphicon glyphicon-plus asnIpAdd"
|
||||
onClick="addContent(this,'ipInfo')" title="add"></span></small>
|
||||
</h4>
|
||||
<div class="row ipInfo boxSolid asnIp hidden disabled">
|
||||
<div class="row">
|
||||
<div class="pull-right">
|
||||
<span class="glyphicon glyphicon-remove pull-right" title="remove"
|
||||
onClick="delContent(this,'ipInfo');" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="ip_type"/></label>
|
||||
<div class="col-md-6">
|
||||
<select name="asnIpCfgs[0].ipType" class="selectpicker show-tick form-control required">
|
||||
<c:forEach items="${fns:getDictList('WHITELIST_IPTYPE')}" var="ipTypeC">
|
||||
<option value="${ipTypeC.itemCode}"
|
||||
<c:if test="${_cfg.asnIpCfgs[0].ipType==ipTypeC.itemCode
|
||||
|| (_cfg.asnIpCfgs[0].ipType==null && ipTypeC.itemCode==4)}">
|
||||
selected
|
||||
</c:if>
|
||||
>
|
||||
<spring:message code="${ipTypeC.itemValue}"/>
|
||||
</option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</div>
|
||||
<div for="asnIpCfgs[0].ipType"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="ip_pattern"/></label>
|
||||
<div class="col-md-6">
|
||||
<select name="asnIpCfgs[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="${_cfg.asnIpCfgs[0].ipPattern==ipPatternC.itemCode || (_cfg.asnIpCfgs[0].ipPattern==null && ipPatternC.itemCode==3)}">selected</c:if>><spring:message code="${ipPatternC.itemValue}"/></option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</div>
|
||||
<div for="asnIpCfgs[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">
|
||||
<input class="form-control required ipCheck" type="text" name="asnIpCfgs[0].destIpAddress" value="${_cfg.asnIpCfgs[0].destIpAddress}">
|
||||
</div>
|
||||
<div for="asnIpCfgs[0].destIpAddress"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<%-- <div class="row port">
|
||||
<div class="col-md-6">
|
||||
<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="portPattern" class="selectpicker show-tick form-control required">
|
||||
<c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC">
|
||||
<option value="${portPatternC.itemCode}" <c:if test="${_cfg.portPattern==portPatternC.itemCode || (_cfg.portPattern==null && portPatternC.itemCode==1)}">selected</c:if>><spring:message code="${portPatternC.itemValue}"/></option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</div>
|
||||
<div for="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="port"/></label>
|
||||
<div class="col-md-6">
|
||||
<input class="form-control required portCheck" type="text" name="destPort" value="${_cfg.destPort}">
|
||||
</div>
|
||||
<div for="destPort"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div> --%>
|
||||
<input type="hidden" name="asnIpCfgs[0].portPattern" value="1">
|
||||
<input type="hidden" name="asnIpCfgs[0].srcPort" value="0">
|
||||
<input type="hidden" name="asnIpCfgs[0].destPort" value="0">
|
||||
<input type="hidden" name="asnIpCfgs[0].srcIpAddress" value="0.0.0.0">
|
||||
<input type="hidden" name="asnIpCfgs[0].direction" value="0">
|
||||
<input type="hidden" name="asnIpCfgs[0].protocolId" value="0">
|
||||
<input type="hidden" name="asnIpCfgs[0].protocol" value="0">
|
||||
</div>
|
||||
</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>
|
||||
<!-- END FORM-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
207
src/main/webapp/WEB-INF/views/basics/asnIpCfgFormUpdate.jsp
Normal file
207
src/main/webapp/WEB-INF/views/basics/asnIpCfgFormUpdate.jsp
Normal file
@@ -0,0 +1,207 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8"%>
|
||||
<%@ include file="/WEB-INF/include/taglib.jsp"%>
|
||||
<html>
|
||||
<head>
|
||||
<title><spring:message code="asn_ip_configuration"></spring:message></title>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
$("#cfgFrom").validate({
|
||||
errorPlacement: function(error,element){
|
||||
$(element).parents(".form-group").find("div[for='"+element.attr("name")+"']").append(error);
|
||||
},
|
||||
submitHandler: function(form){
|
||||
loading('onloading...');
|
||||
form.submit();
|
||||
},
|
||||
errorContainer: "#messageBox",
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="page-content">
|
||||
|
||||
<h3 class="page-title">
|
||||
<spring:message code="asn_ip_configuration"></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>
|
||||
<spring:message code="edit"></spring:message>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body form">
|
||||
<!-- BEGIN FORM-->
|
||||
<form id="cfgFrom" action="${ctx}/basics/asn/update" method="post" class="form-horizontal">
|
||||
<input type="hidden" name="cfgId" value="${_cfg.cfgId}">
|
||||
<input type="hidden" name="compileId" value="${_cfg.compileId}">
|
||||
<input type="hidden" name="functionId" value="${_cfg.functionId}">
|
||||
<input type="hidden" id="serviceId" name="serviceId" value="${_cfg.serviceId}">
|
||||
<input type="hidden" id="isAreaEffective" name="isAreaEffective" value="0">
|
||||
<input type="hidden" id="requestId" name="requestId" value="${_cfg.requestId}">
|
||||
<!-- 配置域类型 -->
|
||||
<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" value="${region.configRegionCode}">
|
||||
</c:if>
|
||||
</c:forEach>
|
||||
<div class="form-body">
|
||||
<!-- desc and action -->
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-md-3"><spring:message code="config_describe"/></label>
|
||||
<div class="col-md-6">
|
||||
<input class="form-control" type="text" name="cfgDesc" value="${_cfg.cfgDesc}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-md-3"><spring:message code="group"/></label>
|
||||
<div class="col-md-6">
|
||||
<select name="asnIpGroup" class="selectpicker show-tick form-control required">
|
||||
<c:forEach items="${policyGroups }" var="policyGroup">
|
||||
<option value="${policyGroup.serviceGroupId}" <c:if test="${_cfg.asnIpGroup==policyGroup.serviceGroupId }">selected</c:if>><spring:message code="${policyGroup.groupName}"/></option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</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>
|
||||
<!-- desc and action -->
|
||||
<%-- <%@include file="/WEB-INF/include/form/complexIpInfo.jsp" %> --%>
|
||||
<div class="row ipInfo">
|
||||
<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="ipType" class="selectpicker show-tick form-control required">
|
||||
<c:forEach items="${fns:getDictList('WHITELIST_IPTYPE')}" var="ipTypeC">
|
||||
<option value="${ipTypeC.itemCode}"
|
||||
<c:if test="${_cfg.ipType==ipTypeC.itemCode
|
||||
|| (_cfg.ipType==null && ipTypeC.itemCode==4)}">
|
||||
selected
|
||||
</c:if>
|
||||
>
|
||||
<spring:message code="${ipTypeC.itemValue}"/>
|
||||
</option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</div>
|
||||
<div for="ipType"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="ip_pattern"/></label>
|
||||
<div class="col-md-6">
|
||||
<select name="ipPattern" class="selectpicker show-tick form-control required">
|
||||
<c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC">
|
||||
<option value="${ipPatternC.itemCode}" <c:if test="${_cfg.ipPattern==ipPatternC.itemCode || (_cfg.ipPattern==null && ipPatternC.itemCode==3)}">selected</c:if>><spring:message code="${ipPatternC.itemValue}"/></option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</div>
|
||||
<div for="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">
|
||||
<input class="form-control required ipCheck" type="text" name="destIpAddress" value="${_cfg.destIpAddress}">
|
||||
</div>
|
||||
<div for="destIpAddress"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<%-- <div class="row port">
|
||||
<div class="col-md-6">
|
||||
<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="portPattern" class="selectpicker show-tick form-control required">
|
||||
<c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC">
|
||||
<option value="${portPatternC.itemCode}" <c:if test="${_cfg.portPattern==portPatternC.itemCode || (_cfg.portPattern==null && portPatternC.itemCode==1)}">selected</c:if>><spring:message code="${portPatternC.itemValue}"/></option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</div>
|
||||
<div for="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="port"/></label>
|
||||
<div class="col-md-6">
|
||||
<input class="form-control required portCheck" type="text" name="destPort" value="${_cfg.destPort}">
|
||||
</div>
|
||||
<div for="destPort"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div> --%>
|
||||
<input type="hidden" name="portPattern" value="${_cfg.portPattern}">
|
||||
<input type="hidden" name="srcPort" value="${_cfg.srcPort}">
|
||||
<input type="hidden" name="destPort" value="${_cfg.destPort}">
|
||||
<input type="hidden" name="srcIpAddress" value="${_cfg.srcIpAddress}">
|
||||
<input type="hidden" name="direction" value="${_cfg.direction}">
|
||||
<input type="hidden" name="protocolId" value="${_cfg.protocolId}">
|
||||
<input type="hidden" name="protocol" value="${_cfg.protocol}">
|
||||
</div>
|
||||
<%-- <%@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>
|
||||
<!-- END FORM-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
363
src/main/webapp/WEB-INF/views/basics/asnIpCfgList.jsp
Normal file
363
src/main/webapp/WEB-INF/views/basics/asnIpCfgList.jsp
Normal file
@@ -0,0 +1,363 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8"%>
|
||||
<%@ include file="/WEB-INF/include/taglib.jsp"%>
|
||||
<html>
|
||||
<head>
|
||||
<title><spring:message code="asn_ip_configuration"></spring:message></title>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
//搜索框提示语初始化
|
||||
if("${cfg.cfgDesc}"){
|
||||
$("#intype").val("${cfg.cfgDesc}");
|
||||
}else if("${cfg.srcIpAddress}"){
|
||||
$("#intype").val("${cfg.srcIpAddress}");
|
||||
}else if("${cfg.srcPort}"){
|
||||
$("#intype").val("${cfg.srcPort}");
|
||||
} 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();
|
||||
});
|
||||
});
|
||||
var edit=function(url){
|
||||
var cked = $('tbody tr td input.i-checks:checkbox:checked');
|
||||
if(cked.val()==1){
|
||||
top.$.jBox.tip("<spring:message code='has_approved'/>", "<spring:message code='info'/>");
|
||||
return;
|
||||
}
|
||||
if(cked.length==1){
|
||||
window.location = url+"&compileId="+cked.attr("id");
|
||||
}else{
|
||||
top.$.jBox.tip("<spring:message code='check_one'/>", "<spring:message code='info'/>");
|
||||
return;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="page-content">
|
||||
<div class="theme-panel hidden-xs hidden-sm">
|
||||
|
||||
<shiro:hasPermission name="asn:ip:config">
|
||||
<button type="button" class="btn btn-primary"
|
||||
onClick="javascript:window.location='${ctx}/basics/asn/addForm?functionId=${cfg.functionId}'">
|
||||
<i class="fa fa-plus"></i>
|
||||
<spring:message code="add"></spring:message></button>
|
||||
</shiro:hasPermission>
|
||||
</div>
|
||||
|
||||
<h3 class="page-title">
|
||||
<spring:message code="asn_ip_configuration"></spring:message>
|
||||
<%-- <small><spring:message code="date_list"/></small> --%>
|
||||
</h3>
|
||||
<h5 class="page-header"></h5>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="portlet">
|
||||
<div class="portlet-body">
|
||||
<div class="row" >
|
||||
<form:form id="searchForm" modelAttribute="cfg" action="${ctx}/basics/asn/list?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="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='group'/></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="cfgDesc"><spring:message code="config_describe"></spring:message></form:option>
|
||||
<form:option value="destIpAddress"><spring:message code="IP"></spring:message></form:option>
|
||||
<%-- <form:option value="destPort"><spring:message code="port"></spring:message></form:option> --%>
|
||||
</form:select>
|
||||
|
||||
</div>
|
||||
|
||||
<input id="intype" class="form-control input-medium" type="text" value="">
|
||||
|
||||
</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="asn:ip:config">
|
||||
<sys:delRow url="${ctx}/basics/asn/updateForm?functionId=${cfg.functionId}" id="contentTable" label="update"></sys:delRow>
|
||||
<sys:delRow url="${ctx}/basics/asn/delete?isValid=-1&functionId=${cfg.functionId }" id="contentTable" label="delete"></sys:delRow>
|
||||
</shiro:hasPermission>
|
||||
<%-- <shiro:hasPermission name="asn:ip: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}/basics/asn/audit?isAudit=1&isValid=1&functionId=${cfg.functionId }" id="contentTable" label="approved"></sys:delRow></li>
|
||||
<li><sys:delRow url="${ctx}/basics/asn/audit?isAudit=2&isValid=0&functionId=${cfg.functionId }" id="contentTable" label="unapproved"></sys:delRow></li>
|
||||
<li><sys:delRow url="${ctx}/basics/asn/audit?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-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>
|
||||
<div class="table-responsive">
|
||||
<sys:message content="${message}" />
|
||||
<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><spring:message code="seq"/></th> --%>
|
||||
<th><spring:message code="config_describe"/></th>
|
||||
<th><spring:message code="group"/></th>
|
||||
<th><spring:message code="ip_type"/></th>
|
||||
<th><spring:message code="IP"/></th>
|
||||
<%-- <th><spring:message code="port"/></th> --%>
|
||||
<th><spring:message code="ip_pattern"/></th>
|
||||
<%-- <th><spring:message code="port_pattern"/></th> --%>
|
||||
<%-- <th><spring:message code="block_type"/></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="is_issued"/></th>
|
||||
<%-- <th><spring:message code="is_audit"/></th> --%>
|
||||
<%-- <th><spring:message code="log_total"/></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> --%>
|
||||
<%-- <th><spring:message code="operation"></spring:message></th> --%>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<c:forEach items="${page.list }" var="cfg" varStatus="status" step="1">
|
||||
<tr>
|
||||
<td><input type="checkbox" class="i-checks" id="${cfg.cfgId}" isValid="${cfg.isValid}" serviceGroupId="${cfg.asnIpGroup}" value="0"></td>
|
||||
<td>${cfg.cfgDesc }</td>
|
||||
<td>${cfg.asnIpGroupName }
|
||||
</td>
|
||||
<td>
|
||||
<c:forEach items="${fns:getDictList('IP_TYPE')}" var="ipTypeC">
|
||||
<c:if test="${cfg.ipType==ipTypeC.itemCode}"><spring:message code="${ipTypeC.itemValue }"/></c:if>
|
||||
</c:forEach>
|
||||
</td>
|
||||
<td title="${cfg.destIpAddress }">${fns:abbr(cfg.destIpAddress, 42)}</td>
|
||||
<%-- <td>${cfg.destPort }</td> --%>
|
||||
<td>
|
||||
<c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC">
|
||||
<c:if test="${cfg.ipPattern==ipPatternC.itemCode}"><spring:message code="${ipPatternC.itemValue }"/></c:if>
|
||||
</c:forEach>
|
||||
</td>
|
||||
<%-- <td>
|
||||
<c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC">
|
||||
<c:if test="${cfg.portPattern eq portPatternC.itemCode}"><spring:message code="${portPatternC.itemValue }"/></c:if>
|
||||
</c:forEach>
|
||||
</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>${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>${cfg.areaEffectiveIds }</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 class="label label-warning"><spring:message code="cancel_approved"></spring:message></span></c:when>
|
||||
</c:choose>
|
||||
</td> --%>
|
||||
<%-- <td audit="${cfg.isAudit}" functionId="${cfg.functionId}" compileId="${cfg.compileId}" action="${cfg.action}"><div class="loading-total"></div></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>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
135
src/main/webapp/WEB-INF/views/cfg/asnPolicyCfgForm.jsp
Normal file
135
src/main/webapp/WEB-INF/views/cfg/asnPolicyCfgForm.jsp
Normal file
@@ -0,0 +1,135 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8"%>
|
||||
<%@ include file="/WEB-INF/include/taglib.jsp"%>
|
||||
<html>
|
||||
<head>
|
||||
<title><spring:message code="asn_policy"></spring:message></title>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
$(".action").on("change", function() {
|
||||
$("#serviceId").val($(this).attr("serviceId"));
|
||||
$("#protocolId").val($(this).attr("protocolId"));
|
||||
});
|
||||
$("#serviceId").val($(".action:checked").attr("serviceId"));
|
||||
$("#protocolId").val($(".action:checked").attr("protocolId"));
|
||||
$("#cfgFrom").validate({
|
||||
errorPlacement: function(error,element){
|
||||
$(element).parents(".form-group").find("div[for='"+element.attr("name")+"']").append(error);
|
||||
},
|
||||
submitHandler: function(form){
|
||||
loading('onloading...');
|
||||
form.submit();
|
||||
},
|
||||
errorContainer: "#messageBox",
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="page-content">
|
||||
|
||||
<h3 class="page-title">
|
||||
<spring:message code="asn_policy"></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="${not empty _cfg.cfgId}"><spring:message code="edit"></spring:message></c:if>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body form">
|
||||
<!-- BEGIN FORM-->
|
||||
<form id="cfgFrom" action="${ctx}/cfg/asnPolicy/saveOrUpdate" method="post" class="form-horizontal">
|
||||
<input type="hidden" name="cfgId" value="${_cfg.cfgId}">
|
||||
<input type="hidden" name="compileId" value="${_cfg.compileId}">
|
||||
<input type="hidden" name="functionId" value="${_cfg.functionId}">
|
||||
<input type="hidden" id="serviceId" name="serviceId" value="${_cfg.serviceId}">
|
||||
<input type="hidden" id="isAreaEffective" name="isAreaEffective" value="0">
|
||||
<input type="hidden" id="requestId" name="requestId" value="0">
|
||||
<!-- 配置域类型 -->
|
||||
<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" value="${region.configRegionCode}">
|
||||
</c:if>
|
||||
</c:forEach>
|
||||
<div class="form-body">
|
||||
<!-- desc and action -->
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-md-3"><spring:message code="config_describe"/></label>
|
||||
<div class="col-md-6">
|
||||
<input class="form-control" type="text" name="cfgDesc" value="${_cfg.cfgDesc}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-md-3"><spring:message code="group"/></label>
|
||||
<div class="col-md-6">
|
||||
<select name="userRegion1" class="selectpicker show-tick form-control required">
|
||||
<c:forEach items="${policyGroups }" var="policyGroup">
|
||||
<option value="${policyGroup.groupId}" <c:if test="${_cfg.userRegion1==policyGroup.groupId }">selected</c:if>><spring:message code="${policyGroup.groupName}"/></option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<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>
|
||||
<!-- desc and action -->
|
||||
<%-- <%@include file="/WEB-INF/include/form/complexIpInfo.jsp" %>
|
||||
<%@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>
|
||||
<!-- END FORM-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
391
src/main/webapp/WEB-INF/views/cfg/asnPolicyCfgList.jsp
Normal file
391
src/main/webapp/WEB-INF/views/cfg/asnPolicyCfgList.jsp
Normal file
@@ -0,0 +1,391 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8"%>
|
||||
<%@ include file="/WEB-INF/include/taglib.jsp"%>
|
||||
<html>
|
||||
<head>
|
||||
<title><spring:message code="asn_policy"></spring:message></title>
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
//搜索框提示语初始化
|
||||
if("${cfg.cfgDesc}"){
|
||||
$("#intype").val("${cfg.cfgDesc}");
|
||||
}else if("${cfg.compileId}"){
|
||||
$("#intype").val("${cfg.compileId}");
|
||||
}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",'');
|
||||
$("#level").attr("value",'');
|
||||
$("#searchForm")[0].reset();
|
||||
});
|
||||
//异步获取voip相关信息
|
||||
$("span[id^=open]").click(function(){
|
||||
var openId=$(this).attr("id");
|
||||
var closeId=$(this).attr("id").replace("open","close");
|
||||
var index=$(this).attr("id").replace("open","");
|
||||
$("#"+openId).hide();
|
||||
$("#"+closeId).show();
|
||||
//var compileId=$(this).attr("compileId");
|
||||
var cfgId=$(this).attr("cfgId");
|
||||
if($("#"+openId).parent().parent().next("tr").hasClass("child")){
|
||||
$("#"+openId).parent().parent().next("tr").show();
|
||||
}else{
|
||||
$.ajax({
|
||||
type:'post',
|
||||
async:false,
|
||||
url:'${ctx}/cfg/ajaxDnsSubList',
|
||||
data:{"cfgId":cfgId,"index":index},
|
||||
dataType:"html",
|
||||
success:function(data){
|
||||
var subTab="<tr class='child'>"+
|
||||
"<td style='border-right: 1px solid #FFFFFF;'>"+
|
||||
"<input type='checkbox' hidden='hidden'/>"+
|
||||
"</td>"+
|
||||
"<td colspan='"+($(".table tr").eq(0).children("th").length-1)+"'>";
|
||||
var html="";
|
||||
html+="<div class='row'>";
|
||||
html = html+data;
|
||||
subTab=subTab+html;
|
||||
subTab+="</td>";
|
||||
subTab+="</tr>";
|
||||
$("#"+openId).parent().parent().after(subTab);
|
||||
$("div[name='tabTitle"+index+"']").get(0).click();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
$("span[id^=close]").on("click",function(){
|
||||
var closeId=$(this).attr("id");
|
||||
var openId=$(this).attr("id").replace("close","open");
|
||||
$("#"+closeId).hide();
|
||||
$("#"+openId).show();
|
||||
$("#"+closeId).parent().parent().next("tr").hide();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="page-content">
|
||||
<div class="theme-panel hidden-xs hidden-sm">
|
||||
<shiro:hasPermission name="asn:policy:config">
|
||||
<button type="button" class="btn btn-primary"
|
||||
onClick="javascript:window.location='${ctx}/cfg/asnPolicy/form?functionId=${cfg.functionId}'">
|
||||
<i class="fa fa-plus"></i>
|
||||
<spring:message code="add"></spring:message></button>
|
||||
</shiro:hasPermission>
|
||||
</div>
|
||||
|
||||
<h3 class="page-title">
|
||||
<spring:message code="asn_policy"></spring:message>
|
||||
</h3>
|
||||
<h5 class="page-header"></h5>
|
||||
<div class="col-md-12">
|
||||
<div class="portlet">
|
||||
<div class="portlet-body">
|
||||
<div class="row" >
|
||||
<sys:message content="${message}"/>
|
||||
<form:form id="searchForm" modelAttribute="cfg" action="${ctx}/cfg/asnPolicy/list?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="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="cfgDesc"><spring:message code="config_describe"></spring:message></form:option>
|
||||
<form:option value="compileId"><spring:message code="cfg_id"></spring:message></form:option>
|
||||
<%-- <form:option value="voipIp.srcIpAddress"><spring:message code="client_ip"/></form:option>
|
||||
<form:option value="voipIp.srcPort"><spring:message code="client_port"/></form:option>
|
||||
<form:option value="voipAccount.cfgKeywords"><spring:message code="key_word"/></form:option>
|
||||
<form:option value="voipAccount.district"><spring:message code="strong_string"/></form:option> --%>
|
||||
</form:select>
|
||||
|
||||
</div>
|
||||
|
||||
<input id="intype" class="form-control input-medium" type="text" value="">
|
||||
|
||||
</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="asn:policy:config">
|
||||
<sys:delRow url="${ctx}/cfg/asnPolicy/form" id="contentTable" label="update"></sys:delRow>
|
||||
<sys:delRow url="${ctx}/cfg/asnPolicy/delete?isValid=-1&functionId=${cfg.functionId }" id="contentTable" label="delete"></sys:delRow>
|
||||
</shiro:hasPermission>
|
||||
<shiro:hasPermission name="asn:policy: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}/cfg/asnPolicy/audit?isAudit=1&isValid=1&functionId=${cfg.functionId }" id="contentTable" label="approved"></sys:delRow></li>
|
||||
<li><sys:delRow url="${ctx}/cfg/asnPolicy/audit?isAudit=2&isValid=0&functionId=${cfg.functionId }" id="contentTable" label="unapproved"></sys:delRow></li>
|
||||
<li><sys:delRow url="${ctx}/cfg/asnPolicy/audit?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-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>
|
||||
<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 style="display: none"><spring:message code="cfg_id"/></th>
|
||||
<th class="cfgDesc"><spring:message code="config_describe"/></th>
|
||||
<th><spring:message code="policy_name"/></th>
|
||||
<th><spring:message code="block_type"/></th>
|
||||
<%-- <th><spring:message code="do_log"/></th>
|
||||
<th><spring:message code="whether_area_block"/></th>
|
||||
<th><spring:message code="letter"/></th>
|
||||
<th><spring:message code="classification"/></th>
|
||||
<th><spring:message code="attribute"/></th>
|
||||
<th><spring:message code="label"/></th> --%>
|
||||
<th><spring:message code="valid_identifier"/></th>
|
||||
<th><spring:message code="is_audit"/></th>
|
||||
<%-- <th><spring:message code="log_total"/></th> --%>
|
||||
<th><spring:message code="creator"/></th>
|
||||
<th class="sort-column a.create_time"><spring:message code="config_time"/></th>
|
||||
<th><spring:message code="editor"/></th>
|
||||
<th class="sort-column a.edit_time"><spring:message code="edit_time"/></th>
|
||||
<th><spring:message code="auditor"/></th>
|
||||
<th class="sort-column a.audit_time"><spring:message code="audit_time"/></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<c:forEach items="${page.list }" var="indexCfg" varStatus="status" step="1">
|
||||
<tr>
|
||||
<td>
|
||||
<%-- <span id="open${status.index}" class="" compileId="${indexCfg.compileId}" cfgId="${indexCfg.cfgId}"> ▷ </span><span style="display: none" id="close${status.index}" > ▼ </span> --%>
|
||||
<input type="checkbox" class="i-checks child-checks" id="${indexCfg.cfgId}" value="${indexCfg.isAudit}">
|
||||
</td>
|
||||
<td>${indexCfg.compileId }</td>
|
||||
<td>${indexCfg.cfgDesc }</td>
|
||||
<td>${indexCfg.asnIpGroupName}</td>
|
||||
<td>
|
||||
<c:forEach items="${fns:getDictList('SERVICE_ACTION') }" var="dict">
|
||||
<c:if test="${dict.itemCode eq indexCfg.action }">
|
||||
<spring:message code="${dict.itemValue }"/>
|
||||
</c:if>
|
||||
</c:forEach>
|
||||
</td>
|
||||
<%-- <td>
|
||||
<c:forEach items="${fns:getDictList('DO_LOG') }" var="dict">
|
||||
<c:if test="${dict.itemCode eq indexCfg.doLog }">
|
||||
<spring:message code="${dict.itemValue }"/>
|
||||
</c:if>
|
||||
</c:forEach>
|
||||
</td>
|
||||
<td>
|
||||
<c:if test="${indexCfg.isAreaEffective==0}"><spring:message code="no"/></c:if>
|
||||
<c:if test="${indexCfg.isAreaEffective==1}">
|
||||
<a href="javascript:viewAreaInfo('${ctx}','${indexCfg.areaEffectiveIds }','${indexCfg.compileId }')" >
|
||||
<spring:message code="yes"/>
|
||||
</a>
|
||||
</c:if>
|
||||
</td>
|
||||
<td>${indexCfg.requestName }</td>
|
||||
<td>
|
||||
<c:set var="classify"></c:set>
|
||||
<c:forEach items="${fn:split(indexCfg.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(indexCfg.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(indexCfg.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>
|
||||
<c:if test="${indexCfg.isValid==0}"><spring:message code="no"/></c:if>
|
||||
<c:if test="${indexCfg.isValid==1}"><spring:message code="yes"/></c:if>
|
||||
<c:if test="${indexCfg.isValid==-1}"><spring:message code="deleted"/></c:if>
|
||||
</td>
|
||||
<td>
|
||||
<c:choose>
|
||||
<c:when test="${indexCfg.isAudit eq '0'}"><span class="label label-danger"><spring:message code="created"></spring:message></span></c:when>
|
||||
<c:when test="${indexCfg.isAudit eq '1'}"><span class="label label-success"><spring:message code="approved"></spring:message></span></c:when>
|
||||
<c:when test="${indexCfg.isAudit eq '2'}"><span class="label label-warning"><spring:message code="unapproved"></spring:message></span></c:when>
|
||||
<c:when test="${indexCfg.isAudit eq '3'}"><span class="label label-warning"><spring:message code="cancel_approved"></spring:message></span></c:when>
|
||||
</c:choose>
|
||||
</td>
|
||||
<%-- <td audit="${indexCfg.isAudit}" functionId="${indexCfg.functionId}" compileId="${indexCfg.compileId}" action="${indexCfg.action}"><div class="loading-total"></div></td> --%>
|
||||
<td>${indexCfg.creatorName }</td>
|
||||
<td><fmt:formatDate value="${indexCfg.createTime }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
|
||||
<td>${indexCfg.editorName }</td>
|
||||
<td><fmt:formatDate value="${indexCfg.editTime }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
|
||||
<td>${indexCfg.auditorName }</td>
|
||||
<td><fmt:formatDate value="${indexCfg.auditTime }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="page" style="margin-top:40px">${page}</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user