Merge branch 'develop' of http://192.168.10.125/k18_web/NFS.git into
develop Conflicts: src/main/resources/messages/message_en.properties src/main/resources/messages/message_ru.properties src/main/resources/messages/message_zh_CN.properties 关键字日志转http url配置功能完成
This commit is contained in:
@@ -35,6 +35,17 @@ public class SysLog extends BaseEntity<SysLog>{
|
||||
private Long consumerTime;//消费时间
|
||||
|
||||
private Integer functionId;//功能菜单id
|
||||
private String compileIds;//配置编译id
|
||||
private String cfgIds;//界面配置id
|
||||
private Integer compileId;//配置编译id
|
||||
private Integer cfgId;//界面配置id
|
||||
private String methodName;//功能方法名称
|
||||
private Integer auditState;//审核状态
|
||||
private Integer action;//GK动作
|
||||
private String operation;//操作说明
|
||||
private String functionName;//功能名称
|
||||
private Integer isValid;//配置有效状态
|
||||
|
||||
|
||||
public Long getConsumerTime() {
|
||||
return consumerTime;
|
||||
@@ -165,6 +176,86 @@ public class SysLog extends BaseEntity<SysLog>{
|
||||
this.functionId = functionId;
|
||||
}
|
||||
|
||||
public Integer getCompileId() {
|
||||
return compileId;
|
||||
}
|
||||
|
||||
public void setCompileId(Integer compileId) {
|
||||
this.compileId = compileId;
|
||||
}
|
||||
|
||||
public String getMethodName() {
|
||||
return methodName;
|
||||
}
|
||||
|
||||
public void setMethodName(String methodName) {
|
||||
this.methodName = methodName;
|
||||
}
|
||||
|
||||
public Integer getAuditState() {
|
||||
return auditState;
|
||||
}
|
||||
|
||||
public void setAuditState(Integer auditState) {
|
||||
this.auditState = auditState;
|
||||
}
|
||||
|
||||
public Integer getAction() {
|
||||
return action;
|
||||
}
|
||||
|
||||
public void setAction(Integer action) {
|
||||
this.action = action;
|
||||
}
|
||||
|
||||
public String getCompileIds() {
|
||||
return compileIds;
|
||||
}
|
||||
|
||||
public void setCompileIds(String compileIds) {
|
||||
this.compileIds = compileIds;
|
||||
}
|
||||
|
||||
public String getCfgIds() {
|
||||
return cfgIds;
|
||||
}
|
||||
|
||||
public void setCfgIds(String cfgIds) {
|
||||
this.cfgIds = cfgIds;
|
||||
}
|
||||
|
||||
public Integer getCfgId() {
|
||||
return cfgId;
|
||||
}
|
||||
|
||||
public void setCfgId(Integer cfgId) {
|
||||
this.cfgId = cfgId;
|
||||
}
|
||||
|
||||
public String getOperation() {
|
||||
return operation;
|
||||
}
|
||||
|
||||
public void setOperation(String operation) {
|
||||
this.operation = operation;
|
||||
}
|
||||
|
||||
public String getFunctionName() {
|
||||
return functionName;
|
||||
}
|
||||
|
||||
public void setFunctionName(String functionName) {
|
||||
this.functionName = functionName;
|
||||
}
|
||||
|
||||
public Integer getIsValid() {
|
||||
return isValid;
|
||||
}
|
||||
|
||||
public void setIsValid(Integer isValid) {
|
||||
this.isValid = isValid;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置请求参数
|
||||
* @param paramMap
|
||||
|
||||
@@ -30,7 +30,7 @@ public class AsnIpCfg extends BaseCfg<AsnIpCfg> {
|
||||
private String destPort;
|
||||
@ExcelField(title="group",sort=2)
|
||||
private String asnIpGroupName;//asn组名
|
||||
private Integer asnIpGroup;//asn号
|
||||
private Integer asnIpGroup;//asn组号
|
||||
/**
|
||||
* 方向
|
||||
*/
|
||||
|
||||
@@ -83,7 +83,7 @@ public class BaseCfg<T> extends BaseEntity<T> implements Cloneable{
|
||||
/**
|
||||
* 是否审核
|
||||
*/
|
||||
@ExcelField(title="is_audit",dictType="AUDIT_STATUS",sort=100)
|
||||
@ExcelField(title="is_audit",dictType="AUDIT_STATUS",sort=25)
|
||||
protected Integer isAudit;
|
||||
/**
|
||||
* 创建人员
|
||||
|
||||
@@ -45,11 +45,11 @@ public class BaseIpCfg extends BaseCfg<BaseIpCfg> {
|
||||
@SerializedName("ipType")
|
||||
@ExcelField(title="ip_type",dictType="IP_TYPE",sort=3)
|
||||
protected Integer ipType;
|
||||
@ExcelField(title="ip_pattern",dictType="IP_PATTERN",sort=4)
|
||||
@ExcelField(title="ip_pattern",dictType="IP_PATTERN",sort=6)
|
||||
protected Integer ipPattern;
|
||||
@ExcelField(title="client_ip",sort=5)
|
||||
protected String srcIpAddress;
|
||||
@ExcelField(title="server_ip",sort=6)
|
||||
@ExcelField(title="server_ip",sort=4)
|
||||
protected String destIpAddress;
|
||||
@ExcelField(title="port_pattern",dictType="PORT_PATTERN",sort=7)
|
||||
protected Integer portPattern;
|
||||
@@ -65,6 +65,14 @@ public class BaseIpCfg extends BaseCfg<BaseIpCfg> {
|
||||
|
||||
private List<NtcSubscribeIdCfg> ntcSubscribeIdCfgList;
|
||||
private NtcSubscribeIdCfg ntcSubscribeIdCfg;
|
||||
private Integer asnIpGroup;//asn组号,仅用于copy属性使用
|
||||
|
||||
public Integer getAsnIpGroup() {
|
||||
return asnIpGroup;
|
||||
}
|
||||
public void setAsnIpGroup(Integer asnIpGroup) {
|
||||
this.asnIpGroup = asnIpGroup;
|
||||
}
|
||||
/**
|
||||
* irType
|
||||
* @return irType
|
||||
|
||||
@@ -82,6 +82,9 @@ public class BaseStringCfg<T> extends BaseCfg<T> {
|
||||
private NtcSubscribeIdCfg ntcSubscribeIdCfg;
|
||||
private IpPortCfg ipPort;
|
||||
|
||||
//http url来源于http关键字的标识
|
||||
private Integer sourceCompileId;
|
||||
|
||||
|
||||
public IpPortCfg getIpPort() {
|
||||
return ipPort;
|
||||
@@ -190,7 +193,12 @@ public class BaseStringCfg<T> extends BaseCfg<T> {
|
||||
public void setIsCaseInsenstive(Integer isCaseInsenstive) {
|
||||
this.isCaseInsenstive =isCaseInsenstive;
|
||||
}
|
||||
|
||||
public Integer getSourceCompileId() {
|
||||
return sourceCompileId;
|
||||
}
|
||||
public void setSourceCompileId(Integer sourceCompileId) {
|
||||
this.sourceCompileId = sourceCompileId;
|
||||
}
|
||||
public static List<BaseStringCfg> replaceBaseKeyList(List<BaseStringCfg> list){
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
BaseStringCfg base=(BaseStringCfg)list.get(i);
|
||||
|
||||
@@ -71,6 +71,14 @@ public class CfgIndexInfo extends BaseCfg<CfgIndexInfo> {
|
||||
private List<P2pHashCfg> p2pHashList;
|
||||
private List<P2pKeywordCfg> p2pKeywordList;
|
||||
|
||||
private Integer sourceCompileId;
|
||||
public Integer getSourceCompileId() {
|
||||
return sourceCompileId;
|
||||
}
|
||||
public void setSourceCompileId(Integer sourceCompileId) {
|
||||
this.sourceCompileId = sourceCompileId;
|
||||
}
|
||||
|
||||
public AvContUrlCfg getAvContUrlCfg() {
|
||||
return avContUrlCfg;
|
||||
}
|
||||
|
||||
@@ -23,11 +23,11 @@ public class DdosIpCfg extends BaseIpCfg {
|
||||
*/
|
||||
private static final long serialVersionUID = -5446903784736960824L;
|
||||
private String indexTable="ddos_ip_cfg";
|
||||
@ExcelField(title="antiddos_protocol",sort=41)
|
||||
@ExcelField(title="antiddos_protocol",sort=22)
|
||||
private String antiddosProtocol;//目前支持TCP_SYN, DNS, NTP,
|
||||
@ExcelField(title="bps_threadshold",sort=42)
|
||||
@ExcelField(title="bps_threadshold",sort=23)
|
||||
private Long bpsThreadshold;// 即DDoS攻击保护动作触发阈值,每秒Bit数和每秒包数
|
||||
@ExcelField(title="pps_threadshold",sort=43)
|
||||
@ExcelField(title="pps_threadshold",sort=24)
|
||||
private Long ppsThreadshold;
|
||||
|
||||
public String getAntiddosProtocol() {
|
||||
|
||||
@@ -14,7 +14,7 @@ public class AsnIpTemplate {
|
||||
*/
|
||||
|
||||
private String cfgDesc;
|
||||
private String asnNo;
|
||||
private String userRegion1;
|
||||
private String destIpAddress;
|
||||
|
||||
@ExcelField(title="config_describe",align=2,sort=1)
|
||||
@@ -25,16 +25,17 @@ public class AsnIpTemplate {
|
||||
this.cfgDesc = cfgDesc;
|
||||
}
|
||||
@ExcelField(title="asn_no",align=2,sort=11)
|
||||
public String getAsnNo() {
|
||||
return asnNo;
|
||||
public String getUserRegion1() {
|
||||
return userRegion1;
|
||||
}
|
||||
public void setAsnNo(String asnNo) {
|
||||
this.asnNo = asnNo;
|
||||
public void setUserRegion1(String userRegion1) {
|
||||
this.userRegion1 = userRegion1;
|
||||
}
|
||||
@ExcelField(title="server_ip",align=2,sort=12)
|
||||
public String getDestIpAddress() {
|
||||
return destIpAddress;
|
||||
}
|
||||
|
||||
public void setDestIpAddress(String destIpAddress) {
|
||||
this.destIpAddress = destIpAddress;
|
||||
}
|
||||
|
||||
@@ -12,10 +12,13 @@ import com.nis.domain.SysDataDictionaryItem;
|
||||
import com.nis.domain.SysDataDictionaryName;
|
||||
import com.nis.domain.basics.ServiceDictInfo;
|
||||
import com.nis.domain.basics.SysDictInfo;
|
||||
import com.nis.domain.configuration.BaseStringCfg;
|
||||
import com.nis.domain.configuration.CfgIndexInfo;
|
||||
import com.nis.domain.specific.SpecificServiceCfg;
|
||||
import com.nis.web.dao.SysDictDao;
|
||||
import com.nis.web.dao.basics.ServiceDictInfoDao;
|
||||
import com.nis.web.dao.basics.SysDictInfoDao;
|
||||
import com.nis.web.dao.configuration.WebsiteCfgDao;
|
||||
import com.nis.web.dao.specific.SpecificServiceCfgDao;
|
||||
import com.nis.web.service.SpringContextHolder;
|
||||
|
||||
@@ -33,6 +36,7 @@ public class ConfigDictUtils {
|
||||
private final static ServiceDictInfoDao serviceDictInfoDao = SpringContextHolder.getBean(ServiceDictInfoDao.class);
|
||||
private final static SysDictInfoDao sysDictInfoDao = SpringContextHolder.getBean(SysDictInfoDao.class);
|
||||
private final static SpecificServiceCfgDao specificServiceCfgDao = SpringContextHolder.getBean(SpecificServiceCfgDao.class);
|
||||
private final static WebsiteCfgDao websiteCfgDao = SpringContextHolder.getBean(WebsiteCfgDao.class);
|
||||
|
||||
/**
|
||||
* 根据主键查询配置详情
|
||||
@@ -149,5 +153,28 @@ public class ConfigDictUtils {
|
||||
}
|
||||
return intArr;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据compileId获取配置内容
|
||||
* @param compileId
|
||||
* @return
|
||||
*/
|
||||
public static String getHttpBodyKeyword(Integer compileId ) {
|
||||
String httpBodyKeyword="";
|
||||
try {
|
||||
if(!StringUtil.isEmpty(compileId)){
|
||||
CfgIndexInfo entity=new CfgIndexInfo();
|
||||
entity.setCompileId(compileId);
|
||||
List httpBodyList=websiteCfgDao.getHttpBodyList(entity);
|
||||
if(!StringUtil.isEmpty(httpBodyList)){
|
||||
BaseStringCfg cfg=(BaseStringCfg)httpBodyList.get(0);
|
||||
httpBodyKeyword=StringUtil.isEmpty(cfg.getCfgKeywords()) ? "":cfg.getCfgKeywords()
|
||||
.replace(Constants.KEYWORD_EXPR, " ");
|
||||
}
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return httpBodyKeyword;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,7 +67,26 @@ public class LogUtils {
|
||||
}else{
|
||||
log.setFunctionId(Integer.parseInt(request.getParameter("functionId")));
|
||||
}
|
||||
if(!StringUtil.isEmpty(request.getParameter("compileId"))){
|
||||
log.setCompileIds(request.getParameter("compileId"));
|
||||
}else{
|
||||
log.setCompileIds(request.getParameter("compileIds"));
|
||||
}
|
||||
|
||||
if(!StringUtil.isEmpty(request.getParameter("cfgId"))){
|
||||
log.setCfgIds(request.getParameter("cfgId"));
|
||||
}else{
|
||||
log.setCfgIds(request.getParameter("ids"));
|
||||
}
|
||||
if(!StringUtil.isEmpty(request.getParameter("isAudit"))){
|
||||
log.setAuditState(Integer.parseInt(request.getParameter("isAudit")));
|
||||
}
|
||||
if(!StringUtil.isEmpty(request.getParameter("action"))){
|
||||
log.setAction(Integer.parseInt(request.getParameter("action")));
|
||||
}
|
||||
if(!(StringUtil.isEmpty(request.getParameter("isValid")))){
|
||||
log.setIsValid(Integer.parseInt(request.getParameter("isValid")));
|
||||
}
|
||||
// 异步保存日志
|
||||
new SaveLogThread(log, handler, ex).start();
|
||||
}
|
||||
@@ -96,6 +115,7 @@ public class LogUtils {
|
||||
String permission = "";
|
||||
if (handler instanceof HandlerMethod){
|
||||
Method m = ((HandlerMethod)handler).getMethod();
|
||||
log.setMethodName(m.getName());
|
||||
RequiresPermissions rp = m.getAnnotation(RequiresPermissions.class);
|
||||
permission = (rp != null ? StringUtils.join(rp.value(), ",") : "");
|
||||
}
|
||||
@@ -104,11 +124,44 @@ public class LogUtils {
|
||||
}
|
||||
// 如果有异常,设置异常信息
|
||||
log.setException(Exceptions.getStackTraceAsString(ex));
|
||||
// 如果无标题并无异常日志,则不保存信息
|
||||
if (StringUtils.isBlank(log.getTitle()) && StringUtils.isBlank(log.getException())){
|
||||
// 如果无标题并无异常日志并且无具体的功能id(非业务配置的操作),则不保存信息
|
||||
if ((StringUtils.isBlank(log.getTitle()) && StringUtils.isBlank(log.getException()) && (log.getFunctionId()==null || log.getFunctionId()==0))){
|
||||
return;
|
||||
}
|
||||
// 保存日志信息
|
||||
if(log.getFunctionId()!=null
|
||||
&& log.getFunctionId()!=0 ){
|
||||
String functionName = DictUtils.getDictLabel("SYS_SERVICE_FUNCTION", log.getFunctionId().toString());
|
||||
if(!StringUtil.isEmpty(log.getMethodName())){
|
||||
String operation = DictUtils.getDictLabel("SYS_SERVICE_OPERATION", log.getMethodName());
|
||||
if("saveOrUpdate".equals(operation)){
|
||||
if (log.getCfgId()!=null || log.getCfgIds()!=null || log.getCompileId()!=null || log.getCompileIds()!=null){
|
||||
log.setOperation("edit");
|
||||
}else{
|
||||
log.setOperation("add");
|
||||
}
|
||||
}else{
|
||||
log.setOperation(operation);
|
||||
}
|
||||
}
|
||||
if(log.getOperation()!=null && !"默认".equals(log.getOperation()) && !"默认".equals(functionName)){
|
||||
log.setFunctionName(functionName);
|
||||
if(!StringUtil.isEmpty(log.getCompileIds())){
|
||||
for(String compileId:StringUtils.split(log.getCompileIds(),",")){
|
||||
log.setCompileId(Integer.parseInt(compileId));
|
||||
logDao.insertCfgOperationLog(log);
|
||||
}
|
||||
}else if(!StringUtil.isEmpty(log.getCfgIds())){
|
||||
for(String cfgId:StringUtils.split(log.getCfgIds(),",")){
|
||||
log.setCfgId(Integer.parseInt(cfgId));
|
||||
logDao.insertCfgOperationLog(log);
|
||||
}
|
||||
}else{
|
||||
logDao.insertCfgOperationLog(log);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
logDao.insert(log);
|
||||
}
|
||||
}
|
||||
@@ -202,7 +255,6 @@ public class LogUtils {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CacheUtils.put(CACHE_MENU_NAME_PATH_MAP, menuMap);
|
||||
CacheUtils.put(CACHE_MENU_NAME_PATH_MAP2, menuMap2);
|
||||
}
|
||||
@@ -240,7 +292,6 @@ public class LogUtils {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
System.out.println(menuNamePath);
|
||||
return menuNamePath;
|
||||
}
|
||||
|
||||
|
||||
@@ -1821,7 +1821,23 @@ public class ExportExcel {
|
||||
if(!StringUtil.isEmpty(titleStr)){
|
||||
//去掉不需要展示的header
|
||||
if(!(noExportField.indexOf(","+titleStr+",") > -1)){
|
||||
titleStr=msgProp.getProperty(titleStr)==null?titleStr:msgProp.getProperty(titleStr);
|
||||
//需要替换的header
|
||||
boolean flag=true;
|
||||
if(noExportField.contains("&")){
|
||||
String replaceField=noExportField.substring(noExportField.indexOf("&")+1);
|
||||
String[] replaceStr=replaceField.split("-");
|
||||
for (int i = 0; i < replaceStr.length; i++) {
|
||||
String [] fields=replaceStr[i].split(":");
|
||||
if(fields[0].equals(titleStr)){
|
||||
titleStr=msgProp.getProperty(fields[1]);
|
||||
flag=false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(flag){
|
||||
titleStr=msgProp.getProperty(titleStr)==null?titleStr:msgProp.getProperty(titleStr);
|
||||
}
|
||||
headerList.add(titleStr);
|
||||
commentList.add(commentStr);
|
||||
}
|
||||
|
||||
@@ -66,6 +66,7 @@ import com.nis.domain.configuration.template.IpRateLimitTemplate;
|
||||
import com.nis.domain.configuration.template.StringAllTemplate;
|
||||
import com.nis.domain.log.BaseLogEntity;
|
||||
import com.nis.domain.log.SearchReport;
|
||||
import com.nis.domain.specific.ConfigGroupInfo;
|
||||
import com.nis.domain.specific.SpecificServiceCfg;
|
||||
import com.nis.exceptions.MaatConvertException;
|
||||
import com.nis.util.Configurations;
|
||||
@@ -1388,6 +1389,35 @@ public class BaseController {
|
||||
+ ";");
|
||||
}
|
||||
}
|
||||
if (regionDict.getFunctionId().equals(600)) {//asn
|
||||
//asn id
|
||||
String userRegion1 = baseIpCfg.getUserRegion1();
|
||||
if(StringUtils.isBlank(userRegion1)) {
|
||||
errInfo.append(
|
||||
String.format(prop.getProperty("can_not_null"), prop.getProperty("asn_no"))
|
||||
+ ";");
|
||||
}else {
|
||||
try {
|
||||
Integer.parseInt(userRegion1);
|
||||
/*ConfigGroupInfo configGroupInfo=asnIpCfgService.getConfigGroupInfoByAsnNo(asnNo);
|
||||
if(configGroupInfo==null) {//不存在则新增
|
||||
PolicyGroupInfo info=new PolicyGroupInfo();
|
||||
info.setAsnNo(asnNo);
|
||||
info.setDescription("Auto generated");
|
||||
info.setGroupName(baseIpCfg.getCfgDesc()+(i+1));
|
||||
info.setGroupType(4);
|
||||
policyGroupInfoService.saveOrUpdate(info);
|
||||
configGroupInfo=asnIpCfgService.getConfigGroupInfoByAsnNo(asnNo);
|
||||
}
|
||||
baseIpCfg.setAsnIpGroup(configGroupInfo.getGroupId());*/
|
||||
}catch (Exception e) {
|
||||
// TODO: handle exception
|
||||
errInfo.append(
|
||||
String.format(prop.getProperty("not_number"), prop.getProperty("asn_no"))
|
||||
+ ";");
|
||||
}
|
||||
}
|
||||
}
|
||||
if (regionDict.getRegionType().equals(1)) {
|
||||
// 校验必填的IP,端口
|
||||
/*
|
||||
@@ -2032,10 +2062,18 @@ public class BaseController {
|
||||
Properties prop = this.getMsgProp();
|
||||
String prefix = ip.split("-")[0];
|
||||
String subfix = ip.split("-")[1];
|
||||
if (Integer.parseInt(prefix.split("\\.")[0]) < 192 || Integer.parseInt(prefix.split("\\.")[0]) > 223
|
||||
|| Integer.parseInt(subfix.split("\\.")[0]) < 192 || Integer.parseInt(subfix.split("\\.")[0]) > 223) {
|
||||
errInfo.append(prop.get(ipName) + " " + prop.get("ip_range_in_c") + ";");
|
||||
if ((Integer.parseInt(prefix.split("\\.")[0])<128&&Integer.parseInt(subfix.split("\\.")[0])<128)
|
||||
||(Integer.parseInt(prefix.split("\\.")[0])>127&&Integer.parseInt(subfix.split("\\.")[0])>127&&Integer.parseInt(prefix.split("\\.")[0])<192&&Integer.parseInt(subfix.split("\\.")[0])<192)
|
||||
||(Integer.parseInt(prefix.split("\\.")[0])>191&&Integer.parseInt(subfix.split("\\.")[0])>191&&Integer.parseInt(prefix.split("\\.")[0])<224&&Integer.parseInt(subfix.split("\\.")[0])<224)
|
||||
||(Integer.parseInt(prefix.split("\\.")[0])>223&&Integer.parseInt(subfix.split("\\.")[0])>223&&Integer.parseInt(prefix.split("\\.")[0])<240&&Integer.parseInt(subfix.split("\\.")[0])<240)
|
||||
||(Integer.parseInt(prefix.split("\\.")[0])>239&&Integer.parseInt(subfix.split("\\.")[0])>239&&Integer.parseInt(prefix.split("\\.")[0])<256&&Integer.parseInt(subfix.split("\\.")[0])<256)) {
|
||||
}else {
|
||||
errInfo.append(prop.get(ipName) + " " + prop.get("ip_range_in_the_same") + ";");
|
||||
}
|
||||
// if (Integer.parseInt(prefix.split("\\.")[0]) < 192 || Integer.parseInt(prefix.split("\\.")[0]) > 223
|
||||
// || Integer.parseInt(subfix.split("\\.")[0]) < 192 || Integer.parseInt(subfix.split("\\.")[0]) > 223) {
|
||||
// errInfo.append(prop.get(ipName) + " " + prop.get("ip_range_in_c") + ";");
|
||||
// }
|
||||
if (!prefix.split("\\.")[0].equals(subfix.split("\\.")[0])
|
||||
|| !prefix.split("\\.")[1].equals(subfix.split("\\.")[1])
|
||||
|| !prefix.split("\\.")[2].equals(subfix.split("\\.")[2])) {
|
||||
@@ -3058,7 +3096,7 @@ public class BaseController {
|
||||
&& "p2p_ip".equals(regionDict.getConfigServiceType())) { // P2p IP
|
||||
List<P2pIpTemplate> list = ei.getDataList(P2pIpTemplate.class, this.getMsgProp());
|
||||
ipPortCfgs = this.checkIpCfg(serviceDict, regionDict, list);
|
||||
} else if (regionDict.getFunctionId().equals(600)) {
|
||||
} else if (regionDict.getFunctionId().equals(600)) {// ANS IP
|
||||
List<AsnIpTemplate> list = ei.getDataList(AsnIpTemplate.class, this.getMsgProp());
|
||||
ipPortCfgs = this.checkIpCfg(serviceDict, regionDict, list);
|
||||
} else {
|
||||
@@ -3104,35 +3142,38 @@ public class BaseController {
|
||||
}
|
||||
}
|
||||
if (regionDict.getRegionType().equals(1)) {// IP
|
||||
if(regionDict.getFunctionId().intValue()==600) {
|
||||
CfgIndexInfo info=new CfgIndexInfo();
|
||||
List<AsnIpCfg> asnIpCfgs=Lists.newArrayList();
|
||||
info.setAsnIpGroup(Integer.parseInt(asnIpGroup));
|
||||
info.setAction(0);
|
||||
info.setCfgRegionCode(regionDict.getConfigRegionCode());
|
||||
info.setCfgRegionCode(regionDict.getConfigRegionCode());
|
||||
info.setCfgType(regionDict.getConfigRegionValue());
|
||||
info.setCreateTime(date);
|
||||
info.setCreatorId(UserUtils.getUser().getId());
|
||||
info.setDoLog(1);
|
||||
info.setFunctionId(regionDict.getFunctionId());
|
||||
info.setIsAudit(0);
|
||||
info.setIsValid(0);
|
||||
info.setIsAreaEffective(0);
|
||||
info.setAttribute("0");
|
||||
info.setClassify("0");
|
||||
info.setLable("0");
|
||||
info.setRequestId(StringUtil.isEmpty(requestId) ? 0 : requestId);
|
||||
info.setServiceId(0);
|
||||
if(regionDict.getFunctionId().intValue()==600) {//ans ip
|
||||
Map<String,List<AsnIpCfg>> asnIpCfgs=new HashMap<>();
|
||||
for (BaseIpCfg cfg : ipPortCfgs) {
|
||||
AsnIpCfg _cfg=new AsnIpCfg();
|
||||
BeanUtils.copyProperties(cfg, _cfg);
|
||||
_cfg.setTableName(AsnIpCfg.getTablename());
|
||||
asnIpCfgs.add(_cfg);
|
||||
_cfg.setAction(0);
|
||||
_cfg.setCfgRegionCode(regionDict.getConfigRegionCode());
|
||||
_cfg.setCfgRegionCode(regionDict.getConfigRegionCode());
|
||||
_cfg.setCfgType(regionDict.getConfigRegionValue());
|
||||
_cfg.setCreateTime(date);
|
||||
_cfg.setCreatorId(UserUtils.getUser().getId());
|
||||
_cfg.setDoLog(1);
|
||||
_cfg.setFunctionId(regionDict.getFunctionId());
|
||||
_cfg.setIsAudit(0);
|
||||
_cfg.setIsValid(0);
|
||||
_cfg.setIsAreaEffective(0);
|
||||
_cfg.setAttribute("0");
|
||||
_cfg.setClassify("0");
|
||||
_cfg.setLable("0");
|
||||
_cfg.setRequestId(StringUtil.isEmpty(requestId) ? 0 : requestId);
|
||||
_cfg.setServiceId(0);
|
||||
if(asnIpCfgs.containsKey(_cfg.getUserRegion1())) {
|
||||
asnIpCfgs.get(_cfg.getUserRegion1()).add(_cfg);
|
||||
}else {
|
||||
List<AsnIpCfg> ips=Lists.newArrayList();
|
||||
ips.add(_cfg);
|
||||
asnIpCfgs.put(_cfg.getUserRegion1(), ips);
|
||||
}
|
||||
}
|
||||
ipPortCfgs.clear();
|
||||
info.setAsnIpCfgs(asnIpCfgs);
|
||||
asnIpCfgService.saveAsnIpCfg(info);
|
||||
asnIpCfgService.saveAsnIpBatch(asnIpCfgs);
|
||||
}else {
|
||||
for (BaseIpCfg cfg : ipPortCfgs) {
|
||||
cfg.setAction(serviceDict==null?null:serviceDict.getAction());
|
||||
|
||||
@@ -131,7 +131,7 @@ public class DdosCfgController extends BaseController {
|
||||
Page<DdosIpCfg> page = ddosCfgService.findPage(pageInfo, entity);
|
||||
titleList.add(entity.getMenuNameCode());
|
||||
classMap.put(entity.getMenuNameCode(), DdosIpCfg.class);
|
||||
String cfgIndexInfoNoExport=",client_port,server_port,ir_type,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
String cfgIndexInfoNoExport=",client_ip,client_port,server_port,ir_type,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport);
|
||||
dataMap.put(entity.getMenuNameCode(), page.getList());
|
||||
/*}*/
|
||||
|
||||
@@ -168,6 +168,7 @@ public class AvController extends BaseController {
|
||||
file.delete();
|
||||
}
|
||||
}
|
||||
FileUtils.deleteDirectory(picPath);
|
||||
if(zouts!=null){
|
||||
zouts.close();
|
||||
}
|
||||
@@ -526,7 +527,7 @@ public class AvController extends BaseController {
|
||||
int second = (int) (ls-hour*3600-minute*60);
|
||||
length = hour+"'"+minute+"''"+second+"'''";
|
||||
logger.info(file.getName()+"时长:"+length);
|
||||
if(ls>0 && second>Constants.AV_DURATION_LIMIT){
|
||||
if(ls>0 && ls>Constants.AV_DURATION_LIMIT){
|
||||
return false;
|
||||
}else{
|
||||
return true;
|
||||
@@ -546,7 +547,7 @@ public class AvController extends BaseController {
|
||||
String sep = System.getProperty("file.separator");
|
||||
String random = UUID.randomUUID()+"";
|
||||
String srcFilePath = Constants.AV_FILE_PATH+"video"+sep+"srcFile";//视频源文件保存路径
|
||||
String picFilePath = StringUtils.getUserfilesBaseDir()+"video"+sep+"picFile";//视频生成的关键帧图片文件保存路径
|
||||
String picFilePath = StringUtils.getUserfilesBaseDir()+"video"+sep+"picFile"+sep+random+sep;//视频生成的关键帧图片文件保存路径
|
||||
|
||||
FileUtils.createDirectory(srcFilePath);
|
||||
FileUtils.createDirectory(picFilePath);
|
||||
@@ -560,13 +561,13 @@ public class AvController extends BaseController {
|
||||
String shellName = Constants.VEDIO_TO_PICTURE_PROC;
|
||||
// String params = srcFileAllPath+" "+picFilePath+" 0.95 90.0 0.5";
|
||||
String params = srcFileAllPath+" "+picFilePath;
|
||||
logger.info("调用视频转关键帧图片程序输入参数:"+params);
|
||||
logger.info("调用视频转关键帧图片程序:"+shellName+" " +params);
|
||||
Map resultMap = avCfgService.execShell(shellName, params);
|
||||
if(resultMap.get("exitStatus").equals(0)){//调用外部程序成功
|
||||
String out = resultMap.get("out").toString();//输出参数
|
||||
logger.info("调用视频转关键帧图片程序输出参数:"+out);
|
||||
JSONArray resArray =JSONArray.fromObject(out);
|
||||
JSONObject resObject = resArray.getJSONObject(0);
|
||||
logger.info("调用视频转关键帧图片程序输出参数:"+resObject);
|
||||
int state = resObject.getInt("state");
|
||||
if(state==1){
|
||||
//关键帧图片生成成功,删除原视频文件
|
||||
|
||||
@@ -184,11 +184,11 @@ public class BgpCfgController extends BaseController{
|
||||
titleList.add(entity.getMenuNameCode());
|
||||
titleList.add("NTC_IP");
|
||||
titleList.add("NTC_BGP_AS");
|
||||
titleList.add("NTC_SUBSCRIBE_ID");
|
||||
// titleList.add("NTC_SUBSCRIBE_ID");
|
||||
classMap.put(entity.getMenuNameCode(), CfgIndexInfo.class);
|
||||
classMap.put("NTC_IP", IpPortCfg.class);
|
||||
classMap.put("NTC_BGP_AS", BaseStringCfg.class);
|
||||
classMap.put("NTC_SUBSCRIBE_ID", NtcSubscribeIdCfg.class);
|
||||
// classMap.put("NTC_SUBSCRIBE_ID", NtcSubscribeIdCfg.class);
|
||||
String cfgIndexInfoNoExport=",policy_name,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
String ipPortInfoNoExport=",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||
@@ -205,22 +205,22 @@ public class BgpCfgController extends BaseController{
|
||||
noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport);
|
||||
noExportMap.put("NTC_IP", ipPortInfoNoExport);
|
||||
noExportMap.put("NTC_BGP_AS", regionCfgNoExport);
|
||||
noExportMap.put("NTC_SUBSCRIBE_ID", ntcSubscribeIdCfgNoExport);
|
||||
// noExportMap.put("NTC_SUBSCRIBE_ID", ntcSubscribeIdCfgNoExport);
|
||||
List<IpPortCfg> ipList=new ArrayList<IpPortCfg>();
|
||||
List<BaseStringCfg> subscribeInfoList=new ArrayList<BaseStringCfg>();
|
||||
// List<BaseStringCfg> subscribeInfoList=new ArrayList<BaseStringCfg>();
|
||||
List<BaseStringCfg> asInfoList=new ArrayList<BaseStringCfg>();
|
||||
for (CfgIndexInfo cfg : page.getList()) {
|
||||
CfgIndexInfo cfgIndexInfo=bgpCfgService.exportbgp(cfg);
|
||||
ipList.addAll(cfgIndexInfo.getIpPortList());
|
||||
subscribeInfoList.addAll(cfgIndexInfo.getNtcSubscribeIdCfgList());
|
||||
// subscribeInfoList.addAll(cfgIndexInfo.getNtcSubscribeIdCfgList());
|
||||
asInfoList.addAll(cfgIndexInfo.getNtcBgpAsCfgList());
|
||||
}
|
||||
asInfoList=BaseStringCfg.replaceBaseKeyList(asInfoList);
|
||||
subscribeInfoList=BaseStringCfg.baseHexList(subscribeInfoList);
|
||||
// subscribeInfoList=BaseStringCfg.baseHexList(subscribeInfoList);
|
||||
dataMap.put(entity.getMenuNameCode(), page.getList());
|
||||
dataMap.put("NTC_IP", ipList);
|
||||
dataMap.put("NTC_BGP_AS", asInfoList);
|
||||
dataMap.put("NTC_SUBSCRIBE_ID", subscribeInfoList);
|
||||
// dataMap.put("NTC_SUBSCRIBE_ID", subscribeInfoList);
|
||||
|
||||
/*}*/
|
||||
this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap);
|
||||
|
||||
@@ -593,7 +593,7 @@ public class FileTransferCfgController extends BaseController{
|
||||
String ipPortInfoNoExport=",do_log,action,config_describe,valid_identifier,is_audit,ir_type,creator,creator"
|
||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||
+",letter,whether_area_block,classification,attribute,label"
|
||||
+",userregion2,userregion3,userregion4,userregion5,group_name,";
|
||||
+",userregion2,userregion3,userregion4,userregion5,group_name,&userregion1:p2p_ip_config_type-";
|
||||
String ntcSubscribeIdCfgNoExport=",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||
+",letter,whether_area_block,classification,attribute,label"
|
||||
@@ -601,7 +601,7 @@ public class FileTransferCfgController extends BaseController{
|
||||
String hashCfgNoExport=",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||
+",letter,whether_area_block,classification,attribute,label"
|
||||
+",userregion2,userregion3,userregion4,userregion5,";
|
||||
+",userregion2,userregion3,userregion4,userregion5,&userregion1:p2p_hash_type-";
|
||||
String keyCfgNoExport=",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||
+",letter,whether_area_block,classification,attribute,label"
|
||||
|
||||
@@ -361,7 +361,7 @@ public class IpController extends BaseController{
|
||||
classMap.put(entity.getMenuNameCode(), CfgIndexInfo.class);
|
||||
classMap.put("NTC_IP", IpPortCfg.class);
|
||||
classMap.put("asn_policy", ConfigGroupInfo.class);
|
||||
String cfgIndexInfoNoExport=",policy_name,group_name,userregion1,userregion3,userregion4,userregion5,";
|
||||
String cfgIndexInfoNoExport=",policy_name,group_name,userregion1,userregion3,userregion4,userregion5,&userregion2:ratelimit-";
|
||||
String ipPortInfoNoExport=",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||
+",letter,whether_area_block,classification,attribute,label"
|
||||
|
||||
@@ -12,6 +12,7 @@ import javax.servlet.http.HttpServletResponse;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.apache.taglibs.standard.functions.Functions;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
@@ -136,6 +137,21 @@ public class WhiteListController extends CommonController{
|
||||
return "/cfg/whitelist/domainList";
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"saveHttpUrlCfgs"})
|
||||
public String saveHttpUrlCfgs(RedirectAttributes model,HttpServletRequest request,HttpServletResponse response,CfgIndexInfo entity) {
|
||||
if(!StringUtil.isEmpty(entity) && !StringUtil.isEmpty(entity.getHttpUrlList())){
|
||||
for (HttpUrlCfg httpUrlCfg : entity.getHttpUrlList()) {
|
||||
CfgIndexInfo cfg=new CfgIndexInfo();
|
||||
List httpList=new ArrayList<>();
|
||||
BeanUtils.copyProperties(httpUrlCfg, cfg);
|
||||
httpList.add(httpUrlCfg);
|
||||
cfg.setHttpUrlList(httpList);
|
||||
websiteCfgService.saveHttpCfg(cfg);
|
||||
}
|
||||
}
|
||||
return "redirect:" + adminPath +"/ntc/whitelist/domain/list?functionId="+entity.getFunctionId();
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"domain/form"})
|
||||
@RequiresPermissions(value={"whitelist:domain:config"})
|
||||
public String domainForm(Model model,String ids,CfgIndexInfo entity) {
|
||||
|
||||
@@ -5,6 +5,7 @@ import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
@@ -19,6 +20,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||
|
||||
import com.nis.domain.FunctionRegionDict;
|
||||
import com.nis.domain.FunctionServiceDict;
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.callback.ProxyFileStrategyCfg;
|
||||
import com.nis.domain.configuration.BaseStringCfg;
|
||||
@@ -33,6 +35,7 @@ import com.nis.domain.configuration.NtcSubscribeIdCfg;
|
||||
import com.nis.exceptions.MaatConvertException;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.DictUtils;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.web.controller.BaseController;
|
||||
import com.nis.web.security.UserUtils;
|
||||
|
||||
@@ -267,8 +270,45 @@ public class HttpRedirectPolicyController extends BaseController{
|
||||
pageInfo.setPageNo(1);
|
||||
pageInfo.setPageSize(-1);
|
||||
}
|
||||
|
||||
Page<CfgIndexInfo> page = httpRedirectCfgService.getHttpRedirectList(pageInfo, entity);
|
||||
Properties prop = getMsgProp();
|
||||
for (CfgIndexInfo str : page.getList()) {
|
||||
if(entity.getFunctionId()!=210 && entity.getFunctionId()!=211){
|
||||
String type="RESPONSE_CODE";
|
||||
if(entity.getFunctionId()==207){
|
||||
type="RESPONSE_CODE";
|
||||
}else if(entity.getFunctionId()==208){
|
||||
type="REDIRECT_RESPONSE_CODE";
|
||||
}else if(entity.getFunctionId()==209){
|
||||
type="CONTROL_REPLACE_ZONE";
|
||||
}
|
||||
String dictlabel= DictUtils.getDictLabel(type, str.getUserRegion1());
|
||||
str.setUserRegion1(prop.getProperty(dictlabel));
|
||||
if(entity.getFunctionId()==207 || entity.getFunctionId()==208){
|
||||
if(StringUtil.isEmpty(str.getUserRegion2())){
|
||||
if(!StringUtil.isEmpty(str.getUserRegion3())){
|
||||
ProxyFileStrategyCfg file= new ProxyFileStrategyCfg();
|
||||
file.setCompileId(Integer.valueOf(str.getUserRegion3()));
|
||||
List<ProxyFileStrategyCfg> allProxyFileStrategys = proxyFileStrategyService.getProxyFileStrategyCfgList(file);
|
||||
if(allProxyFileStrategys!=null && allProxyFileStrategys.size()>0){
|
||||
str.setUserRegion2(allProxyFileStrategys.get(0).getCfgDesc());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
String cfgIndexInfoNoExport=",policy_name,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
if(entity.getFunctionId()==207){
|
||||
cfgIndexInfoNoExport=",policy_name,group_name,userregion3,userregion4,userregion5,&userregion1:response_code-userregion2:response_content-";
|
||||
}else if(entity.getFunctionId()==208){
|
||||
cfgIndexInfoNoExport=",policy_name,group_name,userregion3,userregion4,userregion5,&userregion1:redirect_response_code-userregion2:redirect_url-";
|
||||
}else if(entity.getFunctionId()==209){
|
||||
cfgIndexInfoNoExport=",policy_name,group_name,userregion3,userregion4,userregion5,&userregion1:replace_zone-userregion2:replaced_content-userregion3:replace_content-";
|
||||
}else if(entity.getFunctionId()==211){
|
||||
cfgIndexInfoNoExport=",do_log,log_total,policy_name,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
}
|
||||
String httpUrlCfgNoExport=",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||
+",letter,whether_area_block,classification,attribute,label"
|
||||
|
||||
@@ -5,31 +5,29 @@ import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.apache.taglibs.standard.functions.Functions;
|
||||
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.RequestParam;
|
||||
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||
|
||||
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.SysUser;
|
||||
import com.nis.domain.configuration.BaseStringCfg;
|
||||
import com.nis.domain.configuration.CfgIndexInfo;
|
||||
import com.nis.domain.configuration.HttpUrlCfg;
|
||||
import com.nis.domain.configuration.InterceptPktBin;
|
||||
import com.nis.domain.configuration.IpPortCfg;
|
||||
import com.nis.domain.configuration.PxyObjKeyring;
|
||||
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.web.controller.configuration.CommonController;
|
||||
import com.nis.web.security.UserUtils;
|
||||
@@ -198,6 +196,7 @@ public class InterceptController extends CommonController{
|
||||
Map<String, Class<?>> classMap=new HashMap<String, Class<?>>();
|
||||
Map<String, List> dataMap=new HashMap<String, List>();
|
||||
Map<String, String> noExportMap=new HashMap<String, String>();
|
||||
Map<String, String> replaceExportMap=new HashMap<String, String>();
|
||||
|
||||
|
||||
/*//导出选中记录
|
||||
@@ -218,9 +217,34 @@ public class InterceptController extends CommonController{
|
||||
pageInfo.setPageSize(-1);
|
||||
}
|
||||
Page<CfgIndexInfo> page = ipCfgService.getIpCfgList(pageInfo, entity);
|
||||
|
||||
//获取证书信息
|
||||
List<PxyObjKeyring> certificateList=new ArrayList<PxyObjKeyring>();
|
||||
if(entity.getFunctionId().equals(200)){
|
||||
certificateList=pxyObjKeyringService.findPxyObjKeyrings(null, 1, 1, "ip");
|
||||
}
|
||||
if(entity.getFunctionId().equals(201)){
|
||||
certificateList=pxyObjKeyringService.findPxyObjKeyrings(null, 1, 1, "domain");
|
||||
}
|
||||
for (CfgIndexInfo str : page.getList()) {
|
||||
if(!StringUtil.isEmpty(str.getUserRegion5())){
|
||||
Properties prop = getMsgProp();
|
||||
String cs= DictUtils.getDictLabel("INTERCEPT_DOMAIN_INTENSITY", str.getUserRegion5());
|
||||
str.setUserRegion5(prop.getProperty(cs));
|
||||
}
|
||||
if(certificateList!=null){
|
||||
if(entity.getFunctionId()==200|| entity.getFunctionId()==201){
|
||||
for (PxyObjKeyring pxyObjKeyring : certificateList) {
|
||||
if(str.getUserRegion2().equals(pxyObjKeyring.getCompileId())){
|
||||
str.setUserRegion2(pxyObjKeyring.getCfgDesc());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
titleList.add(entity.getMenuNameCode());
|
||||
classMap.put(entity.getMenuNameCode(), CfgIndexInfo.class);
|
||||
String cfgIndexInfoNoExport=",policy_name,group_name,userregion4,userregion5,";
|
||||
String cfgIndexInfoNoExport="";
|
||||
String ipPortInfoNoExport=",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||
+",letter,whether_area_block,classification,attribute,label"
|
||||
@@ -233,7 +257,7 @@ public class InterceptController extends CommonController{
|
||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||
+",letter,whether_area_block,classification,attribute,label"
|
||||
+",userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport);
|
||||
|
||||
List<IpPortCfg> ipList=new ArrayList<IpPortCfg>();
|
||||
List<BaseStringCfg> httpUrlList=new ArrayList<BaseStringCfg>();
|
||||
List<BaseStringCfg> pktBinList=new ArrayList<BaseStringCfg>();
|
||||
@@ -247,6 +271,7 @@ public class InterceptController extends CommonController{
|
||||
httpUrlList=BaseStringCfg.baseHexList(httpUrlList);
|
||||
dataMap.put(entity.getMenuNameCode(), page.getList());
|
||||
if(entity.getFunctionId()==212){ //IP Payload
|
||||
cfgIndexInfoNoExport=",do_log,log_total,policy_name,group_name,userregion4,userregion5,&userregion1:replace_zone-userregion2:replaced_content-userregion3:replace_content-";
|
||||
titleList.add("PXY_INTERCEPT_IP");
|
||||
titleList.add("PXY_INTERCEPT_PKT_BIN");
|
||||
classMap.put("PXY_INTERCEPT_IP", IpPortCfg.class);
|
||||
@@ -256,16 +281,20 @@ public class InterceptController extends CommonController{
|
||||
dataMap.put("PXY_INTERCEPT_IP", ipList);
|
||||
dataMap.put("PXY_INTERCEPT_PKT_BIN", pktBinList);
|
||||
}else if(entity.getFunctionId()==200){//IP拦截
|
||||
cfgIndexInfoNoExport=",policy_name,group_name,userregion3,userregion4,userregion5,&userregion2:ratelimit-userregion1:certificate-";
|
||||
titleList.add("PXY_INTERCEPT_IP");
|
||||
classMap.put("PXY_INTERCEPT_IP", IpPortCfg.class);
|
||||
noExportMap.put("PXY_INTERCEPT_IP", ipPortInfoNoExport);
|
||||
dataMap.put("PXY_INTERCEPT_IP", ipList);
|
||||
}else if(entity.getFunctionId()==201){//域名拦截
|
||||
cfgIndexInfoNoExport=",policy_name,group_name,userregion3,userregion4,&userregion2:ratelimit-userregion1:certificate-userregion5:intercept_intensity-";
|
||||
titleList.add("NTC_HTTP_URL");
|
||||
classMap.put("NTC_HTTP_URL", HttpUrlCfg.class);
|
||||
noExportMap.put("NTC_HTTP_URL", httpUrlCfgNoExport);
|
||||
dataMap.put("NTC_HTTP_URL", httpUrlList);
|
||||
}
|
||||
noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport);
|
||||
|
||||
/*}*/
|
||||
this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap);
|
||||
} catch (Exception e) {
|
||||
|
||||
@@ -4,6 +4,7 @@ package com.nis.web.controller.configuration.statistics;
|
||||
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -11,20 +12,27 @@ import java.util.Map;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.mchange.v1.util.MapUtils;
|
||||
import com.nis.domain.FunctionServiceDict;
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.SysArea;
|
||||
import com.nis.domain.configuration.CfgIndexInfo;
|
||||
import com.nis.domain.configuration.RequestInfo;
|
||||
import com.nis.util.CacheUtils;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.DictUtils;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.util.StringUtils;
|
||||
import com.nis.web.controller.BaseController;
|
||||
import com.nis.web.service.BaseService;
|
||||
import com.nis.web.service.CommonService;
|
||||
@@ -76,4 +84,33 @@ public class ConfigureStatisticsController extends BaseController{
|
||||
model.addAttribute("configStatisticTime", configureStatisticsService.getConfigStatisticTime());
|
||||
return "/index";
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据业务ID查询当前业务配置是否可继续新增,如果达到规则限制量则不允许新增。
|
||||
* @param serviceId
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping(value = "/getEffectiveCfgNum")
|
||||
public Map getEffectiveCfgNum(Integer serviceId, HttpServletResponse response) {
|
||||
Map map= new HashMap();
|
||||
Integer cfgNum = configureStatisticsService.getEffectiveCfgNum(serviceId);
|
||||
String dictValue = DictUtils.getDictLabel("SERVICE_RULE_LIMIT", serviceId+"","default").trim();
|
||||
Integer ruleLimit = 0;
|
||||
if(!"default".equals(dictValue)){
|
||||
ruleLimit = Integer.parseInt(dictValue);
|
||||
}
|
||||
if(ruleLimit==0){
|
||||
map.put("status", 1);//如果为0说明没有限制
|
||||
}else if(cfgNum<ruleLimit){
|
||||
map.put("status", 1);//当前配置量小于限制
|
||||
}else{
|
||||
map.put("status", 0);//当前配置量大于或等于限制,则不允许添加
|
||||
map.put("msg", String.format(this.getMsgProp().getProperty("ruleLimitTip"),ruleLimit));
|
||||
}
|
||||
map.put("cfgNum", cfgNum);
|
||||
map.put("ruleLimit", ruleLimit);
|
||||
return map;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,16 +88,13 @@ public class SpecificServiceCfgController extends BaseController {
|
||||
// 取出所有符合条件的顶层分页
|
||||
Page<SpecificServiceCfg> page = specificServiceCfgService
|
||||
.findTopPage(pageCondition, specificServiceCfg);
|
||||
// 植入序号
|
||||
for (int i = 0; i < page.getList().size(); i++) {
|
||||
page.getList().get(i).setShowSequence("" + (i + 1 + ((page.getPageNo() - 1) * page.getPageSize())));
|
||||
}
|
||||
model.addAttribute("page", page);
|
||||
// 删除顶层数据、取出id
|
||||
List<Integer> intList = Lists.newArrayList();
|
||||
for (SpecificServiceCfg tempSS : page.getList()) {
|
||||
if (tempSS != null) {
|
||||
intList.add(tempSS.getSpecServiceId());
|
||||
// 植入序号
|
||||
for (int i = 0; i < page.getList().size(); i++) {
|
||||
if (page.getList().get(i) != null) {
|
||||
page.getList().get(i).setShowSequence("" + (i + 1 + ((page.getPageNo() - 1) * page.getPageSize())));
|
||||
intList.add(page.getList().get(i).getSpecServiceId());
|
||||
}
|
||||
}
|
||||
for (int i = allList.size() - 1; i >= 0; i--) {
|
||||
@@ -106,14 +103,13 @@ public class SpecificServiceCfgController extends BaseController {
|
||||
allList.remove(ss);
|
||||
}
|
||||
}
|
||||
|
||||
allList.addAll(page.getList());
|
||||
|
||||
List<SpecificServiceCfg> list = Lists.newArrayList();
|
||||
SpecificServiceCfg.sortList(list, allList, 0, true);
|
||||
//处理下级序号
|
||||
SpecificServiceCfg.addChildrenSeq(list, 0);
|
||||
|
||||
model.addAttribute("page", page);
|
||||
model.addAttribute("list", list);
|
||||
|
||||
return "/specific/specificServiceCfgList";
|
||||
|
||||
@@ -24,4 +24,11 @@ public class SysLogController extends BaseController {
|
||||
return "/sys/logList";
|
||||
}
|
||||
|
||||
@RequiresPermissions("sys:cfgOperationLog:view")
|
||||
@RequestMapping(value = {"cfgOperationLogList"})
|
||||
public String cfgOperationLogList(SysLog sysLog, HttpServletRequest request, HttpServletResponse response, Model model) {
|
||||
Page<SysLog> page = logService.findCfgOperationLogPage(new Page<SysLog>(request, response), sysLog);
|
||||
model.addAttribute("page", page);
|
||||
return "/sys/cfgOperationLogList";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
package com.nis.web.dao;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.nis.domain.SysLog;
|
||||
@MyBatisDao
|
||||
public interface SysLogDao extends CrudDao<SysLog>{
|
||||
|
||||
public void insertCfgOperationLog(SysLog log);
|
||||
public List<SysLog> findCfgOperationLogList(SysLog log);
|
||||
}
|
||||
@@ -28,6 +28,26 @@
|
||||
ORDER BY a.create_date DESC
|
||||
</select>
|
||||
|
||||
<select id="findCfgOperationLogList" resultType="sysLog">
|
||||
SELECT
|
||||
a.*
|
||||
FROM sys_cfg_operation_log a
|
||||
WHERE a.create_date BETWEEN #{beginDate} AND #{endDate}
|
||||
<if test="functionName != null and functionName != ''">
|
||||
AND a.function_name=#{functionName}
|
||||
</if>
|
||||
<if test="createBy != null and createBy != ''">
|
||||
AND a.create_by = #{createBy}
|
||||
</if>
|
||||
<if test="operation != null and operation != ''">
|
||||
AND a.operation=#{operation}
|
||||
</if>
|
||||
<if test="exception != null and exception != ''">
|
||||
AND a.state = 0
|
||||
</if>
|
||||
ORDER BY a.create_date DESC
|
||||
</select>
|
||||
|
||||
|
||||
<insert id="insert" parameterType="sysLog" useGeneratedKeys="true" keyProperty="id" >
|
||||
INSERT INTO sys_log(
|
||||
@@ -59,4 +79,49 @@
|
||||
)
|
||||
</insert>
|
||||
|
||||
<insert id="insertCfgOperationLog" parameterType="sysLog" useGeneratedKeys="true" keyProperty="id" >
|
||||
INSERT INTO sys_cfg_operation_log(
|
||||
type,
|
||||
title,
|
||||
create_by,
|
||||
create_date,
|
||||
remote_addr,
|
||||
user_agent,
|
||||
request_uri,
|
||||
method,
|
||||
state,
|
||||
consumer_time,
|
||||
params,
|
||||
exception,
|
||||
compile_id,
|
||||
cfg_id,
|
||||
function_id,
|
||||
method_name,
|
||||
audit_state,
|
||||
action,
|
||||
operation,
|
||||
function_name
|
||||
) VALUES (
|
||||
#{type},
|
||||
#{title},
|
||||
#{createBy},
|
||||
#{createDate},
|
||||
#{remoteAddr},
|
||||
#{userAgent},
|
||||
#{requestUri},
|
||||
#{method},
|
||||
#{state},
|
||||
#{consumerTime},
|
||||
#{params},
|
||||
#{exception},
|
||||
#{compileId},
|
||||
#{cfgId},
|
||||
#{functionId},
|
||||
#{methodName},
|
||||
#{auditState},
|
||||
#{action},
|
||||
#{operation},
|
||||
#{functionName}
|
||||
)
|
||||
</insert>
|
||||
</mapper>
|
||||
@@ -16,7 +16,10 @@ public interface AsnIpCfgDao extends CrudDao<AsnIpCfg>{
|
||||
public List<AsnIpCfg> getByIds(@Param("ids")String ids);
|
||||
public List<Integer> hasGroupIds(@Param("ids")String ids);
|
||||
public List<AsnIpCfg> findAllList(AsnIpCfg cfg);
|
||||
public List<ConfigGroupInfo> findPolicyGroupInfosByType(@Param("groupId")Integer groupId);
|
||||
// public List<ConfigGroupInfo> findPolicyGroupInfosByType(@Param("groupId")Integer groupId);
|
||||
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 ConfigGroupInfo getInfoByAsnNo(@Param("asnId")Integer asnNo);
|
||||
public List<AsnIpCfg> getByAsnGroup(@Param("groupId")Integer groupId,@Param("asnId")Integer asnNo);
|
||||
public void deleteByAsnGroup(@Param("groupId")Integer groupId,@Param("asnId")Integer asnNo);
|
||||
}
|
||||
|
||||
@@ -206,7 +206,11 @@
|
||||
from asn_ip_cfg r
|
||||
where r.cfg_id in (${ids}) and is_valid !=-1
|
||||
</select>
|
||||
|
||||
<select id="getByAsnGroup" resultMap="asnIpCfgMap" parameterType="java.lang.Integer" >
|
||||
select
|
||||
<include refid="columns"></include>
|
||||
from asn_ip_cfg r where r.is_valid!=-1 and r.asn_ip_group=#{groupId} and r.user_region1=#{asnId}
|
||||
</select>
|
||||
<insert id="insert" parameterType="com.nis.domain.basics.AsnIpCfg" >
|
||||
insert into asn_ip_cfg (
|
||||
CFG_DESC,
|
||||
@@ -392,18 +396,23 @@
|
||||
<update id="updateValid" parameterType="com.nis.domain.basics.AsnIpCfg" >
|
||||
update asn_ip_cfg set is_valid=#{isValid} where cfg_id in (${ids})
|
||||
</update>
|
||||
<select id="findPolicyGroupInfosByType" resultType="com.nis.domain.specific.ConfigGroupInfo" parameterType="java.lang.Integer">
|
||||
select id,group_id,group_name,is_issued,insert_time,update_time,group_type
|
||||
from config_group_info c where c.group_type= #{groupId}
|
||||
</select>
|
||||
<!-- <update id="deleteByAsnGroup" parameterType="java.lang.Integer" >
|
||||
update asn_ip_cfg set is_valid=-1 where asn_ip_group=#{groupId} and user_region1=#{asnId}
|
||||
</update> -->
|
||||
<delete id="deleteByAsnGroup" parameterType="java.lang.Integer" >
|
||||
delete from asn_ip_cfg where asn_ip_group=#{groupId} and user_region1=#{asnId}
|
||||
</delete>
|
||||
<select id="findOtherIps" resultType="java.lang.Integer" parameterType="java.lang.Integer">
|
||||
select 1 from asn_ip_cfg where is_valid=1 and asn_ip_group=#{groupId} and cfg_id !=#{cfgId} limit 1
|
||||
</select>
|
||||
<select id="hasGroupIds" resultType="java.lang.Integer" parameterType="java.lang.Integer">
|
||||
select 1 from asn_ip_cfg where is_valid !=-1 and asn_ip_group in(${ids}) limit 1
|
||||
</select>
|
||||
<select id="countValidIPs" resultType="java.lang.Integer" parameterType="java.lang.Integer">
|
||||
<select id="countValidIPs" resultType="java.lang.Integer" parameterType="java.lang.String">
|
||||
select count(1) from asn_ip_cfg where is_valid !=-1 and asn_ip_group in(${groups}) and cfg_id not in(${ids}) GROUP BY asn_ip_group;
|
||||
</select>
|
||||
|
||||
<select id="getInfoByAsnNo" resultType="com.nis.domain.specific.ConfigGroupInfo" parameterType="java.lang.Integer">
|
||||
select id,group_id,group_name,is_issued,insert_time,update_time,group_type,compile_id,asn_id
|
||||
from config_group_info c where c.asn_id= #{asnId} and c.group_type=4
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -1056,7 +1056,7 @@
|
||||
</update>
|
||||
<!-- update av_voip_ip_cfg表信息 -->
|
||||
<update id="updateAvVoipIp" parameterType="com.nis.domain.configuration.CfgIndexInfo" >
|
||||
update av_voip_ip_cfg
|
||||
update ip_port_cfg
|
||||
<set >
|
||||
<trim suffixOverrides=",">
|
||||
<if test="cfgDesc != null and cfgDesc != ''" >
|
||||
|
||||
@@ -28,12 +28,14 @@ import com.nis.web.dao.MyBatisDao;
|
||||
@MyBatisDao
|
||||
public interface WebsiteCfgDao extends CrudDao<CfgIndexInfo>{
|
||||
|
||||
public List<CfgIndexInfo> getCfgIndexInfos(CfgIndexInfo entity);
|
||||
public CfgIndexInfo getCfgIndexInfo(Long id);
|
||||
public List<CfgIndexInfo> getWebsiteList(CfgIndexInfo entity);
|
||||
public List<IpPortCfg> getIpPortList(CfgIndexInfo entity);
|
||||
public List<HttpUrlCfg> getHttpUrlList(CfgIndexInfo entity);
|
||||
public List<HttpResHeadCfg> getHttpResHdrList(CfgIndexInfo entity);
|
||||
public List<HttpBodyCfg> getHttpResBodyList(CfgIndexInfo entity);
|
||||
public List<HttpBodyCfg> getHttpBodyList(CfgIndexInfo entity);
|
||||
public List<HttpReqHeadCfg> getHttpReqHdrList(CfgIndexInfo entity);
|
||||
public List<HttpBodyCfg> getHttpReqBodyList(CfgIndexInfo entity);
|
||||
public void saveCfgIndex(CfgIndexInfo entity);
|
||||
|
||||
@@ -31,6 +31,8 @@
|
||||
<result column="user_region3" property="userRegion3" jdbcType="VARCHAR" />
|
||||
<result column="user_region4" property="userRegion4" jdbcType="VARCHAR" />
|
||||
<result column="user_region5" property="userRegion5" jdbcType="VARCHAR" />
|
||||
<result column="source_compile_id" property="sourceCompileId" jdbcType="INTEGER" />
|
||||
<result column="cancel_request_id" property="cancelRequestId" jdbcType="INTEGER" />
|
||||
</resultMap>
|
||||
<resultMap id="ipPortMap" type="com.nis.domain.configuration.IpPortCfg" >
|
||||
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
|
||||
@@ -130,7 +132,7 @@
|
||||
a.CREATOR_ID,a.CREATE_TIME,a.EDITOR_ID,a.EDIT_TIME,a.AUDITOR_ID,a.AUDIT_TIME,
|
||||
a.SERVICE_ID,a.REQUEST_ID,a.COMPILE_ID,a.IS_AREA_EFFECTIVE,a.CLASSIFY,
|
||||
a.ATTRIBUTE,a.LABLE,a.AREA_EFFECTIVE_IDS,a.function_id,a.dns_strategy_id,a.user_region1,
|
||||
a.user_region2,a.user_region3,a.user_region4,a.user_region5,a.do_log
|
||||
a.user_region2,a.user_region3,a.user_region4,a.user_region5,a.do_log,a.source_compile_id,a.cancel_request_id
|
||||
</sql>
|
||||
<sql id="IpCfg_Column" >
|
||||
a.cfg_id,a.cfg_desc,a.ip_type,a.src_ip_address,a.ip_pattern,a.port_pattern,a.src_port
|
||||
@@ -328,6 +330,25 @@
|
||||
<include refid="ConfigIndex_Column" />
|
||||
FROM cfg_index_info a where cfg_id=#{cfgId}
|
||||
</select>
|
||||
<select id="getCfgIndexInfos" resultMap="CfgIndexInfoMap" parameterType="com.nis.domain.configuration.CfgIndexInfo">
|
||||
SELECT
|
||||
<include refid="ConfigIndex_Column" />
|
||||
FROM cfg_index_info a
|
||||
<where>
|
||||
<if test="cfgId != null">
|
||||
and cfg_id=#{cfgId}
|
||||
</if>
|
||||
<if test="compileId != null">
|
||||
and compileId=#{compileId}
|
||||
</if>
|
||||
<if test="functionId != null">
|
||||
and function_id=#{functionId}
|
||||
</if>
|
||||
<if test="sourceCompileId != null">
|
||||
and source_compile_id=#{sourceCompileId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="getIpPortList" resultMap="ipPortMap" parameterType="com.nis.domain.configuration.CfgIndexInfo">
|
||||
SELECT
|
||||
<include refid="IpCfg_Column" />
|
||||
@@ -336,7 +357,32 @@
|
||||
<select id="getHttpUrlList" resultMap="stringCfgMap">
|
||||
SELECT
|
||||
<include refid="StrCfg_Column" />
|
||||
FROM http_url_cfg a where compile_id=#{compileId} and function_id=#{functionId}
|
||||
FROM http_url_cfg a
|
||||
<where>
|
||||
<if test="compileId != null">
|
||||
AND a.compile_id =#{compileId}
|
||||
</if>
|
||||
<if test="functionId != null">
|
||||
AND a.function_id =#{functionId}
|
||||
</if>
|
||||
</where>
|
||||
|
||||
</select>
|
||||
<select id="getHttpBodyList" resultMap="stringCfgMap" parameterType="com.nis.domain.configuration.CfgIndexInfo">
|
||||
SELECT
|
||||
<include refid="StrCfg_Column" />
|
||||
FROM http_body_cfg a
|
||||
<where>
|
||||
<if test="compileId != null">
|
||||
AND a.compile_id =#{compileId}
|
||||
</if>
|
||||
<if test="functionId != null">
|
||||
AND a.function_id =#{functionId}
|
||||
</if>
|
||||
<if test="cfgType != null and cfgType !='' ">
|
||||
AND a.cfg_type =#{cfgType}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="getHttpReqBodyList" resultMap="stringCfgMap" parameterType="com.nis.domain.configuration.CfgIndexInfo">
|
||||
SELECT
|
||||
@@ -407,7 +453,8 @@
|
||||
user_region3,
|
||||
user_region4,
|
||||
user_region5,
|
||||
do_log
|
||||
do_log,
|
||||
source_compile_id
|
||||
)values (
|
||||
#{cfgDesc,jdbcType=VARCHAR},
|
||||
#{action,jdbcType=INTEGER},
|
||||
@@ -434,7 +481,8 @@
|
||||
#{userRegion3,jdbcType=VARCHAR},
|
||||
#{userRegion4,jdbcType=VARCHAR},
|
||||
#{userRegion5,jdbcType=VARCHAR},
|
||||
#{doLog,jdbcType=INTEGER}
|
||||
#{doLog,jdbcType=INTEGER},
|
||||
#{sourceCompileId,jdbcType=INTEGER}
|
||||
)
|
||||
</insert>
|
||||
<!-- insert ip_port_cfg表信息 -->
|
||||
@@ -883,6 +931,9 @@
|
||||
update ${tableName} set is_valid = #{isValid,jdbcType=INTEGER},
|
||||
editor_id = #{editorId,jdbcType=INTEGER} ,
|
||||
edit_time = #{editTime,jdbcType=TIMESTAMP}
|
||||
<if test="isAudit !=null ">
|
||||
,is_audit = #{isAudit,jdbcType=BIGINT}
|
||||
</if>
|
||||
<trim prefix="WHERE" prefixOverrides="AND |OR ">
|
||||
<if test="cfgId !=null ">
|
||||
AND cfg_id = #{cfgId,jdbcType=BIGINT}
|
||||
|
||||
@@ -18,4 +18,5 @@ public interface ConfigureStatisticsDao {
|
||||
public List<Object[]> getConfigStatisticTime();
|
||||
public List<Object[]> getRequestStatisticTime();
|
||||
public List<Object[]> getRequestStateStatistics(@Param("requestList")List<RequestInfo> requestList,@Param("serviceList")List<FunctionServiceDict> serviceList) ;
|
||||
public Integer getEffectiveCfgNum(@Param("serviceId")Integer serviceId);
|
||||
}
|
||||
|
||||
@@ -45,4 +45,7 @@
|
||||
from request_num_statistics c
|
||||
group by request_id)
|
||||
</select> -->
|
||||
<select id="getEffectiveCfgNum" resultType="Integer">
|
||||
select count(distinct c.compile_id) from cfg_num_statistics c where c.service_id=#{serviceId} and c.cfg_state=1;
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -44,6 +44,7 @@ public interface SpecificServiceCfgDao extends CrudDao<SpecificServiceCfg> {
|
||||
List<SpecificServiceCfg> getChildrenById(Integer specServiceId);
|
||||
|
||||
ConfigGroupInfo getConfigGroupInfoByGroupId(Integer groupId);
|
||||
ConfigGroupInfo findPolicyGroupInfosByType(@Param("groupType")Integer groupType);
|
||||
Integer getIssuedConfigGroupInfoByGroupIds(@Param("groupIds")String groupIds);
|
||||
|
||||
Integer insertConfigGroupInfo(ConfigGroupInfo entity);
|
||||
|
||||
@@ -237,4 +237,8 @@
|
||||
insert into config_group_info (id,group_id,group_name,is_issued,insert_time,group_type,compile_id,asn_id)
|
||||
values(#{id},#{groupId},#{groupName},#{isIssued},now(),#{groupType},#{compileId},#{asnId})
|
||||
</insert>
|
||||
<select id="findPolicyGroupInfosByType" resultType="com.nis.domain.specific.ConfigGroupInfo" parameterType="java.lang.Integer">
|
||||
select id,group_id,group_name,is_issued,insert_time,update_time,group_type,compile_id,asn_id
|
||||
from config_group_info c where c.group_type= #{groupType}
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -1,5 +1,8 @@
|
||||
package com.nis.web.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.nis.domain.Page;
|
||||
@@ -9,8 +12,9 @@ import com.nis.web.dao.SysLogDao;
|
||||
|
||||
@Service
|
||||
public class LogService extends CrudService<SysLogDao, SysLog> {
|
||||
|
||||
public Page<SysLog> findPage(Page<SysLog> page, SysLog sysLog) {
|
||||
@Autowired
|
||||
protected SysLogDao sysLogDao;
|
||||
public Page<SysLog> findPage(Page<SysLog> page, SysLog sysLog) {
|
||||
|
||||
// 设置默认时间范围,默认当前月
|
||||
if (sysLog.getBeginDate() == null){
|
||||
@@ -24,4 +28,17 @@ public Page<SysLog> findPage(Page<SysLog> page, SysLog sysLog) {
|
||||
|
||||
}
|
||||
|
||||
public Page<SysLog> findCfgOperationLogPage(Page<SysLog> page, SysLog sysLog) {
|
||||
|
||||
// 设置默认时间范围,默认当前月
|
||||
if (sysLog.getBeginDate() == null){
|
||||
sysLog.setBeginDate(DateUtils.setDays(DateUtils.parseDate(DateUtils.getDate()), 1));
|
||||
}
|
||||
if (sysLog.getEndDate() == null){
|
||||
sysLog.setEndDate(DateUtils.addMonths(sysLog.getBeginDate(), 1));
|
||||
}
|
||||
sysLog.setPage(page);
|
||||
List<SysLog> list = sysLogDao.findCfgOperationLogList(sysLog);
|
||||
return page.setList(list);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,8 @@ 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.Map.Entry;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
@@ -10,8 +12,11 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.beust.jcommander.internal.Lists;
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.SysDataDictionaryItem;
|
||||
import com.nis.domain.basics.AsnIpCfg;
|
||||
import com.nis.domain.basics.PolicyGroupInfo;
|
||||
import com.nis.domain.configuration.CfgIndexInfo;
|
||||
import com.nis.domain.maat.GroupReuseAddBean;
|
||||
import com.nis.domain.maat.GroupReuseCfg;
|
||||
@@ -20,11 +25,15 @@ import com.nis.domain.maat.MaatCfg.NumBoundaryCfg;
|
||||
import com.nis.domain.maat.MaatCfg.StringCfg;
|
||||
import com.nis.domain.maat.ToMaatResult;
|
||||
import com.nis.domain.specific.ConfigGroupInfo;
|
||||
import com.nis.exceptions.MaatConvertException;
|
||||
import com.nis.util.ConfigServiceUtil;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.DictUtils;
|
||||
import com.nis.web.dao.CrudDao;
|
||||
import com.nis.web.dao.basics.AsnIpCfgDao;
|
||||
import com.nis.web.dao.basics.PolicyGroupInfoDao;
|
||||
import com.nis.web.dao.specific.SpecificServiceCfgDao;
|
||||
import com.nis.web.security.UserUtils;
|
||||
import com.nis.web.service.CrudService;
|
||||
@Service
|
||||
public class AsnIpCfgService extends CrudService<CrudDao<AsnIpCfg>, AsnIpCfg> {
|
||||
@@ -32,6 +41,8 @@ public class AsnIpCfgService extends CrudService<CrudDao<AsnIpCfg>, AsnIpCfg> {
|
||||
private AsnIpCfgDao asnIpCfgDao;
|
||||
@Autowired
|
||||
private SpecificServiceCfgDao specificServiceCfgDao;
|
||||
@Autowired
|
||||
private PolicyGroupInfoDao policyGroupInfoDao;
|
||||
/**
|
||||
* @param page
|
||||
* @param entity
|
||||
@@ -50,10 +61,13 @@ public class AsnIpCfgService extends CrudService<CrudDao<AsnIpCfg>, AsnIpCfg> {
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public void save(List<AsnIpCfg> entitys){
|
||||
Date createTime=new Date();
|
||||
List<Integer> idList=ConfigServiceUtil.getId(3, entitys.size());
|
||||
int index=0;
|
||||
for(AsnIpCfg entity:entitys) {
|
||||
entity.setCreateTime(createTime);
|
||||
entity.setCreatorId(entity.getCurrentUser().getId());
|
||||
entity.setRegionId(ConfigServiceUtil.getId(3, 1).get(0));
|
||||
entity.setRegionId(idList.get(index));
|
||||
index++;
|
||||
}
|
||||
this.saveBatch(entitys, AsnIpCfgDao.class);
|
||||
}
|
||||
@@ -72,10 +86,117 @@ public class AsnIpCfgService extends CrudService<CrudDao<AsnIpCfg>, AsnIpCfg> {
|
||||
throw new RuntimeException("asn group is issued, cannot update asn ip!");
|
||||
}
|
||||
|
||||
}
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public void saveAsnIpBatch(Map<String,List<AsnIpCfg>> cfgs) {
|
||||
List<AsnIpCfg> toDelAsnIpCfgs=Lists.newArrayList();
|
||||
List<AsnIpCfg> toSaveAsnIpCfgs=Lists.newArrayList();
|
||||
List<SysDataDictionaryItem> isImportAll=DictUtils.getDictList("IS_ASN_IP_IMPORT_ALL");
|
||||
for(Entry<String,List<AsnIpCfg>> entry:cfgs.entrySet()) {
|
||||
Integer asnNo=Integer.parseInt(entry.getKey());
|
||||
ConfigGroupInfo configGroupInfo=this.getConfigGroupInfoByAsnNo(asnNo);
|
||||
if(configGroupInfo==null) {//不存在则新增
|
||||
PolicyGroupInfo info=new PolicyGroupInfo();
|
||||
info.setAsnNo(Integer.parseInt(entry.getKey()));
|
||||
info.setDescription("Create by import excel");
|
||||
info.setGroupName("Import"+asnNo);
|
||||
info.setGroupType(4);
|
||||
this.saveAsnGroup(info);
|
||||
configGroupInfo=this.getConfigGroupInfoByAsnNo(asnNo);
|
||||
}
|
||||
for(AsnIpCfg cfg:entry.getValue()) {
|
||||
cfg.setAsnIpGroup(configGroupInfo.getGroupId());
|
||||
if(configGroupInfo.getIsIssued()==0)
|
||||
cfg.setIsValid(Constants.VALID_NO);
|
||||
else
|
||||
cfg.setIsValid(Constants.VALID_YES);
|
||||
}
|
||||
if(isImportAll.get(0).getItemCode().equals("1")) {//全量下发,删除已有的
|
||||
if(configGroupInfo.getIsIssued()==0) {//已下发
|
||||
List<AsnIpCfg> _toDelAsnIpCfgs=this.getByAsnGroup(configGroupInfo.getGroupId(), configGroupInfo.getAsnId());
|
||||
toDelAsnIpCfgs.addAll(_toDelAsnIpCfgs);
|
||||
}
|
||||
this.deleteByAsnGroup(configGroupInfo.getGroupId(), configGroupInfo.getAsnId());
|
||||
}
|
||||
toSaveAsnIpCfgs.addAll(entry.getValue());
|
||||
}
|
||||
this.save(toSaveAsnIpCfgs);
|
||||
if(toDelAsnIpCfgs.size()>0) {
|
||||
asnIPRegionSendToMaat(toDelAsnIpCfgs,Constants.VALID_NO);
|
||||
}
|
||||
if(toSaveAsnIpCfgs.size()>0) {
|
||||
asnIPRegionSendToMaat(toSaveAsnIpCfgs,Constants.VALID_YES);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* asn ip分组复用新增
|
||||
* @param asnIpCfgs
|
||||
*/
|
||||
public void asnIPRegionSendToMaat(List<AsnIpCfg> asnIpCfgs,Integer valid) {
|
||||
GroupReuseAddBean maatBean = new GroupReuseAddBean();
|
||||
List<GroupReuseCfg> groupReuseList=new ArrayList<>();
|
||||
GroupReuseCfg groupReuseCfg=new GroupReuseCfg();
|
||||
List<IpCfg> ipRegionList = groupReuseCfgAddRemoveConvert(asnIpCfgs,valid,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);
|
||||
if(valid==Constants.VALID_YES) {
|
||||
maatBean.setOpAction(Constants.INSERT_ACTION);
|
||||
//调用服务接口下发配置数据
|
||||
String json=gsonToJson(maatBean);
|
||||
logger.info("asn ip复用域新增配置下发配置参数:"+json);
|
||||
//调用服务接口下发配置
|
||||
ToMaatResult result =ConfigServiceUtil.postGroupReuseSources(json);
|
||||
logger.info("asn ip复用域新增配置响应信息:"+result.getMsg());
|
||||
}else {
|
||||
maatBean.setOpAction(Constants.UPDATE_ACTION);
|
||||
//调用服务接口下发配置数据
|
||||
String json=gsonToJson(maatBean);
|
||||
logger.info("asn ip复用域删除配置下发配置参数:"+json);
|
||||
//调用服务接口下发配置
|
||||
ToMaatResult result = ConfigServiceUtil.put(json,3);
|
||||
logger.info("asn ip复用域删除配置响应信息:"+result.getMsg());
|
||||
}
|
||||
}
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public void saveAsnGroup(PolicyGroupInfo entity) throws MaatConvertException{
|
||||
entity.setIsValid(1);
|
||||
//新增
|
||||
Date createTime=new Date();
|
||||
entity.setCreatorId(UserUtils.getUser().getId());
|
||||
entity.setCreateTime(createTime);
|
||||
//asn类型从综合服务获取groupId
|
||||
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 = new ConfigGroupInfo();
|
||||
group.setGroupId(serviceGroupId);
|
||||
group.setGroupName(entity.getGroupName());
|
||||
group.setIsIssued(0);
|
||||
group.setGroupType(entity.getGroupType());
|
||||
group.setAsnId(entity.getAsnNo());
|
||||
specificServiceCfgDao.insertConfigGroupInfo(group);
|
||||
policyGroupInfoDao.insert(entity);
|
||||
}
|
||||
|
||||
}
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public void saveAsnIpCfg(CfgIndexInfo entity) {
|
||||
Date crateTime=new Date();
|
||||
Date createTime=new Date();
|
||||
ConfigGroupInfo groupInfo=specificServiceCfgDao.getConfigGroupInfoByGroupId(entity.getAsnIpGroup().intValue());
|
||||
if(groupInfo==null) {
|
||||
throw new RuntimeException("ConfigGroupInfo is null!");
|
||||
@@ -89,39 +210,19 @@ public class AsnIpCfgService extends CrudService<CrudDao<AsnIpCfg>, AsnIpCfg> {
|
||||
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId","cfgDesc"});
|
||||
}
|
||||
|
||||
cfg.setCreateTime(crateTime);
|
||||
cfg.setCreateTime(createTime);
|
||||
cfg.setCreatorId(entity.getCurrentUser().getId());
|
||||
cfg.setAsnIpGroup(entity.getAsnIpGroup());
|
||||
cfg.setIsValid(Constants.VALID_YES);
|
||||
}
|
||||
}
|
||||
this.save(entity.getAsnIpCfgs());
|
||||
GroupReuseAddBean maatBean = new GroupReuseAddBean();
|
||||
List<GroupReuseCfg> groupReuseList=new ArrayList<>();
|
||||
GroupReuseCfg groupReuseCfg=new GroupReuseCfg();
|
||||
List<IpCfg> ipRegionList = groupReuseCfgAddRemoveConvert(entity.getAsnIpCfgs(),Constants.VALID_YES,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(crateTime);
|
||||
maatBean.setCreatorName(entity.getCurrentUser().getName());
|
||||
maatBean.setVersion(Constants.MAAT_VERSION);
|
||||
maatBean.setOpAction(Constants.INSERT_ACTION);
|
||||
//调用服务接口下发配置数据
|
||||
String json=gsonToJson(maatBean);
|
||||
logger.info("asn ip复用域新增配置下发配置参数:"+json);
|
||||
//调用服务接口下发配置
|
||||
ToMaatResult result = ConfigServiceUtil.postGroupReuseSources(json);
|
||||
logger.info("asn ip复用域新增配置响应信息:"+result.getMsg());
|
||||
asnIPRegionSendToMaat(entity.getAsnIpCfgs(),Constants.VALID_YES);
|
||||
}else {
|
||||
if(entity.getAsnIpCfgs()!=null) {
|
||||
for(AsnIpCfg cfg:entity.getAsnIpCfgs()) {
|
||||
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
|
||||
cfg.setCreateTime(crateTime);
|
||||
cfg.setCreateTime(createTime);
|
||||
cfg.setCreatorId(entity.getCurrentUser().getId());
|
||||
cfg.setAsnIpGroup(entity.getAsnIpGroup().intValue());
|
||||
cfg.setIsValid(Constants.VALID_NO);
|
||||
@@ -151,34 +252,14 @@ public class AsnIpCfgService extends CrudService<CrudDao<AsnIpCfg>, AsnIpCfg> {
|
||||
}
|
||||
if(issuedList.size()>0) {
|
||||
//已经下发过的,调用分组复用配置删除接口
|
||||
GroupReuseAddBean maatBean = new GroupReuseAddBean();
|
||||
List<GroupReuseCfg> groupReuseList=new ArrayList<>();
|
||||
GroupReuseCfg groupReuseCfg=new GroupReuseCfg();
|
||||
List<IpCfg> ipRegionList = groupReuseCfgAddRemoveConvert(issuedList,Constants.VALID_NO,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(new AsnIpCfg().getCurrentUser().getName());
|
||||
maatBean.setVersion(Constants.MAAT_VERSION);
|
||||
maatBean.setOpAction(Constants.UPDATE_ACTION);
|
||||
//调用服务接口下发配置数据
|
||||
String json=gsonToJson(maatBean);
|
||||
logger.info("asn ip复用域删除配置下发配置参数:"+json);
|
||||
//调用服务接口下发配置
|
||||
ToMaatResult result = ConfigServiceUtil.put(json,3);
|
||||
logger.info("asn ip复用域删除配置响应信息:"+result.getMsg());
|
||||
asnIPRegionSendToMaat(issuedList,Constants.VALID_NO);
|
||||
}
|
||||
asnIpCfgDao.updateValid(isValid, ids);
|
||||
}
|
||||
public List<ConfigGroupInfo> findPolicyGroupInfosByType(Integer groupId) {
|
||||
// TODO Auto-generated method stub
|
||||
return asnIpCfgDao.findPolicyGroupInfosByType(groupId);
|
||||
}
|
||||
// public List<ConfigGroupInfo> findPolicyGroupInfosByType(Integer groupId) {
|
||||
// // TODO Auto-generated method stub
|
||||
// return asnIpCfgDao.findPolicyGroupInfosByType(groupId);
|
||||
// }
|
||||
/**
|
||||
* 选中组中是否含有只剩一个未删除IP的组
|
||||
* @param serviceGroupIds
|
||||
@@ -200,4 +281,19 @@ public class AsnIpCfgService extends CrudService<CrudDao<AsnIpCfg>, AsnIpCfg> {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public ConfigGroupInfo getConfigGroupInfoByAsnNo(Integer asnNo) {
|
||||
return asnIpCfgDao.getInfoByAsnNo(asnNo);
|
||||
}
|
||||
public List<AsnIpCfg> getByAsnGroup(Integer groupId,Integer asnNo) {
|
||||
if(groupId==null||asnNo==null) {
|
||||
throw new RuntimeException("groupId or asnNo is null!");
|
||||
}
|
||||
return asnIpCfgDao.getByAsnGroup(groupId,asnNo);
|
||||
}
|
||||
public void deleteByAsnGroup(Integer groupId,Integer asnNo) {
|
||||
if(groupId==null||asnNo==null) {
|
||||
throw new RuntimeException("groupId or asnNo is null!");
|
||||
}
|
||||
asnIpCfgDao.deleteByAsnGroup(groupId,asnNo);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1558,6 +1558,7 @@ public class AvContentCfgService extends BaseService{
|
||||
entity.setIsValid(isValid);
|
||||
entity.setAuditorId(UserUtils.getUser().getId());
|
||||
entity.setAuditTime(auditTime);
|
||||
avContentCfgDao.updateAvVoipIp(entity);
|
||||
avContentCfgDao.updateAvVoipKeywordCfgt(entity);
|
||||
avContentCfgDao.updateCfgIndexInfo(entity);
|
||||
AreaIpCfg areaIpCfg=new AreaIpCfg();
|
||||
@@ -1588,6 +1589,10 @@ public class AvContentCfgService extends BaseService{
|
||||
|
||||
if(isAudit==1){
|
||||
if(!StringUtil.isEmpty(ipPortList)){
|
||||
IpPortCfg cfg = new IpPortCfg();
|
||||
BeanUtils.copyProperties(entity, cfg, new String[] { "cfgId" });
|
||||
cfg.setTableName(IpPortCfg.getTablename());
|
||||
avContentCfgDao.updateCfgValid(cfg);
|
||||
Map<String,List> ipMap = cfgConvert(ipRegionList,ipPortList,1,entity,groupRelationList);
|
||||
groupRelationList=ipMap.get("groupList");
|
||||
ipRegionList=ipMap.get("dstList");
|
||||
|
||||
@@ -75,13 +75,13 @@ public class BgpCfgService extends CrudService<BgpCfgDao,CfgIndexInfo> {
|
||||
|
||||
public CfgIndexInfo exportbgp(CfgIndexInfo entity){
|
||||
List<IpPortCfg> ipPortList = bgpCfgDao.getIpPortList(entity);
|
||||
NtcSubscribeIdCfg subscribeId = new NtcSubscribeIdCfg();
|
||||
subscribeId.setCompileId(entity.getCompileId());
|
||||
subscribeId.setIsValid(entity.getIsValid());
|
||||
List<NtcSubscribeIdCfg> ntcSubscribeIdCfgList = stringCfgDao.findSubscribeIdCfgList(subscribeId);
|
||||
// NtcSubscribeIdCfg subscribeId = new NtcSubscribeIdCfg();
|
||||
// subscribeId.setCompileId(entity.getCompileId());
|
||||
// subscribeId.setIsValid(entity.getIsValid());
|
||||
// List<NtcSubscribeIdCfg> ntcSubscribeIdCfgList = stringCfgDao.findSubscribeIdCfgList(subscribeId);
|
||||
List<NtcBgpAsCfg> ntcBgpAsCfgList = bgpCfgDao.getNtcBgpAsList(entity);
|
||||
entity.setIpPortList(ipPortList);
|
||||
entity.setNtcSubscribeIdCfgList(ntcSubscribeIdCfgList);
|
||||
// entity.setNtcSubscribeIdCfgList(ntcSubscribeIdCfgList);
|
||||
entity.setNtcBgpAsCfgList(ntcBgpAsCfgList);
|
||||
return entity;
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
@@ -523,4 +524,5 @@ public class HttpRedirectCfgService extends CrudService<WebsiteCfgDao,CfgIndexIn
|
||||
logger.info("http配置取消配置响应信息:"+result.getMsg());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ import com.nis.domain.configuration.IpMultiplexPoolCfg;
|
||||
import com.nis.domain.maat.ToMaatResult;
|
||||
import com.nis.exceptions.MaatConvertException;
|
||||
import com.nis.util.ConfigServiceUtil;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.web.dao.basics.SysDictInfoDao;
|
||||
import com.nis.web.dao.configuration.IpMultiplexPoolCfgDao;
|
||||
import com.nis.web.security.UserUtils;
|
||||
@@ -191,6 +192,7 @@ public class IpMultiplexPoolCfgService extends BaseService{
|
||||
|
||||
public List<IpMultiplexPoolCfg> getIsp(List<IpMultiplexPoolCfg> ispList){
|
||||
for (IpMultiplexPoolCfg snat : ispList) {
|
||||
if(!StringUtil.isEmpty(snat.getAreaEffectiveIds())){
|
||||
if(snat.getAreaEffectiveIds().contains(":")){
|
||||
int index=snat.getAreaEffectiveIds().indexOf(":");
|
||||
String ispCode =snat.getAreaEffectiveIds().substring(index+1);
|
||||
@@ -198,6 +200,12 @@ public class IpMultiplexPoolCfgService extends BaseService{
|
||||
if(dict !=null){
|
||||
snat.setIspName(dict.getItemValue());
|
||||
}
|
||||
}else{
|
||||
SysDictInfo dict= sysDictInfoDao.getDictByItemCode(snat.getAreaEffectiveIds());
|
||||
if(dict !=null){
|
||||
snat.setIspName(dict.getItemValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return ispList;
|
||||
|
||||
@@ -39,6 +39,7 @@ import com.nis.util.ConfigServiceUtil;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.DictUtils;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.web.dao.basics.ServiceDictInfoDao;
|
||||
import com.nis.web.dao.configuration.AreaIpCfgDao;
|
||||
import com.nis.web.dao.configuration.StringCfgDao;
|
||||
import com.nis.web.dao.configuration.WebsiteCfgDao;
|
||||
@@ -58,6 +59,8 @@ public class WebsiteCfgService extends CrudService<WebsiteCfgDao,CfgIndexInfo> {
|
||||
protected AreaIpCfgDao areaIpCfgDao;
|
||||
@Autowired
|
||||
protected StringCfgDao stringCfgDao;
|
||||
@Autowired
|
||||
private ServiceDictInfoDao serviceDictInfoDao;
|
||||
|
||||
public CfgIndexInfo getHttpCfg(Long cfgId){
|
||||
CfgIndexInfo entity = websiteCfgDao.getCfgIndexInfo(cfgId);
|
||||
@@ -377,7 +380,7 @@ public class WebsiteCfgService extends CrudService<WebsiteCfgDao,CfgIndexInfo> {
|
||||
}
|
||||
|
||||
}
|
||||
public void auditHttpCfg(CfgIndexInfo entity,Integer isAudit) throws MaatConvertException{
|
||||
public void auditHttpCfg(CfgIndexInfo entity,Integer isAudit) throws Exception{
|
||||
//修改数据库审核状态信息
|
||||
entity.setTableName(CfgIndexInfo.getTablename());
|
||||
websiteCfgDao.auditCfg(entity);
|
||||
@@ -555,6 +558,14 @@ public class WebsiteCfgService extends CrudService<WebsiteCfgDao,CfgIndexInfo> {
|
||||
maatCfg.setServiceId(entity.getServiceId());
|
||||
maatCfg.setIsValid(0);//无效
|
||||
configCompileList.add(maatCfg);
|
||||
//http关键字配置失效时,需确认是否存在与之关联的HTTPURL配置
|
||||
List<MaatCfg> httpUrlCompile=new ArrayList<>();
|
||||
if(entity.getFunctionId().equals(635)){
|
||||
httpUrlCompile=auditHttpUrlByBodyId(maatCfg,httpUrlCompile,entity);
|
||||
}
|
||||
if(!StringUtil.isEmpty(httpUrlCompile)){
|
||||
configCompileList.addAll(httpUrlCompile);
|
||||
}
|
||||
maatBean.setConfigCompileList(configCompileList);
|
||||
maatBean.setAuditTime(entity.getAuditTime());
|
||||
maatBean.setCreatorName(entity.getCurrentUser().getName());
|
||||
@@ -566,8 +577,122 @@ public class WebsiteCfgService extends CrudService<WebsiteCfgDao,CfgIndexInfo> {
|
||||
//调用服务接口下发配置
|
||||
ToMaatResult result = ConfigServiceUtil.put(json,1);
|
||||
logger.info("http配置取消配置响应信息:"+result.getMsg());
|
||||
|
||||
}
|
||||
}
|
||||
public List<MaatCfg> auditHttpUrlByBodyId(MaatCfg maatCfgBody,List<MaatCfg> httpUrlCompile,CfgIndexInfo cfgHttpBody) throws Exception{
|
||||
ToMaatBean maatBean = new ToMaatBean();
|
||||
MaatCfg maatCfg = new MaatCfg();
|
||||
|
||||
CfgIndexInfo cfg=new CfgIndexInfo();
|
||||
cfg.setSourceCompileId(maatCfgBody.getCompileId());
|
||||
cfg.setFunctionId(6);//http url
|
||||
List<CfgIndexInfo> cfgs=websiteCfgDao.getCfgIndexInfos(cfg);
|
||||
//关键字包含的所有url配置
|
||||
for (CfgIndexInfo cfgIndexInfo : cfgs) {
|
||||
//查询所有httpurl配置
|
||||
List<HttpUrlCfg> httpUrlList=websiteCfgDao.getHttpUrlList(cfgIndexInfo);
|
||||
|
||||
//审核通过的,失效 3 0
|
||||
if(cfgIndexInfo.getIsAudit().equals(1)){
|
||||
cfgIndexInfo.setTableName(CfgIndexInfo.getTablename());
|
||||
cfgIndexInfo.setAuditorId(UserUtils.getUser().getId());
|
||||
cfgIndexInfo.setAuditTime(maatCfgBody.getAuditTime());
|
||||
cfgIndexInfo.setIsAudit(3);
|
||||
cfgIndexInfo.setIsValid(0);
|
||||
//设置配置取消的来函信息
|
||||
serviceDictInfoDao.auditCancleRequestInfo(cfgHttpBody.getCancelRequestId(),
|
||||
"cfg_index_info",
|
||||
cfgIndexInfo.getCfgId().toString());
|
||||
websiteCfgDao.auditCfg(cfgIndexInfo);
|
||||
for (BaseStringCfg httpUrlCfg : httpUrlList) {
|
||||
httpUrlCfg.setTableName(HttpUrlCfg.getTablename());
|
||||
httpUrlCfg.setAuditorId(UserUtils.getUser().getId());
|
||||
httpUrlCfg.setAuditTime(maatCfgBody.getAuditTime());
|
||||
httpUrlCfg.setIsAudit(3);
|
||||
httpUrlCfg.setIsValid(0);
|
||||
websiteCfgDao.auditCfg(httpUrlCfg);
|
||||
}
|
||||
|
||||
}else if(!(cfgIndexInfo.getIsAudit().equals(3) || cfgIndexInfo.getIsValid().equals(-1))){
|
||||
//未审核和审核未通过,删除 0 -1
|
||||
cfgIndexInfo.setTableName(CfgIndexInfo.getTablename());
|
||||
cfgIndexInfo.setEditorId(UserUtils.getUser().getId());
|
||||
cfgIndexInfo.setEditTime(maatCfgBody.getAuditTime());
|
||||
cfgIndexInfo.setIsAudit(0);
|
||||
cfgIndexInfo.setIsValid(-1);
|
||||
websiteCfgDao.updateCfgValid(cfgIndexInfo);
|
||||
|
||||
for (BaseStringCfg httpUrlCfg : httpUrlList) {
|
||||
httpUrlCfg.setTableName(HttpUrlCfg.getTablename());
|
||||
httpUrlCfg.setEditorId(UserUtils.getUser().getId());
|
||||
httpUrlCfg.setEditTime(maatCfgBody.getAuditTime());
|
||||
httpUrlCfg.setIsAudit(0);
|
||||
httpUrlCfg.setIsValid(-1);
|
||||
websiteCfgDao.updateCfgValid(httpUrlCfg);
|
||||
}
|
||||
}
|
||||
//只有审核通过的配置需要下发失效动作
|
||||
if(cfgIndexInfo.getIsAudit().equals(3)){
|
||||
maatCfg.setCompileId(cfgIndexInfo.getCompileId());
|
||||
maatCfg.setServiceId(cfgIndexInfo.getServiceId());
|
||||
maatCfg.setIsValid(0);//无效
|
||||
httpUrlCompile.add(maatCfg);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
List<HttpUrlCfg> httpUrlList=websiteCfgDao.getHttpUrlList(cfg);
|
||||
if(!StringUtil.isEmpty(httpUrlList)){}{
|
||||
for (BaseStringCfg httpUrlCfg : httpUrlList) {
|
||||
//失效中间表
|
||||
CfgIndexInfo entity=new CfgIndexInfo();
|
||||
entity.setTableName(CfgIndexInfo.getTablename());
|
||||
entity.setFunctionId(6);
|
||||
entity.setCompileId(httpUrlCfg.getCompileId());
|
||||
httpUrlCfg.setTableName(HttpUrlCfg.getTablename());
|
||||
//审核通过的,失效 3 0
|
||||
if(httpUrlCfg.getIsAudit().equals(1)){
|
||||
entity.setAuditorId(UserUtils.getUser().getId());
|
||||
entity.setAuditTime(maatCfgBody.getAuditTime());
|
||||
entity.setIsAudit(3);
|
||||
entity.setIsValid(0);
|
||||
|
||||
httpUrlCfg.setAuditorId(UserUtils.getUser().getId());
|
||||
httpUrlCfg.setAuditTime(maatCfgBody.getAuditTime());
|
||||
httpUrlCfg.setIsAudit(3);
|
||||
httpUrlCfg.setIsValid(0);
|
||||
|
||||
websiteCfgDao.auditCfg(entity);
|
||||
websiteCfgDao.auditCfg(httpUrlCfg);
|
||||
//serviceDictInfoDao.auditCancleRequestInfo(cancelRequestId, "cfg_index_info", entity);
|
||||
}else if(!(httpUrlCfg.getIsAudit().equals(3) || httpUrlCfg.getIsValid().equals(-1))){
|
||||
//未审核和审核未通过,删除 0 -1
|
||||
entity.setEditorId(UserUtils.getUser().getId());
|
||||
entity.setEditTime(maatCfgBody.getAuditTime());
|
||||
entity.setIsAudit(0);
|
||||
entity.setIsValid(-1);
|
||||
|
||||
httpUrlCfg.setEditorId(UserUtils.getUser().getId());
|
||||
httpUrlCfg.setEditTime(maatCfgBody.getAuditTime());
|
||||
httpUrlCfg.setIsAudit(0);
|
||||
httpUrlCfg.setIsValid(-1);
|
||||
|
||||
websiteCfgDao.updateCfgValid(entity);
|
||||
websiteCfgDao.updateCfgValid(httpUrlCfg);
|
||||
|
||||
}
|
||||
//只有审核通过的配置需要下发失效动作
|
||||
if(httpUrlCfg.getIsAudit().equals(3)){
|
||||
maatCfg.setCompileId(httpUrlCfg.getCompileId());
|
||||
maatCfg.setServiceId(httpUrlCfg.getServiceId());
|
||||
maatCfg.setIsValid(0);//无效
|
||||
httpUrlCompile.add(maatCfg);
|
||||
}
|
||||
}
|
||||
}*/
|
||||
return httpUrlCompile;
|
||||
}
|
||||
public void saveSslCfg(CfgIndexInfo entity){
|
||||
//设置区域运营商信息
|
||||
setAreaEffectiveIds(entity);
|
||||
|
||||
@@ -38,4 +38,7 @@ public class ConfigureStatisticsService extends CrudService<NumCfgDao,NumBoundar
|
||||
List<Object[]> dataList=configureStatisticsDao.getRequestStateStatistics(requestList,serviceList);
|
||||
return dataList;
|
||||
}
|
||||
public Integer getEffectiveCfgNum(Integer serviceId){
|
||||
return configureStatisticsDao.getEffectiveCfgNum(serviceId);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user