IP公共组配置部分功能提交
This commit is contained in:
74
src/main/java/com/nis/domain/basics/CommonGroupInfo.java
Normal file
74
src/main/java/com/nis/domain/basics/CommonGroupInfo.java
Normal file
@@ -0,0 +1,74 @@
|
||||
package com.nis.domain.basics;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import com.nis.domain.configuration.BaseCfg;
|
||||
import com.nis.util.excel.ExcelField;
|
||||
|
||||
/**
|
||||
* 公共分组实体
|
||||
*/
|
||||
public class CommonGroupInfo extends BaseCfg<CommonGroupInfo> implements Serializable{
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 7931466570918016654L;
|
||||
|
||||
private Integer groupId;
|
||||
|
||||
@ExcelField(title="group_name",sort=1)
|
||||
private String groupName;
|
||||
|
||||
@ExcelField(title="group_type",dictType="GROUP_TYPE",sort=2)
|
||||
private Integer groupType;
|
||||
|
||||
private Integer serviceGroupId;
|
||||
|
||||
@ExcelField(title="desc",sort=4)
|
||||
private String description;
|
||||
|
||||
public Integer getServiceGroupId() {
|
||||
return serviceGroupId;
|
||||
}
|
||||
public void setServiceGroupId(Integer serviceGroupId) {
|
||||
this.serviceGroupId = serviceGroupId;
|
||||
}
|
||||
public Integer getGroupId() {
|
||||
return groupId;
|
||||
}
|
||||
public void setGroupId(Integer groupId) {
|
||||
this.groupId = groupId;
|
||||
}
|
||||
public String getGroupName() {
|
||||
return groupName;
|
||||
}
|
||||
public void setGroupName(String groupName) {
|
||||
this.groupName = groupName;
|
||||
}
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
public Date getEditTime() {
|
||||
return editTime;
|
||||
}
|
||||
public void setEditTime(Date editTime) {
|
||||
this.editTime = editTime;
|
||||
}
|
||||
public Integer getGroupType() {
|
||||
return groupType;
|
||||
}
|
||||
public void setGroupType(Integer groupType) {
|
||||
this.groupType = groupType;
|
||||
}
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
}
|
||||
315
src/main/java/com/nis/domain/basics/IpCommCfg.java
Normal file
315
src/main/java/com/nis/domain/basics/IpCommCfg.java
Normal file
@@ -0,0 +1,315 @@
|
||||
package com.nis.domain.basics;
|
||||
|
||||
import com.google.gson.annotations.Expose;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.nis.domain.configuration.BaseCfg;
|
||||
import com.nis.util.excel.ExcelField;
|
||||
|
||||
public class IpCommCfg extends BaseCfg<IpCommCfg> {
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 4218856118489784060L;
|
||||
|
||||
/**
|
||||
* 创建一个新的实例 BaseIpCfg.
|
||||
*
|
||||
*/
|
||||
public IpCommCfg() {
|
||||
super();
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
private String indexTable="ip_comm_cfg";
|
||||
/**
|
||||
* ip类型
|
||||
*/
|
||||
@Expose
|
||||
@SerializedName("ipType")
|
||||
@ExcelField(title="ip_type",dictType="IP_TYPE",sort=50)
|
||||
protected Integer ipType;
|
||||
@ExcelField(title="src_ip_pattern",dictType="IP_PATTERN",sort=51)
|
||||
protected Integer srcIpPattern;
|
||||
@ExcelField(title="client_ip",sort=52)
|
||||
protected String srcIpAddress;
|
||||
@ExcelField(title="dest_ip_pattern",dictType="IP_PATTERN",sort=53)
|
||||
protected Integer destIpPattern;
|
||||
@ExcelField(title="server_ip",sort=54)
|
||||
protected String destIpAddress;
|
||||
@ExcelField(title="src_port_pattern",dictType="PORT_PATTERN",sort=54)
|
||||
protected Integer srcPortPattern;
|
||||
@ExcelField(title="dest_port_pattern",dictType="PORT_PATTERN",sort=54)
|
||||
protected Integer destPortPattern;
|
||||
@ExcelField(title="client_port",sort=55)
|
||||
protected String srcPort;
|
||||
@ExcelField(title="server_port",sort=56)
|
||||
protected String destPort;
|
||||
protected Integer dnsStrategyId;
|
||||
@ExcelField(title="ir_type",dictType="IR_TYPE",sort=57)
|
||||
protected Integer irType;
|
||||
@ExcelField(title="group_name",sort=58)
|
||||
protected String groupName;
|
||||
// @ExcelField(title="log_total",sort=42)
|
||||
private Long totalLogs;
|
||||
private Integer regionId;
|
||||
private Integer groupId;
|
||||
|
||||
public Integer getRegionId() {
|
||||
return regionId;
|
||||
}
|
||||
public void setRegionId(Integer regionId) {
|
||||
this.regionId = regionId;
|
||||
}
|
||||
public Integer getGroupId() {
|
||||
return groupId;
|
||||
}
|
||||
public void setGroupId(Integer groupId) {
|
||||
this.groupId = groupId;
|
||||
}
|
||||
public Long getTotalLogs() {
|
||||
return totalLogs;
|
||||
}
|
||||
public void setTotalLogs(Long totalLogs) {
|
||||
this.totalLogs = totalLogs;
|
||||
}
|
||||
/**
|
||||
* irType
|
||||
* @return irType
|
||||
*/
|
||||
|
||||
public Integer getIrType() {
|
||||
return irType;
|
||||
}
|
||||
/**
|
||||
* @param irType the irType to set
|
||||
*/
|
||||
public void setIrType(Integer irType) {
|
||||
this.irType = irType;
|
||||
}
|
||||
/**
|
||||
* groupName
|
||||
* @return groupName
|
||||
*/
|
||||
|
||||
public String getGroupName() {
|
||||
return groupName;
|
||||
}
|
||||
/**
|
||||
* @param groupName the groupName to set
|
||||
*/
|
||||
public void setGroupName(String groupName) {
|
||||
this.groupName = groupName;
|
||||
}
|
||||
/**
|
||||
* 方向
|
||||
*/
|
||||
@Expose
|
||||
@SerializedName("direction")
|
||||
@ExcelField(title="direction",dictType="DIRECTION",sort=58)
|
||||
protected Integer direction ;
|
||||
/**
|
||||
* 协议
|
||||
*/
|
||||
@Expose
|
||||
@SerializedName("protocol")
|
||||
@ExcelField(title="protocol",dictType="PROTOCOL",sort=59)
|
||||
protected Integer protocol ;
|
||||
/**
|
||||
* 协议ID
|
||||
*/
|
||||
@Expose
|
||||
@SerializedName("protocolId")
|
||||
protected Integer protocolId ;
|
||||
/**
|
||||
* 限速比例
|
||||
*/
|
||||
protected String ratelimit ;
|
||||
|
||||
/**
|
||||
* ratelimit
|
||||
* @return ratelimit
|
||||
*/
|
||||
|
||||
public String getRatelimit() {
|
||||
return ratelimit;
|
||||
}
|
||||
/**
|
||||
* @param ratelimit the ratelimit to set
|
||||
*/
|
||||
public void setRatelimit(String ratelimit) {
|
||||
this.ratelimit = ratelimit;
|
||||
}
|
||||
/**
|
||||
* ipType
|
||||
* @return ipType
|
||||
*/
|
||||
|
||||
public Integer getIpType() {
|
||||
return ipType;
|
||||
}
|
||||
/**
|
||||
* @param ipType the ipType to set
|
||||
*/
|
||||
public void setIpType(Integer ipType) {
|
||||
this.ipType = ipType;
|
||||
}
|
||||
|
||||
/**
|
||||
* direction
|
||||
* @return direction
|
||||
*/
|
||||
|
||||
public Integer getDirection() {
|
||||
return direction;
|
||||
}
|
||||
/**
|
||||
* @param direction the direction to set
|
||||
*/
|
||||
public void setDirection(Integer direction) {
|
||||
this.direction = direction;
|
||||
}
|
||||
/**
|
||||
* protocol
|
||||
* @return protocol
|
||||
*/
|
||||
|
||||
public Integer getProtocol() {
|
||||
return protocol;
|
||||
}
|
||||
/**
|
||||
* @param protocol the protocol to set
|
||||
*/
|
||||
public void setProtocol(Integer protocol) {
|
||||
this.protocol = protocol;
|
||||
}
|
||||
/**
|
||||
* protocolId
|
||||
* @return protocolId
|
||||
*/
|
||||
|
||||
public Integer getProtocolId() {
|
||||
return protocolId;
|
||||
}
|
||||
/**
|
||||
* @param protocolId the protocolId to set
|
||||
*/
|
||||
public void setProtocolId(Integer protocolId) {
|
||||
this.protocolId = protocolId;
|
||||
}
|
||||
|
||||
|
||||
public Integer getSrcIpPattern() {
|
||||
return srcIpPattern;
|
||||
}
|
||||
public void setSrcIpPattern(Integer srcIpPattern) {
|
||||
this.srcIpPattern = srcIpPattern;
|
||||
}
|
||||
public Integer getDestIpPattern() {
|
||||
return destIpPattern;
|
||||
}
|
||||
public void setDestIpPattern(Integer destIpPattern) {
|
||||
this.destIpPattern = destIpPattern;
|
||||
}
|
||||
public Integer getSrcPortPattern() {
|
||||
return srcPortPattern;
|
||||
}
|
||||
public void setSrcPortPattern(Integer srcPortPattern) {
|
||||
this.srcPortPattern = srcPortPattern;
|
||||
}
|
||||
public Integer getDestPortPattern() {
|
||||
return destPortPattern;
|
||||
}
|
||||
public void setDestPortPattern(Integer destPortPattern) {
|
||||
this.destPortPattern = destPortPattern;
|
||||
}
|
||||
/**
|
||||
* srcIpAddress
|
||||
* @return srcIpAddress
|
||||
*/
|
||||
|
||||
public String getSrcIpAddress() {
|
||||
return srcIpAddress;
|
||||
}
|
||||
/**
|
||||
* @param srcIpAddress the srcIpAddress to set
|
||||
*/
|
||||
public void setSrcIpAddress(String srcIpAddress) {
|
||||
this.srcIpAddress = srcIpAddress;
|
||||
}
|
||||
/**
|
||||
* destIpAddress
|
||||
* @return destIpAddress
|
||||
*/
|
||||
|
||||
public String getDestIpAddress() {
|
||||
return destIpAddress;
|
||||
}
|
||||
/**
|
||||
* @param destIpAddress the destIpAddress to set
|
||||
*/
|
||||
public void setDestIpAddress(String destIpAddress) {
|
||||
this.destIpAddress = destIpAddress;
|
||||
}
|
||||
/**
|
||||
* srcPort
|
||||
* @return srcPort
|
||||
*/
|
||||
|
||||
public String getSrcPort() {
|
||||
return srcPort;
|
||||
}
|
||||
/**
|
||||
* @param srcPort the srcPort to set
|
||||
*/
|
||||
public void setSrcPort(String srcPort) {
|
||||
this.srcPort = srcPort;
|
||||
}
|
||||
/**
|
||||
* destPort
|
||||
* @return destPort
|
||||
*/
|
||||
|
||||
public String getDestPort() {
|
||||
return destPort;
|
||||
}
|
||||
/**
|
||||
* @param destPort the destPort to set
|
||||
*/
|
||||
public void setDestPort(String destPort) {
|
||||
this.destPort = destPort;
|
||||
}
|
||||
|
||||
/**
|
||||
* dnsStrategyId
|
||||
* @return dnsStrategyId
|
||||
*/
|
||||
|
||||
public Integer getDnsStrategyId() {
|
||||
return dnsStrategyId;
|
||||
}
|
||||
/**
|
||||
* @param dnsStrategyId the dnsStrategyId to set
|
||||
*/
|
||||
public void setDnsStrategyId(Integer dnsStrategyId) {
|
||||
this.dnsStrategyId = dnsStrategyId;
|
||||
}
|
||||
@Override
|
||||
public void initDefaultValue(){
|
||||
super.initDefaultValue();
|
||||
this.direction = 0;
|
||||
}
|
||||
|
||||
public String getIndexTable() {
|
||||
return indexTable;
|
||||
}
|
||||
public void setIndexTable(String indexTable) {
|
||||
this.indexTable = indexTable;
|
||||
}
|
||||
public Integer getIndex() {
|
||||
return index;
|
||||
}
|
||||
public void setIndex(Integer index) {
|
||||
this.index = index;
|
||||
}
|
||||
}
|
||||
@@ -78,6 +78,14 @@ public class BaseCfg<T> extends BaseEntity<T> implements Cloneable{
|
||||
protected ScheduleCfg schedule;
|
||||
|
||||
private String commonGroupIds; //公共组织id(考虑一个compile存在多个asn组织的情况)
|
||||
protected Integer groupType; //url组以及dns组相关功能使用
|
||||
protected Integer udFlag; //url组以及dns组相关功能使用 过滤数据库数据标记
|
||||
public Integer getGroupType() {
|
||||
return groupType;
|
||||
}
|
||||
public void setGroupType(Integer groupType) {
|
||||
this.groupType = groupType;
|
||||
}
|
||||
public String getCommonGroupIds() {
|
||||
return commonGroupIds;
|
||||
}
|
||||
@@ -85,8 +93,12 @@ public class BaseCfg<T> extends BaseEntity<T> implements Cloneable{
|
||||
public void setCommonGroupIds(String commonGroupIds) {
|
||||
this.commonGroupIds = commonGroupIds;
|
||||
}
|
||||
|
||||
|
||||
public Integer getUdFlag() {
|
||||
return udFlag;
|
||||
}
|
||||
public void setUdFlag(Integer udFlag) {
|
||||
this.udFlag = udFlag;
|
||||
}
|
||||
|
||||
public String getExType() {
|
||||
return exType;
|
||||
|
||||
@@ -14,7 +14,9 @@ import java.util.Map;
|
||||
import com.google.gson.annotations.Expose;
|
||||
import com.nis.domain.basics.AsnGroupInfo;
|
||||
import com.nis.domain.basics.AsnIpCfg;
|
||||
import com.nis.domain.basics.IpCommCfg;
|
||||
import com.nis.domain.basics.IpReuseIpCfg;
|
||||
import com.nis.domain.basics.UrlCommCfg;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.excel.ExcelField;
|
||||
|
||||
@@ -88,8 +90,8 @@ public class CfgIndexInfo extends BaseCfg<CfgIndexInfo> {
|
||||
private List<AsnKeywordCfg> asnKeywords;
|
||||
@ExcelField(title="log_total",sort=42)
|
||||
private Long totalLogs;
|
||||
|
||||
|
||||
private List<UrlCommCfg> urlCommGroupList;
|
||||
private List<IpCommCfg> ipCommGroupCfgList;
|
||||
/*private CachePolicyUserRegion cachePolicyUserRegion;//缓存策略用户自定义域参数
|
||||
|
||||
public static class CachePolicyUserRegion{
|
||||
@@ -101,6 +103,12 @@ public class CfgIndexInfo extends BaseCfg<CfgIndexInfo> {
|
||||
public String getOrganization() {
|
||||
return organization;
|
||||
}
|
||||
public List<IpCommCfg> getIpCommGroupCfgList() {
|
||||
return ipCommGroupCfgList;
|
||||
}
|
||||
public void setIpCommGroupCfgList(List<IpCommCfg> ipCommGroupCfgList) {
|
||||
this.ipCommGroupCfgList = ipCommGroupCfgList;
|
||||
}
|
||||
public List<AsnKeywordCfg> getAsnKeywords() {
|
||||
return asnKeywords;
|
||||
}
|
||||
@@ -411,4 +419,11 @@ public class CfgIndexInfo extends BaseCfg<CfgIndexInfo> {
|
||||
public void setTotalLogs(Long totalLogs) {
|
||||
this.totalLogs = totalLogs;
|
||||
}
|
||||
public List<UrlCommCfg> getUrlCommGroupList() {
|
||||
return urlCommGroupList;
|
||||
}
|
||||
public void setUrlCommGroupList(List<UrlCommCfg> urlCommGroupList) {
|
||||
this.urlCommGroupList = urlCommGroupList;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.nis.domain.configuration.template;
|
||||
|
||||
import com.nis.util.excel.ExcelField;
|
||||
|
||||
public class IpCommCfgTemplate extends IpAllTemplate{
|
||||
@ExcelField(title="ip_group",align=2,sort=10)
|
||||
private Integer groupId;
|
||||
|
||||
public Integer getGroupId() {
|
||||
return groupId;
|
||||
}
|
||||
|
||||
public void setGroupId(Integer groupId) {
|
||||
this.groupId = groupId;
|
||||
}
|
||||
|
||||
/* @Override
|
||||
public String getSrcIpAddress() {
|
||||
// TODO Auto-generated method stub
|
||||
return super.getSrcIpAddress();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSrcPort() {
|
||||
// TODO Auto-generated method stub
|
||||
return super.getSrcPort();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDestPort() {
|
||||
// TODO Auto-generated method stub
|
||||
return super.getDestPort();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getProtocol() {
|
||||
// TODO Auto-generated method stub
|
||||
return super.getProtocol();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getDirection() {
|
||||
// TODO Auto-generated method stub
|
||||
return super.getDirection();
|
||||
}*/
|
||||
|
||||
}
|
||||
@@ -162,6 +162,7 @@ import com.nis.web.service.SystemService;
|
||||
import com.nis.web.service.UserService;
|
||||
import com.nis.web.service.basics.AsnGroupInfoService;
|
||||
import com.nis.web.service.basics.AsnIpCfgService;
|
||||
import com.nis.web.service.basics.CommonGroupManageService;
|
||||
import com.nis.web.service.basics.InnerProtectionListService;
|
||||
import com.nis.web.service.basics.IpReuseIpCfgService;
|
||||
import com.nis.web.service.basics.PolicyGroupInfoService;
|
||||
@@ -358,6 +359,9 @@ public class BaseController {
|
||||
@Autowired
|
||||
protected ManipulatPolicyService manipulatPolicyService;
|
||||
|
||||
@Autowired
|
||||
protected CommonGroupManageService commonGroupManageService;
|
||||
|
||||
/**
|
||||
* 管理基础路径
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,159 @@
|
||||
package com.nis.web.controller.basics;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.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.CommonGroupInfo;
|
||||
import com.nis.domain.basics.PolicyGroupInfo;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.LogUtils;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.web.controller.BaseController;
|
||||
import com.nis.web.service.basics.CommonGroupManageService;
|
||||
/**
|
||||
* 公共组管理
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping(value = "${adminPath}/basics/commonGroup")
|
||||
public class CommonGroupManageController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private CommonGroupManageService commonGroupManageService;
|
||||
|
||||
@RequestMapping(value = {"list", ""})
|
||||
public String policyGroupList(CommonGroupInfo cfg, Model model, HttpServletRequest request, HttpServletResponse response) {
|
||||
if(cfg == null)cfg=new CommonGroupInfo();
|
||||
Page<CommonGroupInfo> pageCondition = new Page<CommonGroupInfo>(request, response,"r");
|
||||
Page page = commonGroupManageService.findCommonGroupInfoList(pageCondition,cfg);
|
||||
|
||||
model.addAttribute("cfg", cfg);
|
||||
model.addAttribute("page", page);
|
||||
return "/basics/commonGroupList";
|
||||
}
|
||||
|
||||
@RequestMapping(value={"/form"})
|
||||
public String form(Integer groupType,String ids,Model model,String doAction,RedirectAttributes redirectAttributes) {
|
||||
CommonGroupInfo groupInfo = new CommonGroupInfo();
|
||||
if(!StringUtil.isEmpty(ids)){
|
||||
groupInfo = commonGroupManageService.getById(Integer.parseInt(ids));
|
||||
}
|
||||
//groupInfo.setGroupType(groupType);
|
||||
model.addAttribute("_cfg", groupInfo);
|
||||
return "/basics/commonGroupForm";
|
||||
}
|
||||
|
||||
@RequestMapping(value = "saveOrUpdate")
|
||||
public String saveOrUpdate(CommonGroupInfo cfg, Model model, RedirectAttributes redirectAttributes,
|
||||
String itType,Integer groupType,HttpServletRequest request) {
|
||||
|
||||
try {
|
||||
commonGroupManageService.saveOrUpdate(cfg);
|
||||
addMessage(redirectAttributes,"success","save_success");
|
||||
} catch (Exception e) {
|
||||
logger.error("新增失败",e);
|
||||
addMessage(redirectAttributes,"error","save_failed");
|
||||
LogUtils.saveLog(request, null, e, null);
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath + "/basics/commonGroup/list";
|
||||
|
||||
|
||||
}
|
||||
|
||||
@RequestMapping(value={"delete"})
|
||||
public String delete(RedirectAttributes redirectAttributes, Integer groupType,String ids,int isValid,HttpServletRequest request) {
|
||||
try {
|
||||
commonGroupManageService.deldete(ids,isValid);
|
||||
addMessage(redirectAttributes,"success","delete_success");
|
||||
} catch (Exception e) {
|
||||
logger.error("删除失败",e);
|
||||
addMessage(redirectAttributes,"error","delete_failed");
|
||||
LogUtils.saveLog(request, null, e, null);
|
||||
}
|
||||
return "redirect:" + adminPath + "/basics/commonGroup/list";
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@RequestMapping(value="ajaxCheckGroupUse")
|
||||
public boolean ajaxCheckGroupUse(@RequestParam("groupIds")String groupIds){
|
||||
return commonGroupManageService.checkIsIssued(groupIds);
|
||||
}
|
||||
|
||||
//Group配置导出
|
||||
@RequestMapping(value = "exportGroup")
|
||||
public void exportGroup(Model model,HttpServletRequest request,HttpServletResponse response,
|
||||
@ModelAttribute("cfg")CommonGroupInfo entity,String ids,RedirectAttributes redirectAttributes){
|
||||
try {
|
||||
//export data info
|
||||
entity.setMenuNameCode("common_group_manage");
|
||||
List<String> titleList=new ArrayList<String>();
|
||||
Map<String, Class<?>> classMap=new HashMap<String, Class<?>>();
|
||||
Map<String, List> dataMap=new HashMap<String, List>();
|
||||
Map<String, String> noExportMap=new HashMap<String, String>();
|
||||
List<CommonGroupInfo> list = new ArrayList<CommonGroupInfo>();
|
||||
if (!StringUtil.isEmpty(ids)) {
|
||||
list = commonGroupManageService.findGroupInfoList(ids);
|
||||
} else {
|
||||
Page<CommonGroupInfo> pageInfo=new Page<CommonGroupInfo>(request, response,"r");
|
||||
pageInfo.setPageNo(1);
|
||||
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
||||
Page page = commonGroupManageService.findCommonGroupInfoList(pageInfo,entity);
|
||||
list=page.getList();
|
||||
}
|
||||
|
||||
titleList.add(entity.getMenuNameCode());
|
||||
classMap.put(entity.getMenuNameCode(), CommonGroupInfo.class);
|
||||
String cfgIndexInfoNoExport=",config_describe,cfg_id,block_type,do_log,action,valid_identifier,is_audit"
|
||||
+ ",auditor,audit_time,letter,whether_area_block,classification,attribute,label"
|
||||
+",userregion1,userregion2,userregion3,userregion4,userregion5,ir_type,";
|
||||
// 时间过滤
|
||||
if (entity.getSearch_create_time_start() == null ) {
|
||||
cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport;
|
||||
}
|
||||
if (entity.getSearch_edit_time_start() == null) {
|
||||
cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport;
|
||||
}
|
||||
|
||||
if (!StringUtil.isEmpty(entity.gethColumns())) {
|
||||
cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport;
|
||||
}
|
||||
noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport);
|
||||
dataMap.put(entity.getMenuNameCode(), list);
|
||||
String timeRange = initTimeMap(entity);
|
||||
noExportMap.put("timeRange", timeRange);
|
||||
|
||||
if ("csv".equals(entity.getExType())) {
|
||||
this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||
classMap, dataMap, noExportMap);
|
||||
} else {
|
||||
this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||
classMap, dataMap, noExportMap);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("Group export failed",e);
|
||||
addMessage(redirectAttributes,"error","export_failed");
|
||||
LogUtils.saveLog(request, null, e, null);
|
||||
}
|
||||
//return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,479 @@
|
||||
package com.nis.web.controller.basics;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.BlockingQueue;
|
||||
|
||||
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.jets3t.service.ServiceException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||
|
||||
import com.beust.jcommander.internal.Lists;
|
||||
import com.nis.domain.FunctionRegionDict;
|
||||
import com.nis.domain.FunctionServiceDict;
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.basics.CommonGroupInfo;
|
||||
import com.nis.domain.basics.IpCommCfg;
|
||||
import com.nis.domain.basics.PolicyGroupInfo;
|
||||
import com.nis.domain.configuration.BaseIpCfg;
|
||||
import com.nis.domain.configuration.CfgIndexInfo;
|
||||
import com.nis.domain.configuration.IpPortCfg;
|
||||
import com.nis.domain.configuration.template.IpCommCfgTemplate;
|
||||
import com.nis.domain.specific.ConfigGroupInfo;
|
||||
import com.nis.exceptions.MaatConvertException;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.DictUtils;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.util.excel.ImportBigExcel;
|
||||
import com.nis.web.controller.BaseController;
|
||||
import com.nis.web.security.UserUtils;
|
||||
import com.nis.web.service.basics.IpCommGroupCfgService;
|
||||
|
||||
@Controller
|
||||
@RequestMapping(value = "${adminPath}/basics/ip")
|
||||
public class IpCommGroupController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IpCommGroupCfgService ipCommGroupCfgService;
|
||||
|
||||
@RequestMapping(value = { "/list" })
|
||||
public String list(Model model, @ModelAttribute("cfg") IpCommCfg entity, HttpServletRequest request, HttpServletResponse response) {
|
||||
Page<IpCommCfg> page = ipCommGroupCfgService.findPage(new Page<IpCommCfg>(request, response, "r"),entity);
|
||||
List<FunctionRegionDict> regionList = DictUtils.getFunctionRegionDictList(entity.getFunctionId());
|
||||
List<FunctionServiceDict> serviceList = DictUtils.getFunctionServiceDictList(entity.getFunctionId());
|
||||
List<CommonGroupInfo> policyGroupInfos=commonGroupManageService.findCommonGroupInfosByType(5);
|
||||
|
||||
model.addAttribute("page", page);
|
||||
model.addAttribute("regionList", regionList);
|
||||
model.addAttribute("serviceList", serviceList);
|
||||
model.addAttribute("policyGroupInfos", policyGroupInfos);
|
||||
|
||||
return "/basics/ipCommonGroupCfgList";
|
||||
}
|
||||
|
||||
@RequestMapping(value = { "/addForm" })
|
||||
public String addForm(Model model, @ModelAttribute("cfg") CfgIndexInfo cfg, RedirectAttributes redirectAttributes,
|
||||
HttpServletRequest request, HttpServletResponse response) {
|
||||
// IP Group Tyep为5
|
||||
cfg.setGroupType(5);
|
||||
initFormCondition(model, cfg);
|
||||
|
||||
List<CommonGroupInfo> groupInfos=commonGroupManageService.findCommonGroupInfosByType(5);
|
||||
model.addAttribute("policyGroupInfos", groupInfos);
|
||||
model.addAttribute("_cfg", cfg);
|
||||
return "/basics/ipCommGroupFormAdd";
|
||||
}
|
||||
|
||||
@RequestMapping(value = { "/save" })
|
||||
@RequiresPermissions(value = { "ip:common:config" })
|
||||
public String save(Model model, @ModelAttribute("cfg") CfgIndexInfo cfg, RedirectAttributes redirectAttributes,
|
||||
HttpServletRequest request, HttpServletResponse response) {
|
||||
try {
|
||||
ipCommGroupCfgService.saveIpCommGroupCfg(cfg);
|
||||
} catch (Exception e) {
|
||||
logger.error("信息保存失败", e);
|
||||
if (e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes, "error", e.getMessage());
|
||||
} else {
|
||||
addMessage(redirectAttributes, "error", "save_failed");
|
||||
}
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath + "/basics/ip/list?functionId=" + cfg.getFunctionId();
|
||||
}
|
||||
|
||||
@RequestMapping(value = { "/updateForm" })
|
||||
public String updateForm(Model model, @ModelAttribute("cfg") IpCommCfg cfg, RedirectAttributes redirectAttributes, String ids,
|
||||
HttpServletRequest request, HttpServletResponse response) {
|
||||
cfg = ipCommGroupCfgService.get(Long.parseLong(ids));
|
||||
// initUpdateFormCondition(model, cfg);
|
||||
cfg.setGroupType(5);
|
||||
initUpdateFormCondition(model, cfg);
|
||||
List<CommonGroupInfo> groupInfos=commonGroupManageService.findCommonGroupInfosByType(5);
|
||||
model.addAttribute("policyGroupInfos", groupInfos);
|
||||
model.addAttribute("_cfg", cfg);
|
||||
return "/basics/ipCommGroupFormUpdate";
|
||||
}
|
||||
|
||||
@RequestMapping(value = { "/update" })
|
||||
@RequiresPermissions(value = { "ip:common:config" })
|
||||
public String update(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||
@ModelAttribute("cfg") IpCommCfg cfg, RedirectAttributes redirectAttributes) {
|
||||
try {
|
||||
ipCommGroupCfgService.update(cfg);
|
||||
addMessage(redirectAttributes, "success", "save_success");
|
||||
} catch (Exception e) {
|
||||
logger.error("信息保存失败", e);
|
||||
addMessage(redirectAttributes, "error", "save_failed");
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath + "/basics/ip/list?functionId=" + cfg.getFunctionId();
|
||||
}
|
||||
|
||||
// @RequestMapping(value = { "/audit" })
|
||||
// @RequiresPermissions(value = { "ip:common:config" })
|
||||
// public String audit(Model model, @ModelAttribute("cfg") IpCommCfg cfg, Integer isAudit, Integer isValid,
|
||||
// String ids, Integer functionId, HttpServletRequest request, HttpServletResponse response,
|
||||
// RedirectAttributes redirectAttributes) {
|
||||
// // 选中配置审核
|
||||
// if (!StringUtil.isEmpty(ids)) {
|
||||
// List<IpCommCfg> ipGroupCfgs = ipCommGroupCfgService.getByIds(ids);
|
||||
// List<IpCommCfg> temp = Lists.newArrayList();
|
||||
// try {
|
||||
// ipCommGroupCfgService.audit(ipGroupCfgs, isAudit, isValid);
|
||||
// } catch (Exception e) {
|
||||
// logger.error("审核失败", e);
|
||||
// addMessage(redirectAttributes, "error", "audit_failed");
|
||||
// } finally {
|
||||
// temp.clear();
|
||||
// }
|
||||
// return "redirect:" + adminPath + "/basics/ip/list?functionId=" + cfg.getFunctionId();
|
||||
// } else {// 全部审核
|
||||
// // 条件下所有配置审核
|
||||
// Page<IpCommCfg> searchPage = new Page<IpCommCfg>(request, response, "a");
|
||||
// Page<IpCommCfg> auditPage = new Page<IpCommCfg>(request, response, "a");
|
||||
// BeanUtils.copyProperties(searchPage, auditPage);
|
||||
//
|
||||
// try {
|
||||
// auditAll(auditPage, isValid, cfg);
|
||||
// addMessage(redirectAttributes, "success", "audit_success");
|
||||
// } catch (Exception e) {
|
||||
// logger.error("配置下发失败:", e);
|
||||
// if (e instanceof MaatConvertException) {
|
||||
// addMessage(redirectAttributes, "error", "request_service_failed");
|
||||
// } else {
|
||||
// addMessage(redirectAttributes, "error", "audit_failed");
|
||||
// }
|
||||
//
|
||||
// }
|
||||
//
|
||||
// return list(model, request, response, cfg);
|
||||
// }
|
||||
// }
|
||||
|
||||
@RequestMapping(value = { "/delete" })
|
||||
@RequiresPermissions(value = { "ip:common:config" })
|
||||
public String delete(Integer isValid, String ids, Integer functionId, RedirectAttributes redirectAttributes) {
|
||||
try {
|
||||
ipCommGroupCfgService.delete(ids);
|
||||
addMessage(redirectAttributes, "success", "delete_success");
|
||||
} catch (Exception e) {
|
||||
logger.error("Delete failed", e);
|
||||
if (e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes, "error", e.getMessage());
|
||||
} else {
|
||||
addMessage(redirectAttributes, "error", "delete_failed");
|
||||
}
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath + "/basics/ip/list?functionId=" + functionId;
|
||||
}
|
||||
|
||||
// ipComm配置导出
|
||||
@RequestMapping(value = "/exportIpComm")
|
||||
public void exportIpCommonCfg(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||
@ModelAttribute("cfg") IpCommCfg entity, String ids, RedirectAttributes redirectAttributes) {
|
||||
try {
|
||||
// export data info
|
||||
List<String> titleList = new ArrayList<String>();
|
||||
Map<String, Class<?>> classMap = new HashMap<String, Class<?>>();
|
||||
Map<String, List> dataMap = new HashMap<String, List>();
|
||||
Map<String, String> noExportMap = new HashMap<String, String>();
|
||||
List<IpCommCfg> list = new ArrayList<IpCommCfg>();
|
||||
if (!StringUtil.isEmpty(ids)) {
|
||||
list = ipCommGroupCfgService.findByPage(ids);
|
||||
} else {
|
||||
Page<IpCommCfg> pageInfo = new Page<IpCommCfg>(request, response, "r");
|
||||
pageInfo.setPageNo(1);
|
||||
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
||||
Page<IpCommCfg> page = ipCommGroupCfgService.findPage(pageInfo, entity);
|
||||
list = page.getList();
|
||||
}
|
||||
//
|
||||
titleList.add(entity.getMenuNameCode());
|
||||
classMap.put(entity.getMenuNameCode(), IpPortCfg.class);
|
||||
String cfgIndexInfoNoExport = ",block_type,do_log,action"
|
||||
+ ",letter,whether_area_block,classification,attribute,label"
|
||||
+ ",userregion1,userregion2,userregion3,userregion4,userregion5,src_ip_pattern,client_ip,src_port_pattern,client_port,dest_ip_pattern,dest_port_pattern,dest_port,";
|
||||
// 时间过滤
|
||||
if (entity.getSearch_create_time_start() == null) {
|
||||
cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport;
|
||||
}
|
||||
if (entity.getSearch_edit_time_start() == null) {
|
||||
cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport;
|
||||
}
|
||||
if (entity.getSearch_audit_time_start() == null) {
|
||||
cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport;
|
||||
}
|
||||
if (!StringUtil.isEmpty(entity.gethColumns())) {
|
||||
cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport;
|
||||
}
|
||||
|
||||
noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport);
|
||||
dataMap.put(entity.getMenuNameCode(), list);
|
||||
String timeRange = initTimeMap(entity);
|
||||
noExportMap.put("timeRange", timeRange);
|
||||
|
||||
if ("csv".equals(entity.getExType())) {
|
||||
this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||
classMap, dataMap, noExportMap);
|
||||
} else {
|
||||
this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||
classMap, dataMap, noExportMap);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("IpCommGroupCfg export failed", e);
|
||||
addMessage(redirectAttributes, "error", "export_failed");
|
||||
}
|
||||
// return "redirect:" + adminPath
|
||||
// +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量审核
|
||||
*
|
||||
* @param isAudit
|
||||
* @param isValid
|
||||
* @param ids
|
||||
* @param functionId
|
||||
* @param redirectAttributes
|
||||
* @return
|
||||
*/
|
||||
// @Override
|
||||
// public void auditAll(Page page, Integer auditType, Object entity) throws Exception {
|
||||
// long start = System.currentTimeMillis();
|
||||
// page.setOrderBy("");
|
||||
// page.setPageSize(Constants.MAAT_JSON_SEND_SIZE);
|
||||
// page.setPageNo(1);
|
||||
// page.setLastPage(false);
|
||||
// // 携带审核状态信息的BaseCfg
|
||||
// BaseCfg auditBatchCfg = new BaseCfg();
|
||||
// // 携带审核条件的BaseCfg
|
||||
// IpCommCfg searchIpCommGroupCfg = new IpCommCfg();
|
||||
// BeanUtils.copyProperties(entity, auditBatchCfg);
|
||||
// BeanUtils.copyProperties(entity, searchIpCommGroupCfg);
|
||||
//
|
||||
// auditType = (Integer) Reflections.invokeGetter(entity, "isAudit");
|
||||
//
|
||||
// // 全部审核通过,只查询当前条件下的所有未审核的配置 -批量审核通过/不通过
|
||||
// if (auditType.equals(1) || auditType.equals(2)) {
|
||||
//
|
||||
// searchIpCommGroupCfg.setIsValid(0);
|
||||
// searchIpCommGroupCfg.setIsAudit(0);
|
||||
//
|
||||
// if (auditType.equals(1)) {
|
||||
// auditBatchCfg.setIsAudit(1);
|
||||
// auditBatchCfg.setIsValid(1);
|
||||
// } else {
|
||||
// auditBatchCfg.setIsAudit(2);
|
||||
// auditBatchCfg.setIsValid(0);
|
||||
// }
|
||||
// auditBatchCfg.setAuditTime(new Date());
|
||||
// auditBatchCfg.setAuditorId(UserUtils.getUser().getId());
|
||||
// } else {
|
||||
// // 全部取消通过,只查询当前条件下的所有审核通过的配置
|
||||
// searchIpCommGroupCfg.setIsValid(1);
|
||||
// searchIpCommGroupCfg.setIsAudit(1);
|
||||
//
|
||||
// auditBatchCfg.setIsAudit(3);
|
||||
// auditBatchCfg.setIsValid(0);
|
||||
// auditBatchCfg.setAuditTime(new Date());
|
||||
// auditBatchCfg.setAuditorId(UserUtils.getUser().getId());
|
||||
// }
|
||||
//
|
||||
// ServiceConfigTemplateUtil serviceTemplate = new ServiceConfigTemplateUtil();
|
||||
// Integer functionId = 0;
|
||||
// if (auditBatchCfg != null && !StringUtil.isEmpty(auditBatchCfg.getFunctionId())) {
|
||||
// functionId = auditBatchCfg.getFunctionId();
|
||||
// }
|
||||
// List<Map<String, Object>> serviceList = serviceTemplate.getServiceListByFunctionId(functionId);
|
||||
// for (Map<String, Object> service : serviceList) {
|
||||
// String tableNameXml = service.get("tableName").toString(); // 获取业务主配置表
|
||||
// String serviceTypeXml = service.get("serviceType").toString(); // 业务类型 1maat 2callback
|
||||
// String classNameXml = service.get("className").toString(); // 主配置Java类
|
||||
// String serviceIdXml = service.get("id").toString(); // service字典表 service_id字段
|
||||
// auditBatchCfg.setServiceId(Integer.valueOf(serviceIdXml));
|
||||
// auditBatchCfg.setTableName(tableNameXml);
|
||||
// searchIpCommGroupCfg.setServiceId(Integer.valueOf(serviceIdXml));
|
||||
// searchIpCommGroupCfg.setTableName(tableNameXml);
|
||||
//
|
||||
// if ("1".equals(serviceTypeXml)) {// maat类配置
|
||||
// // 存放域配置类型 及 对应表名
|
||||
// List<Map<String, Object>> cfgList = (List<Map<String, Object>>) service.get("cfgList");
|
||||
// List<Map<String, Object>> userRegionList = (List<Map<String, Object>>) service.get("userRegionList");
|
||||
// int cfgType = Integer.parseInt(service.get("cfgType").toString());
|
||||
// if (auditBatchCfg.getIsAudit() == 1) {
|
||||
// boolean hasData = true;
|
||||
//
|
||||
// while (hasData) {
|
||||
// page.setPageNo(1);
|
||||
// page.setLastPage(false);
|
||||
// List list = ipCommGroupCfgService.findPage(page, searchIpCommGroupCfg).getList();
|
||||
// if(CollectionUtils.isNotEmpty(list)){
|
||||
// Map<Integer,List> groupIdMap=new HashMap();
|
||||
// // 配置生效处理
|
||||
// if(auditBatchCfg.getIsAudit().equals(1)) {
|
||||
// hasData=commonPolicyService.auditReuseCommonConfigData(page, auditBatchCfg,groupIdMap,hasData);
|
||||
// Map<Integer,List> groupIpMap=new HashMap();
|
||||
// if(CollectionUtils.isNotEmpty(list)) {
|
||||
// for (IpCommCfg obj : (List<IpCommCfg>)list) {
|
||||
// BaseCfg baseCfg=(BaseCfg)obj;
|
||||
// if(!StringUtil.isEmpty(obj.getGroupId())) {
|
||||
// groupIdMap.get(obj.getGroupId()).add(baseCfg);
|
||||
// }else {
|
||||
// List newList=new ArrayList<>();
|
||||
// newList.add(baseCfg);
|
||||
// groupIdMap.put(obj.getGroupId(),newList);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// }
|
||||
// if(hasData) {
|
||||
// page.setPageNo(1);
|
||||
// page.setLastPage(false);
|
||||
// }
|
||||
// }else{
|
||||
// hasData = false;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// } else {
|
||||
// throw new RuntimeException("wrong service type " + serviceTypeXml);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// // 批量审核通过时,如果没有携带isValid检索条件,返回界面需要将isValid置为null
|
||||
// if (!StringUtil.isEmpty(entity)) {
|
||||
// BaseCfg base = (BaseCfg) entity;
|
||||
// if (!StringUtil.isEmpty(base.getSeltype()) && base.getSeltype().equals("isValid")) {
|
||||
// base.setIsValid(null);
|
||||
// BeanUtils.copyProperties(base, entity);
|
||||
// }
|
||||
// }
|
||||
// long end = System.currentTimeMillis();
|
||||
// logger.warn("配置批量生效/失效耗时:" + (end - start));
|
||||
// }
|
||||
@RequestMapping(value = "import", method=RequestMethod.POST)
|
||||
public String importIp(HttpServletRequest request,HttpServletResponse response,RedirectAttributes redirectAttributes,
|
||||
@RequestParam("files") MultipartFile[] files, Integer serviceDictId ,Integer requestId ,String attribute ,String classify
|
||||
,String regionDictIds ,String importPath) {
|
||||
logger.warn("import start...");
|
||||
long start=System.currentTimeMillis();
|
||||
ImportBigExcel ei=null;
|
||||
try {
|
||||
FunctionServiceDict serviceDict = DictUtils.getFunctionServiceDict(serviceDictId);
|
||||
StringBuffer errTip=new StringBuffer();
|
||||
BlockingQueue<BaseIpCfg> ipPortCfgs =null;
|
||||
//List<CfgIndexInfo> cfgIndexInfos = new ArrayList<CfgIndexInfo>();
|
||||
for (int i = 0; i < files.length; i++) {
|
||||
MultipartFile file = files[i];
|
||||
ei = new ImportBigExcel(file, 0, 1);
|
||||
FunctionRegionDict regionDict = DictUtils.getFunctionRegionDict(Integer.parseInt(regionDictIds.split(",")[i]));
|
||||
//加载模板
|
||||
loadTemplate(ei,regionDict, serviceDict);
|
||||
//------------------------------------check format start----------------------------
|
||||
if (regionDict.getRegionType().equals(1)) {// IP
|
||||
BlockingQueue<IpCommCfgTemplate> list = ei.getDataList(IpCommCfgTemplate.class );
|
||||
ipPortCfgs=this.checkIpCfgMulity(errTip,serviceDict, regionDict, null,null, list);
|
||||
}
|
||||
//删除文件
|
||||
if(ei.getUploadFile()!=null&&ei.getUploadFile().exists()) {
|
||||
ei.getUploadFile().delete();
|
||||
}
|
||||
//------------------------------------check format end----------------------------
|
||||
Date date = new Date();
|
||||
String isSend = request.getParameter("isSend")==null?"":request.getParameter("isSend");
|
||||
|
||||
if (regionDict.getRegionType().equals(1)) {// IP
|
||||
List<BaseIpCfg> _ipPortCfgs=Lists.newArrayList(Constants.MAAT_JSON_SEND_SIZE);
|
||||
while(!ipPortCfgs.isEmpty()) {
|
||||
ipPortCfgs.drainTo(_ipPortCfgs, Constants.MAAT_JSON_SEND_SIZE);
|
||||
|
||||
int ind=0;
|
||||
for (BaseIpCfg cfg : _ipPortCfgs) {
|
||||
cfg.setAction(serviceDict==null?null:serviceDict.getAction());
|
||||
cfg.setCfgRegionCode(regionDict.getConfigRegionCode());
|
||||
cfg.setCfgType(regionDict.getConfigRegionValue());
|
||||
cfg.setCreateTime(date);
|
||||
cfg.setCreatorId(UserUtils.getUser().getId());
|
||||
//cfg.setDoLog(2);
|
||||
cfg.setCompileId(0);
|
||||
cfg.setFunctionId(regionDict.getFunctionId());
|
||||
if(isSend.equals("1")) {
|
||||
cfg.setIsAudit(Constants.AUDIT_YES);
|
||||
cfg.setIsValid(Constants.VALID_YES);
|
||||
cfg.setAuditorId(UserUtils.getUser().getId());
|
||||
cfg.setAuditTime(date);
|
||||
}else {
|
||||
cfg.setIsAudit(Constants.AUDIT_NOT_YET);
|
||||
cfg.setIsValid(Constants.VALID_NO);
|
||||
}
|
||||
cfg.setIsAreaEffective(0);
|
||||
cfg.setLable("0");
|
||||
cfg.setRequestId(StringUtil.isEmpty(requestId) ? 0 : requestId);
|
||||
cfg.setAttribute(attribute);
|
||||
cfg.setClassify(classify);
|
||||
cfg.setServiceId(serviceDict==null?null:serviceDict.getServiceId());
|
||||
cfg.setTableName("ip_comm_cfg");
|
||||
ind++;
|
||||
}
|
||||
ipCommGroupCfgService.saveAndSend(regionDict, serviceDict, _ipPortCfgs,isSend.equals("1"));
|
||||
_ipPortCfgs.clear();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
if(errTip.toString().length()>0) {
|
||||
addMessage(redirectAttributes,"error", errTip.toString());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
if(ei!=null) {
|
||||
if(ei.getUploadFile().exists()) {
|
||||
ei.getUploadFile().delete();
|
||||
}
|
||||
}
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
}else if(e instanceof ServiceException) {
|
||||
addMessage(redirectAttributes,"error", e.getMessage());
|
||||
}else if(e instanceof IndexOutOfBoundsException){
|
||||
addMessage(redirectAttributes,"error", "template_error");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error", "import_failed");
|
||||
}
|
||||
logger.error("import failed", e);
|
||||
}
|
||||
long end=System.currentTimeMillis();
|
||||
logger.warn("import finish,cost:"+(end-start));
|
||||
return "redirect:" + adminPath+ importPath;
|
||||
}
|
||||
@RequestMapping(value="ajaxGetGroups",method=RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<Integer,String> ajaxGetGroups(Model model,@RequestParam(required=true,value="groupIds")String groupIds){
|
||||
Map<Integer,String> groupIdList=new HashMap<Integer,String>();
|
||||
if(StringUtils.isNotBlank(groupIds)) {
|
||||
List<PolicyGroupInfo> list=policyGroupInfoService.findPolicyByGroupInfoList(groupIds);
|
||||
for(PolicyGroupInfo p:list) {
|
||||
groupIdList.put(p.getGroupId(), p.getGroupName());
|
||||
}
|
||||
}
|
||||
return groupIdList;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.nis.web.dao.basics;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import com.nis.domain.basics.CommonGroupInfo;
|
||||
import com.nis.domain.basics.PolicyGroupInfo;
|
||||
import com.nis.web.dao.CrudDao;
|
||||
import com.nis.web.dao.MyBatisDao;
|
||||
|
||||
@MyBatisDao
|
||||
public interface CommonGroupManageDao extends CrudDao<CommonGroupInfo> {
|
||||
List<CommonGroupInfo> findCommonGroupInfoList(CommonGroupInfo commonGroupInfo);
|
||||
|
||||
CommonGroupInfo getById(int id);
|
||||
|
||||
List<CommonGroupInfo> findCommonGroupInfosByType(int groupType);
|
||||
|
||||
List<CommonGroupInfo> findGroupInfoList(@Param("ids")String ids);
|
||||
|
||||
/*List<PolicyGroupInfo> findPolicyGroupInfos();
|
||||
List<PolicyGroupInfo> findHasIPPolicyGroupInfosByType(int groupType);
|
||||
List<PolicyGroupInfo> findPolicyGroupInfosHasIpRegionByType(int groupType);
|
||||
List<PolicyGroupInfo> findNatPolicyGroups();
|
||||
|
||||
PolicyGroupInfo getInfoByAsnNo(PolicyGroupInfo policyGroupInfo);
|
||||
List<PolicyGroupInfo> getHasAreaPolicyGroups(int groupType);
|
||||
int insertBatch(List<PolicyGroupInfo> list);
|
||||
|
||||
Integer getGroupIdByGroupName(String groupName);
|
||||
PolicyGroupInfo getGroupInfo(PolicyGroupInfo policyGroupInfo);
|
||||
|
||||
*/
|
||||
}
|
||||
272
src/main/java/com/nis/web/dao/basics/CommonGroupManageDao.xml
Normal file
272
src/main/java/com/nis/web/dao/basics/CommonGroupManageDao.xml
Normal file
@@ -0,0 +1,272 @@
|
||||
<?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.CommonGroupManageDao" >
|
||||
|
||||
<resultMap id="CommonGroupInfoMap" type="com.nis.domain.basics.CommonGroupInfo" >
|
||||
<id column="group_id" property="groupId" jdbcType="INTEGER" />
|
||||
<result column="group_name" property="groupName" jdbcType="VARCHAR" />
|
||||
<result column="group_type" property="groupType" jdbcType="INTEGER" />
|
||||
<result column="is_valid" property="isValid" jdbcType="INTEGER" />
|
||||
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
|
||||
<result column="edit_time" property="editTime" jdbcType="TIMESTAMP" />
|
||||
<result column="creator_id" property="creatorId" jdbcType="INTEGER" />
|
||||
<result column="editor_id" property="editorId" jdbcType="INTEGER" />
|
||||
<result column="service_group_id" property="serviceGroupId" jdbcType="INTEGER" />
|
||||
<result column="description" property="description" jdbcType="VARCHAR" />
|
||||
</resultMap>
|
||||
<sql id="CommonGroupInfoColumns">
|
||||
r.group_id,r.group_name,r.group_type,r.is_valid,r.create_time,r.edit_time,
|
||||
r.creator_id,r.editor_id,r.service_group_id,r.description
|
||||
</sql>
|
||||
|
||||
<!-- 查出所有 有效数据-->
|
||||
<select id="findCommonGroupInfoList" resultMap="CommonGroupInfoMap">
|
||||
SELECT
|
||||
<include refid="CommonGroupInfoColumns"/>
|
||||
<trim prefix="," prefixOverrides=",">
|
||||
, s.name as creator_name
|
||||
,e.name as editor_name
|
||||
</trim>
|
||||
FROM policy_group_info r
|
||||
left join sys_user s on r.creator_id=s.id
|
||||
left join sys_user e on r.editor_id=e.id
|
||||
|
||||
<trim prefix="WHERE" prefixOverrides="AND |OR ">
|
||||
<if test="page !=null and page.where != null and page.where != ''">
|
||||
AND ${page.where}
|
||||
</if>
|
||||
<if test="groupName != null and groupName != ''">
|
||||
AND r.group_name like concat(concat('%',#{groupName,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="groupType != null">
|
||||
AND r.group_type =#{groupType }
|
||||
</if>
|
||||
<if test="groupType == null">
|
||||
AND r.group_type NOT IN(1,2,3,4)
|
||||
</if>
|
||||
AND r.IS_VALID =1
|
||||
<if test="creatorName != null and creatorName != ''">
|
||||
AND CREATOR_NAME like concat(concat('%',#{creatorName,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="editorName != null and editorName != ''">
|
||||
AND r.EDITOR_NAME like concat(concat('%',#{editorName,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<!-- 数据范围过滤 -->
|
||||
<!-- ${sqlMap.dsf} -->
|
||||
</trim>
|
||||
<choose>
|
||||
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
||||
ORDER BY ${page.orderBy}
|
||||
</when>
|
||||
<otherwise>
|
||||
ORDER BY r.group_id desc
|
||||
</otherwise>
|
||||
</choose>
|
||||
|
||||
</select>
|
||||
|
||||
<select id="getById" resultType="com.nis.domain.basics.CommonGroupInfo">
|
||||
SELECT
|
||||
<include refid="CommonGroupInfoColumns"/>
|
||||
FROM
|
||||
policy_group_info r
|
||||
WHERE
|
||||
r.group_id = #{groupId}
|
||||
</select>
|
||||
|
||||
<insert id="insert" parameterType="com.nis.domain.basics.CommonGroupInfo" >
|
||||
INSERT INTO policy_group_info(
|
||||
IS_VALID,
|
||||
CREATOR_ID,
|
||||
CREATE_TIME,
|
||||
GROUP_NAME,
|
||||
GROUP_TYPE,
|
||||
SERVICE_GROUP_ID,
|
||||
DESCRIPTION
|
||||
)values (
|
||||
1,
|
||||
#{creatorId,jdbcType=INTEGER},
|
||||
#{createTime,jdbcType=TIMESTAMP},
|
||||
#{groupName,jdbcType=VARCHAR},
|
||||
#{groupType,jdbcType=INTEGER},
|
||||
#{serviceGroupId,jdbcType=INTEGER},
|
||||
#{description,jdbcType=VARCHAR}
|
||||
)
|
||||
</insert>
|
||||
<insert id="insertBatch">
|
||||
INSERT INTO policy_group_info(
|
||||
IS_VALID,
|
||||
CREATOR_ID,
|
||||
CREATE_TIME,
|
||||
GROUP_NAME,
|
||||
GROUP_TYPE,
|
||||
SERVICE_GROUP_ID,
|
||||
DESCRIPTION
|
||||
)values
|
||||
<foreach collection ="list" item="info" separator =",">
|
||||
(
|
||||
1,
|
||||
#{info.creatorId,jdbcType=INTEGER},
|
||||
#{info.createTime,jdbcType=TIMESTAMP},
|
||||
#{info.groupName,jdbcType=VARCHAR},
|
||||
#{info.groupType,jdbcType=INTEGER},
|
||||
#{info.serviceGroupId,jdbcType=INTEGER},
|
||||
#{info.description,jdbcType=VARCHAR}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<update id="update" parameterType="com.nis.domain.basics.CommonGroupInfo" >
|
||||
UPDATE policy_group_info
|
||||
<set>
|
||||
<trim suffixOverrides=",">
|
||||
<if test="groupName != null and groupName != ''" >
|
||||
group_name = #{groupName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="groupType != null" >
|
||||
group_type = #{groupType,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="description != null" >
|
||||
description = #{description,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="isValid != null" >
|
||||
is_valid = #{isValid,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>
|
||||
</trim>
|
||||
</set>
|
||||
<where>
|
||||
<if test="groupId != null" >
|
||||
and group_id = #{groupId,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="serviceGroupId != null" >
|
||||
and service_group_id = #{serviceGroupId,jdbcType=INTEGER}
|
||||
</if>
|
||||
</where>
|
||||
</update>
|
||||
|
||||
<select id="findCommonGroupInfosByType" resultMap="CommonGroupInfoMap">
|
||||
SELECT
|
||||
<include refid="CommonGroupInfoColumns"/>
|
||||
FROM
|
||||
policy_group_info r
|
||||
WHERE
|
||||
r.is_valid=1 and r.group_type=#{groupType,jdbcType=INTEGER}
|
||||
</select>
|
||||
|
||||
<select id="findGroupInfoList" resultMap="CommonGroupInfoMap">
|
||||
SELECT
|
||||
<include refid="CommonGroupInfoColumns"/>
|
||||
<trim prefix="," prefixOverrides=",">
|
||||
, s.name as creator_name
|
||||
,e.name as editor_name
|
||||
</trim>
|
||||
FROM
|
||||
policy_group_info r
|
||||
left join sys_user s on r.creator_id=s.id
|
||||
left join sys_user e on r.editor_id=e.id
|
||||
WHERE
|
||||
r.group_id IN (${ids})
|
||||
</select>
|
||||
|
||||
<!-- 查出所有 有效数据-->
|
||||
<!-- <select id="findPolicyGroupInfos" resultMap="PolicyGroupInfoMap">
|
||||
SELECT
|
||||
<include refid="PolicyGroupInfoColumns"/>
|
||||
FROM policy_group_info r
|
||||
where r.is_valid=1
|
||||
</select>
|
||||
<select id="findNatPolicyGroups" resultMap="PolicyGroupInfoMap">
|
||||
SELECT
|
||||
<include refid="PolicyGroupInfoColumns"/>
|
||||
FROM policy_group_info r
|
||||
where r.is_valid=1 AND r.group_type = 2 OR r.group_type = 3
|
||||
</select>
|
||||
<select id="findHasIPPolicyGroupInfosByType" resultMap="PolicyGroupInfoMap">
|
||||
SELECT
|
||||
<include refid="PolicyGroupInfoColumns"/>
|
||||
FROM (
|
||||
SELECT DISTINCT dns_strategy_id FROM dns_ip_cfg WHERE is_valid=1 AND is_audit=1
|
||||
) a
|
||||
LEFT JOIN policy_group_info r ON a.dns_strategy_id=r.group_id
|
||||
where r.is_valid=1 and r.group_type=#{groupType,jdbcType=INTEGER}
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<select id="getInfoByAsnNo" resultType="com.nis.domain.basics.PolicyGroupInfo">
|
||||
SELECT
|
||||
<include refid="PolicyGroupInfoColumns"/>
|
||||
FROM
|
||||
policy_group_info r
|
||||
<trim prefix="WHERE" prefixOverrides="AND |OR ">
|
||||
<if test="groupId != null" >
|
||||
AND group_id = #{groupId,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="asnNo != null" >
|
||||
AND asn_no = #{asnNo,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="isValid != null" >
|
||||
AND is_valid = #{isValid,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="isValid == null" >
|
||||
AND is_valid != -1
|
||||
</if>
|
||||
</trim>
|
||||
</select>
|
||||
|
||||
<select id="getHasAreaPolicyGroups" resultType="com.nis.domain.basics.PolicyGroupInfo">
|
||||
SELECT
|
||||
<include refid="PolicyGroupInfoColumns"/>
|
||||
FROM
|
||||
policy_group_info r
|
||||
WHERE
|
||||
r.is_valid = 1 AND
|
||||
r.group_type = #{groupType,jdbcType=INTEGER} AND
|
||||
r.group_id IN (
|
||||
SELECT ga.group_id FROM group_area_info ga WHERE ga.is_valid != -1
|
||||
)
|
||||
</select>
|
||||
|
||||
<select id="getGroupIdByGroupName" resultType="java.lang.Integer">
|
||||
SELECT
|
||||
r.group_id
|
||||
FROM
|
||||
policy_group_info r
|
||||
WHERE
|
||||
r.group_name = #{groupName}
|
||||
</select>
|
||||
|
||||
<select id="getGroupInfo" resultType="com.nis.domain.basics.PolicyGroupInfo">
|
||||
SELECT
|
||||
<include refid="PolicyGroupInfoColumns"/>
|
||||
FROM
|
||||
policy_group_info r
|
||||
<trim prefix="WHERE" prefixOverrides="AND |OR ">
|
||||
<if test="groupName != null and groupName != ''" >
|
||||
AND group_name = #{groupName,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="groupType != null" >
|
||||
AND group_type = #{groupType,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="asnNo != null" >
|
||||
AND asn_no = #{asnNo,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="isValid != null" >
|
||||
AND is_valid = #{isValid,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="isValid == null" >
|
||||
AND is_valid != -1
|
||||
</if>
|
||||
</trim>
|
||||
</select>
|
||||
|
||||
-->
|
||||
|
||||
|
||||
</mapper>
|
||||
31
src/main/java/com/nis/web/dao/basics/IpCommGroupCfgDao.java
Normal file
31
src/main/java/com/nis/web/dao/basics/IpCommGroupCfgDao.java
Normal file
@@ -0,0 +1,31 @@
|
||||
package com.nis.web.dao.basics;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import com.nis.domain.basics.IpCommCfg;
|
||||
import com.nis.domain.basics.Varibles;
|
||||
import com.nis.web.dao.CrudDao;
|
||||
import com.nis.web.dao.MyBatisDao;
|
||||
@MyBatisDao
|
||||
public interface IpCommGroupCfgDao extends CrudDao<IpCommCfg>{
|
||||
public List<IpCommCfg> findPage(IpCommCfg cfg);
|
||||
public List<IpCommCfg> findByPage(@Param("ids")String ids);
|
||||
public void delete(@Param("ids")String ids);
|
||||
public void updateIssued(IpCommCfg cfg);
|
||||
public List<IpCommCfg> getByIds(@Param("ids")String ids);
|
||||
public List<IpCommCfg> findAllList(IpCommCfg cfg);
|
||||
public List<Integer> findOtherIps(@Param("groupId")Integer groupId,@Param("cfgId")Integer cfgId);
|
||||
public List<Integer> countValidIPs(@Param("groups")String groups,@Param("ids")String ids);
|
||||
public int insertBatch(List<IpCommCfg> list);
|
||||
public Varibles getVaribles(@Param("name")String name);
|
||||
public void ajaxDeleteAsnIp(@Param("ids")String ids);
|
||||
public IpCommCfg getOne(IpCommCfg cfg);
|
||||
public List<Object[]> findAllIpCommGroupCfgList();
|
||||
public void insertIpCommGroupCfg(IpCommCfg ipPortCfg);
|
||||
public int getGroupIdCount(int groupId);
|
||||
|
||||
// 校验分组是否被引用
|
||||
public List<IpCommCfg> getCfgInfoByGroupIds(@Param("ids")String ids);
|
||||
}
|
||||
526
src/main/java/com/nis/web/dao/basics/IpCommGroupCfgDao.xml
Normal file
526
src/main/java/com/nis/web/dao/basics/IpCommGroupCfgDao.xml
Normal file
@@ -0,0 +1,526 @@
|
||||
<?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.IpCommGroupCfgDao">
|
||||
<resultMap id="IpCommGroupCfgMap" type="com.nis.domain.basics.IpCommCfg">
|
||||
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
|
||||
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
|
||||
<result column="cfg_type" property="cfgType" jdbcType="VARCHAR" />
|
||||
<result column="cfg_region_code" property="cfgRegionCode" jdbcType="INTEGER" />
|
||||
<result column="ip_type" property="ipType" jdbcType="INTEGER" />
|
||||
<result column="src_ip_pattern" property="srcIpPattern" jdbcType="INTEGER" />
|
||||
<result column="dest_ip_pattern" property="destIpPattern" jdbcType="INTEGER" />
|
||||
<result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" />
|
||||
<result column="dest_ip_address" property="destIpAddress" jdbcType="VARCHAR" />
|
||||
<result column="port_pattern" property="portPattern" jdbcType="INTEGER" />
|
||||
<result column="src_port" property="srcPort" jdbcType="VARCHAR" />
|
||||
<result column="dest_port" property="destPort" jdbcType="VARCHAR" />
|
||||
<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="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="ratelimit" property="ratelimit" jdbcType="VARCHAR" />
|
||||
<result column="region_id" property="regionId" jdbcType="INTEGER" />
|
||||
<result column="group_id" property="groupId" 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="columns">
|
||||
r.cfg_id,r.cfg_desc,r.cfg_type,r.cfg_region_code,r.ip_type,r.src_ip_pattern,r.src_ip_address,r.dest_ip_pattern,r.dest_ip_address,
|
||||
r.src_port_pattern,r.src_port,r.dest_port_pattern,r.dest_port
|
||||
,r.protocol,r.protocol_id,r.direction,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.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.compile_id,r.region_id,r.group_id
|
||||
</sql>
|
||||
|
||||
<select id="findPage" resultMap="IpCommGroupCfgMap">
|
||||
select
|
||||
<include refid="columns"></include>
|
||||
<trim prefix="," prefixOverrides=",">
|
||||
,s.name as creator_name,e.name as editor_name,u.name as auditor_name
|
||||
</trim>
|
||||
from ip_comm_cfg r
|
||||
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="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="srcIpPattern != null">
|
||||
AND r.src_ip_pattern=#{srcIpPattern,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="destIpPattern != null">
|
||||
AND r.dest_ip_pattern=#{destIpPattern,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="srcPortPattern != null">
|
||||
AND r.src_port_pattern=#{srcPortPattern,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="destPortPattern != null">
|
||||
AND r.dest_port_pattern=#{destPortPattern,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>
|
||||
<if test="userRegion3 != null">
|
||||
AND r.user_region3 like concat(concat('%',#{userRegion3,jdbcType=VARCHAR}),'%')
|
||||
</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="IpCommGroupCfgMap">
|
||||
SELECT
|
||||
<include refid="columns"></include>
|
||||
FROM
|
||||
ip_comm_cfg r
|
||||
WHERE
|
||||
r.cfg_id = #{ids} AND r.is_valid != -1
|
||||
</select>
|
||||
|
||||
<select id="getCfgInfoByGroupIds" resultMap="IpCommGroupCfgMap">
|
||||
SELECT
|
||||
<include refid="columns"></include>
|
||||
FROM
|
||||
ip_comm_cfg r
|
||||
WHERE
|
||||
r.group_id IN(${ids}) AND r.is_valid != -1
|
||||
</select>
|
||||
<select id="getByIds" resultMap="IpCommGroupCfgMap">
|
||||
select
|
||||
<include refid="columns"></include>
|
||||
from ip_comm_cfg r
|
||||
where r.cfg_id in (${ids}) and r.is_valid !=-1
|
||||
</select>
|
||||
<select id="getByAsnNo" resultMap="IpCommGroupCfgMap" parameterType="java.lang.Long" >
|
||||
select
|
||||
<include refid="columns"></include>
|
||||
from ip_comm_cfg r where r.is_valid!=-1 and r.user_region1=#{asnId}
|
||||
</select>
|
||||
<insert id="insertIpCommGroupCfg" parameterType="com.nis.domain.basics.IpCommCfg" >
|
||||
<selectKey resultType="java.lang.Long" order="AFTER" keyProperty="cfgId">
|
||||
SELECT LAST_INSERT_ID()
|
||||
</selectKey>
|
||||
insert into ip_comm_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,
|
||||
GROUP_ID,
|
||||
COMPILE_ID,
|
||||
IS_AREA_EFFECTIVE,
|
||||
CLASSIFY,
|
||||
ATTRIBUTE,
|
||||
LABLE,
|
||||
AREA_EFFECTIVE_IDS,
|
||||
FUNCTION_ID,
|
||||
IP_TYPE,
|
||||
SRC_IP_ADDRESS,
|
||||
SRC_IP_PATTERN,
|
||||
DEST_IP_PATTERN,
|
||||
SRC_PORT_PATTERN,
|
||||
DEST_PORT_PATTERN,
|
||||
SRC_PORT,
|
||||
PROTOCOL,
|
||||
PROTOCOL_ID,
|
||||
DIRECTION,
|
||||
DEST_PORT,
|
||||
DEST_IP_ADDRESS,
|
||||
CFG_TYPE,
|
||||
CFG_REGION_CODE,
|
||||
USER_REGION1,
|
||||
USER_REGION2,
|
||||
USER_REGION3,
|
||||
USER_REGION4,
|
||||
USER_REGION5,
|
||||
)values (
|
||||
#{cfgDesc,jdbcType=VARCHAR},
|
||||
#{action,jdbcType=INTEGER},
|
||||
#{isValid,jdbcType=INTEGER},
|
||||
#{isAudit,jdbcType=INTEGER},
|
||||
#{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},
|
||||
#{groupId,jdbcType=INTEGER},
|
||||
#{compileId,jdbcType=INTEGER},
|
||||
#{isAreaEffective,jdbcType=INTEGER},
|
||||
#{classify,jdbcType=VARCHAR},
|
||||
#{attribute,jdbcType=VARCHAR},
|
||||
#{lable,jdbcType=VARCHAR},
|
||||
#{areaEffectiveIds,jdbcType=VARCHAR},
|
||||
#{functionId,jdbcType=INTEGER},
|
||||
#{ipType,jdbcType=INTEGER},
|
||||
#{srcIpAddress,jdbcType=VARCHAR},
|
||||
#{srcIpPattern,jdbcType=INTEGER},#{destIpPattern,jdbcType=INTEGER},
|
||||
#{srcPortPattern,jdbcType=INTEGER},#{destPortPattern,jdbcType=INTEGER},
|
||||
#{srcPort,jdbcType=VARCHAR},
|
||||
#{protocol,jdbcType=INTEGER},
|
||||
#{protocolId,jdbcType=INTEGER},
|
||||
#{direction,jdbcType=INTEGER},
|
||||
#{destPort,jdbcType=VARCHAR},
|
||||
#{destIpAddress,jdbcType=VARCHAR},
|
||||
#{cfgType,jdbcType=VARCHAR},
|
||||
#{cfgRegionCode,jdbcType=INTEGER},
|
||||
#{userRegion1,jdbcType=VARCHAR},
|
||||
#{userRegion2,jdbcType=VARCHAR},
|
||||
#{userRegion3,jdbcType=VARCHAR},
|
||||
#{userRegion4,jdbcType=VARCHAR},
|
||||
#{userRegion5,jdbcType=VARCHAR}
|
||||
)
|
||||
</insert>
|
||||
<insert id="insertForBatch" parameterType="com.nis.domain.basics.IpCommCfg" >
|
||||
insert into ip_comm_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,
|
||||
GROUP_ID,
|
||||
COMPILE_ID,
|
||||
IS_AREA_EFFECTIVE,
|
||||
CLASSIFY,
|
||||
ATTRIBUTE,
|
||||
LABLE,
|
||||
AREA_EFFECTIVE_IDS,
|
||||
FUNCTION_ID,
|
||||
IP_TYPE,
|
||||
SRC_IP_ADDRESS,
|
||||
SRC_IP_PATTERN,
|
||||
DEST_IP_PATTERN,
|
||||
SRC_PORT_PATTERN,
|
||||
DEST_PORT_PATTERN,
|
||||
SRC_PORT,
|
||||
PROTOCOL,
|
||||
PROTOCOL_ID,
|
||||
DIRECTION,
|
||||
DEST_PORT,
|
||||
DEST_IP_ADDRESS,
|
||||
CFG_TYPE,
|
||||
CFG_REGION_CODE,
|
||||
USER_REGION1,
|
||||
USER_REGION2,
|
||||
USER_REGION3,
|
||||
USER_REGION4,
|
||||
USER_REGION5
|
||||
)values (
|
||||
#{cfgDesc,jdbcType=VARCHAR},
|
||||
#{action,jdbcType=INTEGER},
|
||||
#{isValid,jdbcType=INTEGER},
|
||||
#{isAudit,jdbcType=INTEGER},
|
||||
#{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},
|
||||
#{groupId,jdbcType=INTEGER},
|
||||
#{compileId,jdbcType=INTEGER},
|
||||
#{isAreaEffective,jdbcType=INTEGER},
|
||||
#{classify,jdbcType=VARCHAR},
|
||||
#{attribute,jdbcType=VARCHAR},
|
||||
#{lable,jdbcType=VARCHAR},
|
||||
#{areaEffectiveIds,jdbcType=VARCHAR},
|
||||
#{functionId,jdbcType=INTEGER},
|
||||
#{ipType,jdbcType=INTEGER},
|
||||
#{srcIpAddress,jdbcType=VARCHAR},
|
||||
#{srcIpPattern,jdbcType=INTEGER},#{destIpPattern,jdbcType=INTEGER},
|
||||
#{srcPortPattern,jdbcType=INTEGER},#{destPortPattern,jdbcType=INTEGER},
|
||||
#{srcPort,jdbcType=VARCHAR},
|
||||
#{protocol,jdbcType=INTEGER},
|
||||
#{protocolId,jdbcType=INTEGER},
|
||||
#{direction,jdbcType=INTEGER},
|
||||
#{destPort,jdbcType=VARCHAR},
|
||||
#{destIpAddress,jdbcType=VARCHAR},
|
||||
#{cfgType,jdbcType=VARCHAR},
|
||||
#{cfgRegionCode,jdbcType=INTEGER},
|
||||
#{userRegion1,jdbcType=VARCHAR},
|
||||
#{userRegion2,jdbcType=VARCHAR},
|
||||
#{userRegion3,jdbcType=VARCHAR},
|
||||
#{userRegion4,jdbcType=VARCHAR},
|
||||
#{userRegion5,jdbcType=VARCHAR}
|
||||
)
|
||||
</insert>
|
||||
<update id="update" parameterType="com.nis.domain.basics.IpCommCfg" >
|
||||
update ip_comm_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="srcIpPattern != null" >
|
||||
SRC_IP_PATTERN = #{srcIpPattern,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="destIpPattern != null" >
|
||||
DEST_IP_PATTERN =#{destIpPattern,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="srcPortPattern != null" >
|
||||
SRC_PORT_PATTERN = #{srcPortPattern,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="destPortPattern != null" >
|
||||
DEST_PORT_PATTERN = #{destPortPattern,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="userRegion1 != null and userRegion1 != ''" >
|
||||
USER_REGION1 = #{userRegion1,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="userRegion2 != null and userRegion2 != ''" >
|
||||
USER_REGION2 = #{userRegion2,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="userRegion3 != null and userRegion3 != ''" >
|
||||
USER_REGION3 = #{userRegion3,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="userRegion4 != null and userRegion4 != ''" >
|
||||
USER_REGION4 = #{userRegion4,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="userRegion5 != null and userRegion5 != ''" >
|
||||
USER_REGION5 = #{userRegion5,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="groupId != null and groupId != ''" >
|
||||
GROUP_ID = #{groupId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="regionId != null and regionId != ''" >
|
||||
REGION_ID = #{regionId,jdbcType=INTEGER},
|
||||
</if>
|
||||
</trim>
|
||||
</set>
|
||||
<where>
|
||||
and cfg_id = #{cfgId,jdbcType=INTEGER}
|
||||
</where>
|
||||
</update>
|
||||
|
||||
<delete id="delete" parameterType="java.lang.String" >
|
||||
delete from ip_comm_cfg where cfg_id in (${ids})
|
||||
</delete>
|
||||
<select id="getGroupIdCount" parameterType="java.lang.Integer" resultType="java.lang.Integer">
|
||||
SELECT COUNT(cfg_id) groupCount from ip_comm_cfg
|
||||
WHERE group_id= #{groupId}
|
||||
and is_valid=1
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,235 @@
|
||||
package com.nis.web.service.basics;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
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.CommonGroupInfo;
|
||||
import com.nis.domain.basics.IpCommCfg;
|
||||
import com.nis.domain.basics.PolicyGroupInfo;
|
||||
import com.nis.domain.basics.UrlCommCfg;
|
||||
import com.nis.domain.specific.ConfigGroupInfo;
|
||||
import com.nis.exceptions.MaatConvertException;
|
||||
import com.nis.util.ConfigServiceUtil;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.web.dao.basics.AsnIpCfgDao;
|
||||
import com.nis.web.dao.basics.CommonGroupManageDao;
|
||||
import com.nis.web.dao.basics.IpCommGroupCfgDao;
|
||||
import com.nis.web.dao.basics.UrlCommGroupDao;
|
||||
import com.nis.web.dao.specific.ConfigGroupInfoDao;
|
||||
import com.nis.web.security.UserUtils;
|
||||
import com.nis.web.service.BaseService;
|
||||
import com.nis.web.service.SpringContextHolder;
|
||||
|
||||
@Service
|
||||
public class CommonGroupManageService extends BaseService{
|
||||
|
||||
@Autowired
|
||||
private CommonGroupManageDao commonGroupManageDao;
|
||||
|
||||
@Autowired
|
||||
private ConfigGroupInfoDao configGroupInfoDao;
|
||||
|
||||
@Autowired
|
||||
private IpCommGroupCfgDao ipCommGroupCfgDao;
|
||||
|
||||
@Autowired
|
||||
private UrlCommGroupDao urlCommGroupDao;
|
||||
|
||||
@Autowired
|
||||
private AsnIpCfgDao asnIpCfgDao;
|
||||
|
||||
public Page<CommonGroupInfo> findCommonGroupInfoList(Page<CommonGroupInfo> page, CommonGroupInfo entity) {
|
||||
entity.getSqlMap().put("dsf", configScopeFilter(entity.getCurrentUser(),"r"));
|
||||
entity.setPage(page);
|
||||
List<CommonGroupInfo> list=commonGroupManageDao.findCommonGroupInfoList(entity);
|
||||
page.setList(list);
|
||||
return page;
|
||||
}
|
||||
|
||||
public CommonGroupInfo getById(int id) {
|
||||
CommonGroupInfo groupInfo=commonGroupManageDao.getById(id);
|
||||
return groupInfo;
|
||||
}
|
||||
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public void saveOrUpdate(CommonGroupInfo entity) throws MaatConvertException{
|
||||
entity.setIsValid(1);
|
||||
//新增
|
||||
if(entity.getGroupId()==null){
|
||||
Date createTime=new Date();
|
||||
entity.setCreatorId(UserUtils.getUser().getId());
|
||||
entity.setCreateTime(createTime);
|
||||
//asn类型从综合服务获取groupId 非ASN组 不对config_group_info表添加数据
|
||||
/*if(4==entity.getGroupType().intValue()) {
|
||||
int serviceGroupId=0;
|
||||
List<Integer> groupIds= ConfigServiceUtil.getId(2,1);
|
||||
if(groupIds.size()>0) {
|
||||
serviceGroupId=groupIds.get(0).intValue();
|
||||
}else {
|
||||
throw new MaatConvertException("Get asn group id failed");
|
||||
}
|
||||
entity.setServiceGroupId(serviceGroupId);
|
||||
//新增协议分组
|
||||
ConfigGroupInfo group = configGroupInfoDao.getConfigGroupInfoByGroupId(serviceGroupId);
|
||||
if(group==null){
|
||||
group = new ConfigGroupInfo();
|
||||
group.setGroupId(serviceGroupId);
|
||||
group.setGroupName(entity.getGroupName());
|
||||
group.setIsIssued(0);
|
||||
group.setGroupType(entity.getGroupType());
|
||||
group.setAsnId(entity.getAsnNo());
|
||||
configGroupInfoDao.insertConfigGroupInfo(group);
|
||||
// if(group.getGroupType().intValue()==4) {
|
||||
// AsnCacheUtils.put(entity.getAsnNo(), group);
|
||||
// }
|
||||
|
||||
}
|
||||
}*/
|
||||
commonGroupManageDao.insert(entity);
|
||||
//修改
|
||||
}else{
|
||||
Date editTime=new Date();
|
||||
entity.setEditorId(UserUtils.getUser().getId());
|
||||
entity.setEditTime(editTime);
|
||||
commonGroupManageDao.update(entity);
|
||||
}
|
||||
}
|
||||
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public void deldete(String ids, int isValid){
|
||||
//TODO 公共组删除时需检索是否有被对应公共组配置引用,被引用的公共组无法删除
|
||||
IpCommGroupCfgService ipGroupCfgService = SpringContextHolder.getBean(IpCommGroupCfgService.class);
|
||||
|
||||
CommonGroupInfo entity=new CommonGroupInfo();
|
||||
Date editTime=new Date();
|
||||
entity.setEditorId(UserUtils.getUser().getId());
|
||||
entity.setEditTime(editTime);
|
||||
entity.setIsValid(isValid);
|
||||
if(!StringUtil.isEmpty(ids)){
|
||||
for (String id : ids.split(",")) {
|
||||
if(!StringUtil.isEmpty(id)){
|
||||
entity.setGroupId(Integer.parseInt(id));
|
||||
commonGroupManageDao.update(entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 查询指定类型的分组信息
|
||||
public List<CommonGroupInfo> findCommonGroupInfosByType(int type) {
|
||||
List<CommonGroupInfo> list=commonGroupManageDao.findCommonGroupInfosByType(type);
|
||||
return list;
|
||||
}
|
||||
|
||||
public List<CommonGroupInfo> findGroupInfoList(String ids) {
|
||||
List<CommonGroupInfo> list=commonGroupManageDao.findGroupInfoList(ids);
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除时校验分组是否被引用,未被引用可删除
|
||||
* @param groupIds
|
||||
* @return false未被引用 / true已被引用
|
||||
*/
|
||||
public boolean checkIsIssued(String groupIds) {
|
||||
// 组织格式
|
||||
Map<Integer,Set<Integer>> map = new HashMap<Integer,Set<Integer>>();
|
||||
for(String str : groupIds.split(",")) {
|
||||
Integer id = Integer.valueOf(str.substring(0, str.indexOf("_")));
|
||||
Integer type = Integer.valueOf(str.substring(str.indexOf("_")+1));
|
||||
if(map.containsKey(type)) {
|
||||
Set<Integer> set = map.get(type);
|
||||
set.add(id);
|
||||
map.put(type, set);
|
||||
}else {
|
||||
Set<Integer> set = new HashSet<Integer>();
|
||||
set.add(id);
|
||||
map.put(type, set);
|
||||
}
|
||||
}
|
||||
|
||||
// 根据类型去相应配置查询,若存在被引用的则限制操作
|
||||
Set<Integer> keySet = map.keySet();
|
||||
for (Integer type : keySet) {
|
||||
Set<Integer> set = map.get(type);
|
||||
String str = set.toString();
|
||||
String ids = str.substring(1, str.indexOf("]"));
|
||||
if(type == 5) {
|
||||
List<IpCommCfg> list = ipCommGroupCfgDao.getCfgInfoByGroupIds(ids);
|
||||
if(list.size() > 0) {
|
||||
return true;
|
||||
}
|
||||
}else if(type == 7) {
|
||||
List<UrlCommCfg> list = urlCommGroupDao.getCfgInfoByGroupIds(ids);
|
||||
if(list.size() > 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
public List<PolicyGroupInfo> findPolicyGroupInfos() {
|
||||
List<PolicyGroupInfo> list=commonGroupManageDao.findPolicyGroupInfos();
|
||||
return list;
|
||||
}
|
||||
public List<PolicyGroupInfo> findNatPolicyGroups() {
|
||||
List<PolicyGroupInfo> list=commonGroupManageDao.findNatPolicyGroups();
|
||||
return list;
|
||||
}
|
||||
public List<PolicyGroupInfo> findPolicyGroupInfosByType(int type) {
|
||||
List<PolicyGroupInfo> list=commonGroupManageDao.findPolicyGroupInfosByType(type);
|
||||
return list;
|
||||
}
|
||||
public List<PolicyGroupInfo> findHasIpPolicyGroupInfosByType(int type) {
|
||||
List<PolicyGroupInfo> list=commonGroupManageDao.findHasIPPolicyGroupInfosByType(type);
|
||||
return list;
|
||||
}
|
||||
public List<PolicyGroupInfo> findPolicyGroupInfosHasIpRegionByType(int type) {
|
||||
List<PolicyGroupInfo> list=commonGroupManageDao.findPolicyGroupInfosByType(type);
|
||||
return list;
|
||||
}
|
||||
|
||||
public boolean checkIps(String groupIds) {
|
||||
for(String groupId:groupIds.split(",")) {
|
||||
Integer.parseInt(groupId);
|
||||
}
|
||||
List<Integer> hasIpList=asnIpCfgDao.hasGroupIds(groupIds);
|
||||
if(hasIpList!=null&&hasIpList.size()>0) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public PolicyGroupInfo getInfoByAsnNo(PolicyGroupInfo policyGroupInfo){
|
||||
return commonGroupManageDao.getInfoByAsnNo(policyGroupInfo);
|
||||
}
|
||||
|
||||
*//**
|
||||
* IP复用配置表单-获取拥有区域信息的策略分组
|
||||
* @param groupType
|
||||
* @return
|
||||
*//*
|
||||
public List<PolicyGroupInfo> getHasAreaPolicyGroups(int groupType) {
|
||||
return commonGroupManageDao.getHasAreaPolicyGroups(groupType);
|
||||
}
|
||||
|
||||
public Integer getGroupIdByGroupName(String groupName){
|
||||
return commonGroupManageDao.getGroupIdByGroupName(groupName);
|
||||
}
|
||||
|
||||
public PolicyGroupInfo getGroupInfo(PolicyGroupInfo policyGroupInfo){
|
||||
return commonGroupManageDao.getGroupInfo(policyGroupInfo);
|
||||
}*/
|
||||
|
||||
}
|
||||
@@ -0,0 +1,253 @@
|
||||
package com.nis.web.service.basics;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.ibatis.session.ExecutorType;
|
||||
import org.apache.ibatis.session.SqlSession;
|
||||
import org.apache.ibatis.session.SqlSessionFactory;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.beust.jcommander.internal.Maps;
|
||||
import com.beust.jcommander.internal.Sets;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.nis.domain.FunctionRegionDict;
|
||||
import com.nis.domain.FunctionServiceDict;
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.basics.AsnGroupInfo;
|
||||
import com.nis.domain.basics.AsnIpCfg;
|
||||
import com.nis.domain.basics.IpCommCfg;
|
||||
import com.nis.domain.configuration.BaseIpCfg;
|
||||
import com.nis.domain.configuration.CfgIndexInfo;
|
||||
import com.nis.domain.maat.GroupReuseAddBean;
|
||||
import com.nis.domain.maat.GroupReuseCfg;
|
||||
import com.nis.domain.maat.MaatCfg;
|
||||
import com.nis.domain.maat.ToMaatBean;
|
||||
import com.nis.domain.maat.ToMaatResult;
|
||||
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.util.ConfigServiceUtil;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.web.dao.basics.AsnGroupInfoDao;
|
||||
import com.nis.web.dao.basics.AsnIpCfgDao;
|
||||
import com.nis.web.dao.basics.IpCommGroupCfgDao;
|
||||
import com.nis.web.dao.basics.PolicyGroupInfoDao;
|
||||
import com.nis.web.security.UserUtils;
|
||||
import com.nis.web.service.BaseService;
|
||||
import com.nis.web.service.SpringContextHolder;
|
||||
@Service
|
||||
public class IpCommGroupCfgService extends BaseService {
|
||||
@Autowired
|
||||
private IpCommGroupCfgDao ipCommGroupCfgDao;
|
||||
@Autowired
|
||||
private PolicyGroupInfoDao policyGroupInfoDao;
|
||||
/**
|
||||
* @param page
|
||||
* @param entity
|
||||
* @return
|
||||
*/
|
||||
public Page<IpCommCfg> findPage(Page<IpCommCfg> page, IpCommCfg entity) {
|
||||
entity.getSqlMap().put("dsf", configScopeFilter(entity.getCurrentUser(),"r"));
|
||||
entity.setPage(page);
|
||||
List<IpCommCfg> list=ipCommGroupCfgDao.findPage(entity);
|
||||
page.setList(list);
|
||||
return page;
|
||||
}
|
||||
|
||||
public List<IpCommCfg> findByPage(String ids) {
|
||||
List<IpCommCfg> list=ipCommGroupCfgDao.findByPage(ids);
|
||||
return list;
|
||||
}
|
||||
|
||||
public IpCommCfg get(Long id ) {
|
||||
return ipCommGroupCfgDao.get(id);
|
||||
}
|
||||
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public void save(List<IpCommCfg> entitys) {
|
||||
logger.warn("Start to save IP,size:"+entitys.size());
|
||||
long start=System.currentTimeMillis();
|
||||
for(IpCommCfg ipCfg:entitys) {
|
||||
ipCommGroupCfgDao.insert(ipCfg);
|
||||
}
|
||||
long end=System.currentTimeMillis();
|
||||
logger.warn("Save IP finish,cost:"+(end-start));
|
||||
}
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public void update(IpCommCfg entity){
|
||||
ipCommGroupCfgDao.update(entity);
|
||||
}
|
||||
|
||||
|
||||
public List<IpCommCfg> getByIds(String ids) {
|
||||
if(ids==null) {
|
||||
throw new RuntimeException("ids is null!");
|
||||
}
|
||||
return ipCommGroupCfgDao.getByIds(ids);
|
||||
}
|
||||
|
||||
//新增
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public void saveIpCommGroupCfg(CfgIndexInfo entity) {
|
||||
//TODO 组配置更新时 需检索是否被其它配置引用,若被引用需调用相应服务接口更新配置
|
||||
|
||||
Date createTime=new Date();
|
||||
if(CollectionUtils.isNotEmpty(entity.getIpCommGroupCfgList())) {
|
||||
for (int i = 0; i < entity.getIpCommGroupCfgList().size(); i++) {
|
||||
BeanUtils.copyProperties(entity, entity.getIpCommGroupCfgList().get(i), new String[]{"cfgId","userregion3"});
|
||||
entity.getIpCommGroupCfgList().get(i).setRequestId(0);
|
||||
entity.getIpCommGroupCfgList().get(i).setClassify("0");
|
||||
entity.getIpCommGroupCfgList().get(i).setAttribute("0");
|
||||
entity.getIpCommGroupCfgList().get(i).setLable("0");
|
||||
entity.getIpCommGroupCfgList().get(i).setCreateTime(createTime);
|
||||
entity.getIpCommGroupCfgList().get(i).setCreatorId(entity.getCurrentUser().getId());
|
||||
entity.getIpCommGroupCfgList().get(i).setIsValid(Constants.VALID_NO);
|
||||
entity.getIpCommGroupCfgList().get(i).setIsAudit(Constants.AUDIT_NOT_YET);
|
||||
entity.getIpCommGroupCfgList().get(i).setGroupId(Integer.parseInt(entity.getUserRegion3()));
|
||||
ipCommGroupCfgDao.insertForBatch(entity.getIpCommGroupCfgList().get(i));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// @Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
// public void audit(List<IpCommCfg> ipCommGroupCfgs, Integer isAudit, Integer isValid) {
|
||||
// // TODO Auto-generated method stub
|
||||
// Set<Integer> groupIds=Sets.newHashSet();
|
||||
// if(!StringUtil.isEmpty(ipCommGroupCfgs)){
|
||||
// for(IpCommCfg cfg:ipCommGroupCfgs) {
|
||||
// cfg.setIsValid(isValid);
|
||||
// cfg.setIsAudit(isAudit);
|
||||
// cfg.setAuditorId(UserUtils.getUser().getId());
|
||||
// cfg.setAuditTime(new Date());
|
||||
// groupIds.add(cfg.getGroupId());
|
||||
// ipCommGroupCfgDao.update(cfg);
|
||||
// }
|
||||
// }
|
||||
// //查询有效的Ip配置个数
|
||||
// for(Integer groupId:groupIds) {
|
||||
// Integer groupCount=ipCommGroupCfgDao.getGroupIdCount(groupId);
|
||||
// if(groupCount>0){//udFlag 设置为1
|
||||
// policyGroupInfoDao.updateUdFlag(groupId, 1,5);
|
||||
// }else{//udFlag 设置为0
|
||||
// policyGroupInfoDao.updateUdFlag(groupId, 0,5);
|
||||
// }
|
||||
// }
|
||||
// //下发配置时改变公共组udFlag标识
|
||||
// send2Maat(ipCommGroupCfgs,isValid);
|
||||
// }
|
||||
// public void send2Maat(List<IpCommCfg> ipCommGroupCfgs,int isValid) {
|
||||
// GroupReuseAddBean maatBean = new GroupReuseAddBean();
|
||||
// List<GroupReuseCfg> groupReuseList=new ArrayList<>();
|
||||
// GroupReuseCfg groupReuseCfg=new GroupReuseCfg();
|
||||
// List<IpCfg> ipRegionList = groupReuseCfgAddRemoveConvert(ipCommGroupCfgs,isValid,null);
|
||||
// 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(UserUtils.getUser().getName());
|
||||
// maatBean.setVersion(Constants.MAAT_VERSION);
|
||||
// logger.warn("IP Common Region Send To Maat start");
|
||||
// long start=System.currentTimeMillis();
|
||||
// if(isValid==Constants.VALID_YES) {
|
||||
// maatBean.setOpAction(Constants.INSERT_ACTION);
|
||||
// //调用服务接口下发配置数据
|
||||
// String json=gsonToJson(maatBean);
|
||||
// if(ipCommGroupCfgs.size()<=100) {
|
||||
// logger.info("ip 公共组域新增配置下发配置参数:"+json);
|
||||
// }else {
|
||||
// logger.info("ip 公共组域新增配置下发region条数:"+ipCommGroupCfgs.size());
|
||||
// }
|
||||
// //调用服务接口下发配置
|
||||
// ToMaatResult result =ConfigServiceUtil.postGroupReuseSources(json);
|
||||
// logger.info("ip 公共组域新增配置响应信息:"+result.getMsg());
|
||||
// }else {
|
||||
// maatBean.setOpAction(Constants.UPDATE_ACTION);
|
||||
// //调用服务接口下发配置数据
|
||||
// String json=gsonToJson(maatBean);
|
||||
// if(ipCommGroupCfgs.size()<=100) {
|
||||
// logger.info("ip 公共组域删除配置下发配置参数:"+json);
|
||||
// }else {
|
||||
// logger.info("ip 公共组域删除配置下发region条数:"+ipCommGroupCfgs.size());
|
||||
//
|
||||
// }
|
||||
// //调用服务接口下发配置
|
||||
// ToMaatResult result = ConfigServiceUtil.put(json,3);
|
||||
// logger.info("asn ip复用域删除配置响应信息:"+result.getMsg());
|
||||
// }
|
||||
// long end=System.currentTimeMillis();
|
||||
// logger.warn("IP Common Region Send To Maat finish,cost:"+(end-start));
|
||||
// }
|
||||
public void delete(String ids) {
|
||||
// TODO 公共组配置删除时 需检索是否被其它业务配置引用,没被引用可删除
|
||||
|
||||
if(ids==null) {
|
||||
throw new RuntimeException("ids is null!");
|
||||
}
|
||||
ipCommGroupCfgDao.delete(ids);
|
||||
}
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public void saveAndSend(FunctionRegionDict regionDict, FunctionServiceDict serviceDict, List<BaseIpCfg> cfgs,boolean send) {
|
||||
logger.warn("Start to save IP,size:"+cfgs.size());
|
||||
long start=System.currentTimeMillis();
|
||||
SqlSessionFactory sqlSessionFactory=SpringContextHolder.getBean(SqlSessionFactory.class);
|
||||
SqlSession batchSqlSession = null;
|
||||
//需要通过新增域接口新增的ip集合
|
||||
Map<Integer,Integer> groupCount=Maps.newHashMap();
|
||||
List<IpCommCfg> ipCommCfgs=new ArrayList(cfgs.size());
|
||||
try{
|
||||
batchSqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, false);
|
||||
|
||||
for(BaseIpCfg cfg:cfgs) {
|
||||
IpCommCfg ipCommCfg=new IpCommCfg();
|
||||
BeanUtils.copyProperties(cfg, ipCommCfg);
|
||||
ipCommCfgs.add(ipCommCfg);
|
||||
((IpCommGroupCfgDao) batchSqlSession.getMapper(IpCommGroupCfgDao.class)).insertForBatch(ipCommCfg);
|
||||
// if(send) {
|
||||
// if(groupCount.containsKey(ipCommCfg.getGroupId())) {
|
||||
// groupCount.put(ipCommCfg.getGroupId(), groupCount.get(ipCommCfg.getGroupId())+1);
|
||||
// }else {
|
||||
// groupCount.put(ipCommCfg.getGroupId(), 1);
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
||||
// if(send) {
|
||||
// if(groupCount.size()>0) {
|
||||
// for(Entry<Integer, Integer> groupId:groupCount.entrySet()) {
|
||||
// policyGroupInfoDao.updateUdFlag(groupId.getKey(), 1,5);
|
||||
// }
|
||||
//
|
||||
// this.send2Maat(ipCommCfgs, Constants.VALID_YES);
|
||||
// }
|
||||
// }
|
||||
batchSqlSession.commit();
|
||||
}finally {
|
||||
if(batchSqlSession != null){
|
||||
batchSqlSession.close();
|
||||
}
|
||||
}
|
||||
long end=System.currentTimeMillis();
|
||||
logger.warn("Save IP finish,cost:"+(end-start));
|
||||
cfgs.clear();
|
||||
cfgs=null;
|
||||
}
|
||||
|
||||
}
|
||||
126
src/main/webapp/WEB-INF/views/basics/commonGroupForm.jsp
Normal file
126
src/main/webapp/WEB-INF/views/basics/commonGroupForm.jsp
Normal file
@@ -0,0 +1,126 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8"%>
|
||||
<%@ include file="/WEB-INF/include/taglib.jsp"%>
|
||||
<html>
|
||||
<head>
|
||||
<title><spring:message code="${cfgName}"></spring:message></title>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
if($("[name=groupId]").val()){
|
||||
$("[name=groupType] option").each(function(){
|
||||
if("${_cfg.groupType}"!=$(this).attr("value")){
|
||||
$(this).attr("disabled",true);
|
||||
}
|
||||
});
|
||||
$("[name=groupType]").selectpicker("refresh");
|
||||
}
|
||||
|
||||
$("#cfgFrom").validate({
|
||||
errorPlacement: function(error,element){
|
||||
if($(element).parents().hasClass("tagsinput")){
|
||||
$(element).parents(".col-md-6").next("div").append(error);
|
||||
}else{
|
||||
$(element).parents(".form-group").find("div[for='"+element.attr("name")+"']").append(error);
|
||||
}
|
||||
},
|
||||
submitHandler: function(form){
|
||||
if("${_cfg.groupType}" == 4){
|
||||
$(".asnNo").removeClass("hidden");
|
||||
}
|
||||
if("${_cfg.groupType}" == 6){
|
||||
$("#asnNo").val($(".groupType").find("#asnNo").val());
|
||||
}
|
||||
loading('onloading...');
|
||||
form.submit();
|
||||
},
|
||||
errorContainer: "#messageBox",
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="page-content">
|
||||
|
||||
<h3 class="page-title">
|
||||
<spring:message code="common_group_manage"/>
|
||||
</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.groupId}"><spring:message code="add"></spring:message></c:if>
|
||||
<c:if test="${not empty _cfg.groupId}"><spring:message code="edit"></spring:message></c:if>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body form">
|
||||
<!-- BEGIN FORM-->
|
||||
<form:form id="cfgFrom" modelAttribute="_cfg" action="${ctx}/basics/commonGroup/saveOrUpdate" method="post" class="form-horizontal">
|
||||
<input type="hidden" name="groupId" value="${_cfg.groupId}">
|
||||
<%-- <input type="hidden" name="groupType" value="${_cfg.groupType}"> --%>
|
||||
<div class="form-body">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="group_name"/></label>
|
||||
<div class="col-md-6">
|
||||
<input class="form-control required" type="text" name="groupName" value="${_cfg.groupName}">
|
||||
</div>
|
||||
<div for="groupName"></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="group_type"/></label>
|
||||
<div class="col-md-6">
|
||||
<select id="groupType" name="groupType" class="selectpicker select2 form-control required" >
|
||||
<c:forEach items="${fns:getDictList('GROUP_TYPE')}" var="groupTypeC">
|
||||
<c:if test="${groupTypeC.itemCode eq 5 || groupTypeC.itemCode eq 7 || groupTypeC.itemCode eq 8 || groupTypeC.itemCode eq 9}">
|
||||
<option value="${groupTypeC.itemCode}" <c:if test="${_cfg.groupType==groupTypeC.itemCode || (_cfg.groupType==null && groupTypeC.itemCode==1)}">selected</c:if>><spring:message code="${groupTypeC.itemValue}"/></option>
|
||||
</c:if>
|
||||
</c:forEach>
|
||||
<%-- <option value="5" <c:if test="${_cfg.groupType eq 5 }">selected</c:if>><spring:message code="IP GROUP"/></option>
|
||||
<option value="6" <c:if test="${_cfg.groupType eq 6 }">selected</c:if>><spring:message code="URL GROUP"/></option>
|
||||
<option value="7" <c:if test="${_cfg.groupType eq 7 }">selected</c:if>><spring:message code="Domain GROUP"/></option>
|
||||
<option value="8" <c:if test="${_cfg.groupType eq 8 }">selected</c:if>><spring:message code="SubscribeID GROUP"/></option> --%>
|
||||
</select>
|
||||
</div>
|
||||
<div for="groupType"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label"><spring:message code="desc"/>:</label>
|
||||
<div class="col-md-6">
|
||||
<form:textarea path="description" htmlEscape="false" maxlength="128" class="form-control" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-actions">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="row">
|
||||
<div class="col-md-offset-3 col-md-8">
|
||||
<button id="save" type="submit" class="btn green"><spring:message code="submit"/></button>
|
||||
<button id="cancel" type="button" class="btn default"><spring:message code="cancel"/></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6"> </div>
|
||||
</div>
|
||||
</div>
|
||||
</form:form>
|
||||
<!-- END FORM-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
324
src/main/webapp/WEB-INF/views/basics/commonGroupList.jsp
Normal file
324
src/main/webapp/WEB-INF/views/basics/commonGroupList.jsp
Normal file
@@ -0,0 +1,324 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8"%>
|
||||
<%@ include file="/WEB-INF/include/taglib.jsp"%>
|
||||
<html>
|
||||
<head>
|
||||
<title><spring:message code="${cfgName}"></spring:message></title>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
//搜索框提示语初始化
|
||||
if("${cfg.groupName}"){
|
||||
$("#intype").val("${cfg.groupName}");
|
||||
}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());
|
||||
});
|
||||
$("select[name='groupType']").change(function(){
|
||||
$("#searchForm").submit();
|
||||
});
|
||||
//筛选功能初始化
|
||||
filterActionInit();
|
||||
//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",'');
|
||||
$("#searchForm")[0].reset();
|
||||
});
|
||||
});
|
||||
function deletes(url){
|
||||
var checkboxes = $("tbody tr td input.i-checks:checkbox");
|
||||
var ids = "";
|
||||
var str = "";
|
||||
|
||||
checkboxes.each(function(){
|
||||
if(true == $(this).is(':checked')){
|
||||
str += $(this).attr("id")+"_"+$(this).attr("groupType")+",";
|
||||
ids += $(this).attr("id")+",";
|
||||
/* if(typeof (map.get($(this).attr("groupType"))) != "undefined"){
|
||||
map.set($(this).attr("groupType"), map.get($(this).attr("groupType")) +"_"+ $(this).attr("id"));
|
||||
}else{
|
||||
map.set($(this).attr("groupType"), $(this).attr("id"));
|
||||
} */
|
||||
|
||||
//map.set($(this).attr("groupType"),$(this).attr("id"));
|
||||
}
|
||||
});
|
||||
|
||||
// 去除末尾,
|
||||
if(str.substr(str.length-1)== ','){
|
||||
str = str.substr(0,str.length-1);
|
||||
}
|
||||
if(ids.substr(ids.length-1)== ','){
|
||||
ids = ids.substr(0,ids.length-1);
|
||||
}
|
||||
|
||||
if(str.length >0){
|
||||
// 删除时 校验分组是否已被引用,未引用可删除
|
||||
var canDel = true;
|
||||
var tip='<spring:message code="can_not_delete_issued_group"/>';
|
||||
$.ajax({
|
||||
type:'post',
|
||||
url:'${ctx}/basics/commonGroup/ajaxCheckGroupUse',
|
||||
data:{"groupIds":str},
|
||||
async:false,
|
||||
success:function(data,textStatus){
|
||||
if(data){
|
||||
canDel=false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if(canDel){
|
||||
top.$.jBox.confirm("<spring:message code='confirm_message'/>","<spring:message code='info'/>",function(v,h,f){
|
||||
if(v=="ok"){
|
||||
window.location = url+"&ids="+ids;
|
||||
}
|
||||
},{buttonsFocus:1});
|
||||
top.$('.jbox-body .jbox-icon').css('top','55px');
|
||||
}else{
|
||||
$.jBox.tip(tip);
|
||||
return false;
|
||||
}
|
||||
|
||||
}else{
|
||||
top.$.jBox.tip("<spring:message code='one_more'/>", "<spring:message code='info'/>");
|
||||
return;
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="page-content">
|
||||
<div class="theme-panel hidden-xs hidden-sm">
|
||||
<button type="button" class="addId btn btn-primary"
|
||||
onClick="javascript:window.location='${ctx}/basics/commonGroup/form?groupType=${cfg.groupType}'">
|
||||
<i class="fa fa-plus"></i>
|
||||
<spring:message code="add"></spring:message>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<h3 class="page-title">
|
||||
<spring:message code="common_group_manage"/>
|
||||
</h3>
|
||||
<h5 class="page-header"></h5>
|
||||
<div class="col-md-12">
|
||||
<div class="portlet">
|
||||
<div class="portlet-body">
|
||||
<div class="row" >
|
||||
<form:form id="searchForm" modelAttribute="cfg" action="${ctx}/basics/commonGroup/list" method="post" class="form-search">
|
||||
<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
|
||||
<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
|
||||
<input id="groupType" name="groupType" type="hidden" value="${cfg.groupType}"/>
|
||||
<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">
|
||||
<spring:message code='group_type'/>
|
||||
<select name="groupType" class="selectpicker select2 input-small">
|
||||
<option value=""><spring:message code="all_types"/></option>
|
||||
<c:forEach items="${fns:getDictList('GROUP_TYPE')}" var="groupTypeC">
|
||||
<c:if test="${groupTypeC.itemCode ne 2 && groupTypeC.itemCode ne 3}">
|
||||
<option value="${groupTypeC.itemCode}"
|
||||
<c:if test="${cfg.groupType==groupTypeC.itemCode}">
|
||||
selected
|
||||
</c:if>
|
||||
>
|
||||
<spring:message code="${groupTypeC.itemValue}"/>
|
||||
</option>
|
||||
</c:if>
|
||||
</c:forEach>
|
||||
</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="groupName"><spring:message code="group_name"></spring:message></form:option>
|
||||
<%-- <c:if test="${cfg.groupType==4}">
|
||||
<form:option value="asnNo"><spring:message code="asn_no"></spring:message></form:option>
|
||||
</c:if> --%>
|
||||
</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="avContUrl:config"> --%>
|
||||
<sys:delRow url="${ctx}/basics/commonGroup/form?groupType=${cfg.groupType}" id="contentTable" label="update"></sys:delRow>
|
||||
<a href="javascript:void(0);" class="btn btn-default" onclick="deletes('${ctx}/basics/commonGroup/delete?isValid=0&groupType=${cfg.groupType}')" data-toggle="tooltip" data-placement="top">
|
||||
<i class="fa fa-trash"> <spring:message code="delete"/></i>
|
||||
</a>
|
||||
<%-- <sys:delRow url="${ctx}/basics/asn/delete?isValid=-1&functionId=${cfg.functionId }" id="contentTable" label="delete"></sys:delRow> --%>
|
||||
<%-- </shiro:hasPermission> --%>
|
||||
|
||||
<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="export"></spring:message>
|
||||
<i class="fa fa-angle-down"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu pull-right" style="min-width: 110px;" >
|
||||
<li><sys:delRow url="${ctx}/basics/commonGroup/exportGroup?exType=excel" searchUrl="${ctx}/basics/commonGroup/list" id="contentTable" maxRow="5" label="cfg_excel"></sys:delRow></li>
|
||||
<li><sys:delRow url="${ctx}/basics/commonGroup/exportGroup?exType=csv" searchUrl="${ctx}/basics/commonGroup/list" id="contentTable" maxRow="5" label="cfg_csv"></sys:delRow></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<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>
|
||||
</div>
|
||||
<!-- /筛选搜索内容栏 结束-->
|
||||
</form:form>
|
||||
</div>
|
||||
<sys:message content="${message}" type="${messageType }"/>
|
||||
<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 column="group_name" ><spring:message code="group_name"/></th>
|
||||
<th column="group_type" ><spring:message code="group_type"/></th>
|
||||
<%-- <c:if test="${cfg.groupType==4}">
|
||||
<th column="asn_no" ><spring:message code="asn_no"/></th>
|
||||
</c:if> --%>
|
||||
<%-- <c:if test="${cfg.groupType==6}">
|
||||
<th><spring:message code="group_type"/></th>
|
||||
</c:if> --%>
|
||||
<th column="desc" ><spring:message code="desc"/></th>
|
||||
<th column="creator" ><spring:message code="creator"/></th>
|
||||
<th column="config_time" class="sort-column r.create_time"><spring:message code="config_time"/></th>
|
||||
<th column="editor" ><spring:message code="editor"/></th>
|
||||
<th column="edit_time" class="sort-column r.edit_time"><spring:message code="edit_time"/></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.groupId}" groupType="${cfg.groupType}" serviceGroupId="${cfg.serviceGroupId}"></td>
|
||||
<td>
|
||||
<a href="javascript:;" data-original-title="${cfg.groupName}"
|
||||
class="tooltips" data-flag="false" data-html="true" data-placement="top">
|
||||
${fns:abbr(cfg.groupName,20)}
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<%-- <c:if test="${cfg.groupType==5}">
|
||||
<spring:message code="IP GROUP"/>
|
||||
</c:if>
|
||||
<c:if test="${cfg.groupType==6}">
|
||||
<spring:message code="URL GROUP"/>
|
||||
</c:if>
|
||||
<c:if test="${cfg.groupType==7}">
|
||||
<spring:message code="Domain GROUP"/>
|
||||
</c:if>
|
||||
<c:if test="${cfg.groupType==8}">
|
||||
<spring:message code="SubscribeID GROUP"/>
|
||||
</c:if> --%>
|
||||
<c:forEach items="${fns:getDictList('GROUP_TYPE')}" var="groupTypeC">
|
||||
<c:if test="${cfg.groupType==groupTypeC.itemCode }"><spring:message code="${groupTypeC.itemValue}"/></c:if>
|
||||
</c:forEach>
|
||||
<%-- <c:choose>
|
||||
<c:when test="${cfg.groupType==6 }">
|
||||
<c:forEach items="${fns:getDictList('IR_TYPE')}" var="groupTypeC">
|
||||
<c:if test="${cfg.asnNo==groupTypeC.itemCode }"><spring:message code="${groupTypeC.itemValue}"/></c:if>
|
||||
</c:forEach>
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
<c:forEach items="${fns:getDictList('GROUP_TYPE')}" var="groupTypeC">
|
||||
<c:if test="${cfg.groupType==groupTypeC.itemCode }"><spring:message code="${groupTypeC.itemValue}"/></c:if>
|
||||
</c:forEach>
|
||||
</c:otherwise>
|
||||
</c:choose> --%>
|
||||
</td>
|
||||
<%-- <c:if test="${cfg.groupType==4}">
|
||||
<td>${cfg.asnNo}</td>
|
||||
</c:if> --%>
|
||||
<%-- <c:if test="${cfg.groupType==6}">
|
||||
<td>
|
||||
<c:forEach items="${fns:getDictList('IR_TYPE')}" var="ipTypeC">
|
||||
<c:if test="${cfg.asnNo==ipTypeC.itemCode}">
|
||||
${ipTypeC.itemValue }
|
||||
</c:if>
|
||||
</c:forEach>
|
||||
</td>
|
||||
</c:if> --%>
|
||||
<td title="${cfg.description }">${fns:abbr(cfg.description,20)}</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>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="page">${page}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
366
src/main/webapp/WEB-INF/views/basics/ipCommGroupFormAdd.jsp
Normal file
366
src/main/webapp/WEB-INF/views/basics/ipCommGroupFormAdd.jsp
Normal file
@@ -0,0 +1,366 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8"%>
|
||||
<%@ include file="/WEB-INF/include/taglib.jsp"%>
|
||||
<html>
|
||||
<head>
|
||||
<title><spring:message code="ip_group_configuration"></spring:message></title>
|
||||
<script type="text/javascript">
|
||||
var defaultIpInfo;
|
||||
$(function(){
|
||||
//$("select[name$='protocol']").parents(".form-group").addClass("hidden");
|
||||
// $("select[name$='direction']").parents(".form-group").addClass("hidden");
|
||||
defaultIpInfo=$(".ipInfo").clone();
|
||||
$(".ipAdd").click();
|
||||
$("#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++;
|
||||
});
|
||||
$(".selectpicker").selectpicker("render");
|
||||
//$(obj).addClass("hidden");
|
||||
$("select[name$='ipType']").on("change",function(){
|
||||
switchIpInfo(this);
|
||||
});
|
||||
$("select[name$='IpPattern']").on("change",function(){
|
||||
switchIpInfo(this);
|
||||
});
|
||||
}
|
||||
|
||||
//业务窗口关闭
|
||||
var delContent = function(obj,contentClassName) {
|
||||
if($("."+contentClassName).length==1){
|
||||
top.$.jBox.tip("<spring:message code='one_more'/>");
|
||||
return;
|
||||
}
|
||||
$(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("ipCommGroupCfgList[")>-1){
|
||||
var namePrefix="ipCommGroupCfgList[";
|
||||
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="ip_group_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/ip/save" method="post" class="form-horizontal">
|
||||
<input type="hidden" name="functionId" value="${_cfg.functionId}">
|
||||
<input type="hidden" id="isAreaEffective" name="isAreaEffective" value="0">
|
||||
<input type="hidden" id="compileId" name="compileId" value="0">
|
||||
<input type="hidden" id="requestId" name="requestId" value="0">
|
||||
<input type="hidden" name="isValid" value="${_cfg.isValid}">
|
||||
<input type="hidden" name="isAudit" value="${_cfg.isAudit}">
|
||||
<c:forEach items="${serviceList}" var="service">
|
||||
<input type="hidden" id="serviceId" name="serviceId" value="${service.serviceId}">
|
||||
<input type="hidden" id="action" name="action" value="${service.action}">
|
||||
</c:forEach>
|
||||
<!-- 配置域类型 -->
|
||||
<c:forEach items="${regionList}" var="region">
|
||||
<c:if test="${_cfg.functionId eq region.functionId}">
|
||||
<input type="hidden" name="cfgType" value="${region.configRegionValue}">
|
||||
<input type="hidden" name="cfgRegionCode"
|
||||
isMaat="${region.isMaat}"
|
||||
serviceType="${region.configServiceType}"
|
||||
ipPortShow="${region.configIpPortShow}"
|
||||
ipType="${region.configIpType}"
|
||||
srcIpPattern="${fn:split(region.configIpPattern,';')[0]}"
|
||||
destIpPattern="${fn:split(region.configIpPattern,';')[1]}"
|
||||
srcPortPattern="${fn:split(region.configPortPattern,';')[0]}"
|
||||
destPortPattern="${fn:split(region.configPortPattern,';')[1]}"
|
||||
direction="${region.configDirection}"
|
||||
protocol="${region.configProtocol}"
|
||||
regionType="${region.regionType}"
|
||||
value="${region.configRegionCode}">
|
||||
</c:if>
|
||||
</c:forEach>
|
||||
<div class="form-body">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-md-3"><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"><font color="red">*</font><spring:message code="ip_group"/></label>
|
||||
<div class="col-md-6">
|
||||
<select name="userRegion3" data-live-search="true" data-live-search-placeholder="search" class="selectpicker form-control required">
|
||||
<option value="${_cfg.userRegion3}"><spring:message code="select"/></option>
|
||||
<c:forEach items="${policyGroupInfos}" var="ipGroupInfo">
|
||||
<option value="${ipGroupInfo.groupId}"
|
||||
<c:if test="${_cfg.userRegion3 eq ipGroupInfo.groupId }">
|
||||
selected
|
||||
</c:if>
|
||||
>${ipGroupInfo.groupName}</option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</div>
|
||||
<div for="userRegion3"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<h4 class="form-section">
|
||||
<spring:message code="ip_group_configuration" />
|
||||
<small> <span
|
||||
class="glyphicon glyphicon-plus ipAdd"
|
||||
onClick="addContent(this,'ipInfo')" title="add"></span></small>
|
||||
</h4>
|
||||
<div class="row ipInfo boxSolid hidden disabled">
|
||||
<input type="hidden" name="ipCommGroupCfgList[0].protocolId" value="0">
|
||||
<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 protocol">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group ">
|
||||
<label class="control-label col-md-3"><font color="red">*</font>
|
||||
<spring:message code="protocol" /></label>
|
||||
<div class="col-md-6">
|
||||
<select name="ipCommGroupCfgList[0].protocol"
|
||||
class="selectpicker show-tick form-control required">
|
||||
<c:forEach items="${fns:getDictList('PROTOCOL')}" var="protocolC">
|
||||
<option value="${protocolC.itemCode}" <c:if test="${_cfg.ipCommGroupCfgList[0].protocol==protocolC.itemCode || (_cfg.ipCommGroupCfgList[0].protocol==null && protocolC.itemCode==0)}">selected</c:if>><spring:message code="${protocolC.itemValue}"/></option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</div>
|
||||
<div for="ipCommGroupCfgList[0].protocol"></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="direction" /></label>
|
||||
<div class="col-md-6">
|
||||
<select name="ipCommGroupCfgList[0].direction"
|
||||
class="selectpicker show-tick form-control required">
|
||||
<c:forEach items="${fns:getDictList('DIRECTION')}" var="directionC">
|
||||
<option value="${directionC.itemCode}" <c:if test="${_cfg.ipCommGroupCfgList[0].direction==directionC.itemCode || (_cfg.ipCommGroupCfgList[0].direction==null && directionC.itemCode==0)}">selected</c:if>><spring:message code="${directionC.itemValue}"/></option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</div>
|
||||
<div for="ipCommGroupCfgList[0].direction"></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_type"/></label>
|
||||
<div class="col-md-6">
|
||||
<select name="ipCommGroupCfgList[0].ipType" class="selectpicker show-tick form-control required">
|
||||
<c:forEach items="${fns:getDictList('IP_TYPE')}" var="ipTypeC">
|
||||
<option value="${ipTypeC.itemCode}"
|
||||
<c:if test="${_cfg.ipCommGroupCfgList[0].ipType==ipTypeC.itemCode
|
||||
|| (_cfg.ipCommGroupCfgList[0].ipType==null && ipTypeC.itemCode==4)}">
|
||||
selected
|
||||
</c:if>
|
||||
>
|
||||
<spring:message code="${ipTypeC.itemValue}"/>
|
||||
</option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</div>
|
||||
<div for="ipCommGroupCfgList[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="src_ip_pattern"/></label>
|
||||
<div class="col-md-6">
|
||||
<select name="ipCommGroupCfgList[0].srcIpPattern" class="selectpicker show-tick form-control required">
|
||||
<c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC">
|
||||
<option value="${ipPatternC.itemCode}" <c:if test="${_cfg.ipCommGroupCfgList[0].srcIpPattern==ipPatternC.itemCode || (_cfg.ipCommGroupCfgList[0].srcIpPattern==null && ipPatternC.itemCode==3)}">selected</c:if>><spring:message code="${ipPatternC.itemValue}"/></option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</div>
|
||||
<div for="ipCommGroupCfgList[0].srcIpPattern"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group ">
|
||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="client_ip"/></label>
|
||||
<div class="col-md-6">
|
||||
<input class="form-control required ipCheck" type="text" name="ipCommGroupCfgList[0].srcIpAddress" value="${_cfg.ipCommGroupCfgList[0].srcIpAddress}">
|
||||
</div>
|
||||
<div for="ipCommGroupCfgList[0].srcIpAddress"></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="src_port_pattern"/></label>
|
||||
<div class="col-md-6">
|
||||
<select name="ipCommGroupCfgList[0].srcPortPattern" class="selectpicker show-tick form-control required">
|
||||
<c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC">
|
||||
<option value="${portPatternC.itemCode}" <c:if test="${_cfg.ipCommGroupCfgList[0].srcPortPattern==portPatternC.itemCode || (_cfg.ipCommGroupCfgList[0].srcPortPattern==null && portPatternC.itemCode==1)}">selected</c:if>><spring:message code="${portPatternC.itemValue}"/></option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</div>
|
||||
<div for="ipCommGroupCfgList[0].srcPortPattern"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group ">
|
||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="client_port"/></label>
|
||||
<div class="col-md-6">
|
||||
<input class="form-control required portCheck" type="text" name="ipCommGroupCfgList[0].srcPort" value="${_cfg.ipCommGroupCfgList[0].srcPort}">
|
||||
</div>
|
||||
<div for="ipCommGroupCfgList[0].srcPort"></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="dest_ip_pattern"/></label>
|
||||
<div class="col-md-6">
|
||||
<select name="ipCommGroupCfgList[0].destIpPattern" class="selectpicker show-tick form-control required">
|
||||
<c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC">
|
||||
<option value="${ipPatternC.itemCode}" <c:if test="${_cfg.ipCommGroupCfgList[0].destIpPattern==ipPatternC.itemCode || (_cfg.ipCommGroupCfgList[0].destIpPattern==null && ipPatternC.itemCode==3)}">selected</c:if>><spring:message code="${ipPatternC.itemValue}"/></option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</div>
|
||||
<div for="ipCommGroupCfgList[0].destIpPattern"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group ">
|
||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="server_ip"/></label>
|
||||
<div class="col-md-6">
|
||||
<input class="form-control required ipCheck" type="text" name="ipCommGroupCfgList[0].destIpAddress" value="${_cfg.ipCommGroupCfgList[0].destIpAddress}">
|
||||
</div>
|
||||
<div for="ipCommGroupCfgList[0].destIpAddress"></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="dest_port_pattern"/></label>
|
||||
<div class="col-md-6">
|
||||
<select name="ipCommGroupCfgList[0].destPortPattern" class="selectpicker show-tick form-control required">
|
||||
<c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC">
|
||||
<option value="${portPatternC.itemCode}" <c:if test="${_cfg.ipCommGroupCfgList[0].destPortPattern==portPatternC.itemCode || (_cfg.ipCommGroupCfgList[0].destPortPattern==null && portPatternC.itemCode==1)}">selected</c:if>><spring:message code="${portPatternC.itemValue}"/></option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</div>
|
||||
<div for="ipCommGroupCfgList[0].destPortPattern"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group ">
|
||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="server_port"/></label>
|
||||
<div class="col-md-6">
|
||||
<input class="form-control required portCheck" type="text" name="ipCommGroupCfgList[0].destPort" value="${_cfg.ipCommGroupCfgList[0].destPort}">
|
||||
</div>
|
||||
<div for="ipCommGroupCfgList[0].destPort"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%-- <div class="row">
|
||||
<button type="button" class="btn btn-red-hollow center-block"
|
||||
onClick="more(this);" data-click-times="0">
|
||||
<spring:message code="show_more" />
|
||||
</button>
|
||||
</div> --%>
|
||||
</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">
|
||||
<c:set var="auditPermission" value="false"></c:set>
|
||||
<!-- 拥有配置新增直接生效的功能权限 -->
|
||||
<shiro:hasPermission name="save:audit:permission">
|
||||
<c:set var="auditPermission" value="true"></c:set>
|
||||
</shiro:hasPermission>
|
||||
<c:choose>
|
||||
<c:when test="${!(fns:getUser().isAdmin()) && auditPermission}">
|
||||
<button id="audit" type="submit" class="btn green">
|
||||
<spring:message code="submit" />
|
||||
</button>
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
<button id="save" type="submit" class="btn green">
|
||||
<spring:message code="submit" />
|
||||
</button>
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
<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>
|
||||
323
src/main/webapp/WEB-INF/views/basics/ipCommGroupFormUpdate.jsp
Normal file
323
src/main/webapp/WEB-INF/views/basics/ipCommGroupFormUpdate.jsp
Normal file
@@ -0,0 +1,323 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8"%>
|
||||
<%@ include file="/WEB-INF/include/taglib.jsp"%>
|
||||
<html>
|
||||
<head>
|
||||
<title><spring:message code="ip_group_configuration"></spring:message></title>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
$("select[name='protocol']").parents(".form-group").addClass("hidden");
|
||||
$("select[name='direction']").parents(".form-group").addClass("hidden");
|
||||
$("#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="ip_group_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/ip/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}">
|
||||
<c:choose>
|
||||
<c:when test="${_cfg.isAudit ne 1}">
|
||||
<input type="hidden" name="isValid" value="0">
|
||||
<input type="hidden" name="isAudit" value="0">
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
<input type="hidden" name="isValid" value="${_cfg.isValid}">
|
||||
<input type="hidden" name="isAudit" value="${_cfg.isAudit}">
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
<input type="hidden" id="regionId" name="regionId" value="${_cfg.regionId}">
|
||||
<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}">
|
||||
<input type="hidden" id="protocolId" name="protocolId" value="${_cfg.protocolId}">
|
||||
<!-- 配置域类型 -->
|
||||
<c:forEach items="${regionList}" var="region">
|
||||
<c:if test="${_cfg.functionId eq region.functionId}">
|
||||
<input type="hidden" name="cfgType" value="${region.configRegionValue}">
|
||||
<input type="hidden" name="cfgRegionCode"
|
||||
isMaat="${region.isMaat}"
|
||||
serviceType="${region.configServiceType}"
|
||||
ipPortShow="${region.configIpPortShow}"
|
||||
ipType="${region.configIpType}"
|
||||
srcIpPattern="${fn:split(region.configIpPattern,';')[0]}"
|
||||
destIpPattern="${fn:split(region.configIpPattern,';')[1]}"
|
||||
srcPortPattern="${fn:split(region.configPortPattern,';')[0]}"
|
||||
destPortPattern="${fn:split(region.configPortPattern,';')[1]}"
|
||||
direction="${region.configDirection}"
|
||||
protocol="${region.configProtocol}"
|
||||
regionType="${region.regionType}"
|
||||
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"><font color="red">*</font><spring:message code="ip_group"/></label>
|
||||
<div class="col-md-6">
|
||||
<%-- <input class="form-control required digits asnMustExists" type="text" name="${cfgName}.cfgKeywords" value="${cfg.cfgKeywords}" ctx="${ctx}"> --%>
|
||||
<select name="groupId" data-live-search="true" data-live-search-placeholder="search" class="selectpicker form-control required">
|
||||
<option value="${_cfg.groupId}"><spring:message code="select"/></option>
|
||||
<c:forEach items="${policyGroupInfos}" var="ipGroupInfo">
|
||||
<option value="${ipGroupInfo.groupId}"
|
||||
<c:if test="${_cfg.groupId eq ipGroupInfo.groupId }">
|
||||
selected
|
||||
</c:if>
|
||||
>${ipGroupInfo.groupName}</option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</div>
|
||||
<div for="groupId"></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>
|
||||
<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="protocol" /></label>
|
||||
<div class="col-md-6">
|
||||
<select name="protocol"
|
||||
class="selectpicker show-tick form-control required">
|
||||
<c:forEach items="${fns:getDictList('PROTOCOL')}" var="protocolC">
|
||||
<option value="${protocolC.itemCode}" <c:if test="${_cfg.protocol==protocolC.itemCode || (_cfg.protocol==null && protocolC.itemCode==0)}">selected</c:if>><spring:message code="${protocolC.itemValue}"/></option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</div>
|
||||
<div for="protocol"></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="direction" /></label>
|
||||
<div class="col-md-6">
|
||||
<select name="direction"
|
||||
class="selectpicker show-tick form-control required">
|
||||
<c:forEach items="${fns:getDictList('DIRECTION')}" var="directionC">
|
||||
<option value="${directionC.itemCode}" <c:if test="${_cfg.direction==directionC.itemCode || (_cfg.direction==null && directionC.itemCode==0)}">selected</c:if>><spring:message code="${directionC.itemValue}"/></option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</div>
|
||||
<div for="direction"></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_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="src_ip_pattern"/></label>
|
||||
<div class="col-md-6">
|
||||
<select name="srcIpPattern" class="selectpicker show-tick form-control required">
|
||||
<c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC">
|
||||
<option value="${ipPatternC.itemCode}" <c:if test="${_cfg.srcIpPattern==ipPatternC.itemCode || (_cfg.srcIpPattern==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="client_ip"/></label>
|
||||
<div class="col-md-6">
|
||||
<input class="form-control required ipCheck" type="text" name="srcIpAddress" value="${_cfg.srcIpAddress}">
|
||||
</div>
|
||||
<div for="srcIpAddress"></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="src_port_pattern"/></label>
|
||||
<div class="col-md-6">
|
||||
<select name="srcPortPattern" class="selectpicker show-tick form-control required">
|
||||
<c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC">
|
||||
<option value="${portPatternC.itemCode}" <c:if test="${_cfg.srcPortPattern==portPatternC.itemCode || (_cfg.srcPortPattern==null && portPatternC.itemCode==1)}">selected</c:if>><spring:message code="${portPatternC.itemValue}"/></option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</div>
|
||||
<div for="srcPortPattern"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group ">
|
||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="client_port"/></label>
|
||||
<div class="col-md-6">
|
||||
<input class="form-control required portCheck" type="text" name="srcPort" value="${_cfg.srcPort}">
|
||||
</div>
|
||||
<div for="srcPort"></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="dest_ip_pattern"/></label>
|
||||
<div class="col-md-6">
|
||||
<select name="destIpPattern" class="selectpicker show-tick form-control required">
|
||||
<c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC">
|
||||
<option value="${ipPatternC.itemCode}" <c:if test="${_cfg.destIpPattern==ipPatternC.itemCode || (_cfg.destIpPattern==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="server_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">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="dest_port_pattern"/></label>
|
||||
<div class="col-md-6">
|
||||
<select name="destPortPattern" class="selectpicker show-tick form-control required">
|
||||
<c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC">
|
||||
<option value="${portPatternC.itemCode}" <c:if test="${_cfg.destPortPattern==portPatternC.itemCode || (_cfg.destPortPattern==null && portPatternC.itemCode==1)}">selected</c:if>><spring:message code="${portPatternC.itemValue}"/></option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</div>
|
||||
<div for="destportPattern"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group ">
|
||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="server_port"/></label>
|
||||
<div class="col-md-6">
|
||||
<input class="form-control required portCheck" type="text" name="destPort" value="${_cfg.destPort}">
|
||||
</div>
|
||||
<div for="destPort"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</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">
|
||||
<c:set var="auditPermission" value="false"></c:set>
|
||||
<!-- 拥有配置新增直接生效的功能权限 -->
|
||||
<shiro:hasPermission name="save:audit:permission">
|
||||
<c:set var="auditPermission" value="true"></c:set>
|
||||
</shiro:hasPermission>
|
||||
<c:choose>
|
||||
<c:when test="${!(fns:getUser().isAdmin()) && auditPermission}">
|
||||
<button id="audit" type="submit" class="btn green">
|
||||
<spring:message code="submit" />
|
||||
</button>
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
<button id="save" type="submit" class="btn green">
|
||||
<spring:message code="submit" />
|
||||
</button>
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
<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>
|
||||
361
src/main/webapp/WEB-INF/views/basics/ipCommonGroupCfgList.jsp
Normal file
361
src/main/webapp/WEB-INF/views/basics/ipCommonGroupCfgList.jsp
Normal file
@@ -0,0 +1,361 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8"%>
|
||||
<%@ include file="/WEB-INF/include/taglib.jsp"%>
|
||||
<html>
|
||||
<head>
|
||||
<title><spring:message code="ip_group_configuration"></spring:message></title>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
//搜索框提示语初始化
|
||||
if("${cfg.cfgDesc}"){
|
||||
$("#intype").val("${cfg.cfgDesc}");
|
||||
}else if("${cfg.destIpAddress}"){
|
||||
$("#intype").val("${cfg.destIpAddress}");
|
||||
}else{
|
||||
$("#intype").attr("placeholder","<spring:message code='input'/> "+$("#seltype").find("option:selected").text());
|
||||
}
|
||||
$("#seltype").change(function(){
|
||||
$("#intype").attr("placeholder","<spring:message code='input'/> "+$(this).find("option:selected").text());
|
||||
});
|
||||
//筛选功能初始化
|
||||
filterActionInit();
|
||||
$("#isAudit").change(function(){
|
||||
page();
|
||||
});
|
||||
//reset
|
||||
$("#resetBtn").on("click",function(){
|
||||
$("select.selectpicker").each(function(){
|
||||
$(this).selectpicker('val',$(this).find('option:first').val());
|
||||
$(this).find("option").attr("selected",false);
|
||||
$(this).find("option:first").attr("selected",true);
|
||||
});
|
||||
$(".Wdate").attr("value",'');
|
||||
$("#description").attr("value",'');
|
||||
$("#searchForm")[0].reset();
|
||||
});
|
||||
|
||||
if($("#exportType").val() != null && $("#exportType").val() != ""){
|
||||
if($("#intype").val() != null && $("#intype").val() != ""){
|
||||
$("#exportValue").val($("#intype").val());
|
||||
}
|
||||
}
|
||||
//修改导入Form表单action
|
||||
var importPath="/basics/ip/list?functionId=${cfg.functionId}"
|
||||
$("#importForm1").attr("action","${ctx}/basics/ip/import?importPath="+importPath);
|
||||
ajaxGroupName();
|
||||
});
|
||||
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;
|
||||
}
|
||||
}
|
||||
var ajaxGroupName=function(){
|
||||
var groupIds=[];
|
||||
$(".group").each(function(){
|
||||
if(groupIds.join(",").indexOf($(this).text().trim())==-1){
|
||||
groupIds.push($(this).text().trim());
|
||||
}
|
||||
});
|
||||
$.ajax({
|
||||
type:'post',
|
||||
timeout:10000,//超时时间设置,查询接口时间过长超时
|
||||
url:'${ctx}/basics/ip/ajaxGetGroups',
|
||||
data:{"groupIds":groupIds.join(',')},
|
||||
dataType:'json',
|
||||
async:true,
|
||||
success:function(data,textStatus){//处理返回结果
|
||||
if(textStatus=="success"){
|
||||
$(".group").each(function(){
|
||||
var text=$(this);
|
||||
$.each(data,function(key,values){
|
||||
if(key==$(text).text()){
|
||||
$(text).html(values);
|
||||
}
|
||||
});
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="page-content">
|
||||
<div class="theme-panel hidden-xs hidden-sm">
|
||||
<shiro:hasPermission name="ip:common:config">
|
||||
<button type="button" class="btn btn-primary"
|
||||
onClick="javascript:window.location='${ctx}/basics/ip/addForm?functionId=${cfg.functionId}'">
|
||||
<i class="fa fa-plus"></i>
|
||||
<spring:message code="add"></spring:message>
|
||||
</button>
|
||||
<c:set var="serviceImport" value="false"></c:set>
|
||||
<c:forEach items="${serviceList}" var="service" >
|
||||
<c:if test="${(cfg.functionId eq service.functionId) && service.isImport eq 1}">
|
||||
<c:set var="serviceImport" value="true"></c:set>
|
||||
</c:if>
|
||||
</c:forEach>
|
||||
<c:if test="${serviceImport eq 'true'}">
|
||||
<button type="button" class="btn btn-primary import" >
|
||||
<i class="fa fa-plus"></i>
|
||||
<spring:message code="import"></spring:message>
|
||||
</button>
|
||||
</c:if>
|
||||
</shiro:hasPermission>
|
||||
</div>
|
||||
|
||||
<h3 class="page-title">
|
||||
<spring:message code="ip_group_configuration"></spring:message>
|
||||
</h3>
|
||||
<h5 class="page-header"></h5>
|
||||
<div class="col-md-12">
|
||||
<div class="portlet">
|
||||
<div class="portlet-body">
|
||||
<div class="row" >
|
||||
<form:form id="searchForm" modelAttribute="cfg" action="${ctx}/basics/ip/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="exportType" type="hidden" value="${cfg.seltype}"/>
|
||||
<input id="exportValue" type="hidden" value=""/>
|
||||
<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
|
||||
<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
|
||||
<sys:tableSort id="orderBy" name="orderBy" value="${page.orderBy}"
|
||||
callback="page();" />
|
||||
<!-- 筛选按钮展开状态-->
|
||||
<input id="isFilterAction" name="isFilterAction" type="hidden" value="${cfg.isFilterAction }"/>
|
||||
<!-- 搜索内容与操作按钮栏 -->
|
||||
<div class="col-md-12">
|
||||
<%-- <div class="pull-left">
|
||||
<c:set var="state"><spring:message code='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="isValid"><spring:message code="valid_identifier"></spring:message></form:option> --%>
|
||||
</form:select>
|
||||
</div>
|
||||
|
||||
<input id="intype" class="form-control input-medium" type="text" value="">
|
||||
<div class="input-group-btn">
|
||||
<form:select path="isValid" class="selectpicker select2 input-small" >
|
||||
<form:option value=""><spring:message code="select"/></form:option>
|
||||
<form:option value="1"><spring:message code="yes"/></form:option>
|
||||
<form:option value="0"><spring:message code="no"/></form:option>
|
||||
</form:select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="pull-left">
|
||||
<form:select path="groupId" class="selectpicker select2 input-small" data-live-search="true" data-live-search-placeholder="search">
|
||||
<form:option value=""><spring:message code='ip_group'/></form:option>
|
||||
<c:forEach items="${policyGroupInfos}" var="policyGroup">
|
||||
<form:option value="${policyGroup.groupId}"><spring:message code='${policyGroup.groupName}'/></form:option>
|
||||
</c:forEach>
|
||||
</form:select>
|
||||
</div>
|
||||
<div class="pull-left">
|
||||
<button type="button" class="btn blue" onClick="return page()"> <i class="fa fa-search"></i> <spring:message code="search"/> </button>
|
||||
<button type="button" class="btn btn-default" id="resetBtn"> <i class="fa fa-refresh"></i> <spring:message code="reset"/> </button>
|
||||
<button type="button" class="btn btn-default" id="filter-btn"> <spring:message code="filter"/> <i class="fa fa-angle-double-down"></i></button>
|
||||
</div>
|
||||
<div class="pull-right">
|
||||
<shiro:hasPermission name="ip:common:config">
|
||||
<sys:delRow url="${ctx}/basics/ip/updateForm?functionId=${cfg.functionId}" id="contentTable" label="update"></sys:delRow>
|
||||
<sys:delRow url="${ctx}/basics/ip/delete?isValid=-1&functionId=${cfg.functionId }" id="contentTable" label="delete"></sys:delRow>
|
||||
</shiro:hasPermission>
|
||||
|
||||
<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="export"></spring:message>
|
||||
<i class="fa fa-angle-down"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu pull-right" style="min-width: 110px;" >
|
||||
<li><sys:delRow url="${ctx}/basics/ip/exportIpComm?functionId=${cfg.functionId }&exType=excel" searchUrl="${ctx}/basics/ip/list?functionId=${cfg.functionId}" id="contentTable" maxRow="5" label="cfg_excel"></sys:delRow></li>
|
||||
<li><sys:delRow url="${ctx}/basics/ip/exportIpComm?functionId=${cfg.functionId }&exType=csv" searchUrl="${ctx}/basics/ip/list?functionId=${cfg.functionId}" id="contentTable" maxRow="5" label="cfg_csv"></sys:delRow></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<%-- <shiro:hasPermission name="ip:common:config">
|
||||
<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/ip/audit?isAudit=1&isValid=1&functionId=${cfg.functionId }" id="contentTable" label="approved"></sys:delRow></li>
|
||||
<li><sys:delRow url="${ctx}/basics/ip/audit?isAudit=2&isValid=0&functionId=${cfg.functionId }" id="contentTable" label="unapproved"></sys:delRow></li>
|
||||
<li><sys:delRow url="${ctx}/basics/ip/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>
|
||||
<sys:message content="${message}" type="${messageType }"/>
|
||||
<div class="table-responsive">
|
||||
<table id="contentTable" class="table table-striped table-bordered table-condensed text-nowrap">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><input type="checkbox" class="i-checks" id="checkAll"></th>
|
||||
<%-- <th class="sort-column r.compile_id" style="display: none;" column="cfg_id" ><spring:message code="cfg_id"/></th> --%>
|
||||
<%-- <th><spring:message code="seq"/></th> --%>
|
||||
<th column="config_describe" ><spring:message code="config_describe"/></th>
|
||||
<%-- <th><spring:message code="group"/></th> --%>
|
||||
<th class="sort-column r.user_region3" column="userregion3" ><spring:message code="ip_group"/></th>
|
||||
<th column="ip_type" ><spring:message code="ip_type"/></th>
|
||||
<th column="IP" ><spring:message code="IP"/></th>
|
||||
<th column="ip_pattern" ><spring:message code="ip_pattern"/></th>
|
||||
<%-- <th><spring:message code="is_audit"/></th> --%>
|
||||
<%-- <th><spring:message code="log_total"/></th> --%>
|
||||
<th column="valid_identifier" ><spring:message code="valid_identifier"/></th>
|
||||
<th column="creator" ><spring:message code="creator"/></th>
|
||||
<th column="config_time" class="sort-column r.create_time"><spring:message code="config_time"/></th>
|
||||
<th column="editor" ><spring:message code="editor"/></th>
|
||||
<th column="edit_time" 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}" value="${cfg.isAudit}"></td>
|
||||
<%-- <td>${cfg.compileId }</td> --%>
|
||||
<td>${cfg.cfgDesc }</td>
|
||||
<td class="group">${cfg.groupId}</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.destIpPattern==ipPatternC.itemCode}"><spring:message code="${ipPatternC.itemValue }"/></c:if>
|
||||
</c:forEach>
|
||||
</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>
|
||||
<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>${cfg.creatorName }</td>
|
||||
<td><fmt:formatDate value="${cfg.createTime }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
|
||||
<td>${cfg.editorName }</td>
|
||||
<td><fmt:formatDate value="${cfg.editTime }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
|
||||
<%-- <td>${cfg.auditorName }</td>
|
||||
<td><fmt:formatDate value="${cfg.auditTime }" pattern="yyyy-MM-dd HH:mm:ss"/></td> --%>
|
||||
|
||||
</tr>
|
||||
</c:forEach>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="page">${page}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<c:set var="importPath" value="/basics/ip/list?functionId=${cfg.functionId}"/>
|
||||
<!-- 模板导入,start -->
|
||||
<%@include file="/WEB-INF/include/excel/importModal.jsp" %>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user