Merge branch 'develop_no_common_group' of https://git.mesalab.cn/K18_NTCS_WEB/NTC.git into develop_no_common_group
This commit is contained in:
@@ -14,6 +14,7 @@ public class ScheduleCfg extends BaseCfg<ScheduleCfg>{
|
||||
private String cronValid;//生效cron表达式
|
||||
private String cronInvalid;//失效cron表达式
|
||||
private String whereStr;//动态where 条件
|
||||
private int type;
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
@@ -38,6 +39,11 @@ public class ScheduleCfg extends BaseCfg<ScheduleCfg>{
|
||||
public void setWhereStr(String whereStr) {
|
||||
this.whereStr = whereStr;
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
public void setType(int type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
92
src/main/java/com/nis/domain/SysUserWarn.java
Normal file
92
src/main/java/com/nis/domain/SysUserWarn.java
Normal file
@@ -0,0 +1,92 @@
|
||||
package com.nis.domain;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import javax.xml.bind.annotation.XmlTransient;
|
||||
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
|
||||
public class SysUserWarn {
|
||||
|
||||
private String serviceId; //业务Id
|
||||
private String serviceDesc;//业务描述
|
||||
private Integer interfaceCfgTotal;//界面配置数量
|
||||
|
||||
private Integer systemCfgTotal;//服务端配置数量
|
||||
|
||||
private Date time;//时间
|
||||
private String remark;//备注
|
||||
|
||||
private Integer id;//serviceID
|
||||
private String tableName;//表名
|
||||
/**
|
||||
* 当前实体分页对象
|
||||
*/
|
||||
protected Page<SysUserWarn> page;
|
||||
|
||||
public String getServiceId() {
|
||||
return serviceId;
|
||||
}
|
||||
public void setServiceId(String serviceId) {
|
||||
this.serviceId = serviceId;
|
||||
}
|
||||
public String getServiceDesc() {
|
||||
return serviceDesc;
|
||||
}
|
||||
public void setServiceDesc(String serviceDesc) {
|
||||
this.serviceDesc = serviceDesc;
|
||||
}
|
||||
public Integer getInterfaceCfgTotal() {
|
||||
return interfaceCfgTotal;
|
||||
}
|
||||
public void setInterfaceCfgTotal(Integer interfaceCfgTotal) {
|
||||
this.interfaceCfgTotal = interfaceCfgTotal;
|
||||
}
|
||||
public Integer getSystemCfgTotal() {
|
||||
return systemCfgTotal;
|
||||
}
|
||||
public void setSystemCfgTotal(Integer systemCfgTotal) {
|
||||
this.systemCfgTotal = systemCfgTotal;
|
||||
}
|
||||
public Date getTime() {
|
||||
return time;
|
||||
}
|
||||
public void setTime(Date time) {
|
||||
this.time = time;
|
||||
}
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
public String getTableName() {
|
||||
return tableName;
|
||||
}
|
||||
public void setTableName(String tableName) {
|
||||
this.tableName = tableName;
|
||||
}
|
||||
@JsonIgnore
|
||||
@XmlTransient
|
||||
public Page<SysUserWarn> getPage() {
|
||||
if (page == null){
|
||||
page = new Page<SysUserWarn>();
|
||||
}
|
||||
return page;
|
||||
}
|
||||
|
||||
public Page<SysUserWarn> setPage(Page<SysUserWarn> page) {
|
||||
this.page = page;
|
||||
return page;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
46
src/main/java/com/nis/domain/SysUserWarnData.java
Normal file
46
src/main/java/com/nis/domain/SysUserWarnData.java
Normal file
@@ -0,0 +1,46 @@
|
||||
package com.nis.domain;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class SysUserWarnData {
|
||||
|
||||
private Map<String,List<String>> effective;
|
||||
private Integer effectiveCount;
|
||||
private Map<String,List<String>> obsolete;
|
||||
private Integer obsoleteCount;
|
||||
|
||||
|
||||
public Map<String, List<String>> getEffective() {
|
||||
return effective;
|
||||
}
|
||||
public void setEffective(Map<String, List<String>> effective) {
|
||||
this.effective = effective;
|
||||
}
|
||||
public Integer getEffectiveCount() {
|
||||
return effectiveCount;
|
||||
}
|
||||
public void setEffectiveCount(Integer effectiveCount) {
|
||||
this.effectiveCount = effectiveCount;
|
||||
}
|
||||
public Map<String, List<String>> getObsolete() {
|
||||
return obsolete;
|
||||
}
|
||||
public void setObsolete(Map<String, List<String>> obsolete) {
|
||||
this.obsolete = obsolete;
|
||||
}
|
||||
public Integer getObsoleteCount() {
|
||||
return obsoleteCount;
|
||||
}
|
||||
public void setObsoleteCount(Integer obsoleteCount) {
|
||||
this.obsoleteCount = obsoleteCount;
|
||||
}
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SysUserWarnData [effective=" + effective + ", effectiveCount=" + effectiveCount + ", obsolete="
|
||||
+ obsolete + ", obsoleteCount=" + obsoleteCount + "]";
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
67
src/main/java/com/nis/domain/SysUserWarnRecvData.java
Normal file
67
src/main/java/com/nis/domain/SysUserWarnRecvData.java
Normal file
@@ -0,0 +1,67 @@
|
||||
package com.nis.domain;
|
||||
|
||||
public class SysUserWarnRecvData {
|
||||
private Integer status;
|
||||
private Integer businessCode;
|
||||
private String reason;
|
||||
private String msg;
|
||||
private String fromuri;
|
||||
private String logSource;
|
||||
private String traceCode;
|
||||
private SysUserWarnData data;
|
||||
|
||||
|
||||
public Integer getStatus() {
|
||||
return status;
|
||||
}
|
||||
public void setStatus(Integer status) {
|
||||
this.status = status;
|
||||
}
|
||||
public Integer getBusinessCode() {
|
||||
return businessCode;
|
||||
}
|
||||
public void setBusinessCode(Integer businessCode) {
|
||||
this.businessCode = businessCode;
|
||||
}
|
||||
public String getReason() {
|
||||
return reason;
|
||||
}
|
||||
public void setReason(String reason) {
|
||||
this.reason = reason;
|
||||
}
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
public void setMsg(String msg) {
|
||||
this.msg = msg;
|
||||
}
|
||||
public String getFromuri() {
|
||||
return fromuri;
|
||||
}
|
||||
public void setFromuri(String fromuri) {
|
||||
this.fromuri = fromuri;
|
||||
}
|
||||
public String getLogSource() {
|
||||
return logSource;
|
||||
}
|
||||
public void setLogSource(String logSource) {
|
||||
this.logSource = logSource;
|
||||
}
|
||||
public String getTraceCode() {
|
||||
return traceCode;
|
||||
}
|
||||
public void setTraceCode(String traceCode) {
|
||||
this.traceCode = traceCode;
|
||||
}
|
||||
public SysUserWarnData getData() {
|
||||
return data;
|
||||
}
|
||||
public void setData(SysUserWarnData data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
57
src/main/java/com/nis/domain/basics/ProtectionListInfo.java
Normal file
57
src/main/java/com/nis/domain/basics/ProtectionListInfo.java
Normal file
@@ -0,0 +1,57 @@
|
||||
package com.nis.domain.basics;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import com.nis.domain.configuration.BaseCfg;
|
||||
|
||||
public class ProtectionListInfo extends BaseCfg<ProtectionListInfo> implements Serializable{
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = -3781310894175345207L;
|
||||
private Integer proId;
|
||||
private String keyword;
|
||||
private String targetType;
|
||||
private String description;
|
||||
|
||||
|
||||
public Integer getProId() {
|
||||
return proId;
|
||||
}
|
||||
public void setProId(Integer proId) {
|
||||
this.proId = proId;
|
||||
}
|
||||
public String getKeyword() {
|
||||
return keyword;
|
||||
}
|
||||
public void setKeyword(String keyword) {
|
||||
this.keyword = keyword;
|
||||
}
|
||||
public String getTargetType() {
|
||||
return targetType;
|
||||
}
|
||||
public void setTargetType(String targetType) {
|
||||
this.targetType = targetType;
|
||||
}
|
||||
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 String getDescription() {
|
||||
return description;
|
||||
}
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -12,7 +12,7 @@ public class DomainInterceptMonitTemplate extends StringAllNotDoLogTemplate{
|
||||
private String userRegion5;
|
||||
private String cfgKeywords;
|
||||
|
||||
@ExcelField(title="intercept_intensity",dictType="INTERCEPT_DOMAIN_INTENSITY",align=2,sort=2)
|
||||
@ExcelField(title="intercept_intensity",dictType="INTERCEPT_DOMAIN_INTENSITY",align=2,sort=12)
|
||||
public String getUserRegion5() {
|
||||
return userRegion5;
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ public class P2pIpTemplate extends IpAllTemplate {
|
||||
|
||||
private String userRegion2;
|
||||
|
||||
@ExcelField(title="p2p_ip_config_type",dictType="P2P_IP_TYPE",align=2,sort=2)
|
||||
@ExcelField(title="p2p_ip_config_type",dictType="P2P_IP_TYPE",align=2,sort=5)
|
||||
public String getUserRegion2() {
|
||||
return userRegion2;
|
||||
}
|
||||
|
||||
@@ -331,6 +331,7 @@ public class ScheduleUpdateInterceptor extends BaseInterceptor{
|
||||
if(schedule != null ) {
|
||||
BeanUtils.copyProperties(baseCfg, schedule,new String[]{"userRegion1","userRegion2","userRegion3","userRegion4","userRegion5"});
|
||||
schedule.setTableName(tableName);
|
||||
schedule.setType(1);
|
||||
}
|
||||
return schedule;
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ public class ScheduleCfgJob implements Job {
|
||||
List<ScheduleCfg> newlyCfg = null;
|
||||
int totalNum = 0;
|
||||
do {
|
||||
newlyCfg = dao.findNewlyCfg(scheduleCfgId, limit);
|
||||
newlyCfg = dao.findNewlyCfg(scheduleCfgId, limit,1);
|
||||
if(newlyCfg != null && newlyCfg.size() > 0) {
|
||||
totalNum += newlyCfg.size();
|
||||
for(ScheduleCfg cfg : newlyCfg) {//先取消之前的定时配置
|
||||
|
||||
@@ -1,12 +1,20 @@
|
||||
package com.nis.quartz;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.quartz.Job;
|
||||
import org.quartz.JobDataMap;
|
||||
import org.quartz.JobExecutionContext;
|
||||
import org.quartz.JobExecutionException;
|
||||
import org.quartz.Scheduler;
|
||||
import org.quartz.SchedulerException;
|
||||
|
||||
import com.nis.domain.ScheduleCfg;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.DateUtil;
|
||||
import com.nis.util.DictUtils;
|
||||
import com.nis.web.dao.SchedulerDao;
|
||||
import com.nis.web.service.ScheduleService;
|
||||
import com.nis.web.service.SpringContextHolder;
|
||||
|
||||
@@ -23,16 +31,45 @@ public class ScheduleStatusJob implements Job{
|
||||
|
||||
@Override
|
||||
public void execute(JobExecutionContext context) throws JobExecutionException {
|
||||
//从trigger中 获取 配置信息
|
||||
JobDataMap jobDataMap = context.getTrigger().getJobDataMap();
|
||||
boolean isValid = jobDataMap.getBoolean("isValid");
|
||||
ScheduleCfg cfg = (ScheduleCfg)jobDataMap.get("cfg");
|
||||
Integer compileId = cfg.getCompileId();
|
||||
log.debug(String.format("任务开始执行,compileId:%s,isValid:%s",compileId,isValid ));
|
||||
//配置下发,并修改 配置表的状态,保存下发记录等
|
||||
ScheduleService scheduleService = SpringContextHolder.getBean(ScheduleService.class);
|
||||
scheduleService.issueCompileInfo(cfg, isValid?1:0);
|
||||
log.debug(String.format("任务开始执行,compileId:%s,isValid:%s",compileId,isValid ));
|
||||
|
||||
//全量同步状态
|
||||
String currentStatus = DictUtils.getDictLabel("currrent_sync_status", "status","0");
|
||||
//0:start:开始 1:init:初始化 2:doing:进行中
|
||||
|
||||
//全量同步过程中未执行的任务进入另一个job中,等待全量同步完成开始执行
|
||||
if(currentStatus.equals("0") || currentStatus.equals("1")||currentStatus.equals("2")) {
|
||||
//配置下发,并修改 配置表的状态,保存下发记录等
|
||||
SchedulerDao schedulerDao = SpringContextHolder.getBean(SchedulerDao.class);
|
||||
//从trigger中 获取 配置信息
|
||||
JobDataMap jobDataMap = context.getTrigger().getJobDataMap();
|
||||
boolean isValid = jobDataMap.getBoolean("isValid");
|
||||
|
||||
ScheduleCfg cfg = (ScheduleCfg)jobDataMap.get("cfg");
|
||||
cfg.setId(null);//新入库一个任务
|
||||
cfg.setType(2);//全量同步中未执行的任务
|
||||
cfg.setUserRegion1("single"); //只执行一次
|
||||
if(isValid) {
|
||||
cfg.setCronValid("1900-01-01 01:01:01"); //无实际效果,仅仅为填充值
|
||||
cfg.setCronInvalid("");
|
||||
}else {
|
||||
cfg.setCronValid("");
|
||||
cfg.setCronInvalid("1900-01-01 01:01:01");//无实际效果,仅仅为填充值
|
||||
}
|
||||
schedulerDao.insert(cfg);
|
||||
|
||||
}else {
|
||||
//从trigger中 获取 配置信息
|
||||
JobDataMap jobDataMap = context.getTrigger().getJobDataMap();
|
||||
boolean isValid = jobDataMap.getBoolean("isValid");
|
||||
ScheduleCfg cfg = (ScheduleCfg)jobDataMap.get("cfg");
|
||||
Integer compileId = cfg.getCompileId();
|
||||
log.debug(String.format("任务开始执行,compileId:%s,isValid:%s",compileId,isValid ));
|
||||
//配置下发,并修改 配置表的状态,保存下发记录等
|
||||
ScheduleService scheduleService = SpringContextHolder.getBean(ScheduleService.class);
|
||||
scheduleService.issueCompileInfo(cfg, isValid?1:0);
|
||||
log.debug(String.format("任务开始执行,compileId:%s,isValid:%s",compileId,isValid ));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
548
src/main/java/com/nis/quartz/ScheduleSyncCfgJob.java
Normal file
548
src/main/java/com/nis/quartz/ScheduleSyncCfgJob.java
Normal file
@@ -0,0 +1,548 @@
|
||||
package com.nis.quartz;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.quartz.CalendarIntervalScheduleBuilder;
|
||||
import org.quartz.CalendarIntervalTrigger;
|
||||
import org.quartz.CronScheduleBuilder;
|
||||
import org.quartz.DateBuilder;
|
||||
import org.quartz.DisallowConcurrentExecution;
|
||||
import org.quartz.Job;
|
||||
import org.quartz.JobBuilder;
|
||||
import org.quartz.JobDataMap;
|
||||
import org.quartz.JobDetail;
|
||||
import org.quartz.JobExecutionContext;
|
||||
import org.quartz.JobExecutionException;
|
||||
import org.quartz.JobKey;
|
||||
import org.quartz.PersistJobDataAfterExecution;
|
||||
import org.quartz.ScheduleBuilder;
|
||||
import org.quartz.Scheduler;
|
||||
import org.quartz.SchedulerException;
|
||||
import org.quartz.SimpleScheduleBuilder;
|
||||
import org.quartz.SimpleTrigger;
|
||||
import org.quartz.Trigger;
|
||||
import org.quartz.TriggerBuilder;
|
||||
import org.quartz.TriggerKey;
|
||||
import org.quartz.impl.matchers.GroupMatcher;
|
||||
import org.quartz.impl.triggers.CalendarIntervalTriggerImpl;
|
||||
import org.quartz.impl.triggers.CronTriggerImpl;
|
||||
import org.quartz.spi.MutableTrigger;
|
||||
|
||||
import com.nis.domain.ScheduleCfg;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.DateUtil;
|
||||
import com.nis.util.DateUtils;
|
||||
import com.nis.util.DictUtils;
|
||||
import com.nis.util.StringUtils;
|
||||
import com.nis.web.dao.SchedulerDao;
|
||||
import com.nis.web.service.SpringContextHolder;
|
||||
|
||||
/**
|
||||
* 定时任务 配置全量同步时未执行的定时任务加载
|
||||
* 1、每 n s 执行一次,每次读取 schedule_cfg 最新的数据
|
||||
* 2、删除或新增 定时任务
|
||||
* 3、单线程执行
|
||||
* @author ddm
|
||||
*
|
||||
*/
|
||||
@DisallowConcurrentExecution
|
||||
@PersistJobDataAfterExecution
|
||||
public class ScheduleSyncCfgJob implements Job {
|
||||
SimpleDateFormat sdf=new SimpleDateFormat(Constants.COMMON_DATE_FORMAT);
|
||||
private static final Logger log = Logger.getLogger(ScheduleSyncCfgJob.class);
|
||||
|
||||
/**
|
||||
* 状态组,格式:statusGroup-compileId
|
||||
*/
|
||||
private static final String STATUS_GROUP = "syncGroup-";
|
||||
private static final String STATUS_JOB = "SYNC-JOB";
|
||||
/**
|
||||
* 生效标识:valid-cronexp
|
||||
*/
|
||||
private static final String VALID_KEY = "valid-";
|
||||
/**
|
||||
* 失效标识:invalid-cronexp
|
||||
*/
|
||||
private static final String INVALID_KEY = "invalid-";
|
||||
private static final JobKey STATUS_JOBKEY = JobKey.jobKey(STATUS_JOB, "syncGroup");
|
||||
private static final JobDetail STATUS_JOBDETAIL = JobBuilder.newJob(ScheduleStatusJob.class)
|
||||
.withIdentity(STATUS_JOBKEY)
|
||||
.storeDurably(true)
|
||||
.build();
|
||||
|
||||
@Override
|
||||
public void execute(JobExecutionContext context) throws JobExecutionException {
|
||||
Scheduler scheduler = context.getScheduler();
|
||||
SchedulerDao dao = SpringContextHolder.getBean(SchedulerDao.class);
|
||||
JobDataMap dataMap = context.getJobDetail().getJobDataMap();
|
||||
long scheduleCfgId = dataMap.get("scheduleCfgId") == null ? 0:dataMap.getLong("scheduleCfgId");
|
||||
long limit = dataMap.get("limit") == null ? 1000:dataMap.getLong("limit");
|
||||
log.info(String.format("Sync定时配置任务开始扫描,scheduleCfgId:%s,limit:%s",scheduleCfgId,limit ));
|
||||
List<ScheduleCfg> newlyCfg = null;
|
||||
int totalNum = 0;
|
||||
|
||||
//全量同步当前状态 0:start:开始 1:init:初始化 2:doing:进行中
|
||||
String currentStatus = DictUtils.getDictLabel("currrent_sync_status", "status","0");
|
||||
if(!(currentStatus.equals("0") || currentStatus.equals("1") || currentStatus.equals("2"))) {
|
||||
do {
|
||||
newlyCfg = dao.findNewlyCfg(scheduleCfgId, limit,2);
|
||||
if(newlyCfg != null && newlyCfg.size() > 0) {
|
||||
totalNum += newlyCfg.size();
|
||||
for(ScheduleCfg cfg : newlyCfg) {//先取消之前的定时配置
|
||||
Integer compileId = cfg.getCompileId();
|
||||
try {
|
||||
//取消之前所有的 trigger
|
||||
GroupMatcher<TriggerKey> groupMatcher= GroupMatcher.triggerGroupEquals(STATUS_GROUP + compileId);
|
||||
Set<TriggerKey> triggerKeys = scheduler.getTriggerKeys(groupMatcher);
|
||||
if(triggerKeys != null && triggerKeys.size() > 0) {
|
||||
for(TriggerKey tk : triggerKeys) {
|
||||
scheduler.unscheduleJob(tk);
|
||||
}
|
||||
log.info(String.format("Sync定时任务取消成功,compile:%s", compileId));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error(String.format("Sync定时任务取消异常,compileId:%s", compileId),e);
|
||||
}
|
||||
}
|
||||
int index=0;
|
||||
for(ScheduleCfg cfg : newlyCfg) {
|
||||
Integer compileId = cfg.getCompileId();
|
||||
try {
|
||||
//判断状态,重新添加最新的 trigger
|
||||
Integer isValid = cfg.getIsValid();
|
||||
Integer isAudit = cfg.getIsAudit();
|
||||
//添加定时任务的条件
|
||||
if((isValid == 1 && isAudit == 1) || (isValid == 0 && isAudit == 0)) {
|
||||
//添加定时任务,包括valid 和 invalid
|
||||
addJob(scheduler, cfg,index);
|
||||
log.info(String.format("Sync定时任务添加成功,compile:%s", compileId));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error(String.format("Sync定时任务更新异常,compileId:%s", compileId),e);
|
||||
}
|
||||
index++;
|
||||
}
|
||||
//最后 保存此次 最后的id
|
||||
ScheduleCfg lastCfg = newlyCfg.get(newlyCfg.size() -1);
|
||||
scheduleCfgId = lastCfg.getId();
|
||||
dataMap.put("scheduleCfgId", scheduleCfgId);
|
||||
log.info(String.format("Sync加载定时任务,total num :%s", newlyCfg.size()));
|
||||
}
|
||||
} while (newlyCfg != null && newlyCfg.size() > 0);
|
||||
log.info(String.format("Sync定时配置任务结束执行,total num:%s",totalNum));
|
||||
}
|
||||
log.info("全量同步中缓存的定时配置正在扫描(currentStatus:"+currentStatus+")");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 将定时任务信息添加到 定时器框架中调度
|
||||
* @param scheduler
|
||||
* @param cfg
|
||||
* @throws SchedulerException
|
||||
*/
|
||||
/*public static void addJob(Scheduler scheduler,ScheduleCfg cfg) throws SchedulerException {
|
||||
Integer compileId = cfg.getCompileId();
|
||||
String cronValid = cfg.getCronValid();
|
||||
String cronInvalid = cfg.getCronInvalid();
|
||||
Trigger validTrigger = createTrigger(cronValid, compileId, true, cfg);
|
||||
Trigger invalidTrigger = createTrigger(cronInvalid, compileId, false, cfg);
|
||||
boolean jobExist = scheduler.checkExists(STATUS_JOBKEY);
|
||||
if(!jobExist) {//判断 job 是否存在,不存在添加
|
||||
scheduler.addJob(STATUS_JOBDETAIL, false);
|
||||
}
|
||||
boolean checkExists = scheduler.checkExists(validTrigger.getKey());
|
||||
if(!checkExists) {//判断 valid trigger 是否存在,不存在添加
|
||||
scheduler.scheduleJob(validTrigger);
|
||||
}else {
|
||||
log.warn(String.format("Trigger already exists:%s ", validTrigger.getKey().toString()));
|
||||
}
|
||||
checkExists = scheduler.checkExists(invalidTrigger.getKey());
|
||||
if(!checkExists) {//判断 invalid trigger 是否存在,不存在添加
|
||||
scheduler.scheduleJob(invalidTrigger);
|
||||
}else {
|
||||
log.warn(String.format("Trigger already exists:%s ", invalidTrigger.getKey().toString()));
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
public static void addJob(Scheduler scheduler,ScheduleCfg cfg,int expire) throws SchedulerException {
|
||||
List<Trigger> triList = createTrigger(cfg,expire);
|
||||
boolean jobExist = scheduler.checkExists(STATUS_JOBKEY);
|
||||
if(!jobExist) {//判断 job 是否存在,不存在添加
|
||||
scheduler.addJob(STATUS_JOBDETAIL, false);
|
||||
}
|
||||
for(Trigger tri : triList) {
|
||||
boolean checkExists = scheduler.checkExists(tri.getKey());
|
||||
if(!checkExists) {//判断 valid trigger 是否存在,不存在添加
|
||||
log.debug(String.format("Sync定时任务添加,%s", tri.getKey()));
|
||||
scheduler.scheduleJob(tri);
|
||||
log.info(String.format("Sync定时任务添加成功,%s", tri.getKey()));
|
||||
}else {
|
||||
log.warn(String.format("Trigger(sync) already exists:%s ", tri.getKey().toString()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 将页面配置的内容 转换成 trigger
|
||||
* @param cfg
|
||||
* @return
|
||||
*/
|
||||
public static List<Trigger> createTrigger(ScheduleCfg cfg,int expire){
|
||||
String mode = cfg.getUserRegion1().toUpperCase();//定时任务运行模式:一次,每天,每周,每月
|
||||
List<Trigger> triList = null;
|
||||
switch (mode) {
|
||||
case "ALWAYS"://单次运行,但只创建单次生效触发器
|
||||
triList = createSimpleTrigger(cfg,expire);
|
||||
break;
|
||||
case "SINGLE"://单次运行
|
||||
triList = createSimpleTrigger(cfg,expire);
|
||||
break;
|
||||
case "EVERYDAY"://每天运行 0 0 0 2/1 * ? ,不符合要求,定义每天都执行,然后在 代码判断 间隔时间
|
||||
triList = createCalendarIntervalTrigger(cfg);
|
||||
break;
|
||||
case "EVERYWEEK"://每周运行
|
||||
triList = createCalendarIntervalTrigger(cfg);
|
||||
break;
|
||||
case "EVERYMONTH"://每月运行
|
||||
triList = createEveryMonthTrigger(cfg);
|
||||
break;
|
||||
default:
|
||||
log.warn(String.format("unknown mode : %s ", mode));
|
||||
break;
|
||||
}
|
||||
return triList;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 将时间转换成 时分秒
|
||||
* @param time
|
||||
* @return
|
||||
*/
|
||||
public static List<Integer> parseTime(String time) {
|
||||
if(StringUtils.isNoneBlank(time)) {
|
||||
String[] split = time.split(":");
|
||||
List<Integer> tl = new ArrayList<Integer>(3);
|
||||
for(String s : split) {
|
||||
tl.add(Integer.valueOf(s));
|
||||
}
|
||||
return tl;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static Trigger createCronTrigger(String cron,Integer compileId,boolean isValid,ScheduleCfg cfg) {
|
||||
String triggerName = isValid ? (VALID_KEY + cron) : (INVALID_KEY + cron);
|
||||
JobDataMap dataMap = new JobDataMap();
|
||||
dataMap.put("isValid", isValid);
|
||||
dataMap.put("cfg", cfg);
|
||||
return TriggerBuilder.newTrigger()
|
||||
.withIdentity(createTiggerKey(triggerName, STATUS_GROUP+compileId))
|
||||
.withSchedule(CronScheduleBuilder.cronSchedule(cron))
|
||||
.usingJobData(dataMap)
|
||||
.forJob(STATUS_JOBDETAIL)
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 创建全量同步时未执行的任务,每个任务均为单词任务
|
||||
* @param cfg
|
||||
* @return
|
||||
*/
|
||||
public static List<Trigger> createSimpleTrigger(ScheduleCfg cfg,int expire){
|
||||
List<Trigger> triList = new ArrayList<Trigger>();
|
||||
Integer compileId = cfg.getCompileId();
|
||||
String cronValid = cfg.getCronValid();
|
||||
String cronInvalid = cfg.getCronInvalid();
|
||||
Date validDate = null;
|
||||
Date invalidDate = null;
|
||||
if(StringUtils.isNotBlank(cronValid)){
|
||||
Calendar c = Calendar.getInstance();
|
||||
c.add(Calendar.MINUTE, (expire+1));
|
||||
validDate = c.getTime();
|
||||
|
||||
}
|
||||
if(StringUtils.isNotBlank(cronInvalid)){
|
||||
Calendar c = Calendar.getInstance();
|
||||
c.add(Calendar.MINUTE, (expire+2));
|
||||
invalidDate = c.getTime();
|
||||
}
|
||||
JobDataMap dataMap = new JobDataMap();
|
||||
if(validDate!=null){//生效时间如果不为空,则创建定时生效触发器
|
||||
dataMap.put("isValid", true);
|
||||
dataMap.put("cfg", cfg);
|
||||
String triName = VALID_KEY + cfg.getUserRegion1() + "_" + cronValid;
|
||||
Trigger trigger = TriggerBuilder.newTrigger()
|
||||
.withIdentity(createTiggerKey(triName, STATUS_GROUP+compileId))
|
||||
.withSchedule(SimpleScheduleBuilder.simpleSchedule())
|
||||
.usingJobData(dataMap)
|
||||
.forJob(STATUS_JOBDETAIL)
|
||||
.startAt(validDate)
|
||||
.build();
|
||||
triList.add(trigger);
|
||||
}
|
||||
if(invalidDate!=null){//失效时间如果不为空,则创建定时失效触发器
|
||||
dataMap = new JobDataMap();
|
||||
dataMap.put("isValid", false);
|
||||
dataMap.put("cfg", cfg);
|
||||
String triName = INVALID_KEY + cfg.getUserRegion1() + "_" + cronInvalid;
|
||||
Trigger trigger = TriggerBuilder.newTrigger()
|
||||
.withIdentity(createTiggerKey(triName, STATUS_GROUP+compileId))
|
||||
.withSchedule(SimpleScheduleBuilder.simpleSchedule())
|
||||
.usingJobData(dataMap)
|
||||
.forJob(STATUS_JOBDETAIL)
|
||||
.startAt(invalidDate)
|
||||
.build();
|
||||
triList.add(trigger);
|
||||
}
|
||||
return triList;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 间隔 n 天 或 n 周执行
|
||||
* @param cfg
|
||||
* @return
|
||||
*/
|
||||
public static List<Trigger> createCalendarIntervalTrigger(ScheduleCfg cfg) {
|
||||
List<Trigger> triList = new ArrayList<Trigger>();
|
||||
Integer compileId = cfg.getCompileId();
|
||||
String cronValid = cfg.getCronValid();
|
||||
String cronInvalid = cfg.getCronInvalid();
|
||||
String dayOrWeek = cfg.getUserRegion1();
|
||||
Integer interval = Integer.valueOf(cfg.getUserRegion2());
|
||||
List<Integer> validList = parseTime(cronValid);
|
||||
List<Integer> invalidList = parseTime(cronInvalid);
|
||||
Date validStartTime = DateBuilder.todayAt(validList.get(0), validList.get(1), validList.get(2));
|
||||
Date invalidTime = DateBuilder.todayAt(invalidList.get(0), invalidList.get(1), invalidList.get(2));
|
||||
CalendarIntervalScheduleBuilder intervalBuilder = null;
|
||||
if("EVERYDAY".equalsIgnoreCase(dayOrWeek)) {
|
||||
intervalBuilder = CalendarIntervalScheduleBuilder.calendarIntervalSchedule().withIntervalInDays(interval);
|
||||
//valid
|
||||
JobDataMap dataMap = new JobDataMap();
|
||||
dataMap.put("isValid", true);
|
||||
dataMap.put("cfg", cfg);
|
||||
String triName = VALID_KEY + dayOrWeek+"("+interval+")" + "_" + DateUtils.formatDate(validStartTime, Constants.COMMON_DATE_FORMAT);
|
||||
Trigger validTri = TriggerBuilder.newTrigger()
|
||||
.withIdentity(createTiggerKey(triName, STATUS_GROUP+compileId))
|
||||
.withSchedule(intervalBuilder)
|
||||
.usingJobData(dataMap)
|
||||
.forJob(STATUS_JOBDETAIL)
|
||||
.startAt(validStartTime)
|
||||
.build();
|
||||
triList.add(validTri);
|
||||
//invalid
|
||||
dataMap = new JobDataMap();
|
||||
dataMap.put("isValid", false);
|
||||
dataMap.put("cfg", cfg);
|
||||
triName = INVALID_KEY + dayOrWeek +"("+interval+")" + "_" + DateUtils.formatDate(invalidTime, Constants.COMMON_DATE_FORMAT);
|
||||
validTri = TriggerBuilder.newTrigger()
|
||||
.withIdentity(createTiggerKey(triName, STATUS_GROUP+compileId))
|
||||
.withSchedule(intervalBuilder)
|
||||
.usingJobData(dataMap)
|
||||
.forJob(STATUS_JOBDETAIL)
|
||||
.startAt(invalidTime)
|
||||
.build();
|
||||
triList.add(validTri);
|
||||
}else if("EVERYWEEK".equalsIgnoreCase(dayOrWeek)) {
|
||||
intervalBuilder = CalendarIntervalScheduleBuilder.calendarIntervalSchedule().withIntervalInWeeks(interval);
|
||||
String[] weeks = cfg.getUserRegion3().split(",");
|
||||
for(String week : weeks) {
|
||||
if(StringUtils.isNoneBlank(week)) {
|
||||
Date temp = closestAfterWeek(validStartTime, Integer.valueOf(week));
|
||||
JobDataMap dataMap = new JobDataMap();
|
||||
dataMap.put("isValid", true);
|
||||
dataMap.put("cfg", cfg);
|
||||
String triName = VALID_KEY + dayOrWeek +week+"("+interval+")" + "_" + DateUtils.formatDate(temp, Constants.COMMON_DATE_FORMAT);
|
||||
Trigger validTri = TriggerBuilder.newTrigger()
|
||||
.withIdentity(createTiggerKey(triName, STATUS_GROUP+compileId))
|
||||
.withSchedule(intervalBuilder)
|
||||
.usingJobData(dataMap)
|
||||
.forJob(STATUS_JOBDETAIL)
|
||||
.startAt(temp)
|
||||
.build();
|
||||
triList.add(validTri);
|
||||
//invalid
|
||||
dataMap = new JobDataMap();
|
||||
dataMap.put("isValid", false);
|
||||
dataMap.put("cfg", cfg);
|
||||
temp = closestAfterWeek(invalidTime, Integer.valueOf(week));
|
||||
triName = INVALID_KEY + dayOrWeek +week+"("+interval+")" + "_" + DateUtils.formatDate(temp, Constants.COMMON_DATE_FORMAT);
|
||||
validTri = TriggerBuilder.newTrigger()
|
||||
.withIdentity(createTiggerKey(triName, STATUS_GROUP+compileId))
|
||||
.withSchedule(intervalBuilder)
|
||||
.usingJobData(dataMap)
|
||||
.forJob(STATUS_JOBDETAIL)
|
||||
.startAt(temp)
|
||||
.build();
|
||||
triList.add(validTri);
|
||||
}
|
||||
}
|
||||
}
|
||||
return triList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 每月 执行
|
||||
* @param cfg
|
||||
* @return
|
||||
*/
|
||||
public static List<Trigger> createEveryMonthTrigger(ScheduleCfg cfg){
|
||||
String dayWeek = cfg.getUserRegion3();
|
||||
String cronInvalid = cfg.getCronInvalid();
|
||||
String cronValid = cfg.getCronValid();
|
||||
StringBuilder cronSb = new StringBuilder();
|
||||
Trigger trigger = null;
|
||||
List<Integer> validList = parseTime(cronValid);//time 转换
|
||||
List<Integer> invalidList = parseTime(cronInvalid);//time 转换
|
||||
List<Trigger> triList = new ArrayList<Trigger>();
|
||||
String userRegion4 = cfg.getUserRegion4().toUpperCase();
|
||||
if("day".equalsIgnoreCase(dayWeek)) {//指定天
|
||||
boolean hasL = userRegion4.contains("L");
|
||||
StringBuilder chooseSb = new StringBuilder();
|
||||
for(String str : userRegion4.split(",")) {
|
||||
if(!"L".equalsIgnoreCase(str.trim())) {
|
||||
chooseSb.append(",").append(str);
|
||||
}
|
||||
}
|
||||
chooseSb.deleteCharAt(0);
|
||||
cronSb.append(validList.get(2)).append(" ")//秒
|
||||
.append(validList.get(1)).append(" ")//分
|
||||
.append(validList.get(0)).append(" ")//小时
|
||||
.append(chooseSb.toString()).append(" ")//日
|
||||
.append(cfg.getUserRegion2()).append(" ")//月
|
||||
.append("?").append(" ");//周
|
||||
trigger = createCronTrigger(cronSb.toString(), cfg.getCompileId(), true, cfg);
|
||||
triList.add(trigger);
|
||||
cronSb.setLength(0);
|
||||
cronSb.append(invalidList.get(2)).append(" ")//秒
|
||||
.append(invalidList.get(1)).append(" ")//分
|
||||
.append(invalidList.get(0)).append(" ")//小时
|
||||
.append(chooseSb.toString()).append(" ")//日
|
||||
.append(cfg.getUserRegion2()).append(" ")//月
|
||||
.append("?").append(" ");//周
|
||||
trigger = createCronTrigger(cronSb.toString(), cfg.getCompileId(), false, cfg);
|
||||
triList.add(trigger);
|
||||
if(hasL) {// 月的最后一天,quartz 不支持 1,L 这种指定,所以 L单独处理一下
|
||||
cronSb.setLength(0);
|
||||
cronSb.append(validList.get(2)).append(" ")//秒
|
||||
.append(validList.get(1)).append(" ")//分
|
||||
.append(validList.get(0)).append(" ")//小时
|
||||
.append("L").append(" ")//日
|
||||
.append(cfg.getUserRegion2()).append(" ")//月
|
||||
.append("?").append(" ");//周
|
||||
trigger = createCronTrigger(cronSb.toString(), cfg.getCompileId(), true, cfg);
|
||||
triList.add(trigger);
|
||||
cronSb.setLength(0);
|
||||
cronSb.append(invalidList.get(2)).append(" ")//秒
|
||||
.append(invalidList.get(1)).append(" ")//分
|
||||
.append(invalidList.get(0)).append(" ")//小时
|
||||
.append("L").append(" ")//日
|
||||
.append(cfg.getUserRegion2()).append(" ")//月
|
||||
.append("?").append(" ");//周
|
||||
trigger = createCronTrigger(cronSb.toString(), cfg.getCompileId(), false, cfg);
|
||||
triList.add(trigger);
|
||||
}
|
||||
}else if ("week".equalsIgnoreCase(dayWeek)) {//指定周,1#2: 第一周的周二,4L:最后一周的周四
|
||||
for(String nthWeek : userRegion4.split(",")) {//第几周
|
||||
for(String week : cfg.getUserRegion5().split(",")) {//星期几
|
||||
cronSb.setLength(0);
|
||||
cronSb.append(validList.get(2)).append(" ")//秒
|
||||
.append(validList.get(1)).append(" ")//分
|
||||
.append(validList.get(0)).append(" ")//小时
|
||||
.append("?").append(" ")//日
|
||||
.append(cfg.getUserRegion2()).append(" ");//月
|
||||
if("L".equalsIgnoreCase(nthWeek)) {
|
||||
cronSb.append(week).append("L");//周
|
||||
}else {
|
||||
cronSb.append(week).append("#").append(nthWeek);//周
|
||||
}
|
||||
trigger = createCronTrigger(cronSb.toString(), cfg.getCompileId(), true, cfg);
|
||||
triList.add(trigger);
|
||||
cronSb.setLength(0);
|
||||
cronSb.append(invalidList.get(2)).append(" ")//秒
|
||||
.append(invalidList.get(1)).append(" ")//分
|
||||
.append(invalidList.get(0)).append(" ")//小时
|
||||
.append("?").append(" ")//日
|
||||
.append(cfg.getUserRegion2()).append(" ");//月
|
||||
if("L".equalsIgnoreCase(nthWeek)) {
|
||||
cronSb.append(week).append("L");//周
|
||||
}else {
|
||||
cronSb.append(week).append("#").append(nthWeek);//周
|
||||
}
|
||||
trigger = createCronTrigger(cronSb.toString(), cfg.getCompileId(), false, cfg);
|
||||
triList.add(trigger);
|
||||
}
|
||||
}
|
||||
}
|
||||
return triList;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查找最近的 星期几 ,包括今天
|
||||
* @param date
|
||||
* @param w 周一开始 1 -7
|
||||
* @return
|
||||
*/
|
||||
public static Date closestAfterWeek(Date date,int w) {
|
||||
Calendar cal = Calendar.getInstance();
|
||||
cal.setTime(date);
|
||||
int i = cal.get(Calendar.DAY_OF_WEEK);//周日开始 1-7
|
||||
i = (i==1)? 7: i-1;//转换为 周一到 周日 1-7
|
||||
cal.add(Calendar.DAY_OF_MONTH, (i>w)?(7-(i-w)) : (w-i));
|
||||
return cal.getTime();
|
||||
}
|
||||
|
||||
|
||||
public static TriggerKey createTiggerKey(String name,String group) {
|
||||
TriggerKey key = new TriggerKey(name, group);
|
||||
return key;
|
||||
}
|
||||
|
||||
/**
|
||||
* jquery cron 生成的cron 表达式,quartz 不能直接使用,需要做些修改
|
||||
* @param cron
|
||||
* @return
|
||||
*/
|
||||
public static String modifyCronExp(String cron) {
|
||||
String[] cronArr = cron.split("\\s");
|
||||
if("*".equals(cronArr[4])) {
|
||||
cronArr[4] = "?";
|
||||
}else {
|
||||
cronArr[3] = "*";
|
||||
cronArr[2] = "?";
|
||||
}
|
||||
return "0 " + StringUtils.join(cronArr, " ");
|
||||
}
|
||||
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
CronTriggerImpl cron = new CronTriggerImpl();
|
||||
try {
|
||||
String exp = "0 0 0 ? 1,2 1#4";
|
||||
cron.setCronExpression(exp);
|
||||
System.out.println(cron);
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -852,6 +852,7 @@ public class ConfigServiceUtil {
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+result);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw e;
|
||||
}finally {
|
||||
if (response != null) {
|
||||
@@ -898,6 +899,7 @@ public class ConfigServiceUtil {
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+result);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw e;
|
||||
}finally {
|
||||
if (response != null) {
|
||||
|
||||
@@ -828,5 +828,14 @@ public final class Constants {
|
||||
/**
|
||||
* vpn cgi接口报错信息
|
||||
*/
|
||||
public static final String CGI_ERROR = Configurations.getStringProperty("cgiError","");;
|
||||
public static final String CGI_ERROR = Configurations.getStringProperty("cgiError","");
|
||||
|
||||
/**
|
||||
* 配置保护名单字典key
|
||||
*/
|
||||
public static final String CACHE_PROTECTION_LIST_DICT = "protetionListDict";
|
||||
/**
|
||||
* 管理员用户预警查询服务配置总量接口
|
||||
*/
|
||||
public static final String CONFIG_BY_SERVICE = Configurations.getStringProperty("getConfigByService","");
|
||||
}
|
||||
|
||||
@@ -423,7 +423,7 @@ public class ImportBigExcel extends XLSXCovertCSVReader{
|
||||
throw new RuntimeException("regionDict is null!");
|
||||
}
|
||||
if(dataList.size()==0) {
|
||||
throw new ServiceException(props.getProperty("noneData", "noneData"));
|
||||
throw new ServiceException(props.getProperty("no_data", "no_data"));
|
||||
}else if(this.hasImportLimit&&dataList.size()>(Constants.IMPORT_LIMIT+1)) {
|
||||
throw new ServiceException(props.getProperty("import_limit_is", "The maximum import size is")+" "+Constants.IMPORT_LIMIT);
|
||||
}
|
||||
@@ -432,12 +432,14 @@ public class ImportBigExcel extends XLSXCovertCSVReader{
|
||||
Map<String, Map<String, Object>> dictMap = new HashMap<String,Map<String, Object>>();
|
||||
Object val1 = null;
|
||||
for (int i = 0, len = dataList.size(); i < len; i++) {
|
||||
E e = (E)cls.newInstance();
|
||||
if(i<=headerNum) {
|
||||
List<Object> row=dataList.get(i);
|
||||
//boolean flag = row.stream().allMatch(obj -> "".equals(obj));
|
||||
if(i <= headerNum || row.size() == 0) {// 跳过第一行和空行
|
||||
continue;
|
||||
}
|
||||
|
||||
E e = (E)cls.newInstance();
|
||||
int column = 0;
|
||||
List<Object> row=dataList.get(i);
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (Object[] os : annotationList){
|
||||
Object val=row.get(column);
|
||||
|
||||
@@ -112,7 +112,8 @@ public abstract class XLSXCovertCSVReader {
|
||||
// private String[] record;
|
||||
// private List<String[]> rows = new ArrayList<String[]>();
|
||||
private boolean isCellNull = false;
|
||||
|
||||
|
||||
private int upRowId; // 记录上一行行号
|
||||
/**
|
||||
* Accepts objects needed while parsing.
|
||||
*
|
||||
@@ -203,8 +204,23 @@ public abstract class XLSXCovertCSVReader {
|
||||
if (this.formatString == null)
|
||||
this.formatString = BuiltinFormats
|
||||
.getBuiltinFormat(this.formatIndex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}else if("row".equals(name)) {
|
||||
// 获取行号
|
||||
String r = attributes.getValue("r");
|
||||
int index = Integer.parseInt(r);
|
||||
|
||||
int gap = index - upRowId;
|
||||
if(gap > 1) { // 存在空行
|
||||
while(gap > 1) {
|
||||
optRows(sheetIndex,lastColumnNumber,rowlist);
|
||||
gap--;
|
||||
}
|
||||
|
||||
}
|
||||
upRowId = index;
|
||||
}
|
||||
lastContents = "";
|
||||
}
|
||||
|
||||
|
||||
@@ -155,7 +155,7 @@ public class CheckComplexStringFormatThread implements Callable<String>{
|
||||
// 代理 HTTP(s)重定向
|
||||
if (regionDict.getFunctionId().equals(208)) {
|
||||
if(StringUtils.isBlank(baseStringCfg.getUserRegion1())) {
|
||||
baseStringCfg.setUserRegion1("301");
|
||||
baseStringCfg.setUserRegion1("302");
|
||||
}
|
||||
String userRegion1 = baseStringCfg.getUserRegion1();// 重定向应答码
|
||||
String userRegion2 = baseStringCfg.getUserRegion2();// 重定向URL
|
||||
@@ -381,45 +381,46 @@ public class CheckComplexStringFormatThread implements Callable<String>{
|
||||
prop.getProperty("is_case_insenstive")) + ";");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (isHex.intValue() != 0 && isHex.intValue() != 1) {
|
||||
errInfo.append(
|
||||
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_hex")) + ";");
|
||||
}
|
||||
if (isCaseInsenstive.intValue() != 0 && isCaseInsenstive.intValue() != 1) {
|
||||
errInfo.append(
|
||||
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_case_insenstive"))
|
||||
+ ";");
|
||||
}
|
||||
if (hexP.indexOf("1") == -1 && isHex.intValue() == 1) {
|
||||
errInfo.append(
|
||||
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_hex")) + ";");
|
||||
}
|
||||
if (hexP.equals("1") && isHex.intValue() == 0) {
|
||||
errInfo.append(
|
||||
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_hex")) + ";");
|
||||
}
|
||||
if (hexP.indexOf("2") == -1 && isCaseInsenstive.intValue() == 1) {
|
||||
errInfo.append(
|
||||
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_case_insenstive"))
|
||||
+ ";");
|
||||
}
|
||||
if (hexP.equals("2") && isCaseInsenstive.intValue() == 0) {
|
||||
errInfo.append(
|
||||
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_case_insenstive"))
|
||||
+ ";");
|
||||
}
|
||||
// 关键字十六进制校验
|
||||
if (hexP.indexOf("1") != -1 && isHex.intValue() == 1) {
|
||||
boolean bl = Pattern.compile("^([0-9|a-f|A-F]*)$").matcher(keyword).matches();
|
||||
if(!bl) {
|
||||
errInfo.append(
|
||||
prop.getProperty("key_word") + " '" + keyword + "' "+String.format(prop.getProperty("contains_non_hex_char")) + ";");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
isHex = baseStringCfg.getIsHex();
|
||||
isCaseInsenstive = baseStringCfg.getIsCaseInsenstive();
|
||||
if (isHex.intValue() != 0 && isHex.intValue() != 1) {
|
||||
errInfo.append(
|
||||
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_hex")) + ";");
|
||||
}
|
||||
if (isCaseInsenstive.intValue() != 0 && isCaseInsenstive.intValue() != 1) {
|
||||
errInfo.append(
|
||||
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_case_insenstive"))
|
||||
+ ";");
|
||||
}
|
||||
if (hexP.indexOf("1") == -1 && isHex.intValue() == 1) {
|
||||
errInfo.append(
|
||||
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_hex")) + ";");
|
||||
}
|
||||
if (hexP.equals("1") && isHex.intValue() == 0) {
|
||||
errInfo.append(
|
||||
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_hex")) + ";");
|
||||
}
|
||||
if (hexP.indexOf("2") == -1 && isCaseInsenstive.intValue() == 1) {
|
||||
errInfo.append(
|
||||
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_case_insenstive"))
|
||||
+ ";");
|
||||
}
|
||||
if (hexP.equals("2") && isCaseInsenstive.intValue() == 0) {
|
||||
errInfo.append(
|
||||
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_case_insenstive"))
|
||||
+ ";");
|
||||
}
|
||||
// 关键字十六进制校验
|
||||
if (hexP.indexOf("1") != -1 && isHex.intValue() == 1) {
|
||||
boolean bl = Pattern.compile("^([0-9|a-f|A-F]*)$").matcher(keyword).matches();
|
||||
if(!bl) {
|
||||
errInfo.append(
|
||||
prop.getProperty("key_word") + " '" + keyword + "' "+String.format(prop.getProperty("contains_non_hex_char")) + ";");
|
||||
}
|
||||
}
|
||||
|
||||
if (isHex != null && isCaseInsenstive != null) {
|
||||
if (isHex.intValue() == 0 && isCaseInsenstive.intValue() == 0) {
|
||||
baseStringCfg.setIsHexbin(0);
|
||||
|
||||
@@ -132,10 +132,16 @@ public class CheckIpFormatThread implements Callable<String>{
|
||||
|
||||
// 特殊字段验证
|
||||
// packet ip ratelimit
|
||||
if (serviceDict!=null&&serviceDict.getFunctionId().intValue() == 5 && serviceDict.getAction().intValue() == 64) {
|
||||
if (serviceDict!=null && serviceDict.getAction().intValue() == 64 && (serviceDict.getFunctionId().intValue() == 5
|
||||
|| serviceDict.getFunctionId().intValue() == 63
|
||||
|| serviceDict.getFunctionId().intValue() == 407
|
||||
|| serviceDict.getFunctionId().intValue() == 408) ) {
|
||||
String userRegion1 = IpRateLimitTemplate.userRegion1;
|
||||
baseIpCfg.setUserRegion1(userRegion1);
|
||||
if("0".equals(userRegion1)) {
|
||||
if(StringUtils.isBlank(baseIpCfg.getUserRegion2())) {
|
||||
baseIpCfg.setUserRegion2("0.1");
|
||||
}
|
||||
String userRegion2 = baseIpCfg.getUserRegion2();
|
||||
try {
|
||||
// Double ratelimt= Double.parseDouble(userRegion2);
|
||||
@@ -439,7 +445,7 @@ public class CheckIpFormatThread implements Callable<String>{
|
||||
// 代理 HTTP(s)重定向
|
||||
if (regionDict.getFunctionId().equals(208)) {
|
||||
if(StringUtils.isBlank(baseIpCfg.getUserRegion1())) {
|
||||
baseIpCfg.setUserRegion1("301");
|
||||
baseIpCfg.setUserRegion1("302");
|
||||
}
|
||||
String userRegion1 = baseIpCfg.getUserRegion1();// 重定向应答码
|
||||
String userRegion2 = baseIpCfg.getUserRegion2();// 重定向URL
|
||||
|
||||
@@ -205,7 +205,7 @@ public class CheckStringFormatThread implements Callable<String>{
|
||||
// 代理 HTTP(s)重定向
|
||||
if (regionDict.getFunctionId().equals(208)) {
|
||||
if(StringUtils.isBlank(baseStringCfg.getUserRegion1())) {
|
||||
baseStringCfg.setUserRegion1("301");
|
||||
baseStringCfg.setUserRegion1("302");
|
||||
}
|
||||
String userRegion1 = baseStringCfg.getUserRegion1();// 重定向应答码
|
||||
String userRegion2 = baseStringCfg.getUserRegion2();// 重定向URL
|
||||
@@ -437,49 +437,50 @@ public class CheckStringFormatThread implements Callable<String>{
|
||||
prop.getProperty("is_case_insenstive")) + ";");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (isHex.intValue() != 0 && isHex.intValue() != 1) {
|
||||
errInfo.append(
|
||||
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_hex")) + ";");
|
||||
}
|
||||
if (isCaseInsenstive.intValue() != 0 && isCaseInsenstive.intValue() != 1) {
|
||||
errInfo.append(
|
||||
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_case_insenstive"))
|
||||
+ ";");
|
||||
}
|
||||
if (hexP.indexOf("1") == -1 && isHex.intValue() == 1) {
|
||||
errInfo.append(
|
||||
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_hex")) + ";");
|
||||
}
|
||||
if (hexP.equals("1") && isHex.intValue() == 0) {
|
||||
errInfo.append(
|
||||
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_hex")) + ";");
|
||||
}
|
||||
if (hexP.indexOf("2") == -1 && isCaseInsenstive.intValue() == 1) {
|
||||
errInfo.append(
|
||||
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_case_insenstive"))
|
||||
+ ";");
|
||||
}
|
||||
if (hexP.equals("2") && isCaseInsenstive.intValue() == 0) {
|
||||
errInfo.append(
|
||||
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_case_insenstive"))
|
||||
+ ";");
|
||||
}
|
||||
// 十六进制 关键字校验
|
||||
if (hexP.indexOf("1") != -1 && isHex.intValue() == 1) {
|
||||
boolean bl = Pattern.compile("^([0-9|a-f|A-F]*)$").matcher(keyword).matches();
|
||||
if(!bl) {
|
||||
String message = prop.getProperty("key_word");
|
||||
if(regionDict.getFunctionId().equals(403) || regionDict.getFunctionId().equals(200)) {
|
||||
message = prop.getProperty("domain_name");
|
||||
}
|
||||
errInfo.append(
|
||||
message + " '" + keyword + "' "+String.format(prop.getProperty("contains_non_hex_char")) + ";");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
isHex = baseStringCfg.getIsHex();
|
||||
isCaseInsenstive = baseStringCfg.getIsCaseInsenstive();
|
||||
if (isHex.intValue() != 0 && isHex.intValue() != 1) {
|
||||
errInfo.append(
|
||||
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_hex")) + ";");
|
||||
}
|
||||
if (isCaseInsenstive.intValue() != 0 && isCaseInsenstive.intValue() != 1) {
|
||||
errInfo.append(
|
||||
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_case_insenstive"))
|
||||
+ ";");
|
||||
}
|
||||
if (hexP.indexOf("1") == -1 && isHex.intValue() == 1) {
|
||||
errInfo.append(
|
||||
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_hex")) + ";");
|
||||
}
|
||||
if (hexP.equals("1") && isHex.intValue() == 0) {
|
||||
errInfo.append(
|
||||
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_hex")) + ";");
|
||||
}
|
||||
if (hexP.indexOf("2") == -1 && isCaseInsenstive.intValue() == 1) {
|
||||
errInfo.append(
|
||||
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_case_insenstive"))
|
||||
+ ";");
|
||||
}
|
||||
if (hexP.equals("2") && isCaseInsenstive.intValue() == 0) {
|
||||
errInfo.append(
|
||||
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_case_insenstive"))
|
||||
+ ";");
|
||||
}
|
||||
// 十六进制 关键字校验
|
||||
if (hexP.indexOf("1") != -1 && isHex.intValue() == 1) {
|
||||
boolean bl = Pattern.compile("^([0-9|a-f|A-F]*)$").matcher(keyword).matches();
|
||||
if(!bl) {
|
||||
String message = prop.getProperty("key_word");
|
||||
if(regionDict.getFunctionId().equals(403) || regionDict.getFunctionId().equals(200)) {
|
||||
message = prop.getProperty("domain_name");
|
||||
}
|
||||
errInfo.append(
|
||||
message + " '" + keyword + "' "+String.format(prop.getProperty("contains_non_hex_char")) + ";");
|
||||
}
|
||||
}
|
||||
|
||||
if (isHex != null && isCaseInsenstive != null) {
|
||||
if (isHex.intValue() == 0 && isCaseInsenstive.intValue() == 0) {
|
||||
baseStringCfg.setIsHexbin(0);
|
||||
|
||||
@@ -254,45 +254,46 @@ public class CheckTopicWebsiteFormatThread implements Callable<String>{
|
||||
prop.getProperty("is_case_insenstive")) + ";");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (isHex.intValue() != 0 && isHex.intValue() != 1) {
|
||||
errInfo.append(
|
||||
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_hex")) + ";");
|
||||
}
|
||||
if (isCaseInsenstive.intValue() != 0 && isCaseInsenstive.intValue() != 1) {
|
||||
errInfo.append(
|
||||
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_case_insenstive"))
|
||||
+ ";");
|
||||
}
|
||||
if (hexP.indexOf("1") == -1 && isHex.intValue() == 1) {
|
||||
errInfo.append(
|
||||
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_hex")) + ";");
|
||||
}
|
||||
if (hexP.equals("1") && isHex.intValue() == 0) {
|
||||
errInfo.append(
|
||||
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_hex")) + ";");
|
||||
}
|
||||
if (hexP.indexOf("2") == -1 && isCaseInsenstive.intValue() == 1) {
|
||||
errInfo.append(
|
||||
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_case_insenstive"))
|
||||
+ ";");
|
||||
}
|
||||
if (hexP.equals("2") && isCaseInsenstive.intValue() == 0) {
|
||||
errInfo.append(
|
||||
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_case_insenstive"))
|
||||
+ ";");
|
||||
}
|
||||
// 十六进制 关键字校验
|
||||
if (hexP.indexOf("1") != -1 && isHex.intValue() == 1) {
|
||||
boolean bl = Pattern.compile("^([0-9|a-f|A-F]*)$").matcher(keyword).matches();
|
||||
if(!bl) {
|
||||
errInfo.append(
|
||||
prop.getProperty("domain_name") + " '" + keyword + "' "+String.format(prop.getProperty("contains_non_hex_char")) + ";");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
isHex = baseStringCfg.getIsHex();
|
||||
isCaseInsenstive = baseStringCfg.getIsCaseInsenstive();
|
||||
if (isHex.intValue() != 0 && isHex.intValue() != 1) {
|
||||
errInfo.append(
|
||||
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_hex")) + ";");
|
||||
}
|
||||
if (isCaseInsenstive.intValue() != 0 && isCaseInsenstive.intValue() != 1) {
|
||||
errInfo.append(
|
||||
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_case_insenstive"))
|
||||
+ ";");
|
||||
}
|
||||
if (hexP.indexOf("1") == -1 && isHex.intValue() == 1) {
|
||||
errInfo.append(
|
||||
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_hex")) + ";");
|
||||
}
|
||||
if (hexP.equals("1") && isHex.intValue() == 0) {
|
||||
errInfo.append(
|
||||
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_hex")) + ";");
|
||||
}
|
||||
if (hexP.indexOf("2") == -1 && isCaseInsenstive.intValue() == 1) {
|
||||
errInfo.append(
|
||||
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_case_insenstive"))
|
||||
+ ";");
|
||||
}
|
||||
if (hexP.equals("2") && isCaseInsenstive.intValue() == 0) {
|
||||
errInfo.append(
|
||||
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_case_insenstive"))
|
||||
+ ";");
|
||||
}
|
||||
// 十六进制 关键字校验
|
||||
if (hexP.indexOf("1") != -1 && isHex.intValue() == 1) {
|
||||
boolean bl = Pattern.compile("^([0-9|a-f|A-F]*)$").matcher(keyword).matches();
|
||||
if(!bl) {
|
||||
errInfo.append(
|
||||
prop.getProperty("domain_name") + " '" + keyword + "' "+String.format(prop.getProperty("contains_non_hex_char")) + ";");
|
||||
}
|
||||
}
|
||||
|
||||
if (isHex != null && isCaseInsenstive != null) {
|
||||
if (isHex.intValue() == 0 && isCaseInsenstive.intValue() == 0) {
|
||||
baseStringCfg.setIsHexbin(0);
|
||||
|
||||
@@ -155,6 +155,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.InnerProtectionListService;
|
||||
import com.nis.web.service.basics.IpReuseIpCfgService;
|
||||
import com.nis.web.service.basics.PolicyGroupInfoService;
|
||||
import com.nis.web.service.basics.ServiceDictInfoService;
|
||||
@@ -331,6 +332,8 @@ public class BaseController {
|
||||
protected PxyObjSpoofingIpPoolService pxyObjSpoofingIpPoolService;// 欺骗IP池
|
||||
@Autowired
|
||||
protected AsnGroupInfoService asnGroupInfoService;// asn组
|
||||
@Autowired
|
||||
protected InnerProtectionListService innerProtectionListService;
|
||||
/**
|
||||
* 管理基础路径
|
||||
*/
|
||||
@@ -1531,6 +1534,9 @@ public class BaseController {
|
||||
|| regionDict.getFunctionId().equals(566)) { // APP Feature IP
|
||||
BlockingQueue<IpAllNotDoLogTemplate> list = ei.getDataList(IpAllNotDoLogTemplate.class );
|
||||
ipPortCfgs=this.checkIpCfgMulity(errTip,serviceDict, regionDict,null,asnGroupInfos, list);
|
||||
}else if((regionDict.getFunctionId().equals(63) || regionDict.getFunctionId().equals(407) || regionDict.getFunctionId().equals(408)) && serviceDict!=null && serviceDict.getAction().equals(64)) { // Policies -> Stream
|
||||
BlockingQueue<IpRateLimitTemplate> list = ei.getDataList(IpRateLimitTemplate.class);
|
||||
ipPortCfgs=this.checkIpCfgMulity(errTip,serviceDict, regionDict,null,asnGroupInfos, list);
|
||||
}else {
|
||||
BlockingQueue<IpAllTemplate> list = ei.getDataList(IpAllTemplate.class );
|
||||
ipPortCfgs=this.checkIpCfgMulity(errTip,serviceDict, regionDict, null,asnGroupInfos, list);
|
||||
@@ -1625,6 +1631,9 @@ public class BaseController {
|
||||
String isSend = request.getParameter("isSend")==null?"":request.getParameter("isSend");
|
||||
SpecificServiceCfg specificServiceCfg = null;
|
||||
if (serviceDict!=null&&(serviceDict.getServiceId().intValue() == 33 || serviceDict.getServiceId().intValue() == 145
|
||||
|| serviceDict.getServiceId().intValue() == 1056
|
||||
|| serviceDict.getServiceId().intValue() == 1059
|
||||
|| serviceDict.getServiceId().intValue() == 1060
|
||||
|| serviceDict.getServiceId().intValue() == 35
|
||||
|| serviceDict.getServiceId().intValue() == 147
|
||||
|| serviceDict.getServiceId().intValue() == 36
|
||||
@@ -1899,6 +1908,9 @@ public class BaseController {
|
||||
}
|
||||
if (serviceDict!=null&&(serviceDict.getServiceId().intValue() == 33
|
||||
|| serviceDict.getServiceId().intValue() == 145
|
||||
|| serviceDict.getServiceId().intValue() == 1056
|
||||
|| serviceDict.getServiceId().intValue() == 1059
|
||||
|| serviceDict.getServiceId().intValue() == 1060
|
||||
|| serviceDict.getServiceId().intValue() == 35
|
||||
|| serviceDict.getServiceId().intValue() == 147
|
||||
|| serviceDict.getServiceId().intValue() == 36
|
||||
@@ -2484,7 +2496,9 @@ public class BaseController {
|
||||
} else if(regionDict.getFunctionId().equals(405) || regionDict.getFunctionId().equals(563) || regionDict.getFunctionId().equals(565)
|
||||
|| regionDict.getFunctionId().equals(566)) { // APP Feature IP
|
||||
ei.loadInitParams(IpAllNotDoLogTemplate.class, msgProp, regionDict, serviceDict);
|
||||
} else {
|
||||
} else if((regionDict.getFunctionId().equals(63) || regionDict.getFunctionId().equals(407) || regionDict.getFunctionId().equals(408)) && serviceDict.getAction().equals(64)){ // Policies -> Stream
|
||||
ei.loadInitParams(IpRateLimitTemplate.class, msgProp, regionDict, serviceDict);
|
||||
}else {
|
||||
ei.loadInitParams(IpAllTemplate.class, msgProp, regionDict, serviceDict);
|
||||
}
|
||||
} else if (regionDict.getRegionType().equals(2)) {// 字符串类
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
package com.nis.web.controller.basics;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
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.ProtectionListInfo;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.web.controller.BaseController;
|
||||
|
||||
/**
|
||||
* 内置配置保护名单管理
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping(value = "${adminPath}/basics/innerProtectionList")
|
||||
public class InnerProtectionListController extends BaseController{
|
||||
|
||||
@RequestMapping(value = {"/list", ""})
|
||||
public String policyGroupList(ProtectionListInfo cfg,HttpServletRequest request, HttpServletResponse response, Model model,
|
||||
RedirectAttributes redirectAttributes) {
|
||||
if(cfg == null)cfg=new ProtectionListInfo();
|
||||
Page<ProtectionListInfo> pageCondition = new Page<ProtectionListInfo>(request, response,"r");
|
||||
Page page = innerProtectionListService.findProtectionInfoList(pageCondition,cfg);
|
||||
|
||||
model.addAttribute("cfg", cfg);
|
||||
model.addAttribute("page", page);
|
||||
return "/basics/protectionInfoList";
|
||||
}
|
||||
|
||||
@RequestMapping(value={"/form"})
|
||||
public String form(Integer groupType,String ids,Model model,String doAction,RedirectAttributes redirectAttributes) {
|
||||
ProtectionListInfo protectionListInfo = new ProtectionListInfo();
|
||||
if(!StringUtil.isEmpty(ids)){
|
||||
protectionListInfo = innerProtectionListService.getById(Integer.parseInt(ids));
|
||||
}
|
||||
model.addAttribute("_cfg", protectionListInfo);
|
||||
return "/basics/protectionInfoForm";
|
||||
}
|
||||
|
||||
@RequestMapping(value = "saveOrUpdate")
|
||||
public String saveOrUpdate(ProtectionListInfo cfg,Model model,String itType,Integer groupType,
|
||||
RedirectAttributes redirectAttributes) {
|
||||
try {
|
||||
innerProtectionListService.saveOrUpdate(cfg);
|
||||
addMessage(redirectAttributes,"success","save_success");
|
||||
} catch (Exception e) {
|
||||
logger.error("新增失败",e);
|
||||
addMessage(redirectAttributes,"error","save_failed");
|
||||
}
|
||||
return "redirect:" + adminPath + "/basics/innerProtectionList/list";
|
||||
}
|
||||
|
||||
@RequestMapping(value={"delete"})
|
||||
public String delete(RedirectAttributes redirectAttributes,String ids,int isValid) {
|
||||
try {
|
||||
innerProtectionListService.deldete(ids,isValid);
|
||||
addMessage(redirectAttributes,"success","delete_success");
|
||||
} catch (Exception e) {
|
||||
logger.error("删除失败",e);
|
||||
addMessage(redirectAttributes,"error","delete_failed");
|
||||
}
|
||||
return "redirect:" + adminPath + "/basics/innerProtectionList/list";
|
||||
}
|
||||
|
||||
@RequestMapping(value="ajaxGetAllInfo",method=RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public Map<String,List<String>> ajaxGetAllInfo(HttpServletRequest request, HttpServletResponse response){
|
||||
return innerProtectionListService.ajaxGetAllInfo();
|
||||
}
|
||||
}
|
||||
@@ -72,6 +72,13 @@ public class ConfigSynchronizationController extends BaseController {
|
||||
dictService.updateDictItem(item);
|
||||
//删除字典缓存
|
||||
CacheUtils.remove(Constants.CACHE_DICT_MAP);
|
||||
|
||||
//全量同步之前等待一段时间,避免定时任务还未扫描到当前的同步状态。
|
||||
try{
|
||||
Thread.sleep(60000);
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
send(serviceId,model,request,response);
|
||||
|
||||
@@ -429,6 +429,11 @@ public class IpController extends BaseController{
|
||||
ExportExcel excel=new ExportExcel(serviceDict,regionDict,pro,null, IpAllNotDoLogTemplate.class, 2);
|
||||
excel.setDataList(pro,classList,null).
|
||||
write(request,response, fileName).dispose();
|
||||
}else if((regionDict.getFunctionId().equals(63)|| regionDict.getFunctionId().equals(407) || regionDict.getFunctionId().equals(408)) && serviceDict.getAction().equals(64)){// Policies -> Stream
|
||||
List<IpRateLimitTemplate> classList=new ArrayList<IpRateLimitTemplate>();
|
||||
ExportExcel excel=new ExportExcel(serviceDict,regionDict,pro,null, IpRateLimitTemplate.class, 2);
|
||||
excel.setDataList(pro,classList,null).
|
||||
write(request,response, fileName).dispose();
|
||||
}else{
|
||||
List<IpAllTemplate> classList=new ArrayList<IpAllTemplate>();
|
||||
ExportExcel excel=new ExportExcel(serviceDict,regionDict,pro,null, IpAllTemplate.class, 2);
|
||||
|
||||
@@ -0,0 +1,110 @@
|
||||
package com.nis.web.controller.sys;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.nis.domain.SysUserWarn;
|
||||
import com.nis.domain.SysUserWarnData;
|
||||
import com.nis.domain.SysUserWarnRecvData;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.ServiceConfigTemplateUtil;
|
||||
import com.nis.util.httpclient.HttpClientUtil;
|
||||
import com.nis.web.service.SysUserWarnService;
|
||||
/**
|
||||
* 定时查询 界面配置总量和 服务配置总量 并添加到 sys_user_warn表中
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class StatisticSysUserWarnNumber {
|
||||
|
||||
private Logger logger = Logger.getLogger(this.getClass());
|
||||
|
||||
|
||||
@Autowired
|
||||
protected SysUserWarnService sysUserWarnService;
|
||||
|
||||
@Autowired
|
||||
private HttpServletRequest request;
|
||||
|
||||
|
||||
|
||||
public void insertTotalInfo() {
|
||||
logger.info("定时统计业务号的界面配置总量和服务配置总量-开始。。。。。。。。。。。。。。");
|
||||
long start=System.currentTimeMillis();
|
||||
//获取界面配置的所有业务信息
|
||||
List<Map<String, Object>> serviceList = ServiceConfigTemplateUtil.getServiceList();
|
||||
getSysData(serviceList);
|
||||
long end=System.currentTimeMillis();
|
||||
logger.info("定时统计业务号的界面配置总量和服务配置总量-结束:"+(end-start)+"。。。。。。。。。。。。。。");
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void getSysData(List<Map<String, Object>> serviceList){
|
||||
//调用服务端接口,查询所有业务服务端的配置总量
|
||||
try{
|
||||
Map<String, Object> params = new HashMap<String, Object>();
|
||||
params.put("service", -1);
|
||||
String url = Constants.SERVICE_URL + Constants.CONFIG_BY_SERVICE;
|
||||
String recv = HttpClientUtil.getMsg(url, params, request);
|
||||
if (StringUtils.isNotBlank(recv)) {
|
||||
Gson gson = new GsonBuilder().create();
|
||||
SysUserWarnRecvData fromJson = gson.fromJson(recv, new TypeToken<SysUserWarnRecvData>() {
|
||||
}.getType());
|
||||
if (fromJson.getStatus().intValue() == 200) {
|
||||
SysUserWarnData data = fromJson.getData();
|
||||
Map<String, List<String>> effective = data.getEffective();
|
||||
List<SysUserWarn> listTotal =new ArrayList<SysUserWarn>();
|
||||
for (Map<String, Object> map1 : serviceList) {
|
||||
SysUserWarn entity=new SysUserWarn();
|
||||
entity.setId(Integer.parseInt(map1.get("id").toString()));
|
||||
entity.setTableName(map1.get("tableName").toString());
|
||||
//根据serviceID和表名查询界面各个业务的配置数量
|
||||
Integer cfgCount = sysUserWarnService.getCfgCount(entity);
|
||||
//查询服务端的各个业务的配置数量
|
||||
List<String> list = effective.get(map1.get("id"));
|
||||
SysUserWarn sysUserWarn=new SysUserWarn();
|
||||
sysUserWarn.setServiceId(map1.get("id").toString());
|
||||
sysUserWarn.setServiceDesc(map1.get("desc").toString());
|
||||
if(cfgCount>0){
|
||||
sysUserWarn.setInterfaceCfgTotal(cfgCount);
|
||||
}else{
|
||||
sysUserWarn.setInterfaceCfgTotal(0);
|
||||
}
|
||||
if(list !=null && list.size()>0){
|
||||
sysUserWarn.setSystemCfgTotal(list.size());
|
||||
}else {
|
||||
sysUserWarn.setSystemCfgTotal(0);
|
||||
}
|
||||
sysUserWarn.setTime(new Date());
|
||||
listTotal.add(sysUserWarn);
|
||||
}
|
||||
//判断表中是否有数据
|
||||
Integer total = sysUserWarnService.getAllInfoCount();
|
||||
if(total !=null && total>0){//说明有数据 先删除 后添加
|
||||
sysUserWarnService.deleteAllData();
|
||||
sysUserWarnService.insert(listTotal);
|
||||
}else{// 没有 直接 添加
|
||||
sysUserWarnService.insert(listTotal);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}catch(Exception e) {
|
||||
logger.error("更新所有业务的配置数量失败", e);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.nis.web.controller.sys;
|
||||
|
||||
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.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.SysUserWarn;
|
||||
import com.nis.util.ServiceConfigTemplateUtil;
|
||||
import com.nis.web.controller.BaseController;
|
||||
import com.nis.web.service.SysUserWarnService;
|
||||
|
||||
@Controller
|
||||
@RequestMapping(value = "${adminPath}/sys/warn")
|
||||
public class SysUserWarnController extends BaseController{
|
||||
|
||||
@Autowired
|
||||
protected SysUserWarnService sysUserWarnService;
|
||||
|
||||
|
||||
|
||||
@RequiresPermissions("sys:warnList:view")
|
||||
@RequestMapping(value = {"userWarnList", ""})
|
||||
public String list(@ModelAttribute("warn") SysUserWarn warn, Model model,HttpServletRequest request
|
||||
,HttpServletResponse response) {
|
||||
Page<SysUserWarn> pageCondition = new Page<SysUserWarn>(request, response,"r");
|
||||
Properties msgProp = getMsgProp();
|
||||
Page<SysUserWarn> page = sysUserWarnService.getAllList(pageCondition,warn,msgProp);
|
||||
model.addAttribute("warn", warn);
|
||||
model.addAttribute("page", page);
|
||||
return "/sys/sysUserWarnList";
|
||||
}
|
||||
|
||||
@RequiresPermissions("sys:warnList:view")
|
||||
@ResponseBody
|
||||
@RequestMapping(value = {"serviceSum", ""})
|
||||
public SysUserWarn findServiceSum() {
|
||||
SysUserWarn findServiceSum = sysUserWarnService.findServiceSum();
|
||||
return findServiceSum;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
List<Map<String, Object>> serviceList = ServiceConfigTemplateUtil.getServiceList();
|
||||
System.out.println(serviceList);
|
||||
for (Map<String, Object> map : serviceList) {
|
||||
System.out.println(map.get("id"));
|
||||
System.out.println(map.get("tableName"));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -20,7 +20,7 @@ public interface SchedulerDao extends CrudDao<ScheduleCfg> {
|
||||
* @param size
|
||||
* @return
|
||||
*/
|
||||
List<ScheduleCfg> findNewlyCfg(@Param("id")Long id,@Param("limit")Long limit);
|
||||
List<ScheduleCfg> findNewlyCfg(@Param("id")Long id,@Param("limit")Long limit,@Param("type")int type);
|
||||
|
||||
/**
|
||||
* 更新 del_flag 字段为删除标识
|
||||
|
||||
@@ -135,6 +135,7 @@
|
||||
a.CFG_ID,
|
||||
a.IS_VALID,
|
||||
a.IS_AUDIT,
|
||||
a.function_id,
|
||||
a.CREATOR_ID,
|
||||
a.CREATE_TIME,
|
||||
a.EDITOR_ID,
|
||||
@@ -149,6 +150,7 @@
|
||||
<where>
|
||||
del_Flag = 1
|
||||
and id > #{id}
|
||||
and type=#{type}
|
||||
</where>
|
||||
order by a.id
|
||||
limit #{limit}
|
||||
@@ -176,7 +178,8 @@
|
||||
user_region2,
|
||||
user_region3,
|
||||
user_region4,
|
||||
user_region5
|
||||
user_region5,
|
||||
type
|
||||
) values (
|
||||
#{name,jdbcType=VARCHAR},
|
||||
#{cronValid,jdbcType=VARCHAR},
|
||||
@@ -196,7 +199,8 @@
|
||||
#{userRegion2,jdbcType=VARCHAR},
|
||||
#{userRegion3,jdbcType=VARCHAR},
|
||||
#{userRegion4,jdbcType=VARCHAR},
|
||||
#{userRegion5,jdbcType=VARCHAR}
|
||||
#{userRegion5,jdbcType=VARCHAR},
|
||||
#{type,jdbcType=INTEGER}
|
||||
)
|
||||
</insert>
|
||||
|
||||
@@ -236,7 +240,19 @@
|
||||
|
||||
<!-- 修改配置表状态 -->
|
||||
<update id="updateCfgTableStatus">
|
||||
update ${tableName} set is_valid = #{isValid} ,is_audit = 1 where compile_id = #{compileId}
|
||||
update ${tableName}
|
||||
<set>
|
||||
is_valid = #{isValid} ,
|
||||
is_audit = 1,
|
||||
<!-- <if test="isValid == 0 ">
|
||||
is_audit = 3,
|
||||
</if>
|
||||
<if test="isValid == 1 ">
|
||||
is_audit = 1,
|
||||
</if> -->
|
||||
audit_time=now(),
|
||||
</set>
|
||||
where compile_id = #{compileId}
|
||||
</update>
|
||||
|
||||
<!-- 查询最新的配置状态 -->
|
||||
|
||||
22
src/main/java/com/nis/web/dao/SysUserWarnDao.java
Normal file
22
src/main/java/com/nis/web/dao/SysUserWarnDao.java
Normal file
@@ -0,0 +1,22 @@
|
||||
package com.nis.web.dao;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.nis.domain.SysUserWarn;
|
||||
|
||||
@MyBatisDao
|
||||
public interface SysUserWarnDao extends CrudDao<SysUserWarn>{
|
||||
|
||||
//查询所有的数据
|
||||
public List<SysUserWarn> getAllList(SysUserWarn entity);
|
||||
//查询总的记录数
|
||||
public Integer getAllInfoCount();
|
||||
//查询 所有数据中界面总量 和 服务总量
|
||||
public SysUserWarn getAllSum(SysUserWarn entity);
|
||||
//根据serviceID和表名查询业务配置的数量
|
||||
public Integer getCfgCount(SysUserWarn entity);
|
||||
//新增
|
||||
public int insert(List<SysUserWarn> list);
|
||||
//删除所有的数据
|
||||
public int deleteAllData();
|
||||
}
|
||||
91
src/main/java/com/nis/web/dao/SysUserWarnDao.xml
Normal file
91
src/main/java/com/nis/web/dao/SysUserWarnDao.xml
Normal file
@@ -0,0 +1,91 @@
|
||||
<?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.SysUserWarnDao" >
|
||||
<resultMap id="SysUserWarnMap" type="com.nis.domain.SysUserWarn" >
|
||||
<result column="service_id" property="serviceId" jdbcType="VARCHAR" />
|
||||
<result column="service_desc" property="serviceDesc" jdbcType="VARCHAR" />
|
||||
<result column="interface_cfg_total" property="interfaceCfgTotal" jdbcType="INTEGER" />
|
||||
<result column="system_cfg_total" property="systemCfgTotal" jdbcType="INTEGER" />
|
||||
<result column="time" property="time" jdbcType="TIMESTAMP" />
|
||||
<result column="remark" property="remark" jdbcType="VARCHAR" />
|
||||
</resultMap>
|
||||
|
||||
<select id="getAllList" parameterType="com.nis.domain.SysUserWarn" resultMap="SysUserWarnMap">
|
||||
|
||||
SELECT
|
||||
service_id,
|
||||
service_desc,
|
||||
interface_cfg_total,
|
||||
system_cfg_total,
|
||||
time,
|
||||
remark
|
||||
FROM
|
||||
sys_user_warn
|
||||
<where>
|
||||
<if test="serviceId != null and serviceId !=''" >
|
||||
and service_id = #{serviceId}
|
||||
</if>
|
||||
</where>
|
||||
order by service_id
|
||||
</select>
|
||||
|
||||
<select id="getAllSum" parameterType="com.nis.domain.SysUserWarn" resultType="com.nis.domain.SysUserWarn">
|
||||
|
||||
SELECT
|
||||
SUM(interface_cfg_total) interface_cfg_total,
|
||||
SUM(system_cfg_total) system_cfg_total
|
||||
FROM
|
||||
sys_user_warn
|
||||
<where>
|
||||
<if test="serviceId != null and serviceId !=''" >
|
||||
and service_id = #{serviceId}
|
||||
</if>
|
||||
</where>
|
||||
order by service_id
|
||||
</select>
|
||||
|
||||
<select id="getAllInfoCount" resultType="java.lang.Integer">
|
||||
|
||||
select count(service_id) total from sys_user_warn
|
||||
</select>
|
||||
|
||||
<select id="getCfgCount" parameterType="com.nis.domain.SysUserWarn" resultType="java.lang.Integer">
|
||||
|
||||
select count(cfg_id) cfgTotal from ${tableName}
|
||||
|
||||
<where>
|
||||
service_id = #{id}
|
||||
and is_valid=1
|
||||
</where>
|
||||
|
||||
</select>
|
||||
|
||||
<insert id="insert" parameterType="java.util.List" >
|
||||
insert into sys_user_warn (
|
||||
service_id,
|
||||
service_desc,
|
||||
interface_cfg_total,
|
||||
system_cfg_total,
|
||||
time,
|
||||
remark
|
||||
)values
|
||||
<foreach collection="list" item="item" index= "index" separator =",">
|
||||
(
|
||||
#{item.serviceId,jdbcType=VARCHAR},
|
||||
#{item.serviceDesc,jdbcType=VARCHAR},
|
||||
#{item.interfaceCfgTotal,jdbcType=INTEGER},
|
||||
#{item.systemCfgTotal,jdbcType=INTEGER},
|
||||
#{item.time,jdbcType=TIMESTAMP},
|
||||
#{item.remark,jdbcType=VARCHAR}
|
||||
)
|
||||
</foreach>
|
||||
|
||||
|
||||
</insert>
|
||||
|
||||
<delete id="deleteAllData">
|
||||
|
||||
delete from sys_user_warn
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
21
src/main/java/com/nis/web/dao/basics/InnerProtectionDao.java
Normal file
21
src/main/java/com/nis/web/dao/basics/InnerProtectionDao.java
Normal file
@@ -0,0 +1,21 @@
|
||||
package com.nis.web.dao.basics;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import com.nis.domain.basics.ProtectionListInfo;
|
||||
import com.nis.web.dao.CrudDao;
|
||||
import com.nis.web.dao.MyBatisDao;
|
||||
|
||||
@MyBatisDao
|
||||
public interface InnerProtectionDao extends CrudDao<ProtectionListInfo> {
|
||||
|
||||
List<ProtectionListInfo> findProtectionInfoList(ProtectionListInfo protectionListInfo);
|
||||
|
||||
ProtectionListInfo getById(@Param("proId")int proId);
|
||||
|
||||
List<ProtectionListInfo> ajaxGetAllInfo();
|
||||
|
||||
|
||||
}
|
||||
128
src/main/java/com/nis/web/dao/basics/InnerProtectionDao.xml
Normal file
128
src/main/java/com/nis/web/dao/basics/InnerProtectionDao.xml
Normal file
@@ -0,0 +1,128 @@
|
||||
<?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.InnerProtectionDao" >
|
||||
|
||||
<resultMap id="ProtectionListInfoMap" type="com.nis.domain.basics.ProtectionListInfo" >
|
||||
<id column="id" property="proId" jdbcType="INTEGER" />
|
||||
<result column="keyword" property="keyword" jdbcType="VARCHAR" />
|
||||
<result column="target_type" property="targetType" jdbcType="VARCHAR" />
|
||||
<result column="description" property="description" jdbcType="VARCHAR" />
|
||||
<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" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="ProtectionListInfoColumns">
|
||||
r.id,r.keyword,r.target_type,r.description,r.create_time,r.edit_time,r.creator_id,r.editor_id
|
||||
</sql>
|
||||
|
||||
<!-- 查出所有 有效数据-->
|
||||
<select id="findProtectionInfoList" resultMap="ProtectionListInfoMap">
|
||||
SELECT
|
||||
<include refid="ProtectionListInfoColumns"/>
|
||||
<trim prefix="," prefixOverrides=",">
|
||||
,s.name as creator_name ,e.name as editor_name
|
||||
</trim>
|
||||
FROM inner_protection_list 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="keyword != null and keyword != ''">
|
||||
AND r.keyword like CONCAT(CONCAT('%',#{keyword,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="targetType != null">
|
||||
AND r.target_type like CONCAT(CONCAT('%',#{targetType,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
AND r.IS_VALID = 1
|
||||
<if test="creatorName != null and creatorName != ''">
|
||||
AND r.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.id DESC
|
||||
</otherwise>
|
||||
</choose>
|
||||
|
||||
</select>
|
||||
|
||||
<select id="getById" resultMap="ProtectionListInfoMap">
|
||||
SELECT
|
||||
<include refid="ProtectionListInfoColumns"/>
|
||||
FROM
|
||||
inner_protection_list r
|
||||
WHERE
|
||||
r.ID = #{proId} AND r.IS_VALID = 1
|
||||
</select>
|
||||
|
||||
<insert id="insert" parameterType="com.nis.domain.basics.ProtectionListInfo" >
|
||||
INSERT INTO inner_protection_list(
|
||||
KEYWORD,
|
||||
TARGET_TYPE,
|
||||
DESCRIPTION,
|
||||
IS_VALID,
|
||||
CREATOR_ID,
|
||||
CREATE_TIME
|
||||
)VALUES (
|
||||
#{keyword,jdbcType=VARCHAR},
|
||||
#{targetType,jdbcType=VARCHAR},
|
||||
#{description,jdbcType=VARCHAR},
|
||||
#{isValid,jdbcType=INTEGER},
|
||||
#{creatorId,jdbcType=INTEGER},
|
||||
#{createTime,jdbcType=TIMESTAMP}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="update" parameterType="com.nis.domain.basics.ProtectionListInfo" >
|
||||
update inner_protection_list
|
||||
<set >
|
||||
<trim suffixOverrides=",">
|
||||
<if test="keyword != null and keyword != ''" >
|
||||
keyword = #{keyword,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="targetType != null and targetType != ''" >
|
||||
target_type = #{targetType,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="description != null and description != ''" >
|
||||
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="proId != null" >
|
||||
AND id = #{proId,jdbcType=INTEGER}
|
||||
</if>
|
||||
</where>
|
||||
</update>
|
||||
|
||||
<select id="ajaxGetAllInfo" resultType="com.nis.domain.basics.ProtectionListInfo">
|
||||
SELECT
|
||||
<include refid="ProtectionListInfoColumns"/>
|
||||
FROM
|
||||
inner_protection_list r
|
||||
WHERE
|
||||
r.IS_VALID = 1
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -4,11 +4,12 @@
|
||||
<!-- -->
|
||||
<select id="getConfigStateStatistics" resultType="map">
|
||||
select c.function_id functionId,
|
||||
sum(case when c.cfg_state =1 then 1 else 0 end) as approved,
|
||||
sum(case when c.cfg_state =1 then 1 else 0 end) as effective,
|
||||
sum(case when c.cfg_state =2 then 1 else 0 end) as unapproved,
|
||||
sum(case when c.cfg_state =3 then 1 else 0 end) as cancle_approved,
|
||||
sum(case when c.cfg_state =0 then 1 else 0 end) as created,
|
||||
sum(case when c.cfg_state =-1 then 1 else 0 end) as deleted
|
||||
sum(case when c.cfg_state =-1 then 1 else 0 end) as deleted,
|
||||
sum(case when c.cfg_state =4 or c.cfg_state=1 then 1 else 0 end) as approved
|
||||
from cfg_num_statistics c where c.statistic_time = #{statisticTime}
|
||||
group by c.function_id;
|
||||
</select>
|
||||
|
||||
@@ -2344,7 +2344,8 @@ public abstract class BaseService {
|
||||
try{
|
||||
batchSqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, false);
|
||||
for(int index = 0; index < appPolicyCfgs.size();index++){
|
||||
AppPolicyCfg _cfg = appPolicyCfgs.get(index);
|
||||
AppPolicyCfg _cfg = new AppPolicyCfg();
|
||||
BeanUtils.copyProperties(appPolicyCfgs.get(index), _cfg);
|
||||
((AppCfgDao) batchSqlSession.getMapper(AppCfgDao.class)).insertAppPolicyCfgForBatch(_cfg);
|
||||
|
||||
}
|
||||
|
||||
@@ -40,20 +40,65 @@ public class ScheduleService extends BaseService{
|
||||
ScheduleExceInfo exceNew = dao.findScheduleExceNew(se);
|
||||
//2、如果已经下发,直接下发状态,否则下发配置
|
||||
Integer issueResult = 1;
|
||||
//是否下发内容
|
||||
Integer isIssueContent = 1;
|
||||
String errorInfo = null;
|
||||
String tableName = cfg.getTableName();
|
||||
SchedulerTaskUtil scheduler = new SchedulerTaskUtil();
|
||||
boolean udpateConfigStatus = false;
|
||||
|
||||
try {
|
||||
if(isValid == 1 && (exceNew == null || exceNew.getIsIssue() == 1)) {//生效配置需要下发
|
||||
udpateConfigStatus = scheduler.updateConfigByServiceAndCompile(cfg.getServiceId(), compileId, isValid, 1,configSynchronizationDao);
|
||||
logger.info(String.format("定时器下发配置内容,compileId:%s,isValid:%s,issueResult:%s,errorInfo:%s",compileId,isValid,issueResult,errorInfo));
|
||||
}else{//只需修改状态
|
||||
udpateConfigStatus = scheduler.updateConfigByServiceAndCompile(cfg.getServiceId(), compileId, isValid, 0,configSynchronizationDao);
|
||||
logger.info(String.format("定时器修改配置状态,compileId:%s,isValid:%s,issueResult:%s,errorInfo:%s",compileId,isValid,issueResult,errorInfo));
|
||||
//生效配置需要下发
|
||||
if(isValid == 1 && (exceNew == null || exceNew.getIsIssue() == 1)) {
|
||||
isIssueContent=1;
|
||||
}else {
|
||||
//之下发状态
|
||||
isIssueContent=0;
|
||||
}
|
||||
|
||||
|
||||
//首先对数据库操作
|
||||
if(exceNew == null) {
|
||||
//新增exce_new 表状态
|
||||
exceNew = new ScheduleExceInfo();
|
||||
exceNew.setCompileId(compileId);
|
||||
exceNew.setIssueStatus(isValid);
|
||||
exceNew.setExceTime(new Date());
|
||||
exceNew.setIssueResult(issueResult);
|
||||
exceNew.setErrorInfo(errorInfo);
|
||||
exceNew.setIsIssue(0);
|
||||
exceNew.setScheduleId(cfg.getId());
|
||||
dao.insertScheduleExceNew(exceNew);
|
||||
}else {
|
||||
//修改 exce_new 表状态
|
||||
exceNew.setExceTime(new Date());
|
||||
exceNew.setIssueResult(issueResult);
|
||||
exceNew.setErrorInfo(errorInfo);
|
||||
exceNew.setScheduleId(cfg.getId());
|
||||
dao.updateScheduleExceNew(exceNew);
|
||||
}
|
||||
ServiceConfigTemplateUtil serviceTemplate = new ServiceConfigTemplateUtil();
|
||||
List<Map<String,Object>> serviceList = serviceTemplate.getServiceListByServiceId(cfg.getServiceId());
|
||||
//根据编译ID查询配置表中的配置信息
|
||||
for(Map<String,Object> service:serviceList){
|
||||
//获取业务下的配置域
|
||||
List<Map<String,Object>> cfgList = (List<Map<String, Object>>) service.get("cfgList");
|
||||
//查询子域配置详情
|
||||
if(cfgList!=null){
|
||||
for(Map<String,Object> m:cfgList){
|
||||
String regionTable = m.get("tableName").toString();
|
||||
//更新配置域表的isValid字段
|
||||
dao.updateCfgTableStatus(regionTable, compileId, isValid);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
//3、更新 配置表的 isValid 字段,添加 exce_log 记录
|
||||
dao.insertScheduleExceLog(exceNew);
|
||||
dao.updateCfgTableStatus(tableName, compileId, isValid);
|
||||
|
||||
|
||||
//数据库操作完成后与服务端交互
|
||||
try {
|
||||
udpateConfigStatus = scheduler.updateConfigByServiceAndCompile(cfg.getServiceId(), compileId, isValid, isIssueContent,configSynchronizationDao);
|
||||
logger.info(String.format("定时器下发配置内容,compileId:%s,isValid:%s,issueResult:%s,errorInfo:%s",compileId,isValid,issueResult,errorInfo));
|
||||
} catch (NoSuchFieldException e) {
|
||||
udpateConfigStatus = false;
|
||||
e.printStackTrace();
|
||||
@@ -70,46 +115,6 @@ public class ScheduleService extends BaseService{
|
||||
// logger.info(String.format("配置状态更新,compileId:%s,isValid:%s,issueResult:%s,errorInfo:%s",compileId,isValid,issueResult,errorInfo));
|
||||
|
||||
|
||||
if(udpateConfigStatus){//配置更新成功
|
||||
if(exceNew == null) {
|
||||
//新增exce_new 表状态
|
||||
exceNew = new ScheduleExceInfo();
|
||||
exceNew.setCompileId(compileId);
|
||||
exceNew.setIssueStatus(isValid);
|
||||
exceNew.setExceTime(new Date());
|
||||
exceNew.setIssueResult(issueResult);
|
||||
exceNew.setErrorInfo(errorInfo);
|
||||
exceNew.setIsIssue(0);
|
||||
exceNew.setScheduleId(cfg.getId());
|
||||
dao.insertScheduleExceNew(exceNew);
|
||||
}else {
|
||||
//修改 exce_new 表状态
|
||||
exceNew.setExceTime(new Date());
|
||||
exceNew.setIssueResult(issueResult);
|
||||
exceNew.setErrorInfo(errorInfo);
|
||||
exceNew.setScheduleId(cfg.getId());
|
||||
dao.updateScheduleExceNew(exceNew);
|
||||
}
|
||||
ServiceConfigTemplateUtil serviceTemplate = new ServiceConfigTemplateUtil();
|
||||
List<Map<String,Object>> serviceList = serviceTemplate.getServiceListByServiceId(cfg.getServiceId());
|
||||
//根据编译ID查询配置表中的配置信息
|
||||
for(Map<String,Object> service:serviceList){
|
||||
//获取业务下的配置域
|
||||
List<Map<String,Object>> cfgList = (List<Map<String, Object>>) service.get("cfgList");
|
||||
//查询子域配置详情
|
||||
if(cfgList!=null){
|
||||
for(Map<String,Object> m:cfgList){
|
||||
String regionTable = m.get("tableName").toString();
|
||||
//更新配置域表的isValid字段
|
||||
dao.updateCfgTableStatus(regionTable, compileId, isValid);
|
||||
}
|
||||
}
|
||||
}
|
||||
//3、更新 配置表的 isValid 字段,添加 exce_log 记录
|
||||
dao.insertScheduleExceLog(exceNew);
|
||||
dao.updateCfgTableStatus(tableName, compileId, isValid);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
72
src/main/java/com/nis/web/service/SysUserWarnService.java
Normal file
72
src/main/java/com/nis/web/service/SysUserWarnService.java
Normal file
@@ -0,0 +1,72 @@
|
||||
package com.nis.web.service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Properties;
|
||||
|
||||
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.SysUserWarn;
|
||||
import com.nis.web.dao.SysUserWarnDao;
|
||||
|
||||
@Service
|
||||
public class SysUserWarnService extends BaseService{
|
||||
|
||||
@Autowired
|
||||
private SysUserWarnDao sysUserWarnDao;
|
||||
|
||||
//查询所有的数据
|
||||
public Page<SysUserWarn> getAllList(Page<SysUserWarn> page,SysUserWarn entity,Properties msgProp){
|
||||
|
||||
entity.setPage(page);
|
||||
List<SysUserWarn> allList = sysUserWarnDao.getAllList(entity);
|
||||
if(allList !=null && allList.size()>0){
|
||||
SysUserWarn obj=new SysUserWarn();
|
||||
obj.setServiceId(entity.getServiceId());
|
||||
SysUserWarn allSum = sysUserWarnDao.getAllSum(obj);
|
||||
SysUserWarn sysWarn=new SysUserWarn();
|
||||
String report_total = msgProp.getProperty("report_total");
|
||||
sysWarn.setServiceId(report_total);
|
||||
sysWarn.setServiceDesc("--");
|
||||
sysWarn.setInterfaceCfgTotal(allSum.getInterfaceCfgTotal());
|
||||
sysWarn.setSystemCfgTotal(allSum.getSystemCfgTotal());
|
||||
sysWarn.setTime(allList.get(0).getTime());
|
||||
allList.add(0, sysWarn);
|
||||
}
|
||||
|
||||
page.setList(allList);
|
||||
return page;
|
||||
}
|
||||
//根据serviceID和表名查询业务配置的数量
|
||||
public Integer getAllInfoCount(){
|
||||
|
||||
return sysUserWarnDao.getAllInfoCount();
|
||||
}
|
||||
|
||||
//根据serviceID和表名查询业务配置的数量
|
||||
public Integer getCfgCount(SysUserWarn entity){
|
||||
|
||||
return sysUserWarnDao.getCfgCount(entity);
|
||||
}
|
||||
//新增
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public int insert(List<SysUserWarn> list){
|
||||
return sysUserWarnDao.insert(list);
|
||||
|
||||
}
|
||||
//删除所有的数据
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public int deleteAllData(){
|
||||
return sysUserWarnDao.deleteAllData();
|
||||
|
||||
}
|
||||
//查询 所有业务 界面总量和服务总量的和
|
||||
public SysUserWarn findServiceSum(){
|
||||
SysUserWarn obj=new SysUserWarn();
|
||||
SysUserWarn allSum = sysUserWarnDao.getAllSum(obj);
|
||||
return allSum;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
package com.nis.web.service.basics;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
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.ProtectionListInfo;
|
||||
import com.nis.exceptions.MaatConvertException;
|
||||
import com.nis.util.CacheUtils;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.web.dao.basics.InnerProtectionDao;
|
||||
import com.nis.web.security.UserUtils;
|
||||
import com.nis.web.service.BaseService;
|
||||
|
||||
@Service
|
||||
public class InnerProtectionListService extends BaseService{
|
||||
|
||||
@Autowired
|
||||
private InnerProtectionDao innerProtectionDao;
|
||||
|
||||
public Page<ProtectionListInfo> findProtectionInfoList(Page<ProtectionListInfo> page, ProtectionListInfo entity) {
|
||||
entity.getSqlMap().put("dsf", configScopeFilter(entity.getCurrentUser(),"r"));
|
||||
entity.setPage(page);
|
||||
List<ProtectionListInfo> list = innerProtectionDao.findProtectionInfoList(entity);
|
||||
page.setList(list);
|
||||
return page;
|
||||
}
|
||||
|
||||
public ProtectionListInfo getById(int id) {
|
||||
ProtectionListInfo protectionListInfo = innerProtectionDao.getById(id);
|
||||
return protectionListInfo;
|
||||
}
|
||||
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public void saveOrUpdate(ProtectionListInfo cfg) throws MaatConvertException{
|
||||
cfg.setIsValid(1);
|
||||
if(cfg.getProId()==null){//新增
|
||||
Date createTime=new Date();
|
||||
cfg.setCreatorId(UserUtils.getUser().getId());
|
||||
cfg.setCreateTime(createTime);
|
||||
innerProtectionDao.insert(cfg);
|
||||
|
||||
}else{//更新
|
||||
Date editTime=new Date();
|
||||
cfg.setEditorId(UserUtils.getUser().getId());
|
||||
cfg.setEditTime(editTime);
|
||||
innerProtectionDao.update(cfg);
|
||||
|
||||
}
|
||||
this.updateProtetionListDict();
|
||||
}
|
||||
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public void deldete(String ids, int isValid){
|
||||
ProtectionListInfo entity=new ProtectionListInfo();
|
||||
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.setProId(Integer.parseInt(id));
|
||||
innerProtectionDao.update(entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
this.updateProtetionListDict();
|
||||
}
|
||||
|
||||
public Map<String,List<String>> ajaxGetAllInfo() {
|
||||
Map<String,List<String>> dictMap = (Map<String,List<String>>)CacheUtils.get(Constants.CACHE_PROTECTION_LIST_DICT);
|
||||
if(StringUtil.isEmpty(dictMap)) {
|
||||
dictMap = this.updateProtetionListDict();
|
||||
}
|
||||
return dictMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新字典缓存
|
||||
* @return
|
||||
*/
|
||||
private Map<String, List<String>> updateProtetionListDict() {
|
||||
Map<String,List<String>> dictMap = new HashMap<String,List<String>>();
|
||||
List<ProtectionListInfo> list = innerProtectionDao.ajaxGetAllInfo();
|
||||
for (ProtectionListInfo info : list) {
|
||||
List<String> putList = new ArrayList<String>();
|
||||
if(dictMap.containsKey(info.getTargetType())) {
|
||||
putList = dictMap.get(info.getTargetType());
|
||||
}
|
||||
if(!putList.contains(info.getKeyword())) {
|
||||
putList.add(info.getKeyword());
|
||||
}
|
||||
dictMap.put(info.getTargetType(), putList);
|
||||
}
|
||||
CacheUtils.put(Constants.CACHE_PROTECTION_LIST_DICT, dictMap);
|
||||
return dictMap;
|
||||
}
|
||||
}
|
||||
@@ -155,8 +155,8 @@ public class ConfigSynchronizationService extends BaseService{
|
||||
Page<BaseCfg> page=new Page<BaseCfg>(request,response,Constants.MAAT_JSON_SEND_SIZE,"a");
|
||||
handleCallbackData(className,page,entity,request,response,false);
|
||||
}
|
||||
//如果业务没有配置数据,并且为最后一个业务,需要发送给服务接口一个结束标识
|
||||
if(!isFinished && lastServiceTag){
|
||||
//最后一个业务,发送一个结束标识
|
||||
if(lastServiceTag){
|
||||
String json = "{}";
|
||||
//如果是所有业务全量同步需要发送一个service=-1的请求,有助于服务端删除分组复用配置
|
||||
if(StringUtil.isEmpty(serviceIdCondition)){
|
||||
@@ -477,7 +477,7 @@ public class ConfigSynchronizationService extends BaseService{
|
||||
//调用服务接口配置全量更新
|
||||
isFinished = ((!hasData)&&lastServiceTag)?true:false;
|
||||
FileUtils.writeToFile("/home/ceiec/configSync/"+DateUtils.getDate("yyyy-MM-dd")+"/"+entity.getServiceId()+"_"+page.getPageNo()+"_"+System.currentTimeMillis()+".json", json, false);
|
||||
JSONObject result = ConfigServiceUtil.configSync(json,1,entity.getServiceId(),null,isFinished?"FINISHED":null);
|
||||
JSONObject result = ConfigServiceUtil.configSync(json,1,entity.getServiceId(),null,null);
|
||||
logger.info("全量下发响应信息:"+result.toString());
|
||||
}
|
||||
}
|
||||
@@ -649,7 +649,7 @@ public class ConfigSynchronizationService extends BaseService{
|
||||
//调用服务接口配置全量更新
|
||||
isFinished = ((!hasData)&&lastServiceTag)?true:false;
|
||||
FileUtils.writeToFile("/home/ceiec/configSync/"+DateUtils.getDate("yyyy-MM-dd")+"/"+entity.getServiceId()+"_"+page.getPageNo()+"_"+System.currentTimeMillis()+".json", json, false);
|
||||
JSONObject result = ConfigServiceUtil.configSync(json,1,entity.getServiceId(),null,isFinished?"FINISHED":null);
|
||||
JSONObject result = ConfigServiceUtil.configSync(json,1,entity.getServiceId(),null,null);
|
||||
logger.info("全量下发响应信息:"+result.toString());
|
||||
}
|
||||
}
|
||||
@@ -839,7 +839,7 @@ public class ConfigSynchronizationService extends BaseService{
|
||||
//调用服务接口配置全量更新
|
||||
isFinished = ((!hasData)&&lastServiceTag)?true:false;
|
||||
FileUtils.writeToFile("/home/ceiec/configSync/"+DateUtils.getDate("yyyy-MM-dd")+"/"+entity.getServiceId()+"_"+page.getPageNo()+"_"+System.currentTimeMillis()+".json", json, false);
|
||||
JSONObject result = ConfigServiceUtil.configSync(json,1,entity.getServiceId(),null,isFinished?"FINISHED":null);
|
||||
JSONObject result = ConfigServiceUtil.configSync(json,1,entity.getServiceId(),null,null);
|
||||
logger.info("全量下发响应信息:"+result.toString());
|
||||
}
|
||||
}
|
||||
@@ -1010,7 +1010,7 @@ public class ConfigSynchronizationService extends BaseService{
|
||||
//调用服务接口配置全量更新
|
||||
isFinished = ((!hasData)&&lastServiceTag)?true:false;
|
||||
FileUtils.writeToFile("/home/ceiec/configSync/"+DateUtils.getDate("yyyy-MM-dd")+"/"+entity.getServiceId()+"_"+page.getPageNo()+"_"+System.currentTimeMillis()+".json", json, false);
|
||||
JSONObject result = ConfigServiceUtil.configSync(json,1,entity.getServiceId(),null,isFinished?"FINISHED":null);
|
||||
JSONObject result = ConfigServiceUtil.configSync(json,1,entity.getServiceId(),null,null);
|
||||
logger.info("全量下发响应信息:"+result.toString());
|
||||
}
|
||||
}
|
||||
@@ -1339,7 +1339,7 @@ public class ConfigSynchronizationService extends BaseService{
|
||||
//调用服务接口配置全量更新
|
||||
isFinished = ((!hasData)&&lastServiceTag)?true:false;
|
||||
FileUtils.writeToFile("/home/ceiec/configSync/"+DateUtils.getDate("yyyy-MM-dd")+"/"+entity.getServiceId()+"_"+page.getPageNo()+"_"+System.currentTimeMillis()+".json", json, false);
|
||||
JSONObject result = ConfigServiceUtil.configSync(json,1,entity.getServiceId(),null,isFinished?"FINISHED":null);
|
||||
JSONObject result = ConfigServiceUtil.configSync(json,1,entity.getServiceId(),null,null);
|
||||
logger.info("全量下发响应信息:"+result.toString());
|
||||
}
|
||||
|
||||
@@ -1548,7 +1548,7 @@ public class ConfigSynchronizationService extends BaseService{
|
||||
//调用服务接口配置全量更新
|
||||
isFinished = ((!hasData)&&lastServiceTag)?true:false;
|
||||
FileUtils.writeToFile("/home/ceiec/configSync/"+DateUtils.getDate("yyyy-MM-dd")+"/"+entity.getServiceId()+"_"+page.getPageNo()+"_"+System.currentTimeMillis()+".json", json, false);
|
||||
JSONObject result = ConfigServiceUtil.configSync(json,1,entity.getServiceId(),null,isFinished?"FINISHED":null);
|
||||
JSONObject result = ConfigServiceUtil.configSync(json,1,entity.getServiceId(),null,null);
|
||||
logger.info("全量下发响应信息:"+result.toString());
|
||||
}
|
||||
|
||||
@@ -1703,7 +1703,7 @@ public class ConfigSynchronizationService extends BaseService{
|
||||
//调用服务接口配置全量更新
|
||||
isFinished = ((!hasData)&&lastServiceTag)?true:false;
|
||||
FileUtils.writeToFile("/home/ceiec/configSync/"+DateUtils.getDate("yyyy-MM-dd")+"/"+entity.getServiceId()+"_"+compileId+"_"+page.getPageNo()+"_"+System.currentTimeMillis()+".json", json, false);
|
||||
JSONObject result = ConfigServiceUtil.configSync(json,1,entity.getServiceId(),null,isFinished?"FINISHED":null);
|
||||
JSONObject result = ConfigServiceUtil.configSync(json,1,entity.getServiceId(),null,null);
|
||||
logger.info("全量下发响应信息:"+result.toString());
|
||||
}
|
||||
|
||||
@@ -1859,7 +1859,7 @@ public class ConfigSynchronizationService extends BaseService{
|
||||
//调用服务接口配置全量更新
|
||||
isFinished = ((!hasData)&&lastServiceTag)?true:false;
|
||||
FileUtils.writeToFile("/home/ceiec/configSync/"+DateUtils.getDate("yyyy-MM-dd")+"/"+entity.getServiceId()+"_"+compileId+"_"+page.getPageNo()+"_"+System.currentTimeMillis()+".json", json, false);
|
||||
JSONObject result = ConfigServiceUtil.configSync(json,1,entity.getServiceId(),null,isFinished?"FINISHED":null);
|
||||
JSONObject result = ConfigServiceUtil.configSync(json,1,entity.getServiceId(),null,null);
|
||||
logger.info("全量下发响应信息:"+result.toString());
|
||||
}
|
||||
|
||||
@@ -2021,7 +2021,7 @@ public class ConfigSynchronizationService extends BaseService{
|
||||
FileUtils.writeToFile("/home/ceiec/configSync/"+DateUtils.getDate("yyyy-MM-dd")+"/"+entity.getServiceId()+"_"+page.getPageNo()+"_"+System.currentTimeMillis()+".json", json, false);
|
||||
//调用服务接口同步回调类配置
|
||||
isFinished = ((!hasData)&&lastServiceTag)?true:false;
|
||||
JSONObject result = ConfigServiceUtil.configSync(json,2,entity.getServiceId(),entity.getTableName(),isFinished?"FINISHED":null);
|
||||
JSONObject result = ConfigServiceUtil.configSync(json,2,entity.getServiceId(),entity.getTableName(),null);
|
||||
logger.info("全量下发响应信息:"+result.toString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<property name="group" value="cfg" />
|
||||
</bean>
|
||||
|
||||
<!-- 定时检查 schedule_cfg 表 -->
|
||||
<!-- 定时检查 schedule_cfg(正常任务) 表 -->
|
||||
<bean id="scheduleCfgSimpleTrigger" class="org.springframework.scheduling.quartz.SimpleTriggerFactoryBean">
|
||||
<property name="jobDetail">
|
||||
<ref bean="scheduleCfgJobDetail" />
|
||||
@@ -33,6 +33,24 @@
|
||||
<property name="name" value="scheduleCfgTri" />
|
||||
<property name="group" value="cfg" />
|
||||
</bean>
|
||||
|
||||
|
||||
<!-- 配置加载 任务执行类 -->
|
||||
<bean id="scheduleSyncCfgJobDetail" class="org.springframework.scheduling.quartz.JobDetailFactoryBean">
|
||||
<property name="jobClass" value="com.nis.quartz.ScheduleSyncCfgJob"/>
|
||||
<property name="name" value="scheduleSyncCfgJobDetail" />
|
||||
<property name="group" value="cfg" />
|
||||
</bean>
|
||||
<!-- 定时检查 schedule_cfg(全量同步未执行任务) 表 -->
|
||||
<bean id="scheduleSyncCfgSimpleTrigger" class="org.springframework.scheduling.quartz.SimpleTriggerFactoryBean">
|
||||
<property name="jobDetail">
|
||||
<ref bean="scheduleSyncCfgJobDetail" />
|
||||
</property>
|
||||
<property name="repeatInterval" value="60000" /><!-- 间隔 60s 执行一次 -->
|
||||
<property name="startDelay" value="60000" /><!-- 延迟 60s 启动 -->
|
||||
<property name="name" value="scheduleSyncCfgTri" />
|
||||
<property name="group" value="syncCfg" />
|
||||
</bean>
|
||||
|
||||
|
||||
<!-- 定时任务 -->
|
||||
@@ -44,7 +62,8 @@
|
||||
<property name="startupDelay" value="60" /><!-- 启动延迟时间 ,单位:s-->
|
||||
<property name="triggers">
|
||||
<list>
|
||||
<ref bean="scheduleCfgSimpleTrigger" />
|
||||
<ref bean="scheduleCfgSimpleTrigger" />
|
||||
<ref bean="scheduleSyncCfgSimpleTrigger" />
|
||||
</list>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
@@ -1481,7 +1481,7 @@ reedit=Please re-edit!
|
||||
intercep_domain_required_tip=Domain is required
|
||||
packets=packets
|
||||
GByte=GByte
|
||||
#\u5B9A\u65F6\u5668\u53C2\u6570
|
||||
#\u5b9a\u65f6\u5668\u53c2\u6570
|
||||
interval=Recure every
|
||||
month=Months
|
||||
day=Days
|
||||
@@ -1501,4 +1501,9 @@ always=Permanent
|
||||
schedule=Scheduler
|
||||
cancel_all=Cancel all configurations!
|
||||
pre_version=Previous Version
|
||||
approved_all=Approve all configurations!
|
||||
approved_all=Approve all configurations!
|
||||
protection_list_manage=Protection List Manage
|
||||
effective=Effective
|
||||
admin_user_warn=Admin User Warn
|
||||
interface_total=Interface Total
|
||||
service_total=Service Total
|
||||
@@ -1323,7 +1323,7 @@ address_pool_id=ID \u043f\u0443\u043b \u0430\u0434\u0440\u0435\u0441\u043e\u0432
|
||||
outgoing_unicast_total_size=\u0417\u0430\u043a\u0430\u0447\u0430\u0442\u044c \u0431\u0430\u0439\u0442\u044b
|
||||
voip_sample_reject=\u0411\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0431\u0440\u0430\u0437\u0446\u043e\u0432 VOIP \u0430\u0443\u0434\u0438\u043e
|
||||
available_ip=\u0414\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0439 IP
|
||||
block_by_app_server_ip=DNS-\u0421\u043F\u0443\u0444\u0438\u043D\u0433
|
||||
block_by_app_server_ip=DNS-\u0421\u043f\u0443\u0444\u0438\u043d\u0433
|
||||
certificate_file=\u0424\u0430\u0439\u043b \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u0430
|
||||
address_pool=\u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043f\u0443\u043b\u0430 \u0430\u0434\u0440\u0435\u0441\u043e\u0432
|
||||
transfer_bytes=\u041f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 \u0431\u0430\u0439\u0442\u043e\u0432
|
||||
@@ -1370,7 +1370,7 @@ keyword_log_tips=\u041a\u043e\u0433\u0434\u0430 \u0440\u0435\u0437\u0443\u043b\u
|
||||
conn_record=\u0417\u0430\u043f\u0438\u0441\u0438 \u041f\u043e\u0434\u043a\u044e\u0447\u0435\u043d\u0438\u0439
|
||||
bps=\u0413\u0431\u0438\u0442/\u0441
|
||||
bps_percent=Bps Percent
|
||||
pps=\u041F\u0430\u043A\u0435\u0442/\u0441
|
||||
pps=\u041f\u0430\u043a\u0435\u0442/\u0441
|
||||
pps_percent=pps Percent
|
||||
spoofing_ip_object=\u041f\u0443\u043b IP \u0421\u043f\u0443\u0444\u0438\u043d\u0433
|
||||
spoofing_ip_policy=IP \u0421\u043f\u0443\u0444\u0438\u043d\u0433
|
||||
@@ -1382,13 +1382,13 @@ d_asn=DASN
|
||||
asn_conn_report=\u0421\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430 ASN
|
||||
https_url_report=\u0421\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430 HTTP(s) URL
|
||||
url=URL
|
||||
sum=\u0421\u0443\u043C\u043C\u0430
|
||||
sum=\u0421\u0443\u043c\u043c\u0430
|
||||
url_count=\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e URL
|
||||
ip_range_report=\u0421\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430 \u0425\u043e\u0441\u0442\u043e\u0432 \u0432 \u0433\u0440\u0430\u043d\u0438\u0446\u0430\u0445 \u0438 \u0437\u0430 \u0433\u0440\u0430\u043d\u0438\u0446\u0435\u0439
|
||||
ip_start=\u041d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0439 IP
|
||||
ip_end=\u041a\u043e\u043d\u0435\u0447\u043d\u044b\u0439 IP
|
||||
ip_start_num=\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u041D\u0430\u0447\u0430\u043B\u044C\u043D\u044B\u0445 IP-\u0430\u0434\u0440\u0435\u0441\u043E\u0432
|
||||
ip_end_num=\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u041A\u043E\u043D\u0435\u0447\u043D\u044B\u0445 IP-\u0430\u0434\u0440\u0435\u0441\u043E\u0432
|
||||
ip_start_num=\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u041d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0445 IP-\u0430\u0434\u0440\u0435\u0441\u043e\u0432
|
||||
ip_end_num=\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u041a\u043e\u043d\u0435\u0447\u043d\u044b\u0445 IP-\u0430\u0434\u0440\u0435\u0441\u043e\u0432
|
||||
ip_sub=IP-\u043f\u043e\u0434\u0441\u0435\u0442\u044c
|
||||
start_ip=\u041d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0439 IP
|
||||
end_ip=\u041a\u043e\u043d\u0435\u0447\u043d\u044b\u0439 IP
|
||||
@@ -1403,21 +1403,21 @@ ip_spoofing_group_manage=\u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\
|
||||
min_tcp=\u041c\u0438\u043d.
|
||||
max_tcp=\u041c\u0430\u043a\u0441.
|
||||
APP_TCP_SESSION_BYTE=\u0421\u0435\u0430\u043d\u0441
|
||||
ip_count=\u0415\u0434\u0438\u043D\u0441\u0442\u0432\u0435\u043D\u043D\u044B\u0439 IP-\u0430\u0434\u0440\u0435\u0441
|
||||
ip_count=\u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 IP-\u0430\u0434\u0440\u0435\u0441
|
||||
counnection_count=\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439
|
||||
asn=ASN
|
||||
Unique_num=\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u041a\u043b\u0438\u0435\u043d\u0442\u0430 IP
|
||||
ip=IP
|
||||
country=\u0421\u0442\u0440\u0430\u043d\u0430
|
||||
unique_num=\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u041a\u043b\u0438\u0435\u043d\u0442\u0430 IP
|
||||
import_limit_is=\u041C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u044B\u0439 \u0440\u0430\u0437\u043C\u0435\u0440 \u0438\u043C\u043F\u043E\u0440\u0442\u0430
|
||||
upload_limit_is=\u041E\u0433\u0440\u0430\u043D\u0438\u0447\u0435\u043D\u0438\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u043A\u0438 \u0444\u0430\u0439\u043B\u0430
|
||||
count=\u041F\u043E\u0434\u0441\u0447\u0435\u0442
|
||||
do_blacklist=\u0427\u0435\u0440\u043D\u044B\u0439 \u0421\u043F\u0438\u0441\u043E\u043A
|
||||
l3_header_error=\u0422\u043E\u043B\u044C\u043A\u043E \u0447\u0435\u0442\u044B\u0440\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u044F \u043F\u0440\u0438\u0437\u043D\u0430\u043A\u0438 \u043C\u043E\u0433\u0443\u0442 \u0431\u044B\u0442\u044C \u0432\u0432\u0435\u0434\u0435\u043D\u044B \u0432
|
||||
IP_HEADER=IP \u0417\u0430\u0433\u043E\u043B\u043E\u0432\u043A\u0430
|
||||
ICMP_HEADER=ICMP \u0417\u0430\u0433\u043E\u043B\u043E\u0432\u043A\u0430
|
||||
offset_expression=\u0421\u043C\u0435\u0449\u0435\u043D\u0438\u0435 \u0417\u0430\u0433\u043E\u043B\u043E\u0432\u043A\u0430
|
||||
import_limit_is=\u041c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 \u0438\u043c\u043f\u043e\u0440\u0442\u0430
|
||||
upload_limit_is=\u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0444\u0430\u0439\u043b\u0430
|
||||
count=\u041f\u043e\u0434\u0441\u0447\u0435\u0442
|
||||
do_blacklist=\u0427\u0435\u0440\u043d\u044b\u0439 \u0421\u043f\u0438\u0441\u043e\u043a
|
||||
l3_header_error=\u0422\u043e\u043b\u044c\u043a\u043e \u0447\u0435\u0442\u044b\u0440\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0438 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0432\u0432\u0435\u0434\u0435\u043d\u044b \u0432
|
||||
IP_HEADER=IP \u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430
|
||||
ICMP_HEADER=ICMP \u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430
|
||||
offset_expression=\u0421\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430
|
||||
cfg_custom=\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0435 \u0421\u0442\u043e\u043b\u0431\u0446\u044b
|
||||
event_report=\u041e\u0442\u0447\u0435\u0442 \u043e \u043c\u0435\u0440\u043e\u043f\u0440\u0438\u044f\u0442\u0438\u0438
|
||||
ntc_event_monitor_report=\u0441\u043e\u0431\u044b\u0442\u0438\u044f \u041c\u043e\u043d\u0438\u0442\u043e\u0440 \u041e\u0442\u0447\u0435\u0442
|
||||
@@ -1432,33 +1432,33 @@ letter_num=\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u041f\u
|
||||
config_num=\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0439
|
||||
monitor_num=\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u041c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430
|
||||
control_num=\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f
|
||||
contains_non_hex_char=\u0421\u043E\u0434\u0435\u0440\u0436\u0438\u0442 \u043D\u0435 \u0448\u0435\u0441\u0442\u043D\u0430\u0434\u0446\u0430\u0442\u0435\u0440\u0438\u0447\u043D\u044B\u0435 \u0441\u0438\u043C\u0432\u043E\u043B\u044B
|
||||
max_length=\u041C\u0430\u043A\u0441. \u0414\u043B\u0438\u043D\u0430
|
||||
min_length=\u041C\u0438\u043D. \u0414\u043B\u0438\u043D\u0430
|
||||
length_error=\u041E\u0448\u0438\u0431\u043A\u0430 \u0441 \u0414\u043B\u0438\u043D\u043E\u0439
|
||||
duplicate=\u0414\u0443\u0431\u043B\u0438\u043A\u0430\u0442
|
||||
print=\u041F\u0435\u0447\u0430\u0442\u044C
|
||||
contains_non_hex_char=\u0421\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043d\u0435 \u0448\u0435\u0441\u0442\u043d\u0430\u0434\u0446\u0430\u0442\u0435\u0440\u0438\u0447\u043d\u044b\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u044b
|
||||
max_length=\u041c\u0430\u043a\u0441. \u0414\u043b\u0438\u043d\u0430
|
||||
min_length=\u041c\u0438\u043d. \u0414\u043b\u0438\u043d\u0430
|
||||
length_error=\u041e\u0448\u0438\u0431\u043a\u0430 \u0441 \u0414\u043b\u0438\u043d\u043e\u0439
|
||||
duplicate=\u0414\u0443\u0431\u043b\u0438\u043a\u0430\u0442
|
||||
print=\u041f\u0435\u0447\u0430\u0442\u044c
|
||||
traffic_connect_log=\u0416\u0443\u0440\u043d\u0430\u043b \u0422\u0440\u0430\u0444\u0438\u043a\u0430
|
||||
keyword_log_to_url=\u041E\u0442 \u041A\u043B\u044E\u0447\u0435\u0432\u043E\u0433\u043E \u0421\u043B\u043E\u0432\u0430 \u0414\u043E URL
|
||||
http_log=HTTP \u0436\u0443\u0440\u043D\u0430\u043B\u044B
|
||||
cut_sample_tool=\u0418\u043D\u0441\u0442\u0440\u0443\u043C\u0435\u043D\u0442 \u0434\u043B\u044F \u0432\u044B\u0440\u0435\u0437\u043E\u043A \u043E\u0431\u0440\u0430\u0437\u0446\u0430
|
||||
keyword_log_to_url=\u041e\u0442 \u041a\u043b\u044e\u0447\u0435\u0432\u043e\u0433\u043e \u0421\u043b\u043e\u0432\u0430 \u0414\u043e URL
|
||||
http_log=HTTP \u0436\u0443\u0440\u043d\u0430\u043b\u044b
|
||||
cut_sample_tool=\u0418\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0434\u043b\u044f \u0432\u044b\u0440\u0435\u0437\u043e\u043a \u043e\u0431\u0440\u0430\u0437\u0446\u0430
|
||||
hex_minlength_3=\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0448\u0435\u0441\u0442\u043d\u0430\u0434\u0446\u0430\u0442\u0435\u0440\u0438\u0447\u043d\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u0434\u043b\u0438\u043d\u043e\u0439 3
|
||||
hex_minlength_4=\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0448\u0435\u0441\u0442\u043d\u0430\u0434\u0446\u0430\u0442\u0435\u0440\u0438\u0447\u043d\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u0434\u043b\u0438\u043d\u043e\u0439 4
|
||||
hex_minlength_8=\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0448\u0435\u0441\u0442\u043d\u0430\u0434\u0446\u0430\u0442\u0435\u0440\u0438\u0447\u043d\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u0434\u043b\u0438\u043d\u043e\u0439 8
|
||||
hex_minlength_16=\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0448\u0435\u0441\u0442\u043d\u0430\u0434\u0446\u0430\u0442\u0435\u0440\u0438\u0447\u043d\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u0434\u043b\u0438\u043d\u043e\u0439 16
|
||||
need_input=\u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e
|
||||
max_input=\u0417\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0447\u0435\u0442\u044b\u0440\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430
|
||||
no_need_input=\u041D\u0435 \u043D\u0443\u0436\u043D\u043E \u0437\u0430\u043F\u043E\u043B\u043D\u044F\u0442\u044C \u043F\u0440\u0438\u0437\u043D\u0430\u043A\u0438
|
||||
close_link=\u0417\u0430\u043A\u0440\u044B\u0442\u043E\u0435 \u0441\u043E\u0435\u0434\u0438\u043D\u0435\u043D\u0438\u0435
|
||||
asn_group=ASN \u0433\u0440\u0443\u043F\u043F\u0430
|
||||
can_not_edit_issued_ans_group=\u041D\u0435\u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E \u0440\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043B\u044C\u043D\u0443\u044E \u0433\u0440\u0443\u043F\u043F\u0443 ASN
|
||||
can_not_delete_asn_group_with_audited_ip=\u041D\u0435\u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E \u0443\u0434\u0430\u043B\u0438\u0442\u044C \u0433\u0440\u0443\u043F\u043F\u0443 ASN \u0441 \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043D\u043D\u044B\u043C IP-\u0430\u0434\u0440\u0435\u0441\u043E\u043C
|
||||
organization=\u041E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u044F
|
||||
mismatch=\u041D\u0435\u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435
|
||||
can_not_delete_asn_group_with_audited_ip_address=\u041D\u0435\u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E \u0443\u0434\u0430\u043B\u0438\u0442\u044C \u0433\u0440\u0443\u043F\u043F\u0443 ASN \u0441 \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043D\u043D\u044B\u043C \u043F\u0430\u043A\u0435\u0442\u043E\u043C IP-\u0430\u0434\u0440\u0435\u0441\u0430
|
||||
country_code=\u041A\u043E\u0434 \u0421\u0442\u0440\u0430\u043D\u044B
|
||||
asn_name=\u041D\u0430\u0437\u0432\u0430\u043D\u0438\u0435 ASN
|
||||
details=\u041F\u043E\u0434\u0440\u043E\u0431\u043D\u043E\u0441\u0442\u0438
|
||||
no_need_input=\u041d\u0435 \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0438
|
||||
close_link=\u0417\u0430\u043a\u0440\u044b\u0442\u043e\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435
|
||||
asn_group=ASN \u0433\u0440\u0443\u043f\u043f\u0430
|
||||
can_not_edit_issued_ans_group=\u041d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0433\u0440\u0443\u043f\u043f\u0443 ASN
|
||||
can_not_delete_asn_group_with_audited_ip=\u041d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0433\u0440\u0443\u043f\u043f\u0443 ASN \u0441 \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u043d\u044b\u043c IP-\u0430\u0434\u0440\u0435\u0441\u043e\u043c
|
||||
organization=\u041e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u044f
|
||||
mismatch=\u041d\u0435\u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435
|
||||
can_not_delete_asn_group_with_audited_ip_address=\u041d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0433\u0440\u0443\u043f\u043f\u0443 ASN \u0441 \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u043d\u044b\u043c \u043f\u0430\u043a\u0435\u0442\u043e\u043c IP-\u0430\u0434\u0440\u0435\u0441\u0430
|
||||
country_code=\u041a\u043e\u0434 \u0421\u0442\u0440\u0430\u043d\u044b
|
||||
asn_name=\u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 ASN
|
||||
details=\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438
|
||||
NTC_ASN_NUMBER=ASN
|
||||
application_layer_protocol=L7 \u041f\u0440\u043e\u0442\u043e\u043a\u043e\u043b
|
||||
traffic_statistics=\u041f\u0440\u043e\u043f\u0443\u0441\u043a\u043d\u0430\u044f \u0421\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c \u0422\u0440\u0430\u0444\u0438\u043a\u0430
|
||||
@@ -1467,10 +1467,10 @@ protocol_statistics=\u0421\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430
|
||||
app_statistics=\u0421\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430 \u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439
|
||||
service_statistics=\u0421\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430 \u0421\u0435\u0440\u0432\u0438\u0441\u043e\u0432
|
||||
website_statistics=\u0421\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430 \u0412\u0435\u0431-\u0441\u0430\u0439\u0442\u043e\u0432
|
||||
not_exist=\u041D\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442
|
||||
real_time=\u0412 \u0440\u0435\u0430\u043B\u044C\u043D\u043E\u043C \u0432\u0440\u0435\u043C\u0435\u043D\u0438
|
||||
history=\u0418\u0441\u0442\u043E\u0440\u0438\u044F
|
||||
all_columns_hidden=\u0412\u0441\u0435 \u0441\u0442\u043E\u043B\u0431\u0446\u044B \u0441\u043A\u0440\u044B\u0442\u044B!
|
||||
not_exist=\u041d\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442
|
||||
real_time=\u0412 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0438
|
||||
history=\u0418\u0441\u0442\u043e\u0440\u0438\u044f
|
||||
all_columns_hidden=\u0412\u0441\u0435 \u0441\u0442\u043e\u043b\u0431\u0446\u044b \u0441\u043a\u0440\u044b\u0442\u044b!
|
||||
no_log=\u041d\u0435\u0442 \u0416\u0443\u0440\u043d\u0430\u043b\u043e\u0432
|
||||
all_log=\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0416\u0443\u0440\u043d\u0430\u043b \u0438 \u0416\u0443\u0440\u043d\u0430\u043b-\u0444\u0430\u0439\u043b
|
||||
framework_log=\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0416\u0443\u0440\u043d\u0430\u043b
|
||||
@@ -1483,27 +1483,32 @@ ip_existed=IP \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u044
|
||||
user_check=\u0414\u0430\u043d\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u0437\u0430\u043d\u044f\u0442, \u043d\u0435\u043b\u044c\u0437\u044f \u0443\u0434\u0430\u043b\u0438\u0442\u044c!
|
||||
deletedAsnTip=\u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u2116 cfgId \u0441 ASN asnId \u0431\u044b\u043b\u0430 \u0443\u0434\u0430\u043b\u0435\u043d\u0430;
|
||||
reedit=\u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0439\u0442\u0435 \u0437\u0430\u043d\u043e\u0432\u043e!
|
||||
intercep_domain_required_tip=\u0422\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044F \u0434\u043E\u043C\u0435\u043D
|
||||
packets=\u041F\u0430\u043A\u0435\u0442\u044B
|
||||
intercep_domain_required_tip=\u0422\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0434\u043e\u043c\u0435\u043d
|
||||
packets=\u041f\u0430\u043a\u0435\u0442\u044b
|
||||
GByte=GByte
|
||||
#\u5B9A\u65F6\u5668\u53C2\u6570
|
||||
interval=\u041F\u0440\u043E\u043C\u0435\u0436\u0443\u0442\u043E\u043A
|
||||
month=\u041C\u0435\u0441\u044F\u0446\u044B
|
||||
day=\u0414\u043D\u0438
|
||||
#\u5b9a\u65f6\u5668\u53c2\u6570
|
||||
interval=\u041f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u043a
|
||||
month=\u041c\u0435\u0441\u044f\u0446\u044b
|
||||
day=\u0414\u043d\u0438
|
||||
week=weeks
|
||||
startTime=\u041D\u0430\u0447\u0430\u0442\u044C
|
||||
endTime=\u0417\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u044C
|
||||
single=\u041E\u0434\u043D\u043E\u043A\u0440\u0430\u0442\u043D\u043E
|
||||
everyDay=\u0415\u0436\u0435\u0434\u043D\u0435\u0432\u043D\u043E
|
||||
everyWeek=\u0415\u0436\u0435\u043D\u0435\u0434\u0435\u043B\u044C\u043D\u043E
|
||||
everyMonth=\u0415\u0436\u0435\u043C\u0435\u0441\u044F\u0447\u043D\u043E
|
||||
startTime=\u041d\u0430\u0447\u0430\u0442\u044c
|
||||
endTime=\u0417\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u044c
|
||||
single=\u041e\u0434\u043d\u043e\u043a\u0440\u0430\u0442\u043d\u043e
|
||||
everyDay=\u0415\u0436\u0435\u0434\u043d\u0435\u0432\u043d\u043e
|
||||
everyWeek=\u0415\u0436\u0435\u043d\u0435\u0434\u0435\u043b\u044c\u043d\u043e
|
||||
everyMonth=\u0415\u0436\u0435\u043c\u0435\u0441\u044f\u0447\u043d\u043e
|
||||
on=On
|
||||
is_schduler=Scheduler
|
||||
validate_error=Unexpected error occurred while validating
|
||||
v4_num=IPv4 Number
|
||||
v6_num=IPv6 Number
|
||||
always=\u041F\u043E\u0441\u0442\u043E\u044F\u043D\u043D\u043E
|
||||
always=\u041f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e
|
||||
schedule=Scheduler
|
||||
cancel_all=Cancel all configurations!
|
||||
pre_version=Previous Version
|
||||
approved_all=Approve all configurations!
|
||||
approved_all=Approve all configurations!
|
||||
protection_list_manage=Protection List Manage
|
||||
effective=Effective
|
||||
admin_user_warn=Admin User Warn
|
||||
interface_total=Interface Total
|
||||
service_total=Service Total
|
||||
@@ -231,7 +231,7 @@ delete_failed_admin=\u5220\u9664\u5931\u8d25\uff0c\u7ba1\u7406\u5458\u7528\u6237
|
||||
audit_success=\u5ba1\u6838\u6210\u529f
|
||||
audit_failed=\u5ba1\u6838\u5931\u8d25
|
||||
turning_page=\u6b63\u5728\u4e3a\u60a8\u8df3\u8f6c\u9875\u9762
|
||||
login_timeout=\u767B\u5F55\u8D85\u65F6,\u8bf7\u91cd\u65b0\u767b\u5f55\u3002
|
||||
login_timeout=\u767b\u5f55\u8d85\u65f6,\u8bf7\u91cd\u65b0\u767b\u5f55\u3002
|
||||
captcha_error=\u9a8c\u8bc1\u7801\u4e0d\u6b63\u786e
|
||||
enter_captcha=\u8bf7\u8f93\u5165\u9a8c\u8bc1\u7801
|
||||
input=\u8bf7\u8f93\u5165
|
||||
@@ -1481,22 +1481,27 @@ reedit=\u8bf7\u91cd\u65b0\u7f16\u8f91\uff01
|
||||
intercep_domain_required_tip=\u57df\u540d\u4fe1\u606f\u5fc5\u987b\u914d\u7f6e
|
||||
packets=packets
|
||||
GByte=GByte
|
||||
#\u5B9A\u65F6\u5668\u53C2\u6570
|
||||
interval=\u95F4\u9694
|
||||
#\u5b9a\u65f6\u5668\u53c2\u6570
|
||||
interval=\u95f4\u9694
|
||||
month=\u6708
|
||||
day=\u65E5
|
||||
startTime=\u5F00\u59CB\u65F6\u95F4
|
||||
endTime=\u7ED3\u675F\u65F6\u95F4
|
||||
single=\u5355\u6B21
|
||||
everyDay=\u6BCF\u5929
|
||||
everyWeek=\u6BCF\u5468
|
||||
everyMonth=\u6BCF\u6708
|
||||
validate_error=\u9A8C\u8BC1\u65F6\u53D1\u751F\u610F\u5916\u9519\u8BEF
|
||||
day=\u65e5
|
||||
startTime=\u5f00\u59cb\u65f6\u95f4
|
||||
endTime=\u7ed3\u675f\u65f6\u95f4
|
||||
single=\u5355\u6b21
|
||||
everyDay=\u6bcf\u5929
|
||||
everyWeek=\u6bcf\u5468
|
||||
everyMonth=\u6bcf\u6708
|
||||
validate_error=\u9a8c\u8bc1\u65f6\u53d1\u751f\u610f\u5916\u9519\u8bef
|
||||
v4_num=IPv4 Number
|
||||
v6_num=IPv6 Number
|
||||
always=\u957F\u671F
|
||||
always=\u957f\u671f
|
||||
schedule=Scheduler
|
||||
cancel_all=\u53D6\u6D88\u6240\u6709\u914D\u7F6E!
|
||||
cancel_all=\u53d6\u6d88\u6240\u6709\u914d\u7f6e!
|
||||
pre_version=\u4e0a\u4e00\u7248
|
||||
is_schduler=\u5b9a\u65f6\u5668
|
||||
approved_all=\u5BA1\u6838\u901A\u8FC7\u6240\u6709\u914D\u7F6E!
|
||||
approved_all=\u5ba1\u6838\u901a\u8fc7\u6240\u6709\u914d\u7f6e!
|
||||
protection_list_manage=\u5185\u7f6e\u4fdd\u62a4\u540d\u5355\u7ba1\u7406
|
||||
effective=\u6709\u6548
|
||||
admin_user_warn=\u7ba1\u7406\u5458\u7528\u6237\u9884\u8b66
|
||||
interface_total=\u754c\u9762\u603b\u91cf
|
||||
service_total=\u670d\u52a1\u603b\u91cf
|
||||
@@ -109,6 +109,11 @@
|
||||
<task:scheduled ref="asnIpIask" method="calculateASNIp" cron=" 0 0 0 * * ?" />
|
||||
</task:scheduled-tasks>
|
||||
<!-- 定时任务配置 end -->
|
||||
<!-- 统计页面配置总量和服务配置总量的定时任务配置 -->
|
||||
<!-- <bean id="sysUserWarnTask" class="com.nis.web.controller.sys.StatisticSysUserWarnNumber"></bean>
|
||||
<task:scheduled-tasks>
|
||||
<task:scheduled ref="sysUserWarnTask" method="insertTotalInfo" cron="0 0/10 * * * ?" />
|
||||
</task:scheduled-tasks> -->
|
||||
|
||||
<!-- 默认的注解映射的支持,org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping -->
|
||||
<mvc:annotation-driven
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
CREATE TABLE `inner_protection_list` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`keyword` varchar(500) NOT NULL COMMENT '关键词',
|
||||
`target_type` varchar(128) DEFAULT '' COMMENT '类型',
|
||||
`description` varchar(200) DEFAULT '',
|
||||
`is_valid` int(2) NOT NULL DEFAULT 0 COMMENT '-1删除 1有效',
|
||||
`create_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`editor_id` int(11) DEFAULT NULL,
|
||||
`creator_id` int(11) NOT NULL,
|
||||
`edit_time` datetime DEFAULT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=108 DEFAULT CHARSET=utf8mb4;
|
||||
132
src/main/resources/sql/20190328/alert_proc_statistics_config.sql
Normal file
132
src/main/resources/sql/20190328/alert_proc_statistics_config.sql
Normal file
@@ -0,0 +1,132 @@
|
||||
drop PROCEDURE proc_statistics_config;
|
||||
CREATE DEFINER=`root`@`%` PROCEDURE `proc_statistics_config`()
|
||||
BEGIN
|
||||
|
||||
DECLARE ntime VARCHAR(40);/*当前时间*/
|
||||
|
||||
DECLARE otime VARCHAR(40);/*上次统计时间*/
|
||||
|
||||
DECLARE nRow VARCHAR(40);/*本次统计条数*/
|
||||
|
||||
DECLARE tabName VARCHAR(500);
|
||||
|
||||
DECLARE description VARCHAR(500);
|
||||
|
||||
DECLARE deleteSql VARCHAR(500);
|
||||
|
||||
DECLARE done INT;/*游标标识*/
|
||||
|
||||
DECLARE flag INT;/*循环标识*/
|
||||
|
||||
DECLARE t_error INT;/*错误标识*/
|
||||
|
||||
DECLARE proc_log_table VARCHAR(100);/*存储过程日志表*/
|
||||
|
||||
DECLARE proc_name VARCHAR(100);/*存储过程名称*/
|
||||
|
||||
DECLARE icursor CURSOR FOR SELECT tab_name FROM statistics_tables where is_valid=1;
|
||||
|
||||
DECLARE CONTINUE HANDLER FOR NOT found SET done=1;
|
||||
|
||||
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION set t_error=1;
|
||||
|
||||
select max(statistic_time) into otime from cfg_num_statistics;
|
||||
|
||||
SET done=0;
|
||||
|
||||
SET t_error=0;
|
||||
|
||||
SET proc_log_table='proc_exec_log';
|
||||
|
||||
SET proc_name='proc_statistics_config';
|
||||
|
||||
SET ntime=DATE_FORMAT(SYSDATE(),'%Y-%m-%d %H:%i:%S');
|
||||
|
||||
OPEN icursor;
|
||||
|
||||
loop_iloop:LOOP
|
||||
|
||||
FETCH icursor INTO tabName;
|
||||
|
||||
SET description=tabName;
|
||||
|
||||
set @descriptionStart=concat(description,'表统计start');
|
||||
|
||||
/*统计当前配置表数据到统计表中start*/
|
||||
|
||||
set @v_log_sql1 := concat('insert into ',proc_log_table,'(proc_name,table_name,log_time,description) values(?,?,?,?)');
|
||||
|
||||
PREPARE execs FROM @v_log_sql1;
|
||||
|
||||
EXECUTE execs using proc_name,proc_log_table,ntime,@descriptionStart;
|
||||
|
||||
DEALLOCATE PREPARE execs;
|
||||
|
||||
COMMIT;
|
||||
|
||||
|
||||
#20190328 增加定时任务后is_audit=1 && (is_valid=1 || is_valid=0) 即为approved (增加cfg_state=4[is_valid=0 && is_audit=1],代表定时任务审核过的),而cfg_state=1仅仅代表审核通过且有效的,界面展示的approved值实际包含cfg_state=4和cfg_state=1
|
||||
set @insert_statistics_sql := concat('insert into cfg_num_statistics(statistic_time,function_id,service_id,action,compile_id,cfg_state) select ','''',ntime,'''',',','function_id,service_id,action,compile_id,if(is_valid=-1,-1,if(is_valid=1,1,if(is_audit=0,0,if(is_audit=1,4,if(is_audit=2,2,if(is_audit=3,3,0)))))) cfg_state from ',tabName);
|
||||
|
||||
|
||||
PREPARE execs FROM @insert_statistics_sql;
|
||||
|
||||
EXECUTE execs;
|
||||
|
||||
DEALLOCATE PREPARE execs;
|
||||
|
||||
COMMIT;
|
||||
|
||||
|
||||
|
||||
set @descriptionEnd=concat(description,'表统计end');
|
||||
|
||||
set @v_log_sql2 := concat('insert into ',proc_log_table,'(proc_name,table_name,log_time,description) values(?,?,?,?)');
|
||||
|
||||
PREPARE execs FROM @v_log_sql2;
|
||||
|
||||
EXECUTE execs using proc_name,proc_log_table,ntime,@descriptionEnd;
|
||||
|
||||
DEALLOCATE PREPARE execs;
|
||||
|
||||
COMMIT;
|
||||
|
||||
/*异常退出loop*/
|
||||
IF t_error=1 THEN
|
||||
LEAVE loop_iloop;
|
||||
END IF;
|
||||
|
||||
/*循环结束退出loop*/
|
||||
IF done=1 THEN
|
||||
|
||||
LEAVE loop_iloop;
|
||||
|
||||
ELSE
|
||||
|
||||
SET flag=0;
|
||||
|
||||
END IF;
|
||||
|
||||
IF flag=0 THEN
|
||||
|
||||
SET done=0;
|
||||
|
||||
END IF;
|
||||
|
||||
END LOOP loop_iloop;
|
||||
|
||||
CLOSE icursor;
|
||||
/*取出本次统计条数*/
|
||||
SELECT count(statistic_time) INTO nRow from cfg_num_statistics where statistic_time=ntime;
|
||||
|
||||
|
||||
IF t_error=1 THEN /*如果异常清楚本次数据*/
|
||||
delete from cfg_num_statistics where statistic_time=ntime;
|
||||
COMMIT;
|
||||
ELSEIF nRow > 0 THEN /*判断本次统计是否有数据录入,如果有则删除上次统计数据,如果没有则不清除上次统计数据*/
|
||||
|
||||
delete from cfg_num_statistics where statistic_time=otime;
|
||||
COMMIT;
|
||||
END IF;
|
||||
COMMIT;
|
||||
END
|
||||
1
src/main/resources/sql/20190328/alert_scheduler_cfg.sql
Normal file
1
src/main/resources/sql/20190328/alert_scheduler_cfg.sql
Normal file
@@ -0,0 +1 @@
|
||||
ALTER TABLE schedule_cfg ADD type int(1) DEFAULT 1 COMMENT '1:定时任务;2:全量同步时未执行的任务';
|
||||
2
src/main/resources/sql/20190329/add_sys_menu.sql
Normal file
2
src/main/resources/sql/20190329/add_sys_menu.sql
Normal file
@@ -0,0 +1,2 @@
|
||||
--系统管理->管理员用户预警
|
||||
INSERT INTO `sys_menu` (`id`, `parent_id`, `parent_ids`, `code`, `name`, `sort`, `href`, `target`, `icon`, `is_show`, `permission`, `create_by`, `create_date`, `update_by`, `update_date`, `remarks`, `del_flag`, `menu_bg`, `quick_action`, `is_top`, `function_id`) VALUES ('1252', '2', '0,1,2,', 'admin_user_warn', '管理员用户预警', '5060', '/sys/warn/userWarnList', '', '', '1', 'sys:warnList:view', '1', '2019-03-28 10:06:26', '1', '2019-03-28 11:36:42', '', '1', NULL, '0', '0', NULL);
|
||||
9
src/main/resources/sql/20190329/create_sys_user_warn.sql
Normal file
9
src/main/resources/sql/20190329/create_sys_user_warn.sql
Normal file
@@ -0,0 +1,9 @@
|
||||
CREATE TABLE `sys_user_warn` (
|
||||
`service_id` int(11) NOT NULL COMMENT '业务ID',
|
||||
`service_desc` varchar(255) DEFAULT '' COMMENT '业务描述',
|
||||
`interface_cfg_total` int(11) DEFAULT NULL COMMENT '界面配置数量',
|
||||
`system_cfg_total` int(11) DEFAULT NULL COMMENT '服务配置数量',
|
||||
`time` datetime DEFAULT NULL COMMENT '数据插入时间',
|
||||
`remark` varchar(255) DEFAULT NULL COMMENT '备注',
|
||||
PRIMARY KEY (`service_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='管理员用户预警表';
|
||||
2
src/main/resources/sql/20190401/add_sys_menu.sql
Normal file
2
src/main/resources/sql/20190401/add_sys_menu.sql
Normal file
@@ -0,0 +1,2 @@
|
||||
-- 配置保护名单管理
|
||||
INSERT INTO `sys_menu` (`parent_id`, `parent_ids`, `code`, `name`, `sort`, `href`, `target`, `icon`, `is_show`, `permission`, `create_by`, `create_date`, `update_by`, `update_date`, `remarks`, `del_flag`, `menu_bg`, `quick_action`, `is_top`, `function_id`) VALUES ('109', '0,1,109,', 'protection_list_manage', '内置保护名单管理', '5060', '/basics/innerProtectionList/list', '', 'fa fa-sticky-note-o', '1', 'basic:inner_protection_list:list', '1', '2019-03-25 15:28:34', '1', '2019-03-26 15:04:47', '', '1', NULL, '0', '0', NULL);
|
||||
@@ -14,6 +14,122 @@
|
||||
|
||||
<script>
|
||||
$(function(){
|
||||
//获取国际化文件
|
||||
var title=$.validator.messages.compareDate;
|
||||
var diff=$.validator.messages.expireTip;
|
||||
var tip=$.validator.messages.compareTip;
|
||||
var date="2019-03-25 ";
|
||||
//one 开始时间不能小于当前时间加上2分钟 验证
|
||||
jQuery.validator.addMethod("oneStartDate",function(value,element){
|
||||
var flagTypeSame=true;
|
||||
var singleValid = $("#singleValid").val();
|
||||
if(singleValid !=null && singleValid !=""){
|
||||
var date =new Date();
|
||||
var min=date.getMinutes();
|
||||
date.setMinutes(min+2);
|
||||
if(date <= (new Date(singleValid.replace(/-/g,"\/")))){
|
||||
flagTypeSame=true;
|
||||
}else{
|
||||
flagTypeSame=false;
|
||||
}
|
||||
}
|
||||
return flagTypeSame;
|
||||
},tip);
|
||||
//one 结束时间不能小于开始时间验证
|
||||
jQuery.validator.addMethod("oneDate",function(value,element){
|
||||
var flagTypeSame=true;
|
||||
var singleValid = $("#singleValid").val();
|
||||
var singleInvalid = $("#singleInvalid").val();
|
||||
if(singleValid !=null && singleValid !="" && singleInvalid !=null && singleInvalid !=""){
|
||||
flagTypeSame=CompareDate(singleValid,singleInvalid);
|
||||
}
|
||||
return flagTypeSame;
|
||||
},title);
|
||||
//day 结束时间不能小于开始时间验证
|
||||
jQuery.validator.addMethod("dayDate",function(value,element){
|
||||
var flagTypeSame=true;
|
||||
var dayValid = $("#dayValid").val();
|
||||
var dayInvalid = $("#dayInvalid").val();
|
||||
if(dayValid !=null && dayValid !="" && dayInvalid !=null && dayInvalid !=""){
|
||||
flagTypeSame=CompareDate(date+dayValid,date+dayInvalid);
|
||||
}
|
||||
return flagTypeSame;
|
||||
},title);
|
||||
//week 结束时间不能小于开始时间验证
|
||||
jQuery.validator.addMethod("weekDate",function(value,element){
|
||||
var flagTypeSame=true;
|
||||
var weekValid = $("#weekValid").val();
|
||||
var weekInvalid = $("#weekInvalid").val();
|
||||
if(weekValid !=null && weekValid !="" && weekInvalid !=null && weekInvalid !=""){
|
||||
flagTypeSame=CompareDate(date+weekValid,date+weekInvalid);
|
||||
}
|
||||
return flagTypeSame;
|
||||
},title);
|
||||
//month 结束时间不能小于开始时间验证
|
||||
jQuery.validator.addMethod("monthDate",function(value,element){
|
||||
var flagTypeSame=true;
|
||||
var monthValid = $("#monthValid").val();
|
||||
var monthInvalid = $("#monthInvalid").val();
|
||||
if(monthValid !=null && monthValid !="" && monthInvalid !=null && monthInvalid !=""){
|
||||
flagTypeSame=CompareDate(date+monthValid,date+monthInvalid);
|
||||
}
|
||||
return flagTypeSame;
|
||||
},title);
|
||||
//一次 验证时间差
|
||||
jQuery.validator.addMethod("oneDiffDate",function(value,element){
|
||||
var flagTypeSame=true;
|
||||
var singleValid = $("#singleValid").val();
|
||||
var singleInvalid = $("#singleInvalid").val();
|
||||
if(singleValid !=null && singleValid !="" && singleInvalid !=null && singleInvalid !=""){
|
||||
flagTypeSame=timeToDiffer(singleValid,singleInvalid);
|
||||
}
|
||||
return flagTypeSame;
|
||||
},diff);
|
||||
//day 验证时间差
|
||||
jQuery.validator.addMethod("dayDiffDate",function(value,element){
|
||||
var flagTypeSame=true;
|
||||
var dayValid = $("#dayValid").val();
|
||||
var dayInvalid = $("#dayInvalid").val();
|
||||
if(dayValid !=null && dayValid !="" && dayInvalid !=null && dayInvalid !=""){
|
||||
flagTypeSame=timeToDiffer(date+dayValid,date+dayInvalid);
|
||||
}
|
||||
return flagTypeSame;
|
||||
},diff);
|
||||
//week 验证时间差
|
||||
jQuery.validator.addMethod("weekDiffDate",function(value,element){
|
||||
var flagTypeSame=true;
|
||||
var weekValid = $("#weekValid").val();
|
||||
var weekInvalid = $("#weekInvalid").val();
|
||||
if(weekValid !=null && weekValid !="" && weekInvalid !=null && weekInvalid !=""){
|
||||
flagTypeSame=timeToDiffer(date+weekValid,date+weekInvalid);
|
||||
}
|
||||
return flagTypeSame;
|
||||
},diff);
|
||||
//month 验证时间差
|
||||
jQuery.validator.addMethod("monthDiffDate",function(value,element){
|
||||
var flagTypeSame=true;
|
||||
var monthValid = $("#monthValid").val();
|
||||
var monthInvalid = $("#monthInvalid").val();
|
||||
if(monthValid !=null && monthValid !="" && monthInvalid !=null && monthInvalid !=""){
|
||||
flagTypeSame=timeToDiffer(date+monthValid,date+monthInvalid);
|
||||
}
|
||||
return flagTypeSame;
|
||||
},diff);
|
||||
//比较两个时间的大小
|
||||
function CompareDate(d1,d2){
|
||||
return ((new Date(d1.replace(/-/g,"\/"))) <= (new Date(d2.replace(/-/g,"\/"))));
|
||||
}
|
||||
//计算两个时间的差 是否大于1分钟
|
||||
function timeToDiffer(d1,d2){
|
||||
var dateBegin = new Date(d1.replace(/-/g,"\/"));//将-转化为/,使用new Date
|
||||
var dateEnd = new Date(d2.replace(/-/g,"\/"))
|
||||
var dateDiff = dateEnd.getTime() - dateBegin.getTime();//时间差的毫秒数
|
||||
if(dateDiff<(60*1000)){
|
||||
return false;
|
||||
}else{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
//day week 切换
|
||||
function initDayWeek(){
|
||||
var dayWeekCheck = $("input.dayWeek:checked");
|
||||
@@ -145,14 +261,14 @@
|
||||
<div class="form-group ">
|
||||
<label class="control-label col-md-2"><spring:message code="startTime"/></label>
|
||||
<div class="col-md-4">
|
||||
<input name="schedule.cronValid" id="singleValid" type="text" class="form-control Wdate required" readonly="readonly" value="${_cfg.schedule.cronValid }" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,minDate:'%y-%M-%d %H:{%m+2}:%s', maxDate:'#F{$dp.$D(\'singleInvalid\')}'});"/>
|
||||
<input name="schedule.cronValid" id="singleValid" type="text" class="form-control Wdate required oneStartDate" readonly="readonly" value="${_cfg.schedule.cronValid }" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
|
||||
</div>
|
||||
<div for="schedule.cronValid"></div>
|
||||
</div>
|
||||
<div class="form-group ">
|
||||
<label class="control-label col-md-2"><spring:message code="endTime"/></label>
|
||||
<div class="col-md-4">
|
||||
<input name="schedule.cronInvalid" id="singleInvalid" type="text" class="form-control Wdate required" readonly="readonly" value="${_cfg.schedule.cronInvalid }" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,minDate:'#F{$dp.$D(\'singleValid\')}'});"/>
|
||||
<input name="schedule.cronInvalid" id="singleInvalid" type="text" class="form-control Wdate required oneDate oneDiffDate" readonly="readonly" value="${_cfg.schedule.cronInvalid }" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
|
||||
</div>
|
||||
<div for="schedule.cronInvalid"></div>
|
||||
</div>
|
||||
@@ -171,14 +287,14 @@
|
||||
<div class="form-group ">
|
||||
<label class="control-label col-md-2"><spring:message code="startTime"></spring:message></label>
|
||||
<div class="col-md-4">
|
||||
<input name="schedule.cronValid" type="text" class="form-control Wdate required" readonly="readonly" value="${_cfg.schedule.cronValid }" onClick="WdatePicker({dateFmt:'H:mm:ss'})"/>
|
||||
<input name="schedule.cronValid" type="text" id="dayValid" class="form-control Wdate required " readonly="readonly" value="${_cfg.schedule.cronValid }" onClick="WdatePicker({dateFmt:'H:mm:ss'})"/>
|
||||
</div>
|
||||
<div for="schedule.cronValid"></div>
|
||||
</div>
|
||||
<div class="form-group ">
|
||||
<label class="control-label col-md-2"><spring:message code="endTime"/></label>
|
||||
<div class="col-md-4">
|
||||
<input name="schedule.cronInvalid" type="text" class="form-control Wdate required" readonly="readonly" value="${_cfg.schedule.cronInvalid }" onClick="WdatePicker({dateFmt:'H:mm:ss'})"/>
|
||||
<input name="schedule.cronInvalid" type="text" id="dayInvalid" class="form-control Wdate required dayDate dayDiffDate" readonly="readonly" value="${_cfg.schedule.cronInvalid }" onClick="WdatePicker({dateFmt:'H:mm:ss'})"/>
|
||||
</div>
|
||||
<div for="schedule.cronInvalid"></div>
|
||||
</div>
|
||||
@@ -211,14 +327,14 @@
|
||||
<div class="form-group ">
|
||||
<label class="control-label col-md-2"><spring:message code="startTime"></spring:message></label>
|
||||
<div class="col-md-4">
|
||||
<input name="schedule.cronValid" type="text" class="form-control Wdate required" readonly="readonly" value="${_cfg.schedule.cronValid }" onClick="WdatePicker({dateFmt:'H:mm:ss'})"/>
|
||||
<input name="schedule.cronValid" type="text" id="weekValid" class="form-control Wdate required" readonly="readonly" value="${_cfg.schedule.cronValid }" onClick="WdatePicker({dateFmt:'H:mm:ss'})"/>
|
||||
</div>
|
||||
<div for="schedule.cronValid"></div>
|
||||
</div>
|
||||
<div class="form-group ">
|
||||
<label class="control-label col-md-2"><spring:message code="endTime"/></label>
|
||||
<div class="col-md-4">
|
||||
<input name="schedule.cronInvalid" type="text" class="form-control Wdate required" readonly="readonly" value="${_cfg.schedule.cronInvalid }" onClick="WdatePicker({dateFmt:'H:mm:ss'})"/>
|
||||
<input name="schedule.cronInvalid" type="text" id="weekInvalid" class="form-control Wdate required weekDate weekDiffDate" readonly="readonly" value="${_cfg.schedule.cronInvalid }" onClick="WdatePicker({dateFmt:'H:mm:ss'})"/>
|
||||
</div>
|
||||
<div for="schedule.cronInvalid"></div>
|
||||
</div>
|
||||
@@ -316,14 +432,14 @@
|
||||
<div class="form-group ">
|
||||
<label class="control-label col-md-2"><spring:message code="startTime"></spring:message></label>
|
||||
<div class="col-md-4">
|
||||
<input name="schedule.cronValid" type="text" class="form-control Wdate required" readonly="readonly" value='${_cfg.schedule.cronValid }' onClick="WdatePicker({dateFmt:'H:mm:ss'})"/>
|
||||
<input name="schedule.cronValid" type="text" id="monthValid" class="form-control Wdate required" readonly="readonly" value='${_cfg.schedule.cronValid }' onClick="WdatePicker({dateFmt:'H:mm:ss'})"/>
|
||||
</div>
|
||||
<div for="schedule.cronValid"></div>
|
||||
</div>
|
||||
<div class="form-group ">
|
||||
<label class="control-label col-md-2"><spring:message code="endTime"/></label>
|
||||
<div class="col-md-4">
|
||||
<input name="schedule.cronInvalid" type="text" class="form-control Wdate required" readonly="readonly" value='${_cfg.schedule.cronInvalid }' onClick="WdatePicker({dateFmt:'H:mm:ss'})"/>
|
||||
<input name="schedule.cronInvalid" type="text" id="monthInvalid" class="form-control Wdate required monthDate monthDiffDate" readonly="readonly" value='${_cfg.schedule.cronInvalid }' onClick="WdatePicker({dateFmt:'H:mm:ss'})"/>
|
||||
</div>
|
||||
<div for="schedule.cronInvalid"></div>
|
||||
</div>
|
||||
|
||||
106
src/main/webapp/WEB-INF/views/basics/protectionInfoForm.jsp
Normal file
106
src/main/webapp/WEB-INF/views/basics/protectionInfoForm.jsp
Normal file
@@ -0,0 +1,106 @@
|
||||
<%@ 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(){
|
||||
$("#cfgFrom").validate({
|
||||
errorPlacement: function(error,element){
|
||||
if($(element).parents().hasClass("tagsinput")){
|
||||
$(element).parents(".col-md-6").next("div").append(error);
|
||||
}else{
|
||||
$(element).parents(".form-group").find("div[for='"+element.attr("name")+"']").append(error);
|
||||
}
|
||||
},
|
||||
submitHandler: function(form){
|
||||
loading('onloading...');
|
||||
form.submit();
|
||||
},
|
||||
errorContainer: "#messageBox",
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="page-content">
|
||||
|
||||
<h3 class="page-title">
|
||||
<spring:message code="protection_list_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.proId}"><spring:message code="add"></spring:message></c:if>
|
||||
<c:if test="${not empty _cfg.proId}"><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/innerProtectionList/saveOrUpdate" method="post" class="form-horizontal">
|
||||
<input type="hidden" name="proId" value="${_cfg.proId}">
|
||||
<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="keywords"/></label>
|
||||
<div class="col-md-6">
|
||||
<input class="form-control required" type="text" name="keyword" value="${_cfg.keyword}">
|
||||
</div>
|
||||
<div for="keyword"></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="type"/></label>
|
||||
<div class="col-md-6">
|
||||
<%-- <input class="form-control required" type="text" name="targetType" value="${_cfg.targetType}"> --%>
|
||||
<select name="targetType" class="selectpicker show-tick form-control required">
|
||||
<option value=""><spring:message code="select"/></option>
|
||||
<option value="urlCheck" <c:if test="${_cfg.targetType eq 'urlCheck'}">selected</c:if>><spring:message code="URL"/></option>
|
||||
<option value="domainCheck" <c:if test="${_cfg.targetType eq 'domainCheck'}">selected</c:if>><spring:message code="domain"/></option>
|
||||
<option value="keywordSign" <c:if test="${_cfg.targetType eq 'keywordSign'}">selected</c:if>><spring:message code="keywords"/></option>
|
||||
</select>
|
||||
</div>
|
||||
<div for="targetType"></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>
|
||||
260
src/main/webapp/WEB-INF/views/basics/protectionInfoList.jsp
Normal file
260
src/main/webapp/WEB-INF/views/basics/protectionInfoList.jsp
Normal file
@@ -0,0 +1,260 @@
|
||||
<%@
|
||||
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.keyword}"){
|
||||
$("#intype").val("${cfg.keyword}");
|
||||
}else{
|
||||
$("#intype").attr("placeholder","<spring:message code='input'/> "+$("#seltype").find("option:selected").text());
|
||||
}
|
||||
// 处理 Type下拉检索条件----------------+
|
||||
if($("#seltype").val() == "targetType"){
|
||||
$("#intype").hide();// 隐藏输入框
|
||||
}else{
|
||||
$("#targetType").selectpicker("hide");
|
||||
}
|
||||
|
||||
$("#seltype").change(function(){
|
||||
if($(this).val() == "targetType"){
|
||||
$("#intype").hide();// 隐藏输入框
|
||||
$("#intype").val("");// 清空input条件
|
||||
$("#targetType").find("option").removeAttr("selected",false);
|
||||
$("#targetType").selectpicker("refresh");
|
||||
$("#targetType").selectpicker("show");
|
||||
}else{
|
||||
$("#targetType").find("option:first").attr("selected",true);
|
||||
$("#targetType").selectpicker("hide");// 隐藏下拉框
|
||||
}
|
||||
$("#intype").attr("placeholder","<spring:message code='input'/> "+$(this).find("option:selected").text());
|
||||
});
|
||||
// 处理 Type下拉检索条件----------------+
|
||||
|
||||
//筛选功能初始化
|
||||
filterActionInit();
|
||||
//reset
|
||||
$("#resetBtn").on("click",function(){
|
||||
if($("#seltype").find("option:first").val() == "targetType"){
|
||||
$("#intype").hide();
|
||||
$("#targetType").selectpicker("show");
|
||||
return false;
|
||||
}
|
||||
if($("#seltype").val() == "targetType"){
|
||||
$("#intype").show();
|
||||
$("#intype").attr("placeholder",$.validator.messages.input+$("#seltype").find("option:first").text());
|
||||
$("#targetType").selectpicker("hide");
|
||||
};
|
||||
|
||||
$("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")+",";
|
||||
}
|
||||
});
|
||||
if(str.substr(str.length-1)== ','){
|
||||
ids = str.substr(0,str.length-1);
|
||||
}
|
||||
|
||||
var canDel=true;
|
||||
if(canDel){
|
||||
var added = "";
|
||||
|
||||
top.$.jBox.confirm("<spring:message code='confirm_message'/>"+added,"<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;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="page-content">
|
||||
<div class="theme-panel hidden-xs hidden-sm">
|
||||
<button type="button" class="btn btn-primary" onClick="javascript:window.location='${ctx}/basics/innerProtectionList/form'">
|
||||
<i class="fa fa-plus"></i>
|
||||
<spring:message code="add"></spring:message>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<h3 class="page-title">
|
||||
<spring:message code="protection_list_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/innerProtectionList/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">
|
||||
<div class="input-group">
|
||||
<div class="input-group-btn">
|
||||
<form:select path="seltype" class="selectpicker select2 input-small" >
|
||||
<form:option value="keyword"><spring:message code="keywords"></spring:message></form:option>
|
||||
<form:option value="targetType"><spring:message code="type"></spring:message></form:option>
|
||||
</form:select>
|
||||
</div>
|
||||
<input id="intype" class="form-control input-medium" type="text" value="">
|
||||
<div class="input-group-btn">
|
||||
<form:select id="targetType" path="targetType" class="selectpicker select2 input-small" >
|
||||
<form:option value=""><spring:message code="select"/></form:option>
|
||||
<form:option value="urlCheck"><spring:message code="URL"/></form:option>
|
||||
<form:option value="domainCheck"><spring:message code="domain"/></form:option>
|
||||
<form:option value="keywordSign"><spring:message code="keywords"/></form:option>
|
||||
</form:select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="pull-left">
|
||||
<button type="button" class="btn blue" onClick="return page()"> <i class="fa fa-search"></i> <spring:message code="search"/> </button>
|
||||
<button type="button" class="btn btn-default" id="resetBtn"> <i class="fa fa-refresh"></i> <spring:message code="reset"/> </button>
|
||||
<button type="button" class="btn btn-default" id="filter-btn"> <spring:message code="filter"/> <i class="fa fa-angle-double-down"></i></button>
|
||||
</div>
|
||||
<div class="pull-right">
|
||||
<sys:delRow url="${ctx}/basics/innerProtectionList/form" id="contentTable" label="update"></sys:delRow>
|
||||
<a href="javascript:void(0);" class="btn btn-default" onclick="deletes('${ctx}/basics/innerProtectionList/delete?isValid=-1&functionId=${cfg.functionId }')" 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> --%>
|
||||
|
||||
<%-- <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/policyGroup/exportGroup?exType=excel" searchUrl="${ctx}/basics/policyGroup/policyGroupList" id="contentTable" maxRow="5" label="cfg_excel"></sys:delRow></li>
|
||||
<li><sys:delRow url="${ctx}/basics/policyGroup/exportGroup?exType=csv" searchUrl="${ctx}/basics/policyGroup/policyGroupList" 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="keyword" ><spring:message code="keywords"/></th>
|
||||
<th column="targetType" ><spring:message code="type"/></th>
|
||||
<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 child-checks" id="${cfg.proId}"></td>
|
||||
<td>
|
||||
<a href="javascript:;" data-original-title="${cfg.keyword}"
|
||||
class="tooltips" data-flag="false" data-html="true" data-placement="top">
|
||||
${fns:abbr(cfg.keyword,20)}
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<c:if test="${cfg.targetType eq 'urlCheck'}"><spring:message code="URL"/></c:if>
|
||||
<c:if test="${cfg.targetType eq 'domainCheck'}"><spring:message code="domain"/></c:if>
|
||||
<c:if test="${cfg.targetType eq 'keywordSign'}"><spring:message code="keywords"/></c:if>
|
||||
</td>
|
||||
<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>
|
||||
@@ -85,7 +85,11 @@
|
||||
<!-- 此配置的关键词可以输入多个关键词 -->
|
||||
<c:if test="${region.configMultiKeywords eq 1}">
|
||||
<div class="col-md-6">
|
||||
<input class="form-control required tags <c:if test="${fn:containsIgnoreCase(region.configServiceType,'domain') }"> domainCheck </c:if> <c:if test="${fn:containsIgnoreCase(region.configServiceType,'url') }"> urlCheck </c:if>" type="text" id="tags_${tabName}${status.index}"
|
||||
<input class="form-control required tags
|
||||
<c:if test="${fn:containsIgnoreCase(region.configServiceType,'domain') }"> domainCheck </c:if>
|
||||
<c:if test="${fn:containsIgnoreCase(region.configServiceType,'url') }"> urlCheck </c:if>
|
||||
<c:if test="${(!fn:containsIgnoreCase(region.configServiceType,'domain')) && (!fn:containsIgnoreCase(region.configServiceType,'url')) }"> keywordSign </c:if>"
|
||||
type="text" id="tags_${tabName}${status.index}"
|
||||
name="${cfgName}.cfgKeywords"
|
||||
value="${cfg.cfgKeywords}">
|
||||
</div>
|
||||
@@ -97,6 +101,7 @@
|
||||
<input class="form-control required invisibleChar
|
||||
<c:if test="${fn:containsIgnoreCase(region.configServiceType,'domain') }"> domainCheck </c:if>
|
||||
<c:if test="${fn:containsIgnoreCase(region.configServiceType,'url') }"> urlCheck </c:if>
|
||||
<c:if test="${(!fn:containsIgnoreCase(region.configServiceType,'domain')) && (!fn:containsIgnoreCase(region.configServiceType,'url')) }"> keywordSign </c:if>
|
||||
"
|
||||
type="text"
|
||||
name="${cfgName}.cfgKeywords"
|
||||
|
||||
@@ -228,10 +228,10 @@
|
||||
<c:forEach items="${_cfg.httpUrlList}" var="cfg">
|
||||
<c:if test="${region[1] eq cfg.cfgType }">
|
||||
<div id="${region[1]}Info${index}" class="content content${region[0]}" name="subCfg${index}">
|
||||
<div class="row">
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<div class="form-group">
|
||||
<label><spring:message code='keywords' />:
|
||||
<label><spring:message code='domain' />:
|
||||
${fn:replace(cfg.cfgKeywords, "***and***", " ")}
|
||||
</label>
|
||||
</div>
|
||||
@@ -249,8 +249,8 @@
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label><spring:message code='match_method' />:</label>
|
||||
@@ -261,8 +261,8 @@
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<c:if test="${cfg.isHexbin==0 }">
|
||||
</div>
|
||||
<c:if test="${cfg.isHexbin==0 }">
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
|
||||
@@ -71,9 +71,32 @@
|
||||
$("#searchText").click(function(){
|
||||
$(this).val("");
|
||||
});
|
||||
|
||||
//定时查询界面配置总量和服务配置总量 是否一致
|
||||
t2 = window.setInterval("getServiceSum()",5*60*1000);
|
||||
//去掉定时器的方法
|
||||
//window.clearInterval(t2);
|
||||
|
||||
});
|
||||
|
||||
var t2;
|
||||
//获取界面总量和服务总量
|
||||
function getServiceSum(){
|
||||
$.ajax({
|
||||
type:'post',
|
||||
async:false,
|
||||
cache:false,
|
||||
url:'${ctx}/sys/warn/serviceSum',
|
||||
dataType:"json",
|
||||
success: function(data){
|
||||
if(data !=null && (data.interfaceCfgTotal !=data.systemCfgTotal)){
|
||||
top.$.jBox.tip("界面配置总量和服务配置总量不一致!");
|
||||
}
|
||||
},
|
||||
error: function(){
|
||||
top.$.jBox.tip("界面配置总量和服务配置总量查询失败!");
|
||||
window.clearInterval(t2);
|
||||
}
|
||||
});
|
||||
}
|
||||
//页面跳转函数 level:级别,1顶级,2有子级。name:菜单名称,有多级#间隔。url:访问路径。object:点击元素对象。
|
||||
function page_turn(id, functionId,level, name, url,obj){
|
||||
//$(".page-bar").removeClass("hidden");
|
||||
|
||||
@@ -472,6 +472,7 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<th><spring:message code="service_name"/></th>
|
||||
<th><spring:message code="effective"/></th>
|
||||
<th><spring:message code="approved"/></th>
|
||||
<th><spring:message code="unapproved"/></th>
|
||||
<th><spring:message code="cancel_approved"/></th>
|
||||
@@ -510,6 +511,9 @@
|
||||
<%-- <spring:message code="${serviceName }"/>${serviceName } --%>
|
||||
<spring:message code="${functionName }"/>
|
||||
</td>
|
||||
<td>
|
||||
${statistics.effective }
|
||||
</td>
|
||||
<td>
|
||||
${statistics.approved }
|
||||
</td>
|
||||
|
||||
105
src/main/webapp/WEB-INF/views/sys/sysUserWarnList.jsp
Normal file
105
src/main/webapp/WEB-INF/views/sys/sysUserWarnList.jsp
Normal file
@@ -0,0 +1,105 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8"%>
|
||||
<%@ include file="/WEB-INF/include/taglib.jsp"%>
|
||||
<html>
|
||||
<head>
|
||||
<title>
|
||||
<spring:message code="admin_user_warn"/>
|
||||
</title>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
|
||||
//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);
|
||||
});
|
||||
$(':input','#searchForm')
|
||||
.not(':button,:submit,:reset,:hidden')
|
||||
.attr("value",'');
|
||||
$("#searchForm")[0].reset();
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="page-content">
|
||||
|
||||
<h3 class="page-title">
|
||||
<spring:message code="admin_user_warn"/>
|
||||
</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="warn" action="${ctx}/sys/warn/userWarnList" 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}"/>
|
||||
|
||||
<div class="col-md-12">
|
||||
|
||||
<div class="pull-left">
|
||||
<div class="input-group">
|
||||
<div class="input-group-btn">
|
||||
<span class="selectpicker form-control" ><spring:message code="service_id"/></span>
|
||||
</div>
|
||||
<input name="serviceId" type="text" class="form-control input-medium" maxlength="20" value="${warn.serviceId }" />
|
||||
</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>
|
||||
</div>
|
||||
|
||||
<div class="pull-right">
|
||||
|
||||
<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>
|
||||
<!-- 搜索内容与操作按钮栏 -->
|
||||
|
||||
</form:form>
|
||||
</div>
|
||||
<sys:message content="${message}"/>
|
||||
<div class="table-responsive">
|
||||
|
||||
<table id="contentTable" class="table table-striped table-bordered table-condensed text-nowrap logTb">
|
||||
<thead>
|
||||
<tr>
|
||||
|
||||
<th class="sort-column service_id" column="service_id"><spring:message code="service_id"/></th>
|
||||
<th ><spring:message code="service_name"/></th>
|
||||
<th class="sort-column interface_total" column="interface_total"><spring:message code="interface_total"/></th>
|
||||
<th class="sort-column service_total" column="service_total"><spring:message code="service_total"/></th>
|
||||
<th class="sort-column create_time" column="create_time"><spring:message code="create_time"/></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<c:forEach var="log" items="${page.list }" varStatus="status">
|
||||
<tr>
|
||||
<td>${log.serviceId }</td>
|
||||
<td>${log.serviceDesc }</td>
|
||||
<td>${log.interfaceCfgTotal }</td>
|
||||
<td>${log.systemCfgTotal }</td>
|
||||
<td><fmt:formatDate value="${log.time }" 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>
|
||||
@@ -90,6 +90,8 @@
|
||||
log_trend:"Log Trend",
|
||||
info:"Prompt",
|
||||
protect_warn:"Policy with relax precondition may consume too much resources.Use with cautions!",
|
||||
log_no_data:"This hour no data"
|
||||
log_no_data:"This hour no data",
|
||||
expireTip:"Start time and end time interval is at least 1 minute",
|
||||
compareTip:"Start time should not be less than the current time plus 2 minutes."
|
||||
});
|
||||
}(jQuery));
|
||||
|
||||
@@ -90,6 +90,8 @@
|
||||
log_trend:"Журнал Тенденция",
|
||||
info:"Инфо",
|
||||
protect_warn:"Policy with relax precondition may consume too much resources.Use with cautions!",
|
||||
log_no_data:"Нет данных за этот час"
|
||||
log_no_data:"Нет данных за этот час",
|
||||
expireTip:"Start time and end time interval is at least 1 minute",
|
||||
compareTip:"Start time should not be less than the current time plus 2 minutes."
|
||||
});
|
||||
}(jQuery));
|
||||
|
||||
@@ -90,6 +90,8 @@
|
||||
log_trend:"日志趋势",
|
||||
info:"提示",
|
||||
protect_warn:"该策略执行条件过于宽泛,会消耗较多的计算资源。慎用!",
|
||||
log_no_data:"本小时无数据"
|
||||
log_no_data:"本小时无数据",
|
||||
expireTip:"开始时间结束时间间隔至少为1分钟",
|
||||
compareTip:"开始时间不能小于当前时间加上2分钟 "
|
||||
});
|
||||
}(jQuery));
|
||||
|
||||
@@ -1,11 +1,5 @@
|
||||
$(function(){
|
||||
var protectedList = [".com"];
|
||||
$(".domainCheck").each(function(){
|
||||
$(this).on("blur",function(){
|
||||
protectedListWarn(this,$(this).val(),protectedList);
|
||||
});
|
||||
protectedListWarn(this,$(this).val(),protectedList);
|
||||
});
|
||||
|
||||
// var leff =$("span[class~='le-ca-fo']").attr("data-original-title")
|
||||
// getConfigSyncStatus();
|
||||
$("#contentTable").not(".logTb").find("tbody tr").each(function(i){
|
||||
@@ -33,7 +27,28 @@ $(function(){
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
/** 获取配置保护名单 **/
|
||||
var protectionData;
|
||||
var pathName = window.document.location.pathname.substring(0,window.document.location.pathname.lastIndexOf("/nis")+4);
|
||||
$.ajax({
|
||||
type:'get',
|
||||
url:pathName+'/basics/innerProtectionList/ajaxGetAllInfo',
|
||||
dataType:"json",
|
||||
success:function(data){
|
||||
if(data != null){
|
||||
protectionData = data;
|
||||
for(var key in data){
|
||||
var list = data[key];
|
||||
$("."+key).each(function(){
|
||||
if(!$(this).hasClass("tags")){
|
||||
this.setAttribute("onblur","protectedListWarn(this,'"+key+"')");
|
||||
}
|
||||
protectedListWarn(this,key);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
//增加描述新增时的文字长度限制
|
||||
$("form input[name='cfgDesc']").attr("maxlength","128");
|
||||
@@ -436,8 +451,12 @@ $(function(){
|
||||
});
|
||||
$(this).prev("input[name$='cfgKeywords']").val(keywordValue);*/
|
||||
exprTypeChecked(objNamePrefix,size,options);
|
||||
if($(this).hasClass("urlCheck")){
|
||||
protectedListWarn($("#"+$(this).attr("id")+"_tagsinput"),$(this).val(),protectedList);
|
||||
|
||||
var tagObj = $(this);
|
||||
for(var key in protectionData){
|
||||
if(tagObj.hasClass(key)){
|
||||
protectedListWarn(tagObj,key);
|
||||
}
|
||||
}
|
||||
},
|
||||
onRemoveTag:function(tag,size){
|
||||
@@ -449,8 +468,12 @@ $(function(){
|
||||
});
|
||||
$(this).prev("input[name$='cfgKeywords']").val(keywordValue);*/
|
||||
exprTypeChecked(objNamePrefix,size,options);
|
||||
if($(this).hasClass("urlCheck")){
|
||||
protectedListWarn($("#"+$(this).attr("id")+"_tagsinput"),$(this).val(),protectedList);
|
||||
|
||||
var tagObj = $(this);
|
||||
for(var key in protectionData){
|
||||
if(tagObj.hasClass(key)){
|
||||
protectedListWarn(tagObj,key);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -1719,13 +1742,35 @@ function addPrintTableCss(rowValue,cellValue,tableIdValue,cssName){
|
||||
}
|
||||
}
|
||||
/**保护名单提醒**/
|
||||
function protectedListWarn(obj,value,protectedList){
|
||||
$(obj).next(".fa-warning").remove();
|
||||
if(value !=null){
|
||||
if(protectedList.indexOf(value) >= 0){
|
||||
//$(obj).after("<i class='fa fa-warning font-red-flamingo'>"+$.validator.messages.protect_warn+"</i>");
|
||||
$.jBox.info($.validator.messages.protect_warn,$.validator.messages.info);
|
||||
$('.jbox-body .jbox-icon').css('top','55px');
|
||||
function protectedListWarn(obj,tagKey){
|
||||
var pathName = window.document.location.pathname.substring(0,window.document.location.pathname.lastIndexOf("/nis")+4);
|
||||
$.ajax({
|
||||
type:'get',
|
||||
url:pathName+'/basics/innerProtectionList/ajaxGetAllInfo',
|
||||
dataType:"json",
|
||||
success:function(data){
|
||||
if(data != null){
|
||||
for(var key in data){
|
||||
var list = data[key];
|
||||
$("."+key).each(function(){
|
||||
if(!$(this).hasClass("tags")){
|
||||
this.setAttribute("onblur","protectedListWarn(this,'"+key+"')");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(obj).next(".fa-warning").remove();
|
||||
var value = $(obj).val();
|
||||
var protectedList = data[tagKey];
|
||||
if(value != "" && typeof(protectedList) != "undefined"){
|
||||
if(protectedList.indexOf(value) >= 0){ // 关键字匹配则弹出提示框
|
||||
$.jBox.info($.validator.messages.protect_warn,$.validator.messages.info);
|
||||
$('.jbox-body .jbox-icon').css('top','55px');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@@ -67,6 +67,17 @@ function switchService(){
|
||||
$(".service").removeClass("hidden");
|
||||
}
|
||||
|
||||
// App Identify -> RateLimit隐藏SubscribeID
|
||||
if(functionId == 63){
|
||||
var action = $("input[name='serviceDictId']:checked").attr("action");
|
||||
var label = $(".region").find("input[configservicetype='subscribe_id']").parents("label:first");
|
||||
if(action == 64){
|
||||
$("input[name='regionDictIds'][regiontype='1']").prop("checked",true);
|
||||
$(label).hide();
|
||||
}else{
|
||||
$(label).show();
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 模板下载
|
||||
|
||||
Reference in New Issue
Block a user