Merge branch 'develop' of http://192.168.10.125/k18_web/NFS.git into
develop Conflicts: src/main/java/com/nis/web/service/configuration/ConfigSynchronizationService.java
This commit is contained in:
@@ -9,15 +9,15 @@ public class TrafficIpActiveStatistic{
|
||||
@ExcelField(title="Area",sort=20)
|
||||
String areaId;
|
||||
@ExcelField(title="Number",sort=30)
|
||||
Integer linkNum;
|
||||
Long linkNum;
|
||||
@ExcelField(title="C2S(Pkt)",sort=40)
|
||||
Integer c2sPktNum;
|
||||
Long c2sPktNum;
|
||||
@ExcelField(title="S2C(Pkt)",sort=50)
|
||||
Integer s2cPktNum;
|
||||
Long s2cPktNum;
|
||||
@ExcelField(title="C2S(Byte)",sort=60)
|
||||
Integer c2sByteLen;
|
||||
Long c2sByteLen;
|
||||
@ExcelField(title="S2C(Byte)",sort=70)
|
||||
Integer s2cByteLen;
|
||||
Long s2cByteLen;
|
||||
@ExcelField(title="Time",sort=80)
|
||||
String statTime;
|
||||
|
||||
@@ -48,34 +48,34 @@ public class TrafficIpActiveStatistic{
|
||||
public void setAreaId(String areaId) {
|
||||
this.areaId = areaId;
|
||||
}
|
||||
public Integer getLinkNum() {
|
||||
public Long getLinkNum() {
|
||||
return linkNum;
|
||||
}
|
||||
public void setLinkNum(Integer linkNum) {
|
||||
public void setLinkNum(Long linkNum) {
|
||||
this.linkNum = linkNum;
|
||||
}
|
||||
public Integer getC2sPktNum() {
|
||||
public Long getC2sPktNum() {
|
||||
return c2sPktNum;
|
||||
}
|
||||
public void setC2sPktNum(Integer c2sPktNum) {
|
||||
public void setC2sPktNum(Long c2sPktNum) {
|
||||
this.c2sPktNum = c2sPktNum;
|
||||
}
|
||||
public Integer getS2cPktNum() {
|
||||
public Long getS2cPktNum() {
|
||||
return s2cPktNum;
|
||||
}
|
||||
public void setS2cPktNum(Integer s2cPktNum) {
|
||||
public void setS2cPktNum(Long s2cPktNum) {
|
||||
this.s2cPktNum = s2cPktNum;
|
||||
}
|
||||
public Integer getC2sByteLen() {
|
||||
public Long getC2sByteLen() {
|
||||
return c2sByteLen;
|
||||
}
|
||||
public void setC2sByteLen(Integer c2sByteLen) {
|
||||
public void setC2sByteLen(Long c2sByteLen) {
|
||||
this.c2sByteLen = c2sByteLen;
|
||||
}
|
||||
public Integer getS2cByteLen() {
|
||||
public Long getS2cByteLen() {
|
||||
return s2cByteLen;
|
||||
}
|
||||
public void setS2cByteLen(Integer s2cByteLen) {
|
||||
public void setS2cByteLen(Long s2cByteLen) {
|
||||
this.s2cByteLen = s2cByteLen;
|
||||
}
|
||||
|
||||
|
||||
@@ -717,6 +717,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) {
|
||||
@@ -781,6 +782,7 @@ public class ConfigServiceUtil {
|
||||
//创建连接
|
||||
WebTarget wt = ClientUtil.getWebTarger(url);
|
||||
logger.info("sync_send url:"+url);
|
||||
logger.info("Last-Completed-Tag:"+completeTag);
|
||||
//获取响应结果
|
||||
Builder header = wt.request(MediaType.APPLICATION_JSON)
|
||||
.header("Content-Type", MediaType.APPLICATION_JSON)
|
||||
|
||||
@@ -697,6 +697,7 @@ public final class Constants {
|
||||
public static final String TRAFFIC_IPACTIVE_FIVEMINUTE=Configurations.getStringProperty("trafficIpActiveFiveMinute","trafficIpActiveFiveMinute");
|
||||
public static final String TRAFFIC_IPACTIVE_ONEHOUR=Configurations.getStringProperty("trafficIpActiveOneHour","trafficIpActiveOneHour");
|
||||
public static final String NTC_RADIUS_REPORT=Configurations.getStringProperty("ntcRadiusReport","ntcRadiusReport");
|
||||
public static final String TRAFFIC_BANDWIDTH_TRANS=Configurations.getStringProperty("trafficBandwidthTrans","trafficBandwidthTrans");
|
||||
|
||||
/**
|
||||
* httpclient 工具超时时间设置
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.nis.web.controller.configuration.maintenance;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@@ -9,9 +8,7 @@ import java.util.Map;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.eclipse.jetty.util.ajax.JSON;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
@@ -21,12 +18,8 @@ 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.IpReuseIpCfg;
|
||||
import com.nis.domain.basics.PolicyGroupInfo;
|
||||
import com.nis.domain.configuration.BaseIpCfg;
|
||||
import com.nis.domain.configuration.IpAddrPoolCfg;
|
||||
import com.nis.domain.configuration.IpMultiplexPoolCfg;
|
||||
import com.nis.domain.configuration.UserManage;
|
||||
import com.nis.exceptions.MaatConvertException;
|
||||
import com.nis.util.ConfigServiceUtil;
|
||||
import com.nis.util.Constants;
|
||||
|
||||
@@ -24,9 +24,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.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||
|
||||
import com.nis.domain.Page;
|
||||
@@ -34,7 +32,6 @@ import com.nis.domain.SysDataDictionaryItem;
|
||||
import com.nis.domain.basics.PolicyGroupInfo;
|
||||
import com.nis.domain.configuration.BaseIpCfg;
|
||||
import com.nis.domain.configuration.IpAddrPoolCfg;
|
||||
import com.nis.domain.configuration.IpMultiplexPoolCfg;
|
||||
import com.nis.domain.configuration.IpPortCfg;
|
||||
import com.nis.domain.configuration.IpReusePolicyCfg;
|
||||
import com.nis.domain.configuration.UserManage;
|
||||
@@ -167,23 +164,9 @@ public class IpMultiplexController extends CommonController {
|
||||
|
||||
// 获取用户信息 地址池信息
|
||||
List<UserManage> users = userManageService.findUsers();
|
||||
List<IpAddrPoolCfg> addrPools = ipAddrPoolCfgService.getEffectiveAddrPool();
|
||||
List<IpAddrPoolCfg> addrPoolsNew=new ArrayList<>();
|
||||
for (IpAddrPoolCfg addrPool : addrPools) {
|
||||
Map<String, Object> params = new HashMap<String, Object>();
|
||||
params.put("addr_pool_id", addrPool.getCfgId());
|
||||
String url =Constants.IP_REUSE_CALL_CGI_URL ;
|
||||
Map<String, Object> resultMap=ConfigServiceUtil.getCGIInfo(url, Constants.IP_NUM_GET, params);
|
||||
if(!StringUtil.isEmpty(resultMap)
|
||||
&& !StringUtil.isEmpty(resultMap.get("num"))
|
||||
&& Integer.parseInt(resultMap.get("num").toString()) > 0) {
|
||||
addrPoolsNew.add(addrPool);
|
||||
}
|
||||
}
|
||||
|
||||
model.addAttribute("_cfg", cfg);
|
||||
model.addAttribute("users", users);
|
||||
model.addAttribute("addrPools", addrPoolsNew);
|
||||
model.addAttribute("urlPrefix","/manipulation/ipmulitiplex");
|
||||
return "/cfg/manipulation/ipmulitiplex/snatPolicyForm2";
|
||||
}
|
||||
@@ -250,6 +233,31 @@ public class IpMultiplexController extends CommonController {
|
||||
return "redirect:" + adminPath +"/manipulation/ipmulitiplex/snatPolicyList?functionId="+functionId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 异步获取地址池信息
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping(value = {"/ajaxGetAddrPools"})
|
||||
public List<IpAddrPoolCfg> ajaxGetAddrPools(HttpServletRequest request, HttpServletResponse response){
|
||||
List<IpAddrPoolCfg> addrPools = ipAddrPoolCfgService.getEffectiveAddrPool();
|
||||
List<IpAddrPoolCfg> addrPoolsNew=new ArrayList<>();
|
||||
for (IpAddrPoolCfg addrPool : addrPools) {
|
||||
Map<String, Object> params = new HashMap<String, Object>();
|
||||
params.put("addr_pool_id", addrPool.getCfgId());
|
||||
String url =Constants.IP_REUSE_CALL_CGI_URL ;
|
||||
Map<String, Object> resultMap=ConfigServiceUtil.getCGIInfo(url, Constants.IP_NUM_GET, params);
|
||||
if(!StringUtil.isEmpty(resultMap)
|
||||
&& !StringUtil.isEmpty(resultMap.get("num"))
|
||||
&& Integer.parseInt(resultMap.get("num").toString()) > 0) {
|
||||
addrPoolsNew.add(addrPool);
|
||||
}
|
||||
}
|
||||
return addrPoolsNew;
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/dnatPolicyList"})
|
||||
public String dnatPolicyList(String cfgName,Model model,@ModelAttribute("cfg")IpPortCfg cfg,HttpServletRequest request,HttpServletResponse response) {
|
||||
this._ipList(cfgName,model, cfg, request, response);
|
||||
|
||||
@@ -171,7 +171,6 @@ public class DashboardController extends BaseController{
|
||||
addMessage(redirectAttributes,"request_service_failed");
|
||||
}
|
||||
|
||||
|
||||
model.addAttribute("ipActiveList", ipActiveList);
|
||||
return "/dashboard/trafficIpActiveList";
|
||||
}
|
||||
@@ -661,29 +660,13 @@ public class DashboardController extends BaseController{
|
||||
ip.setId(i);
|
||||
ip.setIpAddr(3+i+".1.1."+i);
|
||||
ip.setAreaId("11");
|
||||
ip.setLinkNum(1212);
|
||||
ip.setLinkNum(1212l);
|
||||
list.add(ip);
|
||||
}
|
||||
page.setList(list);
|
||||
model.addAttribute("page", page);
|
||||
return "/dashboard/trafficWebTypeList";
|
||||
}
|
||||
@RequestMapping(value="bandwidthList")
|
||||
public String bandwidthList( HttpServletRequest request, HttpServletResponse response, Model model){
|
||||
PageLog<TrafficIpActiveStatistic> page = new PageLog<TrafficIpActiveStatistic>(request, response);
|
||||
List list = new ArrayList();
|
||||
for (int i = 1; i < 10; i++) {
|
||||
TrafficIpActiveStatistic ip = new TrafficIpActiveStatistic();
|
||||
ip.setId(i);
|
||||
ip.setIpAddr(3+i+".1.1."+i);
|
||||
ip.setAreaId("11");
|
||||
ip.setLinkNum(1212);
|
||||
list.add(ip);
|
||||
}
|
||||
page.setList(list);
|
||||
model.addAttribute("page", page);
|
||||
return "/dashboard/trafficBandwidthList";
|
||||
}
|
||||
|
||||
////////////////////////////////////////test
|
||||
@RequestMapping(value="showChart")
|
||||
|
||||
@@ -6,15 +6,23 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
|
||||
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.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import com.beust.jcommander.internal.Maps;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.nis.domain.PageLog;
|
||||
import com.nis.domain.dashboard.TrafficIpActiveStatistic;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.util.httpclient.HttpClientUtil;
|
||||
import com.nis.web.controller.BaseController;
|
||||
|
||||
@@ -97,5 +105,52 @@ public class TrafficStatisticsInfoController extends BaseController {
|
||||
}
|
||||
return m;
|
||||
}
|
||||
/**
|
||||
* 根据ip46,协议tcp,udp查询带宽 间隔5分钟数据
|
||||
*/
|
||||
@RequestMapping(value="bandwidthTrans")
|
||||
@ResponseBody
|
||||
public Map ipActiveMinuteList(@RequestParam("addrType")String addrType,@RequestParam("transType")Integer transType){
|
||||
Map<String, Object> fromJsonList = new HashMap<String, Object>();
|
||||
Map map = new HashMap();
|
||||
String url = Constants.DASHBOARD_URL+Constants.TRAFFIC_BANDWIDTH_TRANS;
|
||||
if(!StringUtil.isBlank(addrType)){
|
||||
url=url+"?addrType="+addrType;
|
||||
}
|
||||
if(transType!=null){
|
||||
url=url+"?transType="+transType;
|
||||
}
|
||||
try {
|
||||
String string = HttpClientUtil.get(url);
|
||||
Gson gson = new GsonBuilder().create();
|
||||
fromJsonList = gson.fromJson(string, new TypeToken<Map>(){}.getType());
|
||||
logger.info("带宽1小时,间隔5分钟数据"+fromJsonList);
|
||||
List list = (ArrayList) fromJsonList.get("data");
|
||||
if(!StringUtil.isEmpty(list)){
|
||||
map=(Map) list.get(0);
|
||||
}
|
||||
return map;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.error("带宽详情数据获取错误"+e);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
@RequestMapping(value="bandwidthList")
|
||||
public String bandwidthList( HttpServletRequest request, HttpServletResponse response, Model model){
|
||||
PageLog<TrafficIpActiveStatistic> page = new PageLog<TrafficIpActiveStatistic>(request, response);
|
||||
List list = new ArrayList();
|
||||
for (int i = 1; i < 10; i++) {
|
||||
TrafficIpActiveStatistic ip = new TrafficIpActiveStatistic();
|
||||
ip.setId(i);
|
||||
ip.setIpAddr(3+i+".1.1."+i);
|
||||
ip.setAreaId("11");
|
||||
ip.setLinkNum(1212l);
|
||||
list.add(ip);
|
||||
}
|
||||
page.setList(list);
|
||||
model.addAttribute("page", page);
|
||||
return "/dashboard/trafficBandwidthList";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ public class NtcDestIpReportController extends BaseController {
|
||||
List<FunctionServiceDict> serviceList = DictUtils.getFunctionServiceDictList(bean.getFunctionId());
|
||||
|
||||
if(bean.getServiceId()!=null){
|
||||
bean.setServices(bean.getServiceId().toString());
|
||||
bean.setSearchService(bean.getServiceId().toString());
|
||||
}else{
|
||||
StringBuffer serviceId=new StringBuffer();
|
||||
for(int i=0;i<serviceList.size();i++){
|
||||
|
||||
@@ -35,7 +35,7 @@ public class NtcEntranceReportController extends BaseController {
|
||||
public String list(@ModelAttribute("bean") SearchReport bean,Model model, HttpServletRequest request, HttpServletResponse response) {
|
||||
List<FunctionServiceDict> serviceList = DictUtils.getFunctionServiceDictList(bean.getFunctionId());
|
||||
if(bean.getServiceId()!=null){
|
||||
bean.setServices(bean.getServiceId().toString());
|
||||
bean.setSearchService(bean.getServiceId().toString());
|
||||
}else{
|
||||
StringBuffer serviceId=new StringBuffer();
|
||||
for(int i=0;i<serviceList.size();i++){
|
||||
|
||||
@@ -34,10 +34,10 @@ public class NtcLwhhReportController extends BaseController {
|
||||
@RequestMapping("/ajaxNtcLwhhReport")
|
||||
public String list(@ModelAttribute("bean") SearchReport bean,Model model, HttpServletRequest request, HttpServletResponse response) {
|
||||
List<FunctionServiceDict> serviceList = DictUtils.getFunctionServiceDictList(bean.getFunctionId());
|
||||
List<RequestInfo> requestInfos=requestInfoService.getAllLwhhRequestInfo();
|
||||
List<RequestInfo> requestInfos=requestInfoService.getAllRequestInfo();
|
||||
model.addAttribute("requestInfos", requestInfos);
|
||||
if(bean.getServiceId()!=null){
|
||||
bean.setServices(bean.getServiceId().toString());
|
||||
bean.setSearchService(bean.getServiceId().toString());
|
||||
}else{
|
||||
StringBuffer serviceId=new StringBuffer();
|
||||
for(int i=0;i<serviceList.size();i++){
|
||||
|
||||
@@ -35,7 +35,7 @@ public class NtcSrcipDomesticReportController extends BaseController {
|
||||
public String list(@ModelAttribute("bean") SearchReport bean,Model model, HttpServletRequest request, HttpServletResponse response) {
|
||||
List<FunctionServiceDict> serviceList = DictUtils.getFunctionServiceDictList(bean.getFunctionId());
|
||||
if(bean.getServiceId()!=null){
|
||||
bean.setServices(bean.getServiceId().toString());
|
||||
bean.setSearchService(bean.getServiceId().toString());
|
||||
}else{
|
||||
StringBuffer serviceId=new StringBuffer();
|
||||
for(int i=0;i<serviceList.size();i++){
|
||||
|
||||
@@ -37,7 +37,7 @@ public class NtcTagReportController extends BaseController {
|
||||
List<ServiceDictInfo> labels=serviceDictInfoService.findAllLableDict();
|
||||
model.addAttribute("labels", labels);
|
||||
if(bean.getServiceId()!=null){
|
||||
bean.setServices(bean.getServiceId().toString());
|
||||
bean.setSearchService(bean.getServiceId().toString());
|
||||
}else{
|
||||
StringBuffer serviceId=new StringBuffer();
|
||||
for(int i=0;i<serviceList.size();i++){
|
||||
|
||||
@@ -38,7 +38,7 @@ public class NtcXzReportController extends BaseController {
|
||||
List<ServiceDictInfo> xzs=serviceDictInfoService.findAllXzDict();
|
||||
model.addAttribute("xzs", xzs);
|
||||
if(bean.getServiceId()!=null){
|
||||
bean.setServices(bean.getServiceId().toString());
|
||||
bean.setSearchService(bean.getServiceId().toString());
|
||||
}else{
|
||||
StringBuffer serviceId=new StringBuffer();
|
||||
for(int i=0;i<serviceList.size();i++){
|
||||
|
||||
@@ -24,6 +24,7 @@ import com.nis.domain.configuration.AppStringCfg;
|
||||
import com.nis.domain.configuration.AppTcpCfg;
|
||||
import com.nis.domain.configuration.AppTopicDomainCfg;
|
||||
import com.nis.domain.configuration.AvFileSampleCfg;
|
||||
import com.nis.domain.configuration.AvSignSampleCfg;
|
||||
import com.nis.domain.configuration.BaseCfg;
|
||||
import com.nis.domain.configuration.BaseStringCfg;
|
||||
import com.nis.domain.configuration.CfgIndexInfo;
|
||||
@@ -78,6 +79,7 @@ public interface ConfigSynchronizationDao {
|
||||
public List<FileDigestCfg> getFileDigestListByService(BaseCfg entity);
|
||||
|
||||
public List<AvFileSampleCfg> getAvFileCfgList(BaseCfg entity);
|
||||
public List<AvSignSampleCfg> getAvSignCfgList(BaseCfg entity);
|
||||
public List<PxyObjKeyring> getPxyObjKeyringCfgList(BaseCfg entity);
|
||||
public List<PxyObjTrustedCaCert> getPxyObjTrustedCertCfgList(BaseCfg entity);
|
||||
public List<PxyObjTrustedCaCrl> getPxyObjTrustedCrlCfgList(BaseCfg entity);
|
||||
|
||||
@@ -1216,11 +1216,26 @@
|
||||
</trim>
|
||||
ORDER BY a.CFG_ID
|
||||
</select>
|
||||
<select id="getAvSignSampleById" resultMap="AvSignSampleMap" parameterType="java.lang.Long" >
|
||||
<select id="getAvSignCfgList" resultMap="AvSignSampleMap" parameterType="com.nis.domain.configuration.BaseCfg" >
|
||||
SELECT
|
||||
<include refid="AvSignSample_Column" />
|
||||
FROM av_sign_sample_cfg a
|
||||
WHERE a.CFG_ID = #{cfgId,jdbcType=BIGINT}
|
||||
left join sys_user s on a.creator_id=s.id
|
||||
left join sys_user u on a.auditor_id=u.id
|
||||
<trim prefix="WHERE" prefixOverrides="AND |OR ">
|
||||
<if test="serviceId != null">
|
||||
AND a.SERVICE_ID=#{serviceId,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="functionId != null">
|
||||
AND a.function_id=#{functionId,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="action != null">
|
||||
AND a.action=#{action,jdbcType=INTEGER}
|
||||
</if>
|
||||
and a.is_valid=#{isValid} and a.is_audit=#{isAudit}
|
||||
and a.is_valid!=-1
|
||||
</trim>
|
||||
ORDER BY a.CFG_ID
|
||||
</select>
|
||||
<select id="getDnsStrategyList" resultMap="DnsResStrategyMap">
|
||||
SELECT
|
||||
|
||||
@@ -136,12 +136,12 @@ public class ConfigSynchronizationService extends BaseService{
|
||||
handleCallbackData(className,page,entity,request,response,false);
|
||||
}
|
||||
if(!isFinished && lastServiceTag){//如果业务没有配置数据,并且为最后一个业务,需要发送给服务接口一个结束标识
|
||||
String json = "";
|
||||
if("1".equals(serviceType)){
|
||||
String json = "{}";
|
||||
/*if("1".equals(serviceType)){
|
||||
json="{}";
|
||||
}else{
|
||||
json="[]";
|
||||
}
|
||||
}*/
|
||||
JSONObject result = ConfigServiceUtil.configSync(json,Integer.parseInt(serviceType),entity.getServiceId(),entity.getTableName(),"FINISHED");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user