Merge branch 'develop' of https://git.mesalab.cn/K18_NTCS_WEB/NTC.git into develop
This commit is contained in:
@@ -167,7 +167,7 @@ public class SysUser extends BaseEntity<SysUser> {
|
||||
}
|
||||
|
||||
public static boolean isAdmin(String loginId){
|
||||
return loginId != null && "admin".equals(loginId);
|
||||
return loginId != null && "ceiec".equals(loginId);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -52,6 +52,9 @@ public class PxyObjSpoofingIpPool extends BaseIpCfg{
|
||||
this.ipAddress = ipAddress;
|
||||
}
|
||||
public Integer getGroupId() {
|
||||
if((groupId==null || groupId==0) && cfgId!=null){
|
||||
groupId=cfgId.intValue();
|
||||
}
|
||||
return groupId;
|
||||
}
|
||||
public void setGroupId(Integer groupId) {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1042,7 +1042,7 @@ public class ExportExcel {
|
||||
//expr type
|
||||
if("key_word".equals(headerStr)){
|
||||
if(!StringUtil.isEmpty(region.getConfigMultiKeywords())){
|
||||
if(region.getConfigMultiKeywords().equals(1)){//多关键字输入TODO
|
||||
if(region.getConfigMultiKeywords().equals("1")){//多关键字输入TODO
|
||||
commentStr=commentStr+msgProp.getProperty("rule_desc_tip")+":\n";
|
||||
index++;
|
||||
//允许输入多关键字,多个关键字用换行表示
|
||||
|
||||
@@ -77,7 +77,8 @@ public class TaskInfoController extends BaseController{
|
||||
}else{
|
||||
if (!"true".equals(checkTaskName(taskInfo.getTaskName()))){
|
||||
logger.info(taskInfo.getTaskName()+"重复数据");
|
||||
addMessage("error",model,"save_failed");
|
||||
Properties props=this.getMsgProp();
|
||||
addMessage("error",model,props.getProperty("duplicate", "Duplicate")+" "+props.getProperty("task_name", "Task Name"));
|
||||
return form(taskInfo, model);
|
||||
}
|
||||
// 保存用户信息
|
||||
|
||||
@@ -83,7 +83,8 @@ public class RequestInfoController extends BaseController{
|
||||
}else{
|
||||
if (!"true".equals(checkRequestNumber(requestInfo.getRequestNumber()))){
|
||||
logger.info(requestInfo.getRequestNumber()+"重复数据");
|
||||
addMessage("error",model,"save_failed");
|
||||
Properties props=this.getMsgProp();
|
||||
addMessage("error",model,props.getProperty("duplicate", "Duplicate")+" "+props.getProperty("title", "Title"));
|
||||
return form(requestInfo, model);
|
||||
}
|
||||
// 保存用户信息
|
||||
|
||||
@@ -300,11 +300,16 @@ public class IpController extends BaseController{
|
||||
,FunctionServiceDict serviceDict
|
||||
,Integer requestId) throws Exception{
|
||||
Properties pro=getMsgProp();
|
||||
//String serviceName=pro.getProperty(serviceDict.getServiceName());
|
||||
String regionName=pro.getProperty(regionDict.getConfigRegionValue());
|
||||
//serviceName=StringUtil.isEmpty(serviceName) ?serviceDict.getServiceName():serviceName;
|
||||
regionName=StringUtil.isEmpty(regionName) ?regionDict.getConfigRegionValue():regionName;
|
||||
String fileName = regionName+"_Template.xlsx";
|
||||
String menuCode = menuService.getMenuCodeByFunctionId(serviceDict.getFunctionId());
|
||||
String menuName = pro.getProperty(menuCode);
|
||||
String regionName = pro.getProperty(regionDict.getConfigRegionValue());
|
||||
menuName = StringUtil.isEmpty(menuName) ? menuCode : menuName;
|
||||
regionName = StringUtil.isEmpty(regionName) ? regionDict.getConfigRegionValue() : regionName;
|
||||
|
||||
String fileName = regionName + "_Template.xlsx";
|
||||
if(!menuName.equalsIgnoreCase(regionName)) {
|
||||
fileName = menuName +"_"+ fileName;
|
||||
}
|
||||
//ip类模板
|
||||
if(regionDict.getRegionType().equals(1)){
|
||||
if(regionDict.getFunctionId().equals(5)){// IP Address
|
||||
|
||||
@@ -26,6 +26,7 @@ import com.nis.domain.configuration.HttpUrlCfg;
|
||||
import com.nis.domain.configuration.InterceptPktBin;
|
||||
import com.nis.domain.configuration.IpPortCfg;
|
||||
import com.nis.domain.configuration.PxyObjKeyring;
|
||||
import com.nis.domain.configuration.PxyObjSpoofingIpPool;
|
||||
import com.nis.exceptions.MaatConvertException;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.DictUtils;
|
||||
@@ -60,9 +61,18 @@ public class InterceptController extends CommonController {
|
||||
certificateList = pxyObjKeyringService.findPxyObjKeyrings(null, 1, 1, "domain");
|
||||
}
|
||||
model.addAttribute("certificateList", certificateList);
|
||||
// IP地址仿冒策略使用策略组
|
||||
List<PolicyGroupInfo> policyGroups = policyGroupInfoService.findPolicyGroupInfosByType(6);
|
||||
model.addAttribute("policyGroups", policyGroups);
|
||||
/*if(cfg.getFunctionId().equals(214)){
|
||||
// IP地址仿冒策略使用策略组
|
||||
//List<PolicyGroupInfo> policyGroups = policyGroupInfoService.findPolicyGroupInfosByType(6);
|
||||
List<CfgIndexInfo> list = page.getList();
|
||||
for(CfgIndexInfo c:list){
|
||||
Long cfgId = Long.parseLong(c.getUserRegion2());//user_region2字段存储的为IP仿冒池的ID信息(策略组ID)
|
||||
PxyObjSpoofingIpPool pool = pxyObjSpoofingIpPoolService.getPxyObjSpoofingIpPool(cfgId);
|
||||
c.setUserRegion2(pool.getGroupName());//将IP仿冒池的策略组名重新赋给user_region2
|
||||
}
|
||||
|
||||
// model.addAttribute("policyGroups", policyGroups);
|
||||
}*/
|
||||
return "/cfg/intercept/interceptList";
|
||||
}
|
||||
|
||||
@@ -86,8 +96,9 @@ public class InterceptController extends CommonController {
|
||||
|
||||
model.addAttribute("_cfg", entity);
|
||||
// IP地址仿冒策略使用策略组
|
||||
List<PolicyGroupInfo> policyGroups = policyGroupInfoService.findPolicyGroupInfosByType(6);
|
||||
model.addAttribute("policyGroups", policyGroups);
|
||||
// List<PolicyGroupInfo> policyGroups = policyGroupInfoService.findPolicyGroupInfosByType(6);
|
||||
// List<PxyObjSpoofingIpPool> pools = pxyObjSpoofingIpPoolService.findPxyObjSpoofingIpPools(new PxyObjSpoofingIpPool());
|
||||
// model.addAttribute("policyGroups", pools);
|
||||
|
||||
return "/cfg/intercept/interceptForm";
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ public class PxyObjSpoofingIpPoolController extends BaseController {
|
||||
model.addAttribute("isAdd", true);
|
||||
}
|
||||
|
||||
List<PolicyGroupInfo> groups=policyGroupInfoService.findPolicyGroupInfosByType(6);
|
||||
/*List<PolicyGroupInfo> groups=policyGroupInfoService.findPolicyGroupInfosByType(6);
|
||||
List<PolicyGroupInfo> policyGroups = new ArrayList();
|
||||
//解决目前一个分组只能有一个生效IP
|
||||
for(PolicyGroupInfo group:groups){
|
||||
@@ -101,7 +101,7 @@ public class PxyObjSpoofingIpPoolController extends BaseController {
|
||||
policyGroups.add(group);
|
||||
}
|
||||
}
|
||||
model.addAttribute("policyGroups", policyGroups);
|
||||
model.addAttribute("policyGroups", policyGroups);*/
|
||||
model.addAttribute("_cfg", cfg);
|
||||
return "/cfg/proxy/spoofingIpPool/form";
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
@@ -133,4 +134,61 @@ public class ConfigureStatisticsController extends BaseController{
|
||||
map.put("ruleLimit", ruleLimit);
|
||||
return map;
|
||||
}
|
||||
|
||||
//configureStateStatisticsPrint
|
||||
@ResponseBody
|
||||
@RequestMapping(value = {"/configureStateStatisticsPrint"})
|
||||
public Map configureStateStatisticsPrint(Model model,HttpServletRequest request
|
||||
,HttpServletResponse response
|
||||
,RedirectAttributes redirectAttributes){
|
||||
SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
/****************************Request Info Statistics*****************************/
|
||||
//1、查询所有有效的service
|
||||
List<FunctionServiceDict> serviceDictList = DictUtils.getFunctionServiceDictList();
|
||||
//2、查询所有菜单
|
||||
List<SysMenu> menuList = UserUtils.getMenuCfgList();
|
||||
//3、根据来函分页
|
||||
RequestInfo requestInfo=new RequestInfo();
|
||||
requestInfo.setIsAudit(1);
|
||||
requestInfo.setIsValid(1);
|
||||
Page page = new Page(request, response,"r");
|
||||
page.setPageNo(1);
|
||||
page.setPageSize(Constants.MAX_LOG_EXPORT_SIZE);
|
||||
Page requestPage = requestInfoService.findRequestInfo(page,requestInfo);
|
||||
List<RequestInfo> requestInfos=requestPage.getList();
|
||||
//4、根据当前页的requestInfo信息查询request统计信息
|
||||
List<Object[]> requestStatisticList=new ArrayList<Object[]>();
|
||||
if(!StringUtil.isEmpty(requestInfos)){
|
||||
Date requestStatisticTime=configureStatisticsService.getRequestStatisticTime();
|
||||
String requestStatisticTimeStr="";
|
||||
if(!StringUtil.isEmpty(requestStatisticTime)){
|
||||
requestStatisticTimeStr=sdf.format(requestStatisticTime);
|
||||
}
|
||||
requestStatisticList=configureStatisticsService.getRequestStateStatistics(requestInfos,menuList,requestStatisticTimeStr);
|
||||
if(!StringUtil.isEmpty(requestStatisticList)){
|
||||
for (Iterator iterator = requestStatisticList.iterator(); iterator.hasNext();) {
|
||||
Map map = (Map) iterator.next();
|
||||
for (RequestInfo requestInfoO : requestInfos) {
|
||||
if(requestInfoO.getId().toString().equals(map.get("request").toString())){
|
||||
map.put("request", requestInfoO.getRequestTitle());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
model.addAttribute("requestStatisticTime", requestStatisticTimeStr);
|
||||
}
|
||||
Properties msgProp = getMsgProp();
|
||||
for (int i = 0; i < menuList.size(); i++) {
|
||||
String property = msgProp.getProperty(menuList.get(i).getCode(), menuList.get(i).getCode());
|
||||
menuList.get(i).setCode(property);
|
||||
}
|
||||
requestPage.setList(requestStatisticList);
|
||||
model.addAttribute("requestInfos", requestInfos);
|
||||
model.addAttribute("serviceList", serviceDictList);
|
||||
model.addAttribute("page", requestPage);
|
||||
Map<String,Object> maps=new HashMap<String,Object>();
|
||||
maps.put("menuList", menuList);
|
||||
maps.put("requestStatisticList", requestStatisticList);
|
||||
return maps;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ public class TrafficStatisticsInfoController extends BaseController {
|
||||
Double dropConnNum=0d;
|
||||
Double monitorNum=0d;
|
||||
Double loopConnNum=0d;
|
||||
Double liveConnNum=0d;
|
||||
Double closeConnNum=0d;
|
||||
Double newUniConnNum=0d;
|
||||
Double inoctetsNum=0d;
|
||||
Double outoctetsNum=0d;
|
||||
@@ -86,7 +86,7 @@ public class TrafficStatisticsInfoController extends BaseController {
|
||||
monitorNum = (Double) map.get("monitorNum");
|
||||
dropConnNum = (Double) map.get("dropConnNum");
|
||||
loopConnNum = (Double) map.get("loopConnNum");
|
||||
liveConnNum = (Double) map.get("liveConnNum");
|
||||
closeConnNum = (Double) map.get("closeConnNum");
|
||||
newUniConnNum = (Double) map.get("newUniConnNum");
|
||||
inoctetsNum = (Double) map.get("inoctets");
|
||||
outoctetsNum = (Double) map.get("outoctets");
|
||||
@@ -100,7 +100,7 @@ public class TrafficStatisticsInfoController extends BaseController {
|
||||
m.put("monitorNum", monitorNum);
|
||||
m.put("loopConnNum", loopConnNum);
|
||||
m.put("dropConnNum", dropConnNum);
|
||||
m.put("liveConnNum", liveConnNum);
|
||||
m.put("closeConnNum", closeConnNum);
|
||||
m.put("newUniConnNum", newUniConnNum);
|
||||
|
||||
m.put("bandwidth", bandwidth);
|
||||
@@ -681,7 +681,7 @@ public class TrafficStatisticsInfoController extends BaseController {
|
||||
if("new_link".equals(searchAction)){
|
||||
url=url+"&searchBusinessType="+3;
|
||||
}
|
||||
if("active_link".equals(searchAction)){
|
||||
if("close_link".equals(searchAction)){
|
||||
url=url+"&searchBusinessType="+4;
|
||||
}
|
||||
if("pass".equals(searchAction)){
|
||||
|
||||
@@ -34,6 +34,7 @@ import com.nis.domain.log.BaseLogEntity;
|
||||
import com.nis.domain.maat.LogRecvData;
|
||||
import com.nis.domain.report.NtcAsnRecord;
|
||||
import com.nis.domain.report.NtcIpRangeReport;
|
||||
import com.nis.util.Configurations;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.DateUtils;
|
||||
import com.nis.util.StringUtil;
|
||||
@@ -69,7 +70,7 @@ public class TrafficStatisticsReportController extends BaseController {
|
||||
if ("3".endsWith(searchBusinessType)) {
|
||||
model.addAttribute("searchBusinessType", 3);// IP查询
|
||||
}
|
||||
String url = Constants.DASHBOARD_URL + Constants.NTC_RADIUS_REPORT;
|
||||
String url = Configurations.getStringProperty("dashboardUrlV2","dashboardUrlV2") + Constants.NTC_RADIUS_REPORT;
|
||||
String statTime = bean.getSearchFoundStartTime();
|
||||
String endTime = bean.getSearchFoundEndTime();
|
||||
String account = bean.getAccount();
|
||||
@@ -221,7 +222,7 @@ public class TrafficStatisticsReportController extends BaseController {
|
||||
if ("3".endsWith(searchBusinessType)) {
|
||||
model.addAttribute("searchBusinessType", 3);// IP查询
|
||||
}
|
||||
String url = Constants.DASHBOARD_URL + Constants.NTC_RADIUS_REPORT;
|
||||
String url = Configurations.getStringProperty("dashboardUrlV2","dashboardUrlV2")+ Constants.NTC_RADIUS_REPORT;
|
||||
String statTime = bean.getSearchFoundStartTime();
|
||||
String endTime = bean.getSearchFoundEndTime();
|
||||
String account = bean.getAccount();
|
||||
|
||||
@@ -21,6 +21,7 @@ import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
@@ -35,16 +36,16 @@ import com.nis.util.Constants;
|
||||
import com.nis.util.TimeConstants;
|
||||
import com.nis.util.httpclient.HttpClientUtil;
|
||||
import com.nis.web.controller.BaseController;
|
||||
import com.nis.web.service.basics.TaskInfoService;
|
||||
import com.nis.web.service.configuration.RequestInfoService;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("${adminPath}/eventBlock")
|
||||
public class NtcEventBlockController extends BaseController {
|
||||
|
||||
protected static Logger logger = LoggerFactory.getLogger(NtcEventBlockController.class);
|
||||
|
||||
|
||||
@Autowired
|
||||
private TaskInfoService taskInfoService;
|
||||
private RequestInfoService requestInfoService;
|
||||
|
||||
/**
|
||||
* EventBlock
|
||||
@@ -89,15 +90,20 @@ public class NtcEventBlockController extends BaseController {
|
||||
params.put("searchTaskStartTime", searchTaskStartTime);
|
||||
params.put("searchTaskEndTime", searchTaskEndTime);
|
||||
|
||||
|
||||
if (StringUtils.isNotBlank(log.getTaskIds())) {
|
||||
params.put("taskIds", log.getTaskIds());
|
||||
}
|
||||
|
||||
log.setSearchReportStartTime(searchReportStartTime);
|
||||
log.setSearchReportEndTime(searchReportEndTime);
|
||||
log.setSearchTaskStartTime(searchTaskStartTime);
|
||||
log.setSearchTaskEndTime(searchTaskEndTime);
|
||||
|
||||
params.put("reportType", 1);
|
||||
|
||||
String url = Constants.LOG_BASE_URL + Constants.NTC_EVENT_MONITOR_OR_BLOCK_Report;
|
||||
// String url = "http://192.168.11.56:8888/galaxy-service/service/log/v1/ntcEventsMonitorOrBlock";
|
||||
// String url =
|
||||
// "http://192.168.11.56:8888/galaxy-service/service/log/v1/ntcEventsMonitorOrBlock";
|
||||
String recv = HttpClientUtil.getMsg(url, params, request);
|
||||
if (StringUtils.isNotBlank(recv)) {
|
||||
Gson gson = new GsonBuilder().create();
|
||||
@@ -111,7 +117,7 @@ public class NtcEventBlockController extends BaseController {
|
||||
page.setList(data.getList());
|
||||
model.addAttribute("page", page);
|
||||
// 获取专项列表
|
||||
List<TaskInfo> taskList = taskInfoService.findTaskInfo(new TaskInfo());
|
||||
List<TaskInfo> taskList = requestInfoService.showTask(new TaskInfo());
|
||||
model.addAttribute("taskList", taskList);
|
||||
}
|
||||
}
|
||||
@@ -142,7 +148,6 @@ public class NtcEventBlockController extends BaseController {
|
||||
params.put("pageSize", page.getPageSize());
|
||||
params.put("pageNo", page.getPageNo());
|
||||
|
||||
|
||||
// 判断请求参数
|
||||
String searchReportStartTime = null;
|
||||
String searchReportEndTime = null;
|
||||
@@ -167,7 +172,6 @@ public class NtcEventBlockController extends BaseController {
|
||||
params.put("searchReportEndTime", searchReportEndTime);
|
||||
params.put("searchTaskStartTime", searchTaskStartTime);
|
||||
params.put("searchTaskEndTime", searchTaskEndTime);
|
||||
|
||||
|
||||
if (StringUtils.isNotBlank(log.getTaskIds())) {
|
||||
params.put("taskIds", log.getTaskIds());
|
||||
@@ -177,11 +181,12 @@ public class NtcEventBlockController extends BaseController {
|
||||
log.setSearchReportEndTime(searchReportEndTime);
|
||||
log.setSearchTaskStartTime(searchTaskStartTime);
|
||||
log.setSearchTaskEndTime(searchTaskEndTime);
|
||||
|
||||
|
||||
params.put("reportType", 1);
|
||||
|
||||
String url = Constants.LOG_BASE_URL + Constants.NTC_EVENT_MONITOR_OR_BLOCK_Report;
|
||||
// String url = "http://192.168.11.56:8888/galaxy-service/service/log/v1/ntcEventsMonitorOrBlock";
|
||||
// String url =
|
||||
// "http://192.168.11.56:8888/galaxy-service/service/log/v1/ntcEventsMonitorOrBlock";
|
||||
String recv = HttpClientUtil.getMsg(url, params, request);
|
||||
List<NtcEventMonitorOrBlockReport> list = new ArrayList<>();
|
||||
if (StringUtils.isNotBlank(recv)) {
|
||||
@@ -199,7 +204,7 @@ public class NtcEventBlockController extends BaseController {
|
||||
titleList.add("ntc_event_block_report");
|
||||
classMap.put("ntc_event_block_report", NtcEventMonitorOrBlockReport.class);
|
||||
|
||||
String cfgIndexInfoNoExport = "";
|
||||
String cfgIndexInfoNoExport = "," + hColumns + ",";
|
||||
noExportMap.put("ntc_event_block_report", cfgIndexInfoNoExport);
|
||||
|
||||
Properties msgProp = getMsgProp();
|
||||
@@ -327,4 +332,75 @@ public class NtcEventBlockController extends BaseController {
|
||||
|
||||
return dateTime.toString(TimeConstants.YYYY_MM_DD_HH24_MM_SS);
|
||||
}
|
||||
|
||||
// eventBlockPrint
|
||||
@ResponseBody
|
||||
@RequestMapping(value = "eventBlockPrint")
|
||||
public List<NtcEventMonitorOrBlockReport> eventBlockPrint(@ModelAttribute("log") NtcEventMonitorOrBlockReport log,
|
||||
Model model, HttpServletRequest request, HttpServletResponse response,
|
||||
RedirectAttributes redirectAttributes) {
|
||||
try {
|
||||
PageLog<NtcEventMonitorOrBlockReport> page = new PageLog<NtcEventMonitorOrBlockReport>(request, response);
|
||||
Map<String, Object> params = new HashMap<String, Object>();
|
||||
page.setPageNo(1);
|
||||
page.setPageSize(Constants.MAX_LOG_EXPORT_SIZE);
|
||||
params.put("pageSize", page.getPageSize());
|
||||
params.put("pageNo", page.getPageNo());
|
||||
// 判断请求参数
|
||||
String searchReportStartTime = null;
|
||||
String searchReportEndTime = null;
|
||||
String searchTaskStartTime = null;
|
||||
String searchTaskEndTime = null;
|
||||
/**
|
||||
* 对统计时间参数进行处理 开始-结束(一周内[7天])
|
||||
*/
|
||||
String[] serachReportTimes = getSerachTimes(log.getSearchReportStartTime(), log.getSearchReportEndTime());
|
||||
searchReportStartTime = serachReportTimes[0];
|
||||
searchReportEndTime = serachReportTimes[1];
|
||||
/**
|
||||
* 对报送时间参数进行处理 开始-结束(一周内[7天])
|
||||
*/
|
||||
String[] serachTaskTimes = getSerachTimes(log.getSearchTaskStartTime(), log.getSearchTaskEndTime());
|
||||
searchTaskStartTime = serachTaskTimes[0];
|
||||
searchTaskEndTime = serachTaskTimes[1];
|
||||
|
||||
params.put("searchReportStartTime", searchReportStartTime);
|
||||
params.put("searchReportEndTime", searchReportEndTime);
|
||||
params.put("searchTaskStartTime", searchTaskStartTime);
|
||||
params.put("searchTaskEndTime", searchTaskEndTime);
|
||||
|
||||
if (StringUtils.isNotBlank(log.getTaskIds())) {
|
||||
params.put("taskIds", log.getTaskIds());
|
||||
}
|
||||
|
||||
log.setSearchReportStartTime(searchReportStartTime);
|
||||
log.setSearchReportEndTime(searchReportEndTime);
|
||||
log.setSearchTaskStartTime(searchTaskStartTime);
|
||||
log.setSearchTaskEndTime(searchTaskEndTime);
|
||||
|
||||
params.put("reportType", 1);
|
||||
|
||||
String url = Constants.LOG_BASE_URL + Constants.NTC_EVENT_MONITOR_OR_BLOCK_Report;
|
||||
// String url =
|
||||
// "http://192.168.11.56:8888/galaxy-service/service/log/v1/ntcEventsMonitorOrBlock";
|
||||
String recv = HttpClientUtil.getMsg(url, params, request);
|
||||
List<NtcEventMonitorOrBlockReport> list = new ArrayList<>();
|
||||
if (StringUtils.isNotBlank(recv)) {
|
||||
Gson gson = new GsonBuilder().create();
|
||||
LogRecvData<NtcEventMonitorOrBlockReport> fromJson = gson.fromJson(recv,
|
||||
new TypeToken<LogRecvData<NtcEventMonitorOrBlockReport>>() {
|
||||
}.getType());
|
||||
if (fromJson.getStatus().intValue() == 200) {
|
||||
Page<NtcEventMonitorOrBlockReport> data = fromJson.getData();
|
||||
list = data.getList();
|
||||
}
|
||||
}
|
||||
|
||||
return list;
|
||||
} catch (Exception e) {
|
||||
logger.error("ntc_event_block_report print failed", e);
|
||||
addMessage(redirectAttributes, "error", "print_failed");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
@@ -31,12 +32,11 @@ import com.nis.domain.PageLog;
|
||||
import com.nis.domain.configuration.TaskInfo;
|
||||
import com.nis.domain.maat.LogRecvData;
|
||||
import com.nis.domain.report.NtcEventKeyProtectionReport;
|
||||
import com.nis.domain.report.NtcEventMonitorOrBlockReport;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.TimeConstants;
|
||||
import com.nis.util.httpclient.HttpClientUtil;
|
||||
import com.nis.web.controller.BaseController;
|
||||
import com.nis.web.service.basics.TaskInfoService;
|
||||
import com.nis.web.service.configuration.RequestInfoService;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("${adminPath}/eventKeyProtection")
|
||||
@@ -45,7 +45,7 @@ public class NtcEventKeyProtectionController extends BaseController {
|
||||
protected static Logger logger = LoggerFactory.getLogger(NtcEventKeyProtectionController.class);
|
||||
|
||||
@Autowired
|
||||
private TaskInfoService taskInfoService;
|
||||
private RequestInfoService requestInfoService;
|
||||
|
||||
/**
|
||||
* EventBlock
|
||||
@@ -94,6 +94,11 @@ public class NtcEventKeyProtectionController extends BaseController {
|
||||
params.put("taskIds", log.getTaskIds());
|
||||
}
|
||||
|
||||
log.setSearchReportStartTime(searchReportStartTime);
|
||||
log.setSearchReportEndTime(searchReportEndTime);
|
||||
log.setSearchTaskStartTime(searchTaskStartTime);
|
||||
log.setSearchTaskEndTime(searchTaskEndTime);
|
||||
|
||||
String url = Constants.LOG_BASE_URL + Constants.NTC_EVENT_KEYPROTECTION_Report;
|
||||
// String url =
|
||||
// "http://192.168.11.56:8888/galaxy-service/service/log/v1/ntcEventKeyProtection";
|
||||
@@ -110,7 +115,7 @@ public class NtcEventKeyProtectionController extends BaseController {
|
||||
page.setList(data.getList());
|
||||
model.addAttribute("page", page);
|
||||
// 获取专项列表
|
||||
List<TaskInfo> taskList = taskInfoService.findTaskInfo(new TaskInfo());
|
||||
List<TaskInfo> taskList = requestInfoService.showTask(new TaskInfo());
|
||||
model.addAttribute("taskList", taskList);
|
||||
}
|
||||
}
|
||||
@@ -195,7 +200,7 @@ public class NtcEventKeyProtectionController extends BaseController {
|
||||
titleList.add("ntc_event_key_protection_report");
|
||||
classMap.put("ntc_event_key_protection_report", NtcEventKeyProtectionReport.class);
|
||||
|
||||
String cfgIndexInfoNoExport = "";
|
||||
String cfgIndexInfoNoExport = "," + hColumns + ",";
|
||||
noExportMap.put("ntc_event_key_protection_report", cfgIndexInfoNoExport);
|
||||
|
||||
Properties msgProp = getMsgProp();
|
||||
@@ -320,4 +325,72 @@ public class NtcEventKeyProtectionController extends BaseController {
|
||||
|
||||
return dateTime.toString(TimeConstants.YYYY_MM_DD_HH24_MM_SS);
|
||||
}
|
||||
|
||||
//eventKeyProtectionPrint
|
||||
@ResponseBody
|
||||
@RequestMapping(value = "eventKeyProtectionPrint")
|
||||
public List<NtcEventKeyProtectionReport> eventKeyProtectionPrint(@ModelAttribute("log") NtcEventKeyProtectionReport log, Model model,
|
||||
HttpServletRequest request, HttpServletResponse response,RedirectAttributes redirectAttributes) {
|
||||
try {
|
||||
PageLog<NtcEventKeyProtectionReport> page = new PageLog<NtcEventKeyProtectionReport>(request, response);
|
||||
Map<String, Object> params = new HashMap<String, Object>();
|
||||
page.setPageNo(1);
|
||||
page.setPageSize(Constants.MAX_LOG_EXPORT_SIZE);
|
||||
params.put("pageSize", page.getPageSize());
|
||||
params.put("pageNo", page.getPageNo());
|
||||
|
||||
// 判断请求参数
|
||||
String searchReportStartTime = null;
|
||||
String searchReportEndTime = null;
|
||||
String searchTaskStartTime = null;
|
||||
String searchTaskEndTime = null;
|
||||
|
||||
/**
|
||||
* 对统计时间参数进行处理 开始-结束(一周内[7天])
|
||||
*/
|
||||
String[] serachReportTimes = getSerachTimes(log.getSearchReportStartTime(), log.getSearchReportEndTime());
|
||||
searchReportStartTime = serachReportTimes[0];
|
||||
searchReportEndTime = serachReportTimes[1];
|
||||
|
||||
/**
|
||||
* 对报送时间参数进行处理 开始-结束(一周内[7天])
|
||||
*/
|
||||
String[] serachTaskTimes = getSerachTimes(log.getSearchTaskStartTime(), log.getSearchTaskEndTime());
|
||||
searchTaskStartTime = serachTaskTimes[0];
|
||||
searchTaskEndTime = serachTaskTimes[1];
|
||||
|
||||
params.put("searchReportStartTime", searchReportStartTime);
|
||||
params.put("searchReportEndTime", searchReportEndTime);
|
||||
params.put("searchTaskStartTime", searchTaskStartTime);
|
||||
params.put("searchTaskEndTime", searchTaskEndTime);
|
||||
|
||||
if (StringUtils.isNotBlank(log.getTaskIds())) {
|
||||
params.put("taskIds", log.getTaskIds());
|
||||
}
|
||||
|
||||
log.setSearchReportStartTime(searchReportStartTime);
|
||||
log.setSearchReportEndTime(searchReportEndTime);
|
||||
log.setSearchTaskStartTime(searchTaskStartTime);
|
||||
log.setSearchTaskEndTime(searchTaskEndTime);
|
||||
|
||||
String url = Constants.LOG_BASE_URL + Constants.NTC_EVENT_KEYPROTECTION_Report;
|
||||
String recv = HttpClientUtil.getMsg(url, params, request);
|
||||
List<NtcEventKeyProtectionReport> list = new ArrayList<>();
|
||||
if (StringUtils.isNotBlank(recv)) {
|
||||
Gson gson = new GsonBuilder().create();
|
||||
LogRecvData<NtcEventKeyProtectionReport> fromJson = gson.fromJson(recv,
|
||||
new TypeToken<LogRecvData<NtcEventKeyProtectionReport>>() {
|
||||
}.getType());
|
||||
if (fromJson.getStatus().intValue() == 200) {
|
||||
Page<NtcEventKeyProtectionReport> data = fromJson.getData();
|
||||
list = data.getList();
|
||||
}
|
||||
}
|
||||
return list;
|
||||
} catch (Exception e) {
|
||||
logger.error("ntc_event_key_protection_report print failed", e);
|
||||
addMessage(redirectAttributes, "error", "print_failed");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,9 +2,7 @@ package com.nis.web.controller.report;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@@ -23,6 +21,7 @@ import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
@@ -32,15 +31,12 @@ import com.nis.domain.Page;
|
||||
import com.nis.domain.PageLog;
|
||||
import com.nis.domain.configuration.TaskInfo;
|
||||
import com.nis.domain.maat.LogRecvData;
|
||||
import com.nis.domain.report.BaseReport;
|
||||
import com.nis.domain.report.NtcEventMonitorOrBlockReport;
|
||||
import com.nis.domain.report.NtcURLReport;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.DateUtils;
|
||||
import com.nis.util.TimeConstants;
|
||||
import com.nis.util.httpclient.HttpClientUtil;
|
||||
import com.nis.web.controller.BaseController;
|
||||
import com.nis.web.service.basics.TaskInfoService;
|
||||
import com.nis.web.service.configuration.RequestInfoService;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("${adminPath}/eventMonitor")
|
||||
@@ -49,7 +45,7 @@ public class NtcEventMonitorController extends BaseController {
|
||||
protected static Logger logger = LoggerFactory.getLogger(NtcEventMonitorController.class);
|
||||
|
||||
@Autowired
|
||||
private TaskInfoService taskInfoService;
|
||||
private RequestInfoService requestInfoService;
|
||||
|
||||
/**
|
||||
* EventMonitor
|
||||
@@ -98,11 +94,16 @@ public class NtcEventMonitorController extends BaseController {
|
||||
params.put("taskIds", log.getTaskIds());
|
||||
}
|
||||
|
||||
log.setSearchReportStartTime(searchReportStartTime);
|
||||
log.setSearchReportEndTime(searchReportEndTime);
|
||||
log.setSearchTaskStartTime(searchTaskStartTime);
|
||||
log.setSearchTaskEndTime(searchTaskEndTime);
|
||||
|
||||
params.put("reportType", 2);
|
||||
|
||||
String url = Constants.LOG_BASE_URL + Constants.NTC_EVENT_MONITOR_OR_BLOCK_Report;
|
||||
// String url =
|
||||
// "http://192.168.11.56:8888/galaxy-service/service/log/v1/ntcEventsMonitorOrBlock";
|
||||
// String url =
|
||||
// "http://192.168.11.56:8888/galaxy-service/service/log/v1/ntcEventsMonitorOrBlock";
|
||||
String recv = HttpClientUtil.getMsg(url, params, request);
|
||||
if (StringUtils.isNotBlank(recv)) {
|
||||
Gson gson = new GsonBuilder().create();
|
||||
@@ -115,8 +116,7 @@ public class NtcEventMonitorController extends BaseController {
|
||||
page.setLast(data.getLast());
|
||||
page.setList(data.getList());
|
||||
model.addAttribute("page", page);
|
||||
// 获取专项列表
|
||||
List<TaskInfo> taskList = taskInfoService.findTaskInfo(new TaskInfo());
|
||||
List<TaskInfo> taskList = requestInfoService.showTask(new TaskInfo());
|
||||
model.addAttribute("taskList", taskList);
|
||||
}
|
||||
}
|
||||
@@ -184,8 +184,8 @@ public class NtcEventMonitorController extends BaseController {
|
||||
params.put("reportType", 2);
|
||||
|
||||
String url = Constants.LOG_BASE_URL + Constants.NTC_EVENT_MONITOR_OR_BLOCK_Report;
|
||||
// String url =
|
||||
// "http://192.168.11.56:8888/galaxy-service/service/log/v1/ntcEventsMonitorOrBlock";
|
||||
// String url =
|
||||
// "http://192.168.11.56:8888/galaxy-service/service/log/v1/ntcEventsMonitorOrBlock";
|
||||
String recv = HttpClientUtil.getMsg(url, params, request);
|
||||
List<NtcEventMonitorOrBlockReport> list = new ArrayList<>();
|
||||
if (StringUtils.isNotBlank(recv)) {
|
||||
@@ -202,7 +202,7 @@ public class NtcEventMonitorController extends BaseController {
|
||||
titleList.add("ntc_event_monitor_report");
|
||||
classMap.put("ntc_event_monitor_report", NtcEventMonitorOrBlockReport.class);
|
||||
|
||||
String cfgIndexInfoNoExport = "";
|
||||
String cfgIndexInfoNoExport = "," + hColumns + ",";
|
||||
noExportMap.put("ntc_event_monitor_report", cfgIndexInfoNoExport);
|
||||
|
||||
Properties msgProp = getMsgProp();
|
||||
@@ -330,4 +330,74 @@ public class NtcEventMonitorController extends BaseController {
|
||||
|
||||
return dateTime.toString(TimeConstants.YYYY_MM_DD_HH24_MM_SS);
|
||||
}
|
||||
|
||||
// eventMonitorPrint
|
||||
@ResponseBody
|
||||
@RequestMapping(value = "eventMonitorPrint")
|
||||
public List<NtcEventMonitorOrBlockReport> eventMonitorPrint(@ModelAttribute("log") NtcEventMonitorOrBlockReport log, Model model,
|
||||
HttpServletRequest request, HttpServletResponse response,RedirectAttributes redirectAttributes) {
|
||||
try {
|
||||
PageLog<NtcEventMonitorOrBlockReport> page = new PageLog<NtcEventMonitorOrBlockReport>(request, response);
|
||||
Map<String, Object> params = new HashMap<String, Object>();
|
||||
page.setPageNo(1);
|
||||
page.setPageSize(Constants.MAX_LOG_EXPORT_SIZE);
|
||||
params.put("pageSize", page.getPageSize());
|
||||
params.put("pageNo", page.getPageNo());
|
||||
|
||||
// 判断请求参数
|
||||
String searchReportStartTime = null;
|
||||
String searchReportEndTime = null;
|
||||
String searchTaskStartTime = null;
|
||||
String searchTaskEndTime = null;
|
||||
|
||||
/**
|
||||
* 对统计时间参数进行处理 开始-结束(一周内[7天])
|
||||
*/
|
||||
String[] serachReportTimes = getSerachTimes(log.getSearchReportStartTime(), log.getSearchReportEndTime());
|
||||
searchReportStartTime = serachReportTimes[0];
|
||||
searchReportEndTime = serachReportTimes[1];
|
||||
|
||||
/**
|
||||
* 对报送时间参数进行处理 开始-结束(一周内[7天])
|
||||
*/
|
||||
String[] serachTaskTimes = getSerachTimes(log.getSearchTaskStartTime(), log.getSearchTaskEndTime());
|
||||
searchTaskStartTime = serachTaskTimes[0];
|
||||
searchTaskEndTime = serachTaskTimes[1];
|
||||
|
||||
params.put("searchReportStartTime", searchReportStartTime);
|
||||
params.put("searchReportEndTime", searchReportEndTime);
|
||||
params.put("searchTaskStartTime", searchTaskStartTime);
|
||||
params.put("searchTaskEndTime", searchTaskEndTime);
|
||||
|
||||
if (StringUtils.isNotBlank(log.getTaskIds())) {
|
||||
params.put("taskIds", log.getTaskIds());
|
||||
}
|
||||
|
||||
log.setSearchReportStartTime(searchReportStartTime);
|
||||
log.setSearchReportEndTime(searchReportEndTime);
|
||||
log.setSearchTaskStartTime(searchTaskStartTime);
|
||||
log.setSearchTaskEndTime(searchTaskEndTime);
|
||||
|
||||
params.put("reportType", 2);
|
||||
|
||||
String url = Constants.LOG_BASE_URL + Constants.NTC_EVENT_MONITOR_OR_BLOCK_Report;
|
||||
String recv = HttpClientUtil.getMsg(url, params, request);
|
||||
List<NtcEventMonitorOrBlockReport> list = new ArrayList<>();
|
||||
if (StringUtils.isNotBlank(recv)) {
|
||||
Gson gson = new GsonBuilder().create();
|
||||
LogRecvData<NtcEventMonitorOrBlockReport> fromJson = gson.fromJson(recv,
|
||||
new TypeToken<LogRecvData<NtcEventMonitorOrBlockReport>>() {
|
||||
}.getType());
|
||||
if (fromJson.getStatus().intValue() == 200) {
|
||||
Page<NtcEventMonitorOrBlockReport> data = fromJson.getData();
|
||||
list = data.getList();
|
||||
}
|
||||
}
|
||||
return list;
|
||||
} catch (Exception e) {
|
||||
logger.error("ntc_event_monitor_report print failed", e);
|
||||
addMessage(redirectAttributes, "error", "print_failed");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
@@ -567,4 +568,158 @@ public class ReportController extends BaseController {
|
||||
addMessage(redirectAttributes, "error", "export_failed");
|
||||
}
|
||||
}
|
||||
// asnPrint
|
||||
@ResponseBody
|
||||
@RequestMapping(value = "asnPrint")
|
||||
public List<NtcAsnRecord> asnPrint(@ModelAttribute("log") NtcAsnRecord log, Model model,
|
||||
HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) {
|
||||
try {
|
||||
PageLog<NtcAsnRecord> page = new PageLog<NtcAsnRecord>(request, response);
|
||||
page.setPageNo(1);
|
||||
page.setPageSize(Constants.MAX_LOG_EXPORT_SIZE);
|
||||
Map<String, Object> params = new HashMap<String, Object>();
|
||||
params.put("pageSize", page.getPageSize());
|
||||
params.put("pageNo", page.getPageNo());
|
||||
// 判断请求参数
|
||||
if (StringUtils.isNotEmpty(log.getSearchAsnType())) {
|
||||
params.put("searchAsnType", log.getSearchAsnType());
|
||||
} else {
|
||||
params.put("searchAsnType", 1);
|
||||
}
|
||||
if (StringUtils.isNotBlank(log.getSearchFoundStartTime())
|
||||
&& StringUtils.isNotBlank(log.getSearchFoundEndTime())) {
|
||||
params.put("searchFoundStartTime", log.getSearchFoundStartTime());
|
||||
params.put("searchFoundEndTime", log.getSearchFoundEndTime());
|
||||
} else {
|
||||
Calendar time = Calendar.getInstance();
|
||||
String searchEndTime = DateUtils.formatDateTime(time.getTime());
|
||||
time.add(Calendar.HOUR_OF_DAY, -1);
|
||||
String searchStartTime = DateUtils.formatDateTime(time.getTime());
|
||||
|
||||
params.put("searchFoundStartTime", searchStartTime);
|
||||
params.put("searchFoundEndTime", searchEndTime);
|
||||
log.setSearchFoundStartTime(searchStartTime);
|
||||
log.setSearchFoundEndTime(searchEndTime);
|
||||
}
|
||||
String url = Constants.LOG_BASE_URL + Constants.NTC_ASN_RECORD;
|
||||
String recv = HttpClientUtil.getMsg(url, params, request);
|
||||
List<NtcAsnRecord> list = new ArrayList<NtcAsnRecord>();
|
||||
if (StringUtils.isNotBlank(recv)) {
|
||||
Gson gson = new GsonBuilder().create();
|
||||
LogRecvData<NtcAsnRecord> fromJson = gson.fromJson(recv, new TypeToken<LogRecvData<NtcAsnRecord>>() {
|
||||
}.getType());
|
||||
if (fromJson.getStatus().intValue() == 200) {
|
||||
Page<NtcAsnRecord> data = fromJson.getData();
|
||||
list = data.getList();
|
||||
}
|
||||
}
|
||||
return list;
|
||||
} catch (Exception e) {
|
||||
logger.error("Ntc_Asn_Record print failed", e);
|
||||
addMessage(redirectAttributes, "error", "print_failed");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
// httpsPrint
|
||||
@ResponseBody
|
||||
@RequestMapping(value = "httpsPrint")
|
||||
public List<NtcURLReport> httpsPrint(@ModelAttribute("log") NtcURLReport log, Model model,
|
||||
HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) {
|
||||
try {
|
||||
PageLog<NtcURLReport> page = new PageLog<NtcURLReport>(request, response);
|
||||
page.setPageNo(1);
|
||||
page.setPageSize(Constants.MAX_LOG_EXPORT_SIZE);
|
||||
Map<String, Object> params = new HashMap<String, Object>();
|
||||
params.put("pageSize", page.getPageSize());
|
||||
params.put("pageNo", page.getPageNo());
|
||||
// 判断请求参数
|
||||
if (StringUtils.isNotBlank(log.getSearchReportStartTime())
|
||||
&& StringUtils.isNotBlank(log.getSearchReportEndTime())) {
|
||||
params.put("searchReportStartTime", log.getSearchReportStartTime());
|
||||
params.put("searchReportEndTime", log.getSearchReportEndTime());
|
||||
} else {
|
||||
Calendar time = Calendar.getInstance();
|
||||
String searchEndTime = DateUtils.formatDateTime(time.getTime());
|
||||
time.add(Calendar.HOUR_OF_DAY, -1);
|
||||
String searchStartTime = DateUtils.formatDateTime(time.getTime());
|
||||
|
||||
params.put("searchReportStartTime", searchStartTime);
|
||||
params.put("searchReportEndTime", searchEndTime);
|
||||
log.setSearchReportStartTime(searchStartTime);
|
||||
log.setSearchReportEndTime(searchEndTime);
|
||||
}
|
||||
// url参数
|
||||
if (StringUtils.isNotBlank(log.getSearchUrl())) {
|
||||
params.put("searchUrl", log.getSearchUrl());
|
||||
}
|
||||
String url = Constants.LOG_BASE_URL + Constants.NTC_URL_REPORT;
|
||||
String recv = HttpClientUtil.getMsg(url, params, request);
|
||||
List<NtcURLReport> list = new ArrayList<NtcURLReport>();
|
||||
if (StringUtils.isNotBlank(recv)) {
|
||||
Gson gson = new GsonBuilder().create();
|
||||
LogRecvData<NtcURLReport> fromJson = gson.fromJson(recv, new TypeToken<LogRecvData<NtcURLReport>>() {
|
||||
}.getType());
|
||||
if (fromJson.getStatus().intValue() == 200) {
|
||||
Page<NtcURLReport> data = fromJson.getData();
|
||||
list = data.getList();
|
||||
}
|
||||
}
|
||||
return list;
|
||||
} catch (Exception e) {
|
||||
logger.error("Ntc_HTTPS_Report print failed", e);
|
||||
addMessage(redirectAttributes, "error", "print_failed");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
// ipRangePrint
|
||||
@ResponseBody
|
||||
@RequestMapping(value = "ipRangePrint")
|
||||
public List<NtcIpRangeReport> ipRangePrint(@ModelAttribute("log") NtcIpRangeReport log, Model model,
|
||||
HttpServletRequest request, HttpServletResponse response, String seType,RedirectAttributes redirectAttributes) {
|
||||
try {
|
||||
PageLog<NtcIpRangeReport> page = new PageLog<NtcIpRangeReport>(request, response);
|
||||
page.setPageNo(1);
|
||||
page.setPageSize(Constants.MAX_LOG_EXPORT_SIZE);
|
||||
Map<String, Object> params = new HashMap<String, Object>();
|
||||
params.put("pageSize", page.getPageSize());
|
||||
params.put("pageNo", page.getPageNo());
|
||||
log.setSearchAreaType(seType);
|
||||
// 判断请求参数
|
||||
// 查询国家
|
||||
if (StringUtils.isNotBlank(log.getSearchCountry())) {
|
||||
params.put("searchCountry", log.getSearchCountry());
|
||||
}
|
||||
// 查询开始IP
|
||||
if (StringUtils.isNotBlank(log.getSearchStartIp())) {
|
||||
params.put("searchIp", log.getSearchIp());
|
||||
}
|
||||
//
|
||||
if (StringUtils.isNotBlank(log.getSearchAreaType())) {
|
||||
params.put("searchType", log.getSearchAreaType());
|
||||
}
|
||||
if (StringUtils.isNotBlank(log.getSearchAreaType())) {
|
||||
params.put("searchDesc", log.getSearchDesc());
|
||||
}
|
||||
|
||||
String url = Constants.LOG_BASE_URL + Constants.NTC_IP_RANGE_REPORT;
|
||||
String recv = HttpClientUtil.getMsg(url, params, request);
|
||||
List<NtcIpRangeReport> list = new ArrayList<NtcIpRangeReport>();
|
||||
if (StringUtils.isNotBlank(recv)) {
|
||||
Gson gson = new GsonBuilder().create();
|
||||
LogRecvData<NtcIpRangeReport> fromJson = gson.fromJson(recv,
|
||||
new TypeToken<LogRecvData<NtcIpRangeReport>>() {
|
||||
}.getType());
|
||||
if (fromJson.getStatus().intValue() == 200) {
|
||||
Page<NtcIpRangeReport> data = fromJson.getData();
|
||||
list = data.getList();
|
||||
}
|
||||
}
|
||||
return list;
|
||||
} catch (Exception e) {
|
||||
logger.error("Ntc_Ip_Range_Report print failed", e);
|
||||
addMessage(redirectAttributes, "error", "print_failed");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,5 +25,7 @@ public interface SysMenuDao extends CrudDao<SysMenu>{
|
||||
Integer getServiceId(@Param("functionId")Integer functionId, @Param("action")Integer action);
|
||||
|
||||
List<SysMenu> findAllCfgList(@Param("policiesMenuId")String policiesMenuId);
|
||||
|
||||
String getMenuCodeByFunctionId(@Param("functionId")Integer functionId, @Param("parentId")String id);
|
||||
|
||||
}
|
||||
@@ -218,4 +218,13 @@
|
||||
WHERE
|
||||
s.function_id = #{functionId} AND s.action = #{action} AND s.is_valid = 1
|
||||
</select>
|
||||
|
||||
<select id="getMenuCodeByFunctionId" resultType="java.lang.String">
|
||||
SELECT
|
||||
m.code
|
||||
FROM
|
||||
sys_menu m
|
||||
WHERE
|
||||
m.function_id = #{functionId} AND m.parent_ids LIKE concat(concat('%',#{parentId,jdbcType=VARCHAR}),'%') AND del_flag = 1
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -138,7 +138,7 @@
|
||||
<select id="findList" resultMap="PxyObjSpoofingPoolMap" parameterType="com.nis.domain.configuration.PxyObjSpoofingIpPool">
|
||||
SELECT
|
||||
<include refid="PxyObjSpoofingIpPoolColumns"/>
|
||||
FROM pxy_obj_spoofing_ip_pool r where (r.is_valid!=-1 and r.is_audit!=3) AND r.group_id =#{groupId,jdbcType=INTEGER}
|
||||
FROM pxy_obj_spoofing_ip_pool r where r.is_valid=1 and r.is_audit=1
|
||||
<if test="cfgId != null">
|
||||
AND r.CFG_ID!=#{cfgId,jdbcType=BIGINT}
|
||||
</if>
|
||||
@@ -146,7 +146,9 @@
|
||||
|
||||
<insert id="insert" parameterType="com.nis.domain.configuration.PxyObjSpoofingIpPool" >
|
||||
insert into pxy_obj_spoofing_ip_pool (
|
||||
CFG_ID,
|
||||
<selectKey resultType="java.lang.Long" order="AFTER" keyProperty="cfgId">
|
||||
SELECT LAST_INSERT_ID()
|
||||
</selectKey>
|
||||
CFG_DESC,
|
||||
ACTION,
|
||||
IS_VALID,
|
||||
@@ -176,7 +178,6 @@
|
||||
user_region,
|
||||
port
|
||||
)values (
|
||||
#{cfgId,jdbcType=VARCHAR},
|
||||
#{cfgDesc,jdbcType=VARCHAR},
|
||||
#{action,jdbcType=INTEGER},
|
||||
0,
|
||||
|
||||
@@ -99,7 +99,7 @@
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from request_info
|
||||
where request_number = #{requestNumber,jdbcType=VARCHAR}
|
||||
where request_number = #{requestNumber,jdbcType=VARCHAR} and is_valid !=-1
|
||||
</select>
|
||||
<!-- 根据来id查询 -->
|
||||
<select id="getRequestInfoById" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
||||
|
||||
@@ -96,7 +96,7 @@
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from task_info
|
||||
where task_name = #{taskName,jdbcType=VARCHAR}
|
||||
where task_name = #{taskName,jdbcType=VARCHAR} and is_valid !=-1
|
||||
</select>
|
||||
<!-- 根据来id查询 -->
|
||||
<select id="getTaskInfoById" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
||||
|
||||
@@ -2123,6 +2123,22 @@ public abstract class BaseService {
|
||||
umap.put("bps_threadshold", _cfg.getBpsThreadshold());
|
||||
umap.put("pps_threadshold", _cfg.getPpsThreadshold());
|
||||
maatCfg.setUserRegion(new Gson().toJson(umap));
|
||||
}else if(regionDict.getFunctionId()==200) {// IP Intercept
|
||||
maatCfg.setUserRegion(Constants.USER_REGION_PLACEHOLDER);
|
||||
if(_cfg.getAction().equals(Constants.MONIT_ACTION)) {
|
||||
maatCfg.setUserRegion(Constants.INTERCEPT_IP_MONIT_USER_REGION_KEY+"="+Constants.USER_REGION_PLACEHOLDER);
|
||||
}
|
||||
}else if(regionDict.getFunctionId()==207 || regionDict.getFunctionId()==208 || regionDict.getFunctionId()==209) {// HTTP(s)阻断、重定向、替换
|
||||
String userRegion = Constants.USER_REGION_PLACEHOLDER;
|
||||
if(_cfg.getAction().equals(Constants.REJECT_ACTION)) {// 阻断
|
||||
userRegion = Constants.REDIRECT_RESPONSE_CODE_KEY+"="+_cfg.getUserRegion1()+";"+Constants.REDIRECT_CONTENT_KEY+"="+_cfg.getUserRegion2();
|
||||
}else if(_cfg.getAction().equals(48)) {// 重定向
|
||||
userRegion = Constants.REDIRECT_RESPONSE_CODE_KEY+"="+_cfg.getUserRegion1()+";"+Constants.REDIRECT_URL_KEY+"="+_cfg.getUserRegion2();;
|
||||
}else if(_cfg.getAction().equals(Constants.REPLACE_ACTION)) {// 替换
|
||||
String substitute = "/"+_cfg.getUserRegion2()+"/"+_cfg.getUserRegion3();
|
||||
userRegion = Constants.REPLACE_ZONE_KEY+"="+_cfg.getUserRegion1()+";"+Constants.REPLACE_SUBSTITUTE_KEY+"="+substitute;
|
||||
}
|
||||
maatCfg.setUserRegion(userRegion);
|
||||
}
|
||||
|
||||
configCompileList.add(maatCfg);
|
||||
@@ -2214,6 +2230,25 @@ public abstract class BaseService {
|
||||
}
|
||||
}else if(regionDict.getDictId()==159) {
|
||||
maatCfg.setUserRegion(Constants.P2P_HASH_TYPE_USER_REGION_KEY+"="+_cfg.getUserRegion1());
|
||||
}else if(regionDict.getFunctionId()==201) {// Domain Intercept
|
||||
String userRegion = Constants.USERREGION_DOMAIN_ID+"="+_cfg.getCompileId()+";"+Constants.USERREGION_DOMAIN_STR+"="+_cfg.getCfgKeywords();
|
||||
if(_cfg.getAction().equals(Constants.MONIT_ACTION)) {// 监测 需要发keyring_id、拦截强度
|
||||
userRegion = Constants.INTERCEPT_IP_MONIT_USER_REGION_KEY+"=0"+";"+Constants.INTERCEPT_DOMAN_INTENSITY_USER_REGION_KEY+"="+_cfg.getUserRegion5()+";" + userRegion;
|
||||
}else if(_cfg.getAction().equals(Constants.RATELIMIT_ACTION)) {// 限速 需要发Droprate
|
||||
userRegion = Constants.INTERCEPT_IP_RATELIMIT_DROPRATE_USER_REGION_KEY+"="+_cfg.getUserRegion2()+";" + userRegion;
|
||||
}
|
||||
maatCfg.setUserRegion(userRegion);
|
||||
}else if(regionDict.getFunctionId()==207 || regionDict.getFunctionId()==208 || regionDict.getFunctionId()==209) {// HTTP(s)阻断、重定向、替换
|
||||
String userRegion = Constants.USER_REGION_PLACEHOLDER;
|
||||
if(_cfg.getAction().equals(Constants.REJECT_ACTION)) {// 阻断
|
||||
userRegion = Constants.REDIRECT_RESPONSE_CODE_KEY+"="+_cfg.getUserRegion1()+";"+Constants.REDIRECT_CONTENT_KEY+"="+_cfg.getUserRegion2();
|
||||
}else if(_cfg.getAction().equals(48)) {// 重定向
|
||||
userRegion = Constants.REDIRECT_RESPONSE_CODE_KEY+"="+_cfg.getUserRegion1()+";"+Constants.REDIRECT_URL_KEY+"="+_cfg.getUserRegion2();;
|
||||
}else if(_cfg.getAction().equals(Constants.REPLACE_ACTION)) {// 替换
|
||||
String substitute = "/"+_cfg.getUserRegion2()+"/"+_cfg.getUserRegion3();
|
||||
userRegion = Constants.REPLACE_ZONE_KEY+"="+_cfg.getUserRegion1()+";"+Constants.REPLACE_SUBSTITUTE_KEY+"="+substitute;
|
||||
}
|
||||
maatCfg.setUserRegion(userRegion);
|
||||
}
|
||||
configCompileList.add(maatCfg);
|
||||
}
|
||||
@@ -2294,6 +2329,17 @@ public abstract class BaseService {
|
||||
if(StringUtil.isEmpty(dictValue) || dictValue.equals("默认")){
|
||||
maatCfg.setUserRegion(Constants.HTTP_HEADER_USER_REGION_KEY+"="+cfg.getDistrict());
|
||||
}
|
||||
}else if(regionDict.getFunctionId()==207 || regionDict.getFunctionId()==208 || regionDict.getFunctionId()==209) {// HTTP(s)阻断、重定向、替换
|
||||
String userRegion = Constants.USER_REGION_PLACEHOLDER;
|
||||
if(cfg.getAction().equals(Constants.REJECT_ACTION)) {// 阻断
|
||||
userRegion = Constants.REDIRECT_RESPONSE_CODE_KEY+"="+cfg.getUserRegion1()+";"+Constants.REDIRECT_CONTENT_KEY+"="+cfg.getUserRegion2();
|
||||
}else if(cfg.getAction().equals(48)) {// 重定向
|
||||
userRegion = Constants.REDIRECT_RESPONSE_CODE_KEY+"="+cfg.getUserRegion1()+";"+Constants.REDIRECT_URL_KEY+"="+cfg.getUserRegion2();;
|
||||
}else if(cfg.getAction().equals(Constants.REPLACE_ACTION)) {// 替换
|
||||
String substitute = "/"+cfg.getUserRegion2()+"/"+cfg.getUserRegion3();
|
||||
userRegion = Constants.REPLACE_ZONE_KEY+"="+cfg.getUserRegion1()+";"+Constants.REPLACE_SUBSTITUTE_KEY+"="+substitute;
|
||||
}
|
||||
maatCfg.setUserRegion(userRegion);
|
||||
}
|
||||
configCompileList.add(maatCfg);
|
||||
}
|
||||
|
||||
@@ -15,27 +15,24 @@ public class LogService extends CrudService<SysLogDao, SysLog> {
|
||||
@Autowired
|
||||
protected SysLogDao sysLogDao;
|
||||
public Page<SysLog> findPage(Page<SysLog> page, SysLog sysLog) {
|
||||
|
||||
// 设置默认时间范围,默认当前月
|
||||
if (sysLog.getBeginDate() == null){
|
||||
sysLog.setBeginDate(DateUtils.setDays(DateUtils.parseDate(DateUtils.getDate()), 1));
|
||||
}
|
||||
if (sysLog.getEndDate() == null){
|
||||
sysLog.setEndDate(DateUtils.addMonths(sysLog.getBeginDate(), 1));
|
||||
sysLog.setEndDate(DateUtils.parseDate(DateUtils.getDate()));
|
||||
}
|
||||
if (sysLog.getBeginDate() == null){
|
||||
sysLog.setBeginDate(DateUtils.addMonths(sysLog.getEndDate(), -1));
|
||||
}
|
||||
|
||||
return super.findPage(page, sysLog);
|
||||
|
||||
}
|
||||
|
||||
public Page<SysLog> findCfgOperationLogPage(Page<SysLog> page, SysLog sysLog) {
|
||||
|
||||
// 设置默认时间范围,默认当前月
|
||||
if (sysLog.getBeginDate() == null){
|
||||
sysLog.setBeginDate(DateUtils.setDays(DateUtils.parseDate(DateUtils.getDate()), 1));
|
||||
}
|
||||
if (sysLog.getEndDate() == null){
|
||||
sysLog.setEndDate(DateUtils.addMonths(sysLog.getBeginDate(), 1));
|
||||
sysLog.setEndDate(DateUtils.parseDate(DateUtils.getDate()));
|
||||
}
|
||||
if (sysLog.getBeginDate() == null){
|
||||
sysLog.setBeginDate(DateUtils.addMonths(sysLog.getEndDate(), -1));
|
||||
}
|
||||
sysLog.setPage(page);
|
||||
List<SysLog> list = sysLogDao.findCfgOperationLogList(sysLog);
|
||||
|
||||
@@ -107,5 +107,9 @@ public class MenuService extends BaseService {
|
||||
public Integer getServiceId(Integer functionId, Integer action) {
|
||||
return menuDao.getServiceId(functionId,action);
|
||||
}
|
||||
|
||||
|
||||
// 获取菜单code
|
||||
public String getMenuCodeByFunctionId(Integer functionId) {
|
||||
return menuDao.getMenuCodeByFunctionId(functionId,",86,");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1025,7 +1025,7 @@ public class AppCfgService extends BaseService {
|
||||
if(StringUtil.isEmpty(entity.getUserRegion4())){
|
||||
userRegion+=Constants.USER_REGION_SPLIT +Constants.APP_VIGNORE_USER_REGION_KEY+"=1";
|
||||
}
|
||||
|
||||
userRegion+=Constants.USER_REGION_SPLIT+"config_id="+entity.getCompileId();
|
||||
maatCfg.setUserRegion(userRegion);
|
||||
configCompileList.add(maatCfg);
|
||||
maatBean.setConfigCompileList(configCompileList);
|
||||
|
||||
@@ -18,6 +18,7 @@ import com.nis.domain.configuration.CfgIndexInfo;
|
||||
import com.nis.domain.configuration.HttpUrlCfg;
|
||||
import com.nis.domain.configuration.InterceptPktBin;
|
||||
import com.nis.domain.configuration.IpPortCfg;
|
||||
import com.nis.domain.configuration.PxyObjSpoofingIpPool;
|
||||
import com.nis.domain.maat.MaatCfg;
|
||||
import com.nis.domain.maat.MaatCfg.NumBoundaryCfg;
|
||||
import com.nis.domain.maat.ToMaatBean;
|
||||
@@ -33,6 +34,7 @@ import com.nis.util.Constants;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.web.dao.configuration.AreaIpCfgDao;
|
||||
import com.nis.web.dao.configuration.InterceptCfgDao;
|
||||
import com.nis.web.dao.configuration.PxyObjSpoofingIpPoolDao;
|
||||
import com.nis.web.dao.configuration.WebsiteCfgDao;
|
||||
import com.nis.web.security.UserUtils;
|
||||
import com.nis.web.service.BaseService;
|
||||
@@ -51,6 +53,8 @@ public class InterceptCfgService extends CrudService<WebsiteCfgDao,CfgIndexInfo>
|
||||
protected InterceptCfgDao interceptCfgDao;
|
||||
@Autowired
|
||||
protected AreaIpCfgDao areaIpCfgDao;
|
||||
@Autowired
|
||||
protected PxyObjSpoofingIpPoolDao pxyObjSpoofingIpPoolDao;
|
||||
|
||||
public CfgIndexInfo getInterceptCfg(Long cfgId,Integer compileId){
|
||||
CfgIndexInfo entity = websiteCfgDao.getCfgIndexInfo(cfgId,compileId);
|
||||
@@ -107,20 +111,57 @@ public class InterceptCfgService extends CrudService<WebsiteCfgDao,CfgIndexInfo>
|
||||
setAreaEffectiveIds(entity);
|
||||
if(entity.getCfgId()==null){
|
||||
Integer compileId = 0;
|
||||
Integer spoofingPoolId = 0 ;
|
||||
try {
|
||||
List<Integer> idList = ConfigServiceUtil.getId(1, 1);
|
||||
if(idList!=null && idList.size()>0){
|
||||
List<Integer> idList = new ArrayList();
|
||||
if(entity.getServiceId().equals(518)){//ip仿冒策略
|
||||
idList= ConfigServiceUtil.getId(1, 2);
|
||||
compileId = idList.get(0);
|
||||
}
|
||||
spoofingPoolId = idList.get(1);
|
||||
}else{
|
||||
idList= ConfigServiceUtil.getId(1, 1);
|
||||
compileId = idList.get(0);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.info("获取编译ID出错");
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+e.getMessage());
|
||||
}
|
||||
if(entity.getServiceId().equals(518)){//ip仿冒策略
|
||||
//保存IP仿冒池
|
||||
PxyObjSpoofingIpPool spoofingPool = new PxyObjSpoofingIpPool();
|
||||
spoofingPool.setIpType(4);//ipv4
|
||||
spoofingPool.setIpAddress(entity.getUserRegion2());//仿冒IP
|
||||
spoofingPool.setProtocol(0);
|
||||
if("dnat".equals(entity.getUserRegion1().toLowerCase())){//spoofing server ip->dnat
|
||||
spoofingPool.setDirection(1);
|
||||
}else{
|
||||
spoofingPool.setDirection(2);//spoofing client ip->snat
|
||||
}
|
||||
|
||||
spoofingPool.setPort("0");
|
||||
spoofingPool.setUserRegion("0");
|
||||
spoofingPool.setLocation(0);
|
||||
spoofingPool.setServiceId(642);
|
||||
spoofingPool.setAreaEffectiveIds("0");
|
||||
spoofingPool.setIsAreaEffective(0);
|
||||
spoofingPool.setCreateTime(new Date());
|
||||
spoofingPool.setCreatorId(UserUtils.getUser().getId());
|
||||
spoofingPool.setCompileId(spoofingPoolId);
|
||||
spoofingPool.setAction(1);
|
||||
spoofingPool.setFunctionId(666);
|
||||
spoofingPool.setRequestId(0);
|
||||
pxyObjSpoofingIpPoolDao.insert(spoofingPool);//保存仿冒IP池配置
|
||||
|
||||
entity.setUserRegion3(String.valueOf(spoofingPool.getCfgId()));//将仿冒IP池配置ID作为策略组ID
|
||||
|
||||
}
|
||||
|
||||
entity.setCompileId(compileId);
|
||||
entity.setCreateTime(new Date());
|
||||
entity.setCreatorId(entity.getCurrentUser().getId());
|
||||
websiteCfgDao.saveCfgIndex(entity);
|
||||
|
||||
if(entity.getIpPortList()!=null){
|
||||
for(IpPortCfg cfg:entity.getIpPortList()){
|
||||
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
|
||||
@@ -155,6 +196,30 @@ public class InterceptCfgService extends CrudService<WebsiteCfgDao,CfgIndexInfo>
|
||||
|
||||
|
||||
}else{
|
||||
if(entity.getServiceId().equals(518)){//ip仿冒策略
|
||||
//保存IP仿冒池
|
||||
Long cfgId = Long.parseLong(entity.getUserRegion3());
|
||||
PxyObjSpoofingIpPool spoofingPool = pxyObjSpoofingIpPoolDao.getPxyObjSpoofingIpPool(cfgId);
|
||||
spoofingPool.setIpType(4);//ipv4
|
||||
spoofingPool.setIpAddress(entity.getUserRegion2());//仿冒IP
|
||||
spoofingPool.setProtocol(0);
|
||||
if("dnat".equals(entity.getUserRegion1())){//spoofing server ip->dnat
|
||||
spoofingPool.setDirection(1);
|
||||
}else{
|
||||
spoofingPool.setDirection(2);//spoofing client ip->snat
|
||||
}
|
||||
|
||||
spoofingPool.setPort("0");
|
||||
spoofingPool.setUserRegion("0");
|
||||
spoofingPool.setLocation(0);
|
||||
spoofingPool.setServiceId(642);
|
||||
spoofingPool.setAreaEffectiveIds("0");
|
||||
spoofingPool.setIsAreaEffective(0);
|
||||
spoofingPool.setEditTime(new Date());
|
||||
spoofingPool.setEditorId(UserUtils.getUser().getId());
|
||||
pxyObjSpoofingIpPoolDao.update(spoofingPool);//保存仿冒IP池配置
|
||||
|
||||
}
|
||||
entity.setEditTime(new Date());
|
||||
entity.setEditorId(entity.getCurrentUser().getId());
|
||||
|
||||
@@ -220,6 +285,20 @@ public class InterceptCfgService extends CrudService<WebsiteCfgDao,CfgIndexInfo>
|
||||
websiteCfgDao.updateCfgValid(entity);
|
||||
//查询子配置
|
||||
entity = this.getInterceptCfg(Long.parseLong(id),entity.getCompileId());
|
||||
|
||||
//IP仿冒策略下的仿冒IP池也失效
|
||||
if(entity.getServiceId().equals(518)){
|
||||
PxyObjSpoofingIpPool pool = new PxyObjSpoofingIpPool();
|
||||
if(StringUtils.isNotEmpty(entity.getUserRegion3())){
|
||||
pool.setCfgId(Long.parseLong(entity.getUserRegion3()));
|
||||
pool.setIsValid(isValid);
|
||||
pool.setIsAudit(entity.getIsAudit());
|
||||
pool.setEditTime(new Date());
|
||||
pool.setEditorId(UserUtils.getUser().getId());
|
||||
pxyObjSpoofingIpPoolDao.update(pool);
|
||||
}
|
||||
}
|
||||
|
||||
if(entity.getIpPortList()!=null && entity.getIpPortList().size()>0){
|
||||
IpPortCfg cfg = new IpPortCfg();
|
||||
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
|
||||
@@ -274,6 +353,56 @@ public class InterceptCfgService extends CrudService<WebsiteCfgDao,CfgIndexInfo>
|
||||
|
||||
//查询子配置并修改审核状态
|
||||
entity = this.getInterceptCfg(entity.getCfgId(),entity.getCompileId());
|
||||
if(entity.getServiceId().equals(518)){//IP仿冒策略
|
||||
//仿冒IP池配置匹配下发或者取消
|
||||
PxyObjSpoofingIpPool pool=new PxyObjSpoofingIpPool();
|
||||
pool.setCfgId(Long.valueOf(entity.getUserRegion3()));
|
||||
pool.setIsValid(entity.getIsValid());
|
||||
pool.setIsAudit(isAudit);
|
||||
pool.setAuditorId(UserUtils.getUser().getId());
|
||||
pool.setAuditTime(new Date());
|
||||
pxyObjSpoofingIpPoolDao.update(pool);
|
||||
pool = pxyObjSpoofingIpPoolDao.getPxyObjSpoofingIpPool(pool.getCfgId());
|
||||
List<PxyObjSpoofingIpPool> list = new ArrayList<PxyObjSpoofingIpPool>();
|
||||
String json="";
|
||||
String areaEffectiveIds="0";
|
||||
if(entity.getIsAudit()==1){
|
||||
pool.setAreaEffectiveIds(areaEffectiveIds);
|
||||
pool.setGroupId(pool.getCfgId().intValue());//界面端的配置ID作为策略分组ID
|
||||
list.add(pool);
|
||||
//调用服务接口下发配置数据
|
||||
json=gsonToJson(list);
|
||||
logger.info("欺骗IP池配置下发配置参数:"+json);
|
||||
//调用服务接口下发配置
|
||||
try {
|
||||
ToMaatResult result = ConfigServiceUtil.postCallbackCfg(json);
|
||||
if(result!=null){
|
||||
logger.info("欺骗IP池配置下发响应信息:"+result.getMsg());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("欺骗IP池配置配置下发失败",e);
|
||||
throw e;
|
||||
}
|
||||
}else if(entity.getIsAudit()==3){
|
||||
PxyObjSpoofingIpPool cfg = new PxyObjSpoofingIpPool();
|
||||
cfg.setIsValid(0);
|
||||
cfg.setCompileId(pool.getCompileId());
|
||||
cfg.setServiceId(pool.getServiceId());
|
||||
list.add(cfg);
|
||||
//调用服务接口取消配置
|
||||
json=gsonToJson(list);
|
||||
logger.info("欺骗IP池配置配置参数:"+json);
|
||||
//调用服务接口取消配置
|
||||
try {
|
||||
ToMaatResult result = ConfigServiceUtil.put(json, 2);
|
||||
logger.info("欺骗IP池配置响应信息:"+result.getMsg());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.info("欺骗IP池配置配置失败");
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(entity.getIpPortList()!=null && entity.getIpPortList().size()>0){
|
||||
IpPortCfg cfg = new IpPortCfg();
|
||||
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
|
||||
@@ -357,7 +486,7 @@ public class InterceptCfgService extends CrudService<WebsiteCfgDao,CfgIndexInfo>
|
||||
entity.setUserRegion1(StringUtil.isEmpty(entity.getUserRegion1()) ? "0":entity.getUserRegion1());
|
||||
maatCfg.setUserRegion(Constants.INTERCEPT_IP_MONIT_USER_REGION_KEY+"="+entity.getUserRegion1());
|
||||
//监测的域名需下发拦截强度
|
||||
if(entity.getFunctionId().equals(201)){
|
||||
if(entity.getFunctionId().equals(200)){
|
||||
entity.setUserRegion5(StringUtil.isEmpty(entity.getUserRegion5()) ? "1":entity.getUserRegion5());
|
||||
if(StringUtil.isEmpty(maatCfg.getUserRegion())) {
|
||||
maatCfg.setUserRegion(Constants.INTERCEPT_DOMAN_INTENSITY_USER_REGION_KEY+"="+entity.getUserRegion5());
|
||||
@@ -398,7 +527,7 @@ public class InterceptCfgService extends CrudService<WebsiteCfgDao,CfgIndexInfo>
|
||||
if(entity.getAction().equals(48)){
|
||||
//HTTP replace: replace type is not null ;find is not null;replace with is not null(userRegion is not null)
|
||||
userRegion="nat_type="+entity.getUserRegion1();
|
||||
userRegion+=";spoofing_ip_pool="+entity.getUserRegion2();
|
||||
userRegion+=";spoofing_ip_pool="+entity.getUserRegion3();
|
||||
maatCfg.setUserRegion(userRegion);
|
||||
}
|
||||
|
||||
|
||||
@@ -165,6 +165,7 @@ public class PxyObjSpoofingIpPoolService extends BaseService{
|
||||
areaEffectiveIds = this.setEffectiveRange(entity.getAreaEffectiveIds());
|
||||
}
|
||||
entity.setAreaEffectiveIds(areaEffectiveIds);
|
||||
entity.setGroupId(entity.getCfgId().intValue());//界面的配置ID作为策略分组ID
|
||||
list.add(entity);
|
||||
//调用服务接口下发配置数据
|
||||
json=gsonToJson(list);
|
||||
|
||||
Reference in New Issue
Block a user