diff --git a/src/main/java/com/nis/domain/dashboard/codedic/CodeAppDic.java b/src/main/java/com/nis/domain/dashboard/codedic/CodeAppDic.java new file mode 100644 index 000000000..a20996933 --- /dev/null +++ b/src/main/java/com/nis/domain/dashboard/codedic/CodeAppDic.java @@ -0,0 +1,73 @@ +package com.nis.domain.dashboard.codedic; + +public class CodeAppDic { + private Integer id; + + private String appName; + + private String appNameZh; + + private String viewCode; + + private String icon; + + private String behavior; + + private Integer coreApp; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getAppName() { + return appName; + } + + public void setAppName(String appName) { + this.appName = appName == null ? null : appName.trim(); + } + + public String getAppNameZh() { + return appNameZh; + } + + public void setAppNameZh(String appNameZh) { + this.appNameZh = appNameZh == null ? null : appNameZh.trim(); + } + + public String getViewCode() { + return viewCode; + } + + public void setViewCode(String viewCode) { + this.viewCode = viewCode == null ? null : viewCode.trim(); + } + + public String getIcon() { + return icon; + } + + public void setIcon(String icon) { + this.icon = icon == null ? null : icon.trim(); + } + + public String getBehavior() { + return behavior; + } + + public void setBehavior(String behavior) { + this.behavior = behavior == null ? null : behavior.trim(); + } + + public Integer getCoreApp() { + return coreApp; + } + + public void setCoreApp(Integer coreApp) { + this.coreApp = coreApp; + } +} \ No newline at end of file diff --git a/src/main/java/com/nis/domain/dashboard/codedic/CodeBehaviorTypeDic.java b/src/main/java/com/nis/domain/dashboard/codedic/CodeBehaviorTypeDic.java new file mode 100644 index 000000000..a57814479 --- /dev/null +++ b/src/main/java/com/nis/domain/dashboard/codedic/CodeBehaviorTypeDic.java @@ -0,0 +1,33 @@ +package com.nis.domain.dashboard.codedic; + +public class CodeBehaviorTypeDic { + private Integer id; + + private String behaviorType; + + private String viewCode; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getBehaviorType() { + return behaviorType; + } + + public void setBehaviorType(String behaviorType) { + this.behaviorType = behaviorType == null ? null : behaviorType.trim(); + } + + public String getViewCode() { + return viewCode; + } + + public void setViewCode(String viewCode) { + this.viewCode = viewCode == null ? null : viewCode.trim(); + } +} \ No newline at end of file diff --git a/src/main/java/com/nis/domain/dashboard/codedic/CodeBrowserTypeDic.java b/src/main/java/com/nis/domain/dashboard/codedic/CodeBrowserTypeDic.java new file mode 100644 index 000000000..04c62dd8f --- /dev/null +++ b/src/main/java/com/nis/domain/dashboard/codedic/CodeBrowserTypeDic.java @@ -0,0 +1,43 @@ +package com.nis.domain.dashboard.codedic; + +public class CodeBrowserTypeDic { + private Integer id; + + private String browserType; + + private String viewCode; + + private String icon; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getBrowserType() { + return browserType; + } + + public void setBrowserType(String browserType) { + this.browserType = browserType == null ? null : browserType.trim(); + } + + public String getViewCode() { + return viewCode; + } + + public void setViewCode(String viewCode) { + this.viewCode = viewCode == null ? null : viewCode.trim(); + } + + public String getIcon() { + return icon; + } + + public void setIcon(String icon) { + this.icon = icon == null ? null : icon.trim(); + } +} \ No newline at end of file diff --git a/src/main/java/com/nis/domain/dashboard/codedic/CodeOsTypeDic.java b/src/main/java/com/nis/domain/dashboard/codedic/CodeOsTypeDic.java new file mode 100644 index 000000000..86d4c507b --- /dev/null +++ b/src/main/java/com/nis/domain/dashboard/codedic/CodeOsTypeDic.java @@ -0,0 +1,43 @@ +package com.nis.domain.dashboard.codedic; + +public class CodeOsTypeDic { + private Integer id; + + private String osType; + + private String viewCode; + + private String icon; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getOsType() { + return osType; + } + + public void setOsType(String osType) { + this.osType = osType == null ? null : osType.trim(); + } + + public String getViewCode() { + return viewCode; + } + + public void setViewCode(String viewCode) { + this.viewCode = viewCode == null ? null : viewCode.trim(); + } + + public String getIcon() { + return icon; + } + + public void setIcon(String icon) { + this.icon = icon == null ? null : icon.trim(); + } +} \ No newline at end of file diff --git a/src/main/java/com/nis/domain/dashboard/codedic/CodeProtocolTypeDic.java b/src/main/java/com/nis/domain/dashboard/codedic/CodeProtocolTypeDic.java new file mode 100644 index 000000000..a671ae85b --- /dev/null +++ b/src/main/java/com/nis/domain/dashboard/codedic/CodeProtocolTypeDic.java @@ -0,0 +1,33 @@ +package com.nis.domain.dashboard.codedic; + +public class CodeProtocolTypeDic { + private Integer id; + + private String protocolType; + + private String viewCode; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getProtocolType() { + return protocolType; + } + + public void setProtocolType(String protocolType) { + this.protocolType = protocolType == null ? null : protocolType.trim(); + } + + public String getViewCode() { + return viewCode; + } + + public void setViewCode(String viewCode) { + this.viewCode = viewCode == null ? null : viewCode.trim(); + } +} \ No newline at end of file diff --git a/src/main/java/com/nis/domain/dashboard/codedic/CodeServiceTypeDic.java b/src/main/java/com/nis/domain/dashboard/codedic/CodeServiceTypeDic.java new file mode 100644 index 000000000..4b4588685 --- /dev/null +++ b/src/main/java/com/nis/domain/dashboard/codedic/CodeServiceTypeDic.java @@ -0,0 +1,33 @@ +package com.nis.domain.dashboard.codedic; + +public class CodeServiceTypeDic { + private Integer id; + + private String serviceType; + + private String viewCode; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getServiceType() { + return serviceType; + } + + public void setServiceType(String serviceType) { + this.serviceType = serviceType == null ? null : serviceType.trim(); + } + + public String getViewCode() { + return viewCode; + } + + public void setViewCode(String viewCode) { + this.viewCode = viewCode == null ? null : viewCode.trim(); + } +} \ No newline at end of file diff --git a/src/main/java/com/nis/domain/dashboard/codedic/CodeWebServiceDic.java b/src/main/java/com/nis/domain/dashboard/codedic/CodeWebServiceDic.java new file mode 100644 index 000000000..d99624362 --- /dev/null +++ b/src/main/java/com/nis/domain/dashboard/codedic/CodeWebServiceDic.java @@ -0,0 +1,53 @@ +package com.nis.domain.dashboard.codedic; + +public class CodeWebServiceDic { + private Integer id; + + private String website; + + private String domainName; + + private String viewCode; + + private String icon; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getWebsite() { + return website; + } + + public void setWebsite(String website) { + this.website = website == null ? null : website.trim(); + } + + public String getDomainName() { + return domainName; + } + + public void setDomainName(String domainName) { + this.domainName = domainName == null ? null : domainName.trim(); + } + + public String getViewCode() { + return viewCode; + } + + public void setViewCode(String viewCode) { + this.viewCode = viewCode == null ? null : viewCode.trim(); + } + + public String getIcon() { + return icon; + } + + public void setIcon(String icon) { + this.icon = icon == null ? null : icon.trim(); + } +} \ No newline at end of file diff --git a/src/main/java/com/nis/domain/log/SearchReport.java b/src/main/java/com/nis/domain/log/SearchReport.java index 55e0feedf..c99242112 100644 --- a/src/main/java/com/nis/domain/log/SearchReport.java +++ b/src/main/java/com/nis/domain/log/SearchReport.java @@ -8,6 +8,7 @@ */ package com.nis.domain.log; +import java.util.Date; import java.util.HashMap; import com.nis.domain.BaseEntity; @@ -35,7 +36,9 @@ public class SearchReport extends BaseEntity{ private String reportBusinessType; private String searchBusinessType; private String searchReportStartTime; + private Date reportStartTime; private String searchReportEndTime; + private Date reportEndTime; private String searchService; private HashMap searchCondition; public static final String searchConditionSplitor=","; @@ -44,7 +47,51 @@ public class SearchReport extends BaseEntity{ private Integer pageSize; private String orderBy; private String fields; + //界面查询的时间 + private String reportTime; + /** + * reportStartTime + * @return reportStartTime + */ + + public Date getReportStartTime() { + return reportStartTime; + } + /** + * @param reportStartTime the reportStartTime to set + */ + public void setReportStartTime(Date reportStartTime) { + this.reportStartTime = reportStartTime; + } + /** + * reportEndTime + * @return reportEndTime + */ + + public Date getReportEndTime() { + return reportEndTime; + } + /** + * @param reportEndTime the reportEndTime to set + */ + public void setReportEndTime(Date reportEndTime) { + this.reportEndTime = reportEndTime; + } + /** + * reportTime + * @return reportTime + */ + + public String getReportTime() { + return reportTime; + } + /** + * @param reportTime the reportTime to set + */ + public void setReportTime(String reportTime) { + this.reportTime = reportTime; + } /** * pageNo * @return pageNo diff --git a/src/main/java/com/nis/domain/log/BaseReportLog.java b/src/main/java/com/nis/domain/report/BaseReport.java similarity index 89% rename from src/main/java/com/nis/domain/log/BaseReportLog.java rename to src/main/java/com/nis/domain/report/BaseReport.java index 7061da40e..b3b6f3140 100644 --- a/src/main/java/com/nis/domain/log/BaseReportLog.java +++ b/src/main/java/com/nis/domain/report/BaseReport.java @@ -6,7 +6,7 @@ *@date 2018年7月5日 上午11:12:48 *@version 版本号 */ -package com.nis.domain.log; +package com.nis.domain.report; import java.util.Date; @@ -19,7 +19,7 @@ import com.nis.domain.BaseEntity; * @date 2018年7月5日 上午11:12:48 * @version V1.0 */ -public class BaseReportLog extends BaseEntity { +public class BaseReport extends BaseEntity { /** * @Fields serialVersionUID:TODO(用一句话描述这个变量表示什么) * diff --git a/src/main/java/com/nis/domain/log/ReportLog.java b/src/main/java/com/nis/domain/report/LogReport.java similarity index 89% rename from src/main/java/com/nis/domain/log/ReportLog.java rename to src/main/java/com/nis/domain/report/LogReport.java index 4cf45a790..e3001ae96 100644 --- a/src/main/java/com/nis/domain/log/ReportLog.java +++ b/src/main/java/com/nis/domain/report/LogReport.java @@ -6,7 +6,7 @@ *@date 2018年6月13日 下午2:21:04 *@version 版本号 */ -package com.nis.domain.log; +package com.nis.domain.report; import java.util.Date; @@ -17,7 +17,7 @@ import java.util.Date; * @date 2018年6月13日 下午2:21:04 * @version V1.0 */ -public class ReportLog extends BaseReportLog{ +public class LogReport extends BaseReport{ /** * @Fields serialVersionUID:TODO(用一句话描述这个变量表示什么) * diff --git a/src/main/java/com/nis/domain/report/NtcAttrTypeReport.java b/src/main/java/com/nis/domain/report/NtcAttrTypeReport.java new file mode 100644 index 000000000..c34d655e3 --- /dev/null +++ b/src/main/java/com/nis/domain/report/NtcAttrTypeReport.java @@ -0,0 +1,16 @@ +package com.nis.domain.report; + +public class NtcAttrTypeReport extends BaseReport{ + + private static final long serialVersionUID = -4537371833119510177L; + + private Integer attrType; + + public Integer getAttrType() { + return attrType; + } + + public void setAttrType(Integer attrType) { + this.attrType = attrType; + } +} diff --git a/src/main/java/com/nis/domain/report/NtcDestIpReport.java b/src/main/java/com/nis/domain/report/NtcDestIpReport.java new file mode 100644 index 000000000..c1bf9c4f0 --- /dev/null +++ b/src/main/java/com/nis/domain/report/NtcDestIpReport.java @@ -0,0 +1,16 @@ +package com.nis.domain.report; + +public class NtcDestIpReport extends BaseReport{ + + private static final long serialVersionUID = 8905927100915123026L; + + private String destCountry; + + public String getDestCountry() { + return destCountry; + } + + public void setDestCountry(String destCountry) { + this.destCountry = destCountry; + } +} diff --git a/src/main/java/com/nis/domain/report/NtcEntranceReport.java b/src/main/java/com/nis/domain/report/NtcEntranceReport.java new file mode 100644 index 000000000..136befe26 --- /dev/null +++ b/src/main/java/com/nis/domain/report/NtcEntranceReport.java @@ -0,0 +1,16 @@ +package com.nis.domain.report; + +public class NtcEntranceReport extends BaseReport{ + + private static final long serialVersionUID = -5042608104505377779L; + + private Integer entranceId; + + public Integer getEntranceId() { + return entranceId; + } + + public void setEntranceId(Integer entranceId) { + this.entranceId = entranceId; + } +} diff --git a/src/main/java/com/nis/domain/report/NtcLwhhReport.java b/src/main/java/com/nis/domain/report/NtcLwhhReport.java new file mode 100644 index 000000000..dc9a5d1f5 --- /dev/null +++ b/src/main/java/com/nis/domain/report/NtcLwhhReport.java @@ -0,0 +1,43 @@ +/** + *@Title: NtcServiceReportLog.java + *@Package com.nis.domain.log + *@Description TODO + *@author dell + *@date 2018年7月9日 上午8:57:01 + *@version 版本号 + */ +package com.nis.domain.report; + +/** + * @ClassName: NtcServiceReportLog.java + * @Description: TODO + * @author (dell) + * @date 2018年7月9日 上午8:57:01 + * @version V1.0 + */ +public class NtcLwhhReport extends BaseReport { + + /** + * @Fields serialVersionUID:TODO(用一句话描述这个变量表示什么) + * + * @since 1.0.0 + */ + + private static final long serialVersionUID = 2245672277797057001L; + private Integer lwhh; + /** + * lwhh + * @return lwhh + */ + + public Integer getLwhh() { + return lwhh; + } + /** + * @param lwhh the lwhh to set + */ + public void setLwhh(Integer lwhh) { + this.lwhh = lwhh; + } + +} diff --git a/src/main/java/com/nis/domain/report/NtcServiceReport.java b/src/main/java/com/nis/domain/report/NtcServiceReport.java new file mode 100644 index 000000000..a6354660f --- /dev/null +++ b/src/main/java/com/nis/domain/report/NtcServiceReport.java @@ -0,0 +1,28 @@ +/** + *@Title: NtcServiceReportLog.java + *@Package com.nis.domain.log + *@Description TODO + *@author dell + *@date 2018年7月9日 上午8:57:01 + *@version 版本号 + */ +package com.nis.domain.report; + +/** + * @ClassName: NtcServiceReportLog.java + * @Description: TODO + * @author (dell) + * @date 2018年7月9日 上午8:57:01 + * @version V1.0 + */ +public class NtcServiceReport extends BaseReport { + + /** + * @Fields serialVersionUID:TODO(用一句话描述这个变量表示什么) + * + * @since 1.0.0 + */ + + private static final long serialVersionUID = 5574384523786886920L; + +} diff --git a/src/main/java/com/nis/domain/report/NtcSrcipDomesticReport.java b/src/main/java/com/nis/domain/report/NtcSrcipDomesticReport.java new file mode 100644 index 000000000..eb472b463 --- /dev/null +++ b/src/main/java/com/nis/domain/report/NtcSrcipDomesticReport.java @@ -0,0 +1,58 @@ +/** + *@Title: NtcServiceReportLog.java + *@Package com.nis.domain.log + *@Description TODO + *@author dell + *@date 2018年7月9日 上午8:57:01 + *@version 版本号 + */ +package com.nis.domain.report; + +/** + * @ClassName: NtcServiceReportLog.java + * @Description: TODO + * @author (dell) + * @date 2018年7月9日 上午8:57:01 + * @version V1.0 + */ +public class NtcSrcipDomesticReport extends BaseReport { + + /** + * @Fields serialVersionUID:TODO(用一句话描述这个变量表示什么) + * + * @since 1.0.0 + */ + + private static final long serialVersionUID = 2245672277797057001L; + private String srcProvince; + private String srcCity; + /** + * srcProvince + * @return srcProvince + */ + + public String getSrcProvince() { + return srcProvince; + } + /** + * @param srcProvince the srcProvince to set + */ + public void setSrcProvince(String srcProvince) { + this.srcProvince = srcProvince; + } + /** + * srcCity + * @return srcCity + */ + + public String getSrcCity() { + return srcCity; + } + /** + * @param srcCity the srcCity to set + */ + public void setSrcCity(String srcCity) { + this.srcCity = srcCity; + } + +} diff --git a/src/main/java/com/nis/domain/report/NtcTagReport.java b/src/main/java/com/nis/domain/report/NtcTagReport.java new file mode 100644 index 000000000..bf69082f4 --- /dev/null +++ b/src/main/java/com/nis/domain/report/NtcTagReport.java @@ -0,0 +1,43 @@ +/** + *@Title: NtcServiceReportLog.java + *@Package com.nis.domain.log + *@Description TODO + *@author dell + *@date 2018年7月9日 上午8:57:01 + *@version 版本号 + */ +package com.nis.domain.report; + +/** + * @ClassName: NtcServiceReportLog.java + * @Description: TODO + * @author (dell) + * @date 2018年7月9日 上午8:57:01 + * @version V1.0 + */ +public class NtcTagReport extends BaseReport { + + /** + * @Fields serialVersionUID:TODO(用一句话描述这个变量表示什么) + * + * @since 1.0.0 + */ + + private static final long serialVersionUID = 2245672277797057001L; + private Integer tag; + /** + * tag + * @return tag + */ + + public Integer getTag() { + return tag; + } + /** + * @param tag the tag to set + */ + public void setTag(Integer tag) { + this.tag = tag; + } + +} diff --git a/src/main/java/com/nis/domain/log/ReportResultLog.java b/src/main/java/com/nis/domain/report/ReportResult.java similarity index 77% rename from src/main/java/com/nis/domain/log/ReportResultLog.java rename to src/main/java/com/nis/domain/report/ReportResult.java index 537cfa137..ca7b3af35 100644 --- a/src/main/java/com/nis/domain/log/ReportResultLog.java +++ b/src/main/java/com/nis/domain/report/ReportResult.java @@ -6,8 +6,10 @@ *@date 2018年6月11日 下午2:04:09 *@version 版本号 */ -package com.nis.domain.log; +package com.nis.domain.report; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; import java.util.Map.Entry; import javax.ws.rs.client.Invocation.Builder; @@ -19,6 +21,7 @@ import com.google.common.reflect.TypeToken; import com.google.gson.Gson; import com.nis.domain.Page; import com.nis.domain.RestfulResult; +import com.nis.domain.log.SearchReport; import com.nis.exceptions.MaatConvertException; import com.nis.util.Constants; import com.nis.util.StringUtils; @@ -31,7 +34,7 @@ import com.nis.util.httpclient.ClientUtil; * @date 2018年6月11日 下午2:04:09 * @version V1.0 */ -public class ReportResultLog extends RestfulResult{ +public class ReportResult extends RestfulResult{ private Integer logSource; private Page data; /** @@ -62,13 +65,13 @@ public class ReportResultLog extends RestfulResult{ public void setData(Page data) { this.data = data; } - public ReportResultLog getReport(String reportUrl,SearchReport searchCondition) throws MaatConvertException{ - if(StringUtils.isBlank(searchCondition.getSearchService())){ - throw new MaatConvertException(""); - } + public ReportResult getReport(String reportUrl,SearchReport searchCondition) throws MaatConvertException, UnsupportedEncodingException{ +// if(StringUtils.isBlank(searchCondition.getSearchService())){ +// throw new MaatConvertException(""); +// } String result = null; - ReportResultLog bean = null; - StringBuffer url=new StringBuffer(reportUrl+"?"); + ReportResult bean = null; + StringBuffer url=new StringBuffer(reportUrl); url.append("searchBusinessType=").append(searchCondition.getSearchBusinessType()) .append("&searchService=").append(searchCondition.getSearchService()); if(searchCondition.getSearchCondition()!=null){ @@ -95,20 +98,17 @@ public class ReportResultLog extends RestfulResult{ url.append("&fields=").append(searchCondition.getFields()); } //创建连接 - WebTarget wt = ClientUtil.getWebTarger(url.toString()); + WebTarget wt = ClientUtil.getWebTarger(URLEncoder.encode(url.toString(),"UTF-8")); Builder header = wt.request(MediaType.APPLICATION_JSON); Response response= header.get(); if( response.getStatus() == 200){ result= response.readEntity(String.class); Gson gson=Constants.gsonbuilder.create(); - bean = gson.fromJson(result, new TypeToken>(){ + bean = gson.fromJson(result, new TypeToken>(){ private static final long serialVersionUID = 7963055764864141968L;}.getType()); }else{ throw new MaatConvertException(":"+response.readEntity(String.class)); } return bean; } - public static void main(String[] args) { - - } } \ No newline at end of file diff --git a/src/main/java/com/nis/util/CodeDicUtils.java b/src/main/java/com/nis/util/CodeDicUtils.java new file mode 100644 index 000000000..54e6b1a43 --- /dev/null +++ b/src/main/java/com/nis/util/CodeDicUtils.java @@ -0,0 +1,163 @@ +package com.nis.util; + +import java.util.ArrayList; +import java.util.List; +import org.springframework.stereotype.Service; + +import com.nis.domain.dashboard.codedic.CodeAppDic; +import com.nis.domain.dashboard.codedic.CodeBehaviorTypeDic; +import com.nis.domain.dashboard.codedic.CodeBrowserTypeDic; +import com.nis.domain.dashboard.codedic.CodeOsTypeDic; +import com.nis.domain.dashboard.codedic.CodeProtocolTypeDic; +import com.nis.domain.dashboard.codedic.CodeServiceTypeDic; +import com.nis.domain.dashboard.codedic.CodeWebServiceDic; +import com.nis.web.dao.dashboard.codedic.CodeAppDicDao; +import com.nis.web.dao.dashboard.codedic.CodeBehaviorTypeDicDao; +import com.nis.web.dao.dashboard.codedic.CodeBrowserTypeDicDao; +import com.nis.web.dao.dashboard.codedic.CodeOsTypeDicDao; +import com.nis.web.dao.dashboard.codedic.CodeProtocolTypeDicDao; +import com.nis.web.dao.dashboard.codedic.CodeResult; +import com.nis.web.dao.dashboard.codedic.CodeServiceTypeDicDao; +import com.nis.web.dao.dashboard.codedic.CodeWebServiceDicDao; +import com.nis.web.service.SpringContextHolder; +@Service +public class CodeDicUtils { + private final static CodeAppDicDao codeAppDicDao = SpringContextHolder.getBean(CodeAppDicDao.class); + private final static CodeBehaviorTypeDicDao codeBehaviorTypeDicDao = SpringContextHolder.getBean(CodeBehaviorTypeDicDao.class); + private final static CodeBrowserTypeDicDao codeBrowserTypeDicDao = SpringContextHolder.getBean(CodeBrowserTypeDicDao.class); + private final static CodeOsTypeDicDao codeOsTypeDicDao = SpringContextHolder.getBean(CodeOsTypeDicDao.class); + private final static CodeProtocolTypeDicDao codeProtocolTypeDicDao = SpringContextHolder.getBean(CodeProtocolTypeDicDao.class); + private final static CodeServiceTypeDicDao codeServiceTypeDicDao = SpringContextHolder.getBean(CodeServiceTypeDicDao.class); + private final static CodeWebServiceDicDao codeWebServiceDicDao = SpringContextHolder.getBean(CodeWebServiceDicDao.class); + + + private static final String APP_CODE="appCode"; + private static final String BEHAVIOR_CODE="behaviorCode"; + private static final String BROWSER_CODE="browserCode"; + private static final String OS_CODE="osCode"; + private static final String PROTOCOL_CODE="protocolCode"; + private static final String SERVICE_CODE="serviceCode"; + private static final String WEB_CODE="webCode"; + /** + * 适用于大屏图表标签显示 + */ + public static List getCodeList(String name) { +// List menuList = (List)getCache(CACHE_MENU_LIST); +// if (menuList == null){ +// SysUser user = getUser(); +// if (user.isAdmin()){ +// menuList = sysMenuDao.findAllList(new SysMenu()); +// }else{ +// menuList = sysMenuDao.findSysMenuByUserId(user.getId()); +// } +// putCache(CACHE_MENU_LIST, menuList); +// } + + List result = new ArrayList<>(); + if (name.equals(APP_CODE)) { + List codeDicList = (List) CacheUtils.get(APP_CODE); + if(StringUtil.isEmpty(codeDicList)){ + codeDicList = codeAppDicDao.getCodeDicList(); + CacheUtils.put(APP_CODE,codeDicList); + } + for (int i = 0; i < codeDicList.size(); i++) { + CodeResult codeResult = new CodeResult(); + codeResult.setItem(codeDicList.get(i).getAppName()); + codeResult.setCode(codeDicList.get(i).getViewCode()); + codeResult.setCoreApp(codeDicList.get(i).getCoreApp()); + result.add(codeResult); + } + return result; + + } else if (name.equals(BEHAVIOR_CODE)) { + List codeDicList = (List) CacheUtils.get(BEHAVIOR_CODE); + if(StringUtil.isEmpty(codeDicList)){ + codeDicList = codeBehaviorTypeDicDao.getCodeDicList(); + CacheUtils.put(BEHAVIOR_CODE,codeDicList); + } + for (int i = 0; i < codeDicList.size(); i++) { + CodeResult codeResult = new CodeResult(); + codeResult.setItem(codeDicList.get(i).getBehaviorType()); + codeResult.setCode(codeDicList.get(i).getViewCode()); + + result.add(codeResult); + } + return result; + } else if (name.equals(BROWSER_CODE)) { + List codeDicList = (List) CacheUtils.get(BROWSER_CODE); + if(StringUtil.isEmpty(codeDicList)){ + codeDicList = codeBrowserTypeDicDao.getCodeDicList(); + CacheUtils.put(BROWSER_CODE, codeDicList); + } + for (int i = 0; i < codeDicList.size(); i++) { + CodeResult codeResult = new CodeResult(); + codeResult.setItem(codeDicList.get(i).getBrowserType()); + codeResult.setCode(codeDicList.get(i).getViewCode()); + + result.add(codeResult); + } + return result; + } else if (name.equals(OS_CODE)) { + List codeDicList = (List) CacheUtils.get(OS_CODE); + if(StringUtil.isEmpty(codeDicList)){ + codeDicList = codeOsTypeDicDao.getCodeDicList(); + CacheUtils.put(OS_CODE, codeDicList); + } + for (int i = 0; i < codeDicList.size(); i++) { + CodeResult codeResult = new CodeResult(); + codeResult.setItem(codeDicList.get(i).getOsType()); + codeResult.setCode(codeDicList.get(i).getViewCode()); + + result.add(codeResult); + } + return result; + } else if (name.equals(PROTOCOL_CODE)) { + List codeDicList = (List) CacheUtils.get(PROTOCOL_CODE); + if(StringUtil.isEmpty(codeDicList)){ + codeDicList = codeProtocolTypeDicDao.getCodeDicList(); + CacheUtils.put(PROTOCOL_CODE, codeDicList); + } + for (int i = 0; i < codeDicList.size(); i++) { + CodeResult codeResult = new CodeResult(); + codeResult.setItem(codeDicList.get(i).getProtocolType()); + codeResult.setCode(codeDicList.get(i).getViewCode()); + + result.add(codeResult); + } + return result; + } else if (name.equals(SERVICE_CODE)) { + List codeDicList = (List) CacheUtils.get(SERVICE_CODE); + if(StringUtil.isEmpty(codeDicList)){ + codeDicList = codeServiceTypeDicDao.getCodeDicList(); + CacheUtils.put(SERVICE_CODE, codeDicList); + } + for (int i = 0; i < codeDicList.size(); i++) { + CodeResult codeResult = new CodeResult(); + codeResult.setItem(codeDicList.get(i).getServiceType()); + codeResult.setCode(codeDicList.get(i).getViewCode()); + + result.add(codeResult); + } + return result; + } else if (name.equals(WEB_CODE)) { + List codeDicList = (List) CacheUtils.get(WEB_CODE); + if(StringUtil.isEmpty(codeDicList)){ + codeDicList = codeWebServiceDicDao.getCodeDicList(); + CacheUtils.put(WEB_CODE, codeDicList); + } + for (int i = 0; i < codeDicList.size(); i++) { + CodeResult codeResult = new CodeResult(); + codeResult.setItem(codeDicList.get(i).getWebsite()); + codeResult.setCode(codeDicList.get(i).getViewCode()); + + result.add(codeResult); + } + return result; + } + return result; + } + public static void main(String[] args) { + getCodeList(APP_CODE); + } + +} diff --git a/src/main/java/com/nis/util/ConfigServiceUtil.java b/src/main/java/com/nis/util/ConfigServiceUtil.java index 79c81db9a..a491d7976 100644 --- a/src/main/java/com/nis/util/ConfigServiceUtil.java +++ b/src/main/java/com/nis/util/ConfigServiceUtil.java @@ -17,9 +17,9 @@ import org.slf4j.LoggerFactory; import com.google.common.reflect.TypeToken; import com.google.gson.Gson; -import com.nis.domain.log.ReportLog; -import com.nis.domain.log.ReportResultLog; import com.nis.domain.maat.ToMaatResult; +import com.nis.domain.report.LogReport; +import com.nis.domain.report.ReportResult; import com.nis.exceptions.MaatConvertException; import com.nis.util.httpclient.ClientUtil; @@ -309,12 +309,12 @@ public class ConfigServiceUtil { * @exception * @since 1.0.0 */ - public static ReportResultLog getReport(int type,String ids,String serviceIds,String searchReportStartTime,String searchReportEndTime) throws MaatConvertException{ + public static ReportResult getReport(int type,String ids,String serviceIds,String searchReportStartTime,String searchReportEndTime) throws MaatConvertException{ if(StringUtils.isBlank(ids)||StringUtils.isBlank(serviceIds)){ throw new MaatConvertException(""); } String result = null; - ReportResultLog bean = null; + ReportResult bean = null; StringBuffer url=new StringBuffer(Constants.SERVICE_URL+Constants.NTC_PZ_REPORT+"?"); url.append("searchBusinessType=").append(type) .append("&searchService=").append(serviceIds).append("&searchCfgId=").append(ids); @@ -331,7 +331,7 @@ public class ConfigServiceUtil { if( response.getStatus() == 200){ result= response.readEntity(String.class); Gson gson=Constants.gsonbuilder.create(); - bean = gson.fromJson(result, new TypeToken>(){ + bean = gson.fromJson(result, new TypeToken>(){ private static final long serialVersionUID = 7963055764864141968L;}.getType()); }else{ throw new MaatConvertException(":"+response.readEntity(String.class)); diff --git a/src/main/java/com/nis/util/Constants.java b/src/main/java/com/nis/util/Constants.java index 104cffacb..56464ba8b 100644 --- a/src/main/java/com/nis/util/Constants.java +++ b/src/main/java/com/nis/util/Constants.java @@ -7,6 +7,16 @@ import java.util.Map; import com.google.gson.GsonBuilder; public final class Constants { + /** + * 报表去重连接符 + */ + public static final String REPORT_TRIM_CONNECTOR="_;_"; + /** + * 报表类型 + */ + public static final int REPORT_TYPE_HOUR=1; + public static final int REPORT_TYPE_DAY=2; + public static final int REPORT_TYPE_MONTH=3; /** * 配置审核下发的类型 maat类型 */ @@ -419,4 +429,19 @@ public final class Constants { public static final String DIGEST_FILE_TYPE = Configurations.getStringProperty("digest_file_type",""); public static final long DIGEST_SINGLE_FILE_MAX_SIZE = Configurations.getLongProperty("digest_single_file_max_size",10485760l);//10M public static final long DIGEST_TOTAL_FILE_MAX_SIZE = Configurations.getLongProperty("digest_total_file_max_size",52428800l);//50M + + //YSP文件特征配置相关参数,用于调用外部程序生成特征文件时使用 + public static final String AV_FILE_PATH = Configurations.getStringProperty("av_file_path", "/home/ysp/"); + public static final String AV_SAMPLE_AUDIO_REGION = Configurations.getStringProperty("av_sample_audio_region", "av_sample_audio"); + public static final String AV_SAMPLE_VEDIO_REGION = Configurations.getStringProperty("av_sample_vedio_region", "av_sample_vedio"); + public static final String AV_SAMPLE_PITURE_REGION = Configurations.getStringProperty("av_sample_pitrue_region", "av_sample_pitrue"); + public static final String AV_SAMPLE_VOIP_REGION = Configurations.getStringProperty("av_sample_voip_region", "av_sample_voip"); + public static final String AUDIO_SAMPLE_CREATE_PROC = Configurations.getStringProperty("audio_sample_create_proc", "./audio_convert_proc"); + public static final String VEDIO_SAMPLE_CREATE_PROC = Configurations.getStringProperty("vedio_sample_create_proc", "./vedio_convert_proc"); + public static final String PICTURE_SAMPLE_CREATE_PROC = Configurations.getStringProperty("picture_sample_create_proc", "./picture_convert_proc"); + //HTTP自定义域相关参数 + public static String HTTP_HEADER_USER_REGION_KEY=Configurations.getStringProperty("http_header_user_region_key", "HTTP_HEADER"); + public static String HTTP_HEADER_DICT_MODULE=Configurations.getStringProperty("http_header_dict_module", "REQUEST_HEADER_DISTRICT"); + //DNS自定义域参数 + public static String DNS_STRATEGY_USER_REGION_KEY=Configurations.getStringProperty("dns_strategy_user_region_key", "DNS_STRATEGY"); } diff --git a/src/main/java/com/nis/util/DateUtils.java b/src/main/java/com/nis/util/DateUtils.java index 0a331f4ba..011f1dd0a 100644 --- a/src/main/java/com/nis/util/DateUtils.java +++ b/src/main/java/com/nis/util/DateUtils.java @@ -243,6 +243,89 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils { SimpleDateFormat sdf = new SimpleDateFormat(format); return sdf.parse(date); } + /** + * + * isLeapYear(计算是否为闰年) + * (这里描述这个方法适用条件 – 可选) + * @param years + * @return + *boolean + * @exception + * @since 1.0.0 + */ + public static boolean isLeapYear(int years){ + Calendar calendar=Calendar.getInstance(); + calendar.set(years,Calendar.DECEMBER,31); + if(calendar.get(Calendar.DAY_OF_YEAR)==366){ + return true; + } + return false; + } + /** + * + * setLastDayOfMonth(设置天为月末最后一天) + * (这里描述这个方法适用条件 – 可选) + * @param cal + *void + * @exception + * @since 1.0.0 + */ + public static void setLastDayOfMonth(Calendar cal){ + switch(cal.get(Calendar.MONTH)){ + case 0:{ + cal.set(Calendar.DAY_OF_MONTH, 31); + break; + } + case 1:{ + if(DateUtils.isLeapYear(cal.get(Calendar.YEAR))){ + cal.set(Calendar.DAY_OF_MONTH, 29); + }else{ + cal.set(Calendar.DAY_OF_MONTH, 28); + } + break; + } + case 2:{ + cal.set(Calendar.DAY_OF_MONTH, 31); + break; + } + case 3:{ + cal.set(Calendar.DAY_OF_MONTH, 30); + break; + } + case 4:{ + cal.set(Calendar.DAY_OF_MONTH, 31); + break; + } + case 5:{ + cal.set(Calendar.DAY_OF_MONTH, 30); + break; + } + case 6:{ + cal.set(Calendar.DAY_OF_MONTH, 31); + break; + } + case 7:{ + cal.set(Calendar.DAY_OF_MONTH, 31); + break; + } + case 8:{ + cal.set(Calendar.DAY_OF_MONTH, 30); + break; + } + case 9:{ + cal.set(Calendar.DAY_OF_MONTH, 31); + break; + } + case 10:{ + cal.set(Calendar.DAY_OF_MONTH, 30); + break; + } + case 11:{ + cal.set(Calendar.DAY_OF_MONTH, 31); + break; + } + } + } /** * @param args * @throws ParseException diff --git a/src/main/java/com/nis/util/httpclient/HttpClientUtil.java b/src/main/java/com/nis/util/httpclient/HttpClientUtil.java index b27d47323..2f9dd8f2a 100644 --- a/src/main/java/com/nis/util/httpclient/HttpClientUtil.java +++ b/src/main/java/com/nis/util/httpclient/HttpClientUtil.java @@ -10,6 +10,7 @@ package com.nis.util.httpclient; import java.io.IOException; import java.net.SocketTimeoutException; +import java.net.URI; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -137,7 +138,9 @@ public class HttpClientUtil { } HttpGet request = new HttpGet(uriBuilder.build()); request.setConfig(requestConfig); - + URI uri = request.getURI(); + logger.info(uri); + System.err.println(uri); response = getHttpClient().execute(request); int status = response.getStatusLine().getStatusCode(); if (status == HttpStatus.SC_OK) { diff --git a/src/main/java/com/nis/web/controller/BaseController.java b/src/main/java/com/nis/web/controller/BaseController.java index 359bf0282..56e7bb5df 100644 --- a/src/main/java/com/nis/web/controller/BaseController.java +++ b/src/main/java/com/nis/web/controller/BaseController.java @@ -1,7 +1,10 @@ package com.nis.web.controller; import java.beans.PropertyEditorSupport; import java.io.IOException; +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; @@ -45,6 +48,7 @@ import com.nis.exceptions.MaatConvertException; import com.nis.util.Configurations; //import com.nis.main.ConvertTool; import com.nis.util.Constants; +import com.nis.util.DateUtil; import com.nis.util.DateUtils; import com.nis.util.DictUtils; import com.nis.util.JsonMapper; @@ -331,16 +335,6 @@ public class BaseController { model.addAttribute("serviceList", serviceList); } protected void initReportCondition(Model model,SearchReport report){ - List requestInfos=requestInfoService.getAllRequestInfo(); - model.addAttribute("requestInfos", requestInfos); - List fls=serviceDictInfoService.findAllFlDict(); - model.addAttribute("fls", fls); - List xzs=serviceDictInfoService.findAllXzDict(); - model.addAttribute("xzs", xzs); - List lables=serviceDictInfoService.findAllLableDict(); - model.addAttribute("lables", lables); - List regionList = DictUtils.getFunctionRegionDictList(report.getFunctionId()); - model.addAttribute("regionList", regionList); List serviceList = DictUtils.getFunctionServiceDictList(report.getFunctionId()); model.addAttribute("serviceList", serviceList); } @@ -1001,5 +995,114 @@ public class BaseController { } return msg.toString(); } - + /** + * + * setReportSearchTime(报表查询设置开始时间与结束时间) + * (这里描述这个方法适用条件 – 可选) + * @param bean + * @throws ParseException + *void + * @exception + * @since 1.0.0 + */ + public void setReportSearchTime(SearchReport bean) throws ParseException{ + SimpleDateFormat sdf=new SimpleDateFormat(Constants.SEARCH_DATEFORMAT); + String reportTime=bean.getReportTime(); + if(StringUtils.isNotBlank(reportTime)){ + Calendar startCal=Calendar.getInstance(); + startCal.setTime(getReportTime(reportTime)); + startCal.set(Calendar.MINUTE, 0); + startCal.set(Calendar.SECOND, 0); + startCal.set(Calendar.MILLISECOND, 0); + Calendar endCal=Calendar.getInstance(); + endCal.setTime(getReportTime(reportTime)); + endCal.set(Calendar.MINUTE, 59); + endCal.set(Calendar.SECOND, 59); + endCal.set(Calendar.MILLISECOND, 0); + if(bean.getReportType()==Constants.REPORT_TYPE_HOUR){ + startCal.set(Calendar.HOUR_OF_DAY, 0); + endCal.set(Calendar.HOUR_OF_DAY, 23); + }else if(bean.getReportType()==Constants.REPORT_TYPE_DAY){ + startCal.set(Calendar.HOUR_OF_DAY, 0); + startCal.set(Calendar.DAY_OF_MONTH, 1); + endCal.set(Calendar.HOUR_OF_DAY, 23); + DateUtils.setLastDayOfMonth(endCal); + }else if(bean.getReportType()==Constants.REPORT_TYPE_MONTH){ + startCal.set(Calendar.HOUR_OF_DAY, 0); + startCal.set(Calendar.DAY_OF_MONTH, 1); + startCal.set(Calendar.MONTH, 0); + endCal.set(Calendar.HOUR_OF_DAY, 23); + DateUtils.setLastDayOfMonth(endCal); + endCal.set(Calendar.MONTH, 11); + } + bean.setReportStartTime(startCal.getTime()); + bean.setReportEndTime(endCal.getTime()); + bean.setSearchReportStartTime(sdf.format(startCal.getTime())); + bean.setSearchReportEndTime(sdf.format(endCal.getTime())); + }else{ + Date date=new Date(); + bean.setReportEndTime(date); + bean.setSearchReportEndTime(sdf.format(date)); + Calendar startCal=Calendar.getInstance(); + startCal.setTime(date); + startCal.set(Calendar.MINUTE, 0); + startCal.set(Calendar.SECOND, 0); + startCal.set(Calendar.MILLISECOND, 0); + if(bean.getReportType()==Constants.REPORT_TYPE_HOUR){ + startCal.set(Calendar.HOUR_OF_DAY, 0); + }else if(bean.getReportType()==Constants.REPORT_TYPE_DAY){ + startCal.set(Calendar.HOUR_OF_DAY, 0); + startCal.set(Calendar.DAY_OF_MONTH, 1); + }else if(bean.getReportType()==Constants.REPORT_TYPE_MONTH){ + startCal.set(Calendar.HOUR_OF_DAY, 0); + startCal.set(Calendar.DAY_OF_MONTH, 1); + startCal.set(Calendar.MONTH, 0); + } + bean.setReportStartTime(startCal.getTime()); + bean.setSearchReportStartTime(sdf.format(startCal.getTime())); + + } + logger.info("search start time "+bean.getSearchReportStartTime()); + logger.info("search end time "+bean.getSearchReportEndTime()); + } + public List getDateTitiles(SearchReport bean){ + SimpleDateFormat sdf=new SimpleDateFormat(Constants.SEARCH_DATEFORMAT); + List titles=new ArrayList(); + Calendar cal=Calendar.getInstance(); + cal.setTime(bean.getReportStartTime()); + while(cal.getTimeInMillis() ajaxGetLogTotal(Model model,long endTime,int action,Integer functionId,Integer compileId){ Map data=new HashMap(); - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + SimpleDateFormat sdf=new SimpleDateFormat(Constants.SEARCH_DATEFORMAT); int interval=Constants.LOG_TIME_RANGE; Date endDate=new Date(endTime); Date startDate=new Date(endTime-interval); diff --git a/src/main/java/com/nis/web/controller/report/NtcDestIpReportController.java b/src/main/java/com/nis/web/controller/report/NtcDestIpReportController.java new file mode 100644 index 000000000..9474a0d6d --- /dev/null +++ b/src/main/java/com/nis/web/controller/report/NtcDestIpReportController.java @@ -0,0 +1,88 @@ +package com.nis.web.controller.report; + +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Collections; +import java.util.Date; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; + +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.ModelAttribute; +import org.springframework.web.bind.annotation.RequestMapping; + +import com.nis.domain.FunctionServiceDict; +import com.nis.domain.Page; +import com.nis.domain.basics.ServiceDictInfo; +import com.nis.domain.log.SearchReport; +import com.nis.domain.report.NtcTagReport; +import com.nis.domain.report.ReportResult; +import com.nis.util.Constants; +import com.nis.util.DictUtils; +import com.nis.web.controller.BaseController; + +@Controller +@RequestMapping("${adminPath}/report") +public class NtcDestIpReportController extends BaseController { + @RequestMapping("/ajaxNtcDestIpReport") + public String list(@ModelAttribute("bean") SearchReport bean,Model model, HttpServletRequest request, HttpServletResponse response) { + + List serviceList = DictUtils.getFunctionServiceDictList(bean.getFunctionId()); + + if(bean.getAction()!=null){ + for(FunctionServiceDict service:serviceList){ + if(service.getAction().intValue()==bean.getAction().intValue()){ + bean.setSearchService(service.getServiceId().toString()); + } + } + }else{ + StringBuffer serviceId=new StringBuffer(); + for(int i=0;i titles=this.getDateTitiles(bean); + model.addAttribute("titles", titles); + + HashMap> showData=new LinkedHashMap<>();//构造数据展示集合 + List line= new ArrayList(); + long total=0l; + for(String title:titles){ + line.add(10000l); + total+=10000l; + } + List _line= new ArrayList(); + _line.add(total); + _line.addAll(line); + for (int i = 0; i < 20; i++) { + showData.put("巴西"+i, _line); + } + + model.addAttribute("datas", showData); + return "/report/destIp"; + } +} diff --git a/src/main/java/com/nis/web/controller/report/NtcEntranceReportController.java b/src/main/java/com/nis/web/controller/report/NtcEntranceReportController.java new file mode 100644 index 000000000..d77f52e2b --- /dev/null +++ b/src/main/java/com/nis/web/controller/report/NtcEntranceReportController.java @@ -0,0 +1,88 @@ +package com.nis.web.controller.report; + +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Collections; +import java.util.Date; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; + +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.ModelAttribute; +import org.springframework.web.bind.annotation.RequestMapping; + +import com.nis.domain.FunctionServiceDict; +import com.nis.domain.Page; +import com.nis.domain.basics.ServiceDictInfo; +import com.nis.domain.log.SearchReport; +import com.nis.domain.report.NtcTagReport; +import com.nis.domain.report.ReportResult; +import com.nis.util.Constants; +import com.nis.util.DictUtils; +import com.nis.web.controller.BaseController; + +@Controller +@RequestMapping("${adminPath}/report") +public class NtcEntranceReportController extends BaseController { + @RequestMapping("/ajaxNtcIspReport") + public String list(@ModelAttribute("bean") SearchReport bean,Model model, HttpServletRequest request, HttpServletResponse response) { + + List serviceList = DictUtils.getFunctionServiceDictList(bean.getFunctionId()); + + if(bean.getAction()!=null){ + for(FunctionServiceDict service:serviceList){ + if(service.getAction().intValue()==bean.getAction().intValue()){ + bean.setSearchService(service.getServiceId().toString()); + } + } + }else{ + StringBuffer serviceId=new StringBuffer(); + for(int i=0;i titles=this.getDateTitiles(bean); + model.addAttribute("titles", titles); + + HashMap> showData=new LinkedHashMap<>();//构造数据展示集合 + List line= new ArrayList(); + long total=0l; + for(String title:titles){ + line.add(10000l); + total+=10000l; + } + List _line= new ArrayList(); + _line.add(total); + _line.addAll(line); + for (int i = 0; i < 20; i++) { + showData.put(""+i, _line); + } + + model.addAttribute("datas", showData); + return "/report/entranceId"; + } +} diff --git a/src/main/java/com/nis/web/controller/report/NtcLwhhReportController.java b/src/main/java/com/nis/web/controller/report/NtcLwhhReportController.java new file mode 100644 index 000000000..1721ef8e9 --- /dev/null +++ b/src/main/java/com/nis/web/controller/report/NtcLwhhReportController.java @@ -0,0 +1,132 @@ +package com.nis.web.controller.report; + +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.LinkedHashMap; +import java.util.List; + +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.ModelAttribute; +import org.springframework.web.bind.annotation.RequestMapping; + +import com.nis.domain.FunctionServiceDict; +import com.nis.domain.Page; +import com.nis.domain.basics.ServiceDictInfo; +import com.nis.domain.configuration.RequestInfo; +import com.nis.domain.log.SearchReport; +import com.nis.domain.report.NtcLwhhReport; +import com.nis.domain.report.ReportResult; +import com.nis.util.Constants; +import com.nis.util.DictUtils; +import com.nis.web.controller.BaseController; + +@Controller +@RequestMapping("${adminPath}/report") +public class NtcLwhhReportController extends BaseController { + @RequestMapping("/ajaxNtcLwhhReport") + public String list(@ModelAttribute("bean") SearchReport bean,Model model, HttpServletRequest request, HttpServletResponse response) { + List serviceList = DictUtils.getFunctionServiceDictList(bean.getFunctionId()); + List requestInfos=requestInfoService.getAllRequestInfo(); + model.addAttribute("requestInfos", requestInfos); + if(bean.getAction()!=null){ + for(FunctionServiceDict service:serviceList){ + if(service.getAction().intValue()==bean.getAction().intValue()){ + bean.setSearchService(service.getServiceId().toString()); + } + } + }else{ + StringBuffer serviceId=new StringBuffer(); + for(int i=0;i result=new ReportResult<>(); + StringBuffer url=new StringBuffer(Constants.LOG_BASE_URL+Constants.NTC_SERVICE_REPORT+"?"); + bean.setPageSize(-1); + bean.setFields("lwhh,sum,reportTime"); + try { + this.setReportSearchTime(bean); + } catch (ParseException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + List titles=this.getDateTitiles(bean); + model.addAttribute("titles", titles); +// try { +// result=result.getReport(url.toString(), bean); +// Page page=result.getData(); +// List list=page.getList(); +// HashMap trimData=new HashMap<>();//数据累加去重 +// for(NtcLwhhReportLog report:list){ +// String trimStr=""; +// if(bean.getReportType()==Constants.REPORT_TYPE_HOUR){ +// trimStr=report.getLwhh().intValue()+Constants.REPORT_TRIM_CONNECTOR+ +// sdf.format(cal.getTime()).substring(0,13); +// +// }else if(bean.getReportType()==Constants.REPORT_TYPE_DAY){ +// trimStr=report.getLwhh().intValue()+Constants.REPORT_TRIM_CONNECTOR+ +// sdf.format(cal.getTime()).substring(0,10); +// +// }else if(bean.getReportType()==Constants.REPORT_TYPE_MONTH){ +// trimStr=report.getLwhh().intValue()+Constants.REPORT_TRIM_CONNECTOR+ +// sdf.format(cal.getTime()).substring(0,7); +// } +// if(trimData.containsKey(trimStr)){ +// trimData.put(trimStr, trimData.get(trimStr)+report.getSum().longValue()); +// }else{ +// trimData.put(trimStr, report.getSum().longValue()); +// } +// } +// HashMap> showData=new LinkedHashMap<>();//构造数据展示集合 +// for(RequestInfo requestInfo:requestInfos){ +// List line= new ArrayList(); +// long total=0; +// for(String title:titles){ +// if(trimData.containsKey(requestInfo.getId().longValue()+Constants.REPORT_TRIM_CONNECTOR+title)){ +// line.add(trimData.get(requestInfo.getId().longValue()+Constants.REPORT_TRIM_CONNECTOR+title)); +// total+=trimData.get(requestInfo.getId().longValue()+Constants.REPORT_TRIM_CONNECTOR+title).longValue(); +// }else{ +// line.add(0l); +// } +// } +// List _line= new ArrayList(); +// _line.add(total); +// _line.addAll(line); +// showData.put(requestInfo.getId().toString(), _line); +// } +// model.addAttribute("datas", showData); +// } catch (Exception e) { +// // TODO: handle exception +// e.printStackTrace(); +// } + HashMap> showData=new LinkedHashMap<>();//构造数据展示集合 + for(RequestInfo requestInfo:requestInfos){ + List line= new ArrayList(); + long total=0l; + for(String title:titles){ + line.add(10000l); + total+=10000l; + } + List _line= new ArrayList(); + _line.add(total); + _line.addAll(line); + showData.put(requestInfo.getId().toString(), _line); + } + model.addAttribute("datas", showData); + return "/report/lwhh"; + } +} diff --git a/src/main/java/com/nis/web/controller/report/NtcServiceReportController.java b/src/main/java/com/nis/web/controller/report/NtcServiceReportController.java new file mode 100644 index 000000000..b5eb4ff61 --- /dev/null +++ b/src/main/java/com/nis/web/controller/report/NtcServiceReportController.java @@ -0,0 +1,83 @@ +package com.nis.web.controller.report; + +import java.io.UnsupportedEncodingException; +import java.text.ParseException; +import java.util.HashMap; +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.ModelAttribute; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; + +import com.nis.domain.FunctionServiceDict; +import com.nis.domain.Page; +import com.nis.domain.log.SearchReport; +import com.nis.domain.report.NtcServiceReport; +import com.nis.domain.report.ReportResult; +import com.nis.exceptions.MaatConvertException; +import com.nis.util.Constants; +import com.nis.util.DictUtils; +import com.nis.web.controller.BaseController; + +@Controller +@RequestMapping("${adminPath}/report") +public class NtcServiceReportController extends BaseController { + @RequestMapping("/ajaxNtcServiceReport") + @ResponseBody + public Map report(@ModelAttribute("bean") SearchReport bean,Model model, HttpServletRequest request, HttpServletResponse response) { + Map data=new HashMap<>(); + List serviceList = DictUtils.getFunctionServiceDictList(bean.getFunctionId()); + if(bean.getAction()!=null){ + for(FunctionServiceDict service:serviceList){ + if(service.getAction().intValue()==bean.getAction().intValue()){ + bean.setSearchService(service.getServiceId().toString()); + } + } + }else{ + StringBuffer serviceId=new StringBuffer(); + for(int i=0;i result=new ReportResult<>(); + StringBuffer url=new StringBuffer(Constants.LOG_BASE_URL+Constants.NTC_SERVICE_REPORT+"?"); +// try { +// result=result.getReport(url.toString(), bean); +// Page page=result.getData(); +// List data=page.getList(); +// for(NtcServiceReport report:data){ +// if(datas.containsKey(report.getService().toString())){ +// data.put(report.getService().toString(), datas.get(report.getService().toString())+report.getSum().longValue()); +// }else{ +// data.put(report.getService().toString(),report.getSum().longValue()); +// } +// } +// } catch (Exception e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } + if(bean.getAction()!=null){ + data.put(bean.getAction().toString(), 66666666l); + } + return data; + } +} diff --git a/src/main/java/com/nis/web/controller/report/NtcSrcipDomesticReportController.java b/src/main/java/com/nis/web/controller/report/NtcSrcipDomesticReportController.java new file mode 100644 index 000000000..7ed1ceebb --- /dev/null +++ b/src/main/java/com/nis/web/controller/report/NtcSrcipDomesticReportController.java @@ -0,0 +1,138 @@ +package com.nis.web.controller.report; + +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.LinkedHashMap; +import java.util.List; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.commons.lang3.StringUtils; +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 com.nis.domain.FunctionServiceDict; +import com.nis.domain.Page; +import com.nis.domain.basics.ServiceDictInfo; +import com.nis.domain.log.SearchReport; +import com.nis.domain.report.NtcSrcipDomesticReport; +import com.nis.domain.report.ReportResult; +import com.nis.util.Constants; +import com.nis.util.DictUtils; +import com.nis.web.controller.BaseController; + +@Controller +@RequestMapping("${adminPath}/report") +public class NtcSrcipDomesticReportController extends BaseController { + @RequestMapping("/ajaxNtcSrcipDomesticReport") + public String list(@ModelAttribute("bean") SearchReport bean,Model model, HttpServletRequest request, HttpServletResponse response) { + List serviceList = DictUtils.getFunctionServiceDictList(bean.getFunctionId()); + if(bean.getAction()!=null){ + for(FunctionServiceDict service:serviceList){ + if(service.getAction().intValue()==bean.getAction().intValue()){ + bean.setSearchService(service.getServiceId().toString()); + } + } + }else{ + StringBuffer serviceId=new StringBuffer(); + for(int i=0;i result=new ReportResult<>(); + StringBuffer url=new StringBuffer(Constants.LOG_BASE_URL+Constants.NTC_SERVICE_REPORT+"?"); + bean.setPageSize(-1); + bean.setFields("srcProvince,srcCity,sum,reportTime"); + try { + this.setReportSearchTime(bean); + } catch (ParseException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + List titles=this.getDateTitiles(bean); + model.addAttribute("titles", titles); +// try { +// result=result.getReport(url.toString(), bean); +// Page page=result.getData(); +// List list=page.getList(); +// HashMap trimData=new HashMap<>();//数据累加去重 +// for(NtcSrcipDomesticReport report:list){ +// String trimStr=""; +// if(bean.getReportType()==Constants.REPORT_TYPE_HOUR){ +// trimStr=report.getSrcProvince()+Constants.REPORT_TRIM_CONNECTOR+ +// report.getSrcCity()+Constants.REPORT_TRIM_CONNECTOR+ +// sdf.format(cal.getTime()).substring(0,13); +// +// }else if(bean.getReportType()==Constants.REPORT_TYPE_DAY){ +// trimStr=report.getSrcProvince()+Constants.REPORT_TRIM_CONNECTOR+ +// report.getSrcCity()+Constants.REPORT_TRIM_CONNECTOR+ +// sdf.format(cal.getTime()).substring(0,10); +// +// }else if(bean.getReportType()==Constants.REPORT_TYPE_MONTH){ +// trimStr=report.getSrcProvince()+Constants.REPORT_TRIM_CONNECTOR+ +// report.getSrcCity()+Constants.REPORT_TRIM_CONNECTOR+ +// sdf.format(cal.getTime()).substring(0,7); +// } +// if(trimData.containsKey(trimStr)){ +// trimData.put(trimStr, trimData.get(trimStr)+report.getSum().longValue()); +// }else{ +// trimData.put(trimStr, report.getSum().longValue()); +// } +// } +// HashMap> showData=new HashMap<>();//构造数据展示集合 +// +// for(String key:trimData.keySet()){ +// List line= new ArrayList(); +// long total=0; +// String[] keyArr=key.split(Constants.REPORT_TRIM_CONNECTOR); +// String location=keyArr[0]+Constants.REPORT_TRIM_CONNECTOR+keyArr[1]; +// for(String title:titles){ +// if(trimData.containsKey(location+Constants.REPORT_TRIM_CONNECTOR+title)){ +// line.add(trimData.get(location+Constants.REPORT_TRIM_CONNECTOR+title)); +// total+=trimData.get(location+Constants.REPORT_TRIM_CONNECTOR+title).longValue(); +// }else{ +// line.add(0l); +// } +// } +// List _line= new ArrayList(); +// _line.add(total); +// _line.addAll(line); +// showData.put(location, _line); +// } +// model.addAttribute("datas", showData); +// } catch (Exception e) { +// // TODO: handle exception +// e.printStackTrace(); +// } + HashMap> showData=new LinkedHashMap<>();//构造数据展示集合 + long total=0; + List line= new ArrayList(); + for(String title:titles){ + line.add(10000l); + total+=10000l; + } + List _line= new ArrayList(); + _line.add(total); + _line.addAll(line); + for(int i=0;i<1000;i++){ + showData.put("河北"+Constants.REPORT_TRIM_CONNECTOR+"廊坊"+i, _line); + } + model.addAttribute("splitor", Constants.REPORT_TRIM_CONNECTOR); + model.addAttribute("datas", showData); + return "/report/srcIp"; + } +} diff --git a/src/main/java/com/nis/web/controller/report/NtcTagReportController.java b/src/main/java/com/nis/web/controller/report/NtcTagReportController.java new file mode 100644 index 000000000..d31d973c2 --- /dev/null +++ b/src/main/java/com/nis/web/controller/report/NtcTagReportController.java @@ -0,0 +1,130 @@ +package com.nis.web.controller.report; + +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.LinkedHashMap; +import java.util.List; + +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.ModelAttribute; +import org.springframework.web.bind.annotation.RequestMapping; + +import com.nis.domain.FunctionServiceDict; +import com.nis.domain.basics.ServiceDictInfo; +import com.nis.domain.log.SearchReport; +import com.nis.domain.report.NtcTagReport; +import com.nis.domain.report.ReportResult; +import com.nis.util.Constants; +import com.nis.util.DictUtils; +import com.nis.web.controller.BaseController; + +@Controller +@RequestMapping("${adminPath}/report") +public class NtcTagReportController extends BaseController { + @RequestMapping("/ajaxNtcTagReport") + public String list(@ModelAttribute("bean") SearchReport bean,Model model, HttpServletRequest request, HttpServletResponse response) { + List serviceList = DictUtils.getFunctionServiceDictList(bean.getFunctionId()); + List labels=serviceDictInfoService.findAllLableDict(); + model.addAttribute("labels", labels); + if(bean.getAction()!=null){ + for(FunctionServiceDict service:serviceList){ + if(service.getAction().intValue()==bean.getAction().intValue()){ + bean.setSearchService(service.getServiceId().toString()); + } + } + }else{ + StringBuffer serviceId=new StringBuffer(); + for(int i=0;i result=new ReportResult<>(); + StringBuffer url=new StringBuffer(Constants.LOG_BASE_URL+Constants.NTC_SERVICE_REPORT+"?"); + bean.setPageSize(-1); + bean.setFields("tag,sum,reportTime"); + try { + this.setReportSearchTime(bean); + } catch (ParseException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + List titles=this.getDateTitiles(bean); + model.addAttribute("titles", titles); +// try { +// result=result.getReport(url.toString(), bean); +// Page page=result.getData(); +// List list=page.getList(); +// HashMap trimData=new HashMap<>();//数据累加去重 +// for(NtcTagReportLog report:list){ +// String trimStr=""; +// if(bean.getReportType()==Constants.REPORT_TYPE_HOUR){ +// trimStr=report.getTag().intValue()+Constants.REPORT_TRIM_CONNECTOR+ +// sdf.format(cal.getTime()).substring(0,13); +// +// }else if(bean.getReportType()==Constants.REPORT_TYPE_DAY){ +// trimStr=report.getTag().intValue()+Constants.REPORT_TRIM_CONNECTOR+ +// sdf.format(cal.getTime()).substring(0,10); +// +// }else if(bean.getReportType()==Constants.REPORT_TYPE_MONTH){ +// trimStr=report.getTag().intValue()+Constants.REPORT_TRIM_CONNECTOR+ +// sdf.format(cal.getTime()).substring(0,7); +// } +// if(trimData.containsKey(trimStr)){ +// trimData.put(trimStr, trimData.get(trimStr)+report.getSum().longValue()); +// }else{ +// trimData.put(trimStr, report.getSum().longValue()); +// } +// } +// HashMap> showData=new LinkedHashMap<>();//构造数据展示集合 +// for(ServiceDictInfo label:lables){ +// List line= new ArrayList(); +// long total=0; +// for(String title:titles){ +// if(trimData.containsKey(label.getServiceDictId().intValue()+Constants.REPORT_TRIM_CONNECTOR+title)){ +// line.add(trimData.get(label.getServiceDictId().intValue()+Constants.REPORT_TRIM_CONNECTOR+title)); +// total+=trimData.get(label.getServiceDictId().intValue()+Constants.REPORT_TRIM_CONNECTOR+title).longValue(); +// }else{ +// line.add(0l); +// } +// } +// List _line= new ArrayList(); +// _line.add(total); +// _line.addAll(line); +// showData.put(label.getServiceDictId().toString(), _line); +// } +// model.addAttribute("datas", showData); +// } catch (Exception e) { +// // TODO: handle exception +// e.printStackTrace(); +// } + HashMap> showData=new LinkedHashMap<>();//构造数据展示集合 + for(ServiceDictInfo label:labels){ + List line= new ArrayList(); + long total=0l; + for(String title:titles){ + line.add(10000l); + total+=10000l; + } + List _line= new ArrayList(); + _line.add(total); + _line.addAll(line); + showData.put(label.getServiceDictId().toString(), _line); + } + model.addAttribute("datas", showData); + return "/report/label"; + } +} diff --git a/src/main/java/com/nis/web/controller/report/NtcXzReportController.java b/src/main/java/com/nis/web/controller/report/NtcXzReportController.java new file mode 100644 index 000000000..9e8fbc9fe --- /dev/null +++ b/src/main/java/com/nis/web/controller/report/NtcXzReportController.java @@ -0,0 +1,87 @@ +package com.nis.web.controller.report; + +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Collections; +import java.util.Date; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; + +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.ModelAttribute; +import org.springframework.web.bind.annotation.RequestMapping; + +import com.nis.domain.FunctionServiceDict; +import com.nis.domain.Page; +import com.nis.domain.basics.ServiceDictInfo; +import com.nis.domain.log.SearchReport; +import com.nis.domain.report.NtcTagReport; +import com.nis.domain.report.ReportResult; +import com.nis.util.Constants; +import com.nis.util.DictUtils; +import com.nis.web.controller.BaseController; + +@Controller +@RequestMapping("${adminPath}/report") +public class NtcXzReportController extends BaseController { + @RequestMapping("/ajaxNtcXzReport") + public String list(@ModelAttribute("bean") SearchReport bean,Model model, HttpServletRequest request, HttpServletResponse response) { + List serviceList = DictUtils.getFunctionServiceDictList(bean.getFunctionId()); + List xzs=serviceDictInfoService.findAllXzDict(); + model.addAttribute("xzs", xzs); + if(bean.getAction()!=null){ + for(FunctionServiceDict service:serviceList){ + if(service.getAction().intValue()==bean.getAction().intValue()){ + bean.setSearchService(service.getServiceId().toString()); + } + } + }else{ + StringBuffer serviceId=new StringBuffer(); + for(int i=0;i titles=this.getDateTitiles(bean); + model.addAttribute("titles", titles); + + HashMap> showData=new LinkedHashMap<>();//构造数据展示集合 + for(ServiceDictInfo xz:xzs){ + List line= new ArrayList(); + long total=0l; + for(String title:titles){ + line.add(10000l); + total+=10000l; + } + List _line= new ArrayList(); + _line.add(total); + _line.addAll(line); + showData.put(xz.getServiceDictId().toString(), _line); + } + model.addAttribute("datas", showData); + return "/report/attrType"; + } +} diff --git a/src/main/java/com/nis/web/controller/report/TestBean.java b/src/main/java/com/nis/web/controller/report/TestBean.java index 740735fbc..70362d306 100644 --- a/src/main/java/com/nis/web/controller/report/TestBean.java +++ b/src/main/java/com/nis/web/controller/report/TestBean.java @@ -8,7 +8,7 @@ */ package com.nis.web.controller.report; -import com.nis.domain.log.BaseReportLog; +import com.nis.domain.report.BaseReport; /** * @ClassName: TestBean.java @@ -17,7 +17,7 @@ import com.nis.domain.log.BaseReportLog; * @date 2018年7月6日 上午9:20:48 * @version V1.0 */ -public class TestBean extends BaseReportLog { +public class TestBean extends BaseReport { /** * @Fields serialVersionUID:TODO(用一句话描述这个变量表示什么) diff --git a/src/main/java/com/nis/web/dao/dashboard/codedic/CodeAppDicDao.java b/src/main/java/com/nis/web/dao/dashboard/codedic/CodeAppDicDao.java new file mode 100644 index 000000000..a3fe0fa5c --- /dev/null +++ b/src/main/java/com/nis/web/dao/dashboard/codedic/CodeAppDicDao.java @@ -0,0 +1,11 @@ +package com.nis.web.dao.dashboard.codedic; + +import java.util.List; + +import com.nis.domain.dashboard.codedic.CodeAppDic; +import com.nis.web.dao.MyBatisDao; + +@MyBatisDao +public interface CodeAppDicDao { + List getCodeDicList(); +} \ No newline at end of file diff --git a/src/main/java/com/nis/web/dao/dashboard/codedic/CodeAppDicDao.xml b/src/main/java/com/nis/web/dao/dashboard/codedic/CodeAppDicDao.xml new file mode 100644 index 000000000..df9fa7084 --- /dev/null +++ b/src/main/java/com/nis/web/dao/dashboard/codedic/CodeAppDicDao.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + id, app_name, app_name_zh, view_code, icon, behavior, core_app + + + \ No newline at end of file diff --git a/src/main/java/com/nis/web/dao/dashboard/codedic/CodeBehaviorTypeDicDao.java b/src/main/java/com/nis/web/dao/dashboard/codedic/CodeBehaviorTypeDicDao.java new file mode 100644 index 000000000..53ba289f4 --- /dev/null +++ b/src/main/java/com/nis/web/dao/dashboard/codedic/CodeBehaviorTypeDicDao.java @@ -0,0 +1,12 @@ +package com.nis.web.dao.dashboard.codedic; + +import java.util.List; + +import com.nis.domain.dashboard.codedic.CodeBehaviorTypeDic; +import com.nis.web.dao.MyBatisDao; + +@MyBatisDao +public interface CodeBehaviorTypeDicDao { + List getCodeDicList(); + +} \ No newline at end of file diff --git a/src/main/java/com/nis/web/dao/dashboard/codedic/CodeBehaviorTypeDicDao.xml b/src/main/java/com/nis/web/dao/dashboard/codedic/CodeBehaviorTypeDicDao.xml new file mode 100644 index 000000000..4ba5e221a --- /dev/null +++ b/src/main/java/com/nis/web/dao/dashboard/codedic/CodeBehaviorTypeDicDao.xml @@ -0,0 +1,17 @@ + + + + + + + + + + id, behavior_type, view_code + + + \ No newline at end of file diff --git a/src/main/java/com/nis/web/dao/dashboard/codedic/CodeBrowserTypeDicDao.java b/src/main/java/com/nis/web/dao/dashboard/codedic/CodeBrowserTypeDicDao.java new file mode 100644 index 000000000..74de6a0ed --- /dev/null +++ b/src/main/java/com/nis/web/dao/dashboard/codedic/CodeBrowserTypeDicDao.java @@ -0,0 +1,12 @@ +package com.nis.web.dao.dashboard.codedic; + +import java.util.List; + +import com.nis.domain.dashboard.codedic.CodeBrowserTypeDic; +import com.nis.web.dao.MyBatisDao; + +@MyBatisDao +public interface CodeBrowserTypeDicDao { + List getCodeDicList(); + +} \ No newline at end of file diff --git a/src/main/java/com/nis/web/dao/dashboard/codedic/CodeBrowserTypeDicDao.xml b/src/main/java/com/nis/web/dao/dashboard/codedic/CodeBrowserTypeDicDao.xml new file mode 100644 index 000000000..123fd815a --- /dev/null +++ b/src/main/java/com/nis/web/dao/dashboard/codedic/CodeBrowserTypeDicDao.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + id, browser_type, view_code, icon + + + \ No newline at end of file diff --git a/src/main/java/com/nis/web/dao/dashboard/codedic/CodeOsTypeDicDao.java b/src/main/java/com/nis/web/dao/dashboard/codedic/CodeOsTypeDicDao.java new file mode 100644 index 000000000..cca4a3d2f --- /dev/null +++ b/src/main/java/com/nis/web/dao/dashboard/codedic/CodeOsTypeDicDao.java @@ -0,0 +1,12 @@ +package com.nis.web.dao.dashboard.codedic; + +import java.util.List; + +import com.nis.domain.dashboard.codedic.CodeOsTypeDic; +import com.nis.web.dao.MyBatisDao; + +@MyBatisDao +public interface CodeOsTypeDicDao { + List getCodeDicList(); + +} \ No newline at end of file diff --git a/src/main/java/com/nis/web/dao/dashboard/codedic/CodeOsTypeDicDao.xml b/src/main/java/com/nis/web/dao/dashboard/codedic/CodeOsTypeDicDao.xml new file mode 100644 index 000000000..39f52f586 --- /dev/null +++ b/src/main/java/com/nis/web/dao/dashboard/codedic/CodeOsTypeDicDao.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + id, os_type, view_code, icon + + + \ No newline at end of file diff --git a/src/main/java/com/nis/web/dao/dashboard/codedic/CodeProtocolTypeDicDao.java b/src/main/java/com/nis/web/dao/dashboard/codedic/CodeProtocolTypeDicDao.java new file mode 100644 index 000000000..c1aeb7465 --- /dev/null +++ b/src/main/java/com/nis/web/dao/dashboard/codedic/CodeProtocolTypeDicDao.java @@ -0,0 +1,12 @@ +package com.nis.web.dao.dashboard.codedic; + +import java.util.List; + +import com.nis.domain.dashboard.codedic.CodeProtocolTypeDic; +import com.nis.web.dao.MyBatisDao; + +@MyBatisDao +public interface CodeProtocolTypeDicDao { + List getCodeDicList(); + +} \ No newline at end of file diff --git a/src/main/java/com/nis/web/dao/dashboard/codedic/CodeProtocolTypeDicDao.xml b/src/main/java/com/nis/web/dao/dashboard/codedic/CodeProtocolTypeDicDao.xml new file mode 100644 index 000000000..149031436 --- /dev/null +++ b/src/main/java/com/nis/web/dao/dashboard/codedic/CodeProtocolTypeDicDao.xml @@ -0,0 +1,17 @@ + + + + + + + + + + id, protocol_type, view_code + + + \ No newline at end of file diff --git a/src/main/java/com/nis/web/dao/dashboard/codedic/CodeResult.java b/src/main/java/com/nis/web/dao/dashboard/codedic/CodeResult.java new file mode 100644 index 000000000..00e948b0e --- /dev/null +++ b/src/main/java/com/nis/web/dao/dashboard/codedic/CodeResult.java @@ -0,0 +1,29 @@ +package com.nis.web.dao.dashboard.codedic; + +public class CodeResult { + + private String item; + private String code; + private Integer coreApp; + + public String getItem() { + return item; + } + public void setItem(String item) { + this.item = item; + } + public String getCode() { + return code; + } + public void setCode(String code) { + this.code = code; + } + public Integer getCoreApp() { + return coreApp; + } + public void setCoreApp(Integer coreApp) { + this.coreApp = coreApp; + } + + +} diff --git a/src/main/java/com/nis/web/dao/dashboard/codedic/CodeServiceTypeDicDao.java b/src/main/java/com/nis/web/dao/dashboard/codedic/CodeServiceTypeDicDao.java new file mode 100644 index 000000000..6efb3782c --- /dev/null +++ b/src/main/java/com/nis/web/dao/dashboard/codedic/CodeServiceTypeDicDao.java @@ -0,0 +1,11 @@ +package com.nis.web.dao.dashboard.codedic; + +import java.util.List; + +import com.nis.domain.dashboard.codedic.CodeServiceTypeDic; +import com.nis.web.dao.MyBatisDao; +@MyBatisDao +public interface CodeServiceTypeDicDao { + List getCodeDicList(); + +} \ No newline at end of file diff --git a/src/main/java/com/nis/web/dao/dashboard/codedic/CodeServiceTypeDicDao.xml b/src/main/java/com/nis/web/dao/dashboard/codedic/CodeServiceTypeDicDao.xml new file mode 100644 index 000000000..61b0cfedd --- /dev/null +++ b/src/main/java/com/nis/web/dao/dashboard/codedic/CodeServiceTypeDicDao.xml @@ -0,0 +1,17 @@ + + + + + + + + + + id, service_type, view_code + + + \ No newline at end of file diff --git a/src/main/java/com/nis/web/dao/dashboard/codedic/CodeWebServiceDicDao.java b/src/main/java/com/nis/web/dao/dashboard/codedic/CodeWebServiceDicDao.java new file mode 100644 index 000000000..c50483d2c --- /dev/null +++ b/src/main/java/com/nis/web/dao/dashboard/codedic/CodeWebServiceDicDao.java @@ -0,0 +1,12 @@ +package com.nis.web.dao.dashboard.codedic; + +import java.util.List; + +import com.nis.domain.dashboard.codedic.CodeWebServiceDic; +import com.nis.web.dao.MyBatisDao; + +@MyBatisDao +public interface CodeWebServiceDicDao { + List getCodeDicList(); + +} \ No newline at end of file diff --git a/src/main/java/com/nis/web/dao/dashboard/codedic/CodeWebServiceDicDao.xml b/src/main/java/com/nis/web/dao/dashboard/codedic/CodeWebServiceDicDao.xml new file mode 100644 index 000000000..46142fb98 --- /dev/null +++ b/src/main/java/com/nis/web/dao/dashboard/codedic/CodeWebServiceDicDao.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + id, website, domain_name, view_code, icon + + + \ No newline at end of file diff --git a/src/main/java/com/nis/web/service/configuration/IpCfgService.java b/src/main/java/com/nis/web/service/configuration/IpCfgService.java index c5d520b65..e41e94697 100644 --- a/src/main/java/com/nis/web/service/configuration/IpCfgService.java +++ b/src/main/java/com/nis/web/service/configuration/IpCfgService.java @@ -310,7 +310,7 @@ public class IpCfgService extends CrudService { maatCfg.initDefaultValue(); BeanUtils.copyProperties(cfg, maatCfg); - if(cfg.getIsAudit()==1){ + if(cfg.getIsAudit()==Constants.AUDIT_YES){ maatBean.setOpAction(Constants.INSERT_ACTION); Map map = cfgConvert(ipRegionList,beans,1,cfg,groupRelationList); groupRelationList=map.get("groupList"); @@ -343,10 +343,10 @@ public class IpCfgService extends CrudService { logger.error("IP白名单配置下发失败",e); throw e; } - }else if(cfg.getIsAudit()==3){ + }else if(cfg.getIsAudit()==Constants.AUDIT_NOT_YES){ maatCfg.setCompileId(cfg.getCompileId()); maatCfg.setServiceId(cfg.getServiceId()); - maatCfg.setIsValid(0);//无效 + maatCfg.setIsValid(Constants.VALID_NO);//无效 configCompileList.add(maatCfg); maatBean.setConfigCompileList(configCompileList); maatBean.setAuditTime(cfg.getAuditTime()); diff --git a/src/main/java/com/nis/web/service/configuration/WebsiteCfgService.java b/src/main/java/com/nis/web/service/configuration/WebsiteCfgService.java index 91e2ad96e..e02d7d9c0 100644 --- a/src/main/java/com/nis/web/service/configuration/WebsiteCfgService.java +++ b/src/main/java/com/nis/web/service/configuration/WebsiteCfgService.java @@ -421,12 +421,12 @@ public class WebsiteCfgService extends CrudService { //请求头域 if(entity.getHttpReqHdrList()!=null && entity.getHttpReqHdrList().size()>0){ for(ComplexkeywordCfg head:entity.getHttpReqHdrList()){ - String dictValue = DictUtils.getDictCode("REQUEST_HEADER_DISTRICT", head.getDistrict()); + String dictValue = DictUtils.getDictCode(Constants.HTTP_HEADER_DICT_MODULE, head.getDistrict()); if(StringUtil.isEmpty(dictValue) || dictValue.equals("默认")){ if(userRegion.equals("")){ - userRegion += "HTTP_HEADER="+head.getDistrict(); + userRegion += Constants.HTTP_HEADER_USER_REGION_KEY+"="+head.getDistrict(); }else{ - userRegion += Constants.USER_REGION_SPLIT+"HTTP_HEADER="+head.getDistrict(); + userRegion += Constants.USER_REGION_SPLIT+Constants.HTTP_HEADER_USER_REGION_KEY+"="+head.getDistrict(); } } @@ -435,12 +435,12 @@ public class WebsiteCfgService extends CrudService { //应答头域 if(entity.getHttpResHdrList()!=null && entity.getHttpResHdrList().size()>0){ for(ComplexkeywordCfg head:entity.getHttpResHdrList()){ - String dictValue = DictUtils.getDictCode("RESPONSE_HEADER_DISTRICT", head.getDistrict()); + String dictValue = DictUtils.getDictCode(Constants.HTTP_HEADER_DICT_MODULE, head.getDistrict()); if(StringUtil.isEmpty(dictValue) || dictValue.equals("默认")){ if(userRegion.equals("")){ - userRegion += "HTTP_HEADER="+head.getDistrict(); + userRegion += Constants.HTTP_HEADER_USER_REGION_KEY+"="+head.getDistrict(); }else{ - userRegion += Constants.USER_REGION_SPLIT+"HTTP_HEADER="+head.getDistrict(); + userRegion += Constants.USER_REGION_SPLIT+Constants.HTTP_HEADER_USER_REGION_KEY+"="+head.getDistrict(); } } @@ -905,7 +905,7 @@ public class WebsiteCfgService extends CrudService { // dns reject userRegion=;dnsStrategyId; if(!StringUtil.isEmpty(entity.getDnsStrategyId())){ // maatCfg.setUserRegion(Constants.USER_REGION_SPLIT+entity.getDnsStrategyId()+Constants.USER_REGION_SPLIT); - maatCfg.setUserRegion("DNS_STRATEGY="+entity.getDnsStrategyId()); + maatCfg.setUserRegion(Constants.DNS_STRATEGY_USER_REGION_KEY+"="+entity.getDnsStrategyId()); } configCompileList.add(maatCfg); maatBean.setConfigCompileList(configCompileList); diff --git a/src/main/java/com/nis/web/service/log/CodeDicService.java b/src/main/java/com/nis/web/service/log/CodeDicService.java new file mode 100644 index 000000000..086c3b454 --- /dev/null +++ b/src/main/java/com/nis/web/service/log/CodeDicService.java @@ -0,0 +1,130 @@ +package com.nis.web.service.log; + +import java.util.ArrayList; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import com.nis.domain.dashboard.codedic.CodeAppDic; +import com.nis.domain.dashboard.codedic.CodeBehaviorTypeDic; +import com.nis.domain.dashboard.codedic.CodeBrowserTypeDic; +import com.nis.domain.dashboard.codedic.CodeOsTypeDic; +import com.nis.domain.dashboard.codedic.CodeProtocolTypeDic; +import com.nis.domain.dashboard.codedic.CodeServiceTypeDic; +import com.nis.domain.dashboard.codedic.CodeWebServiceDic; +import com.nis.web.dao.dashboard.codedic.CodeAppDicDao; +import com.nis.web.dao.dashboard.codedic.CodeBehaviorTypeDicDao; +import com.nis.web.dao.dashboard.codedic.CodeBrowserTypeDicDao; +import com.nis.web.dao.dashboard.codedic.CodeOsTypeDicDao; +import com.nis.web.dao.dashboard.codedic.CodeProtocolTypeDicDao; +import com.nis.web.dao.dashboard.codedic.CodeResult; +import com.nis.web.dao.dashboard.codedic.CodeServiceTypeDicDao; +import com.nis.web.dao.dashboard.codedic.CodeWebServiceDicDao; +@Service +public class CodeDicService { + @Autowired + private static CodeAppDicDao codeAppDicDao; + @Autowired + private static CodeBehaviorTypeDicDao codeBehaviorTypeDicDao; + @Autowired + private static CodeBrowserTypeDicDao codeBrowserTypeDicDao; + @Autowired + private static CodeOsTypeDicDao codeOsTypeDicDao; + @Autowired + private static CodeProtocolTypeDicDao codeProtocolTypeDicDao; + @Autowired + private static CodeServiceTypeDicDao codeServiceTypeDicDao; + @Autowired + private static CodeWebServiceDicDao codeWebServiceDicDao; + + + private static final String APP_CODE="appCode"; + private static final String BEHAVIOR_CODE="behaviorCode"; + private static final String BROWSER_CODE="browserCode"; + private static final String OS_CODE="osCode"; + private static final String PROTOCOL_CODE="protocolCode"; + private static final String SERVICE_CODE="serviceCode"; + private static final String WEB_CODE="webCode"; + /** + * 适用于大屏图表标签显示 + */ + public static List getCodeList(String name) { + List result = new ArrayList<>(); + if (name.equals(APP_CODE)) { + List codeDicList = codeAppDicDao.getCodeDicList(); + CodeResult codeResult = new CodeResult(); + for (int i = 0; i < codeDicList.size(); i++) { + codeResult.setItem(codeDicList.get(i).getAppName()); + codeResult.setCode(codeDicList.get(i).getViewCode()); + codeResult.setCoreApp(codeDicList.get(i).getCoreApp()); + result.add(codeResult); + } + return result; + + } else if (name.equals(BEHAVIOR_CODE)) { + List codeDicList = codeBehaviorTypeDicDao.getCodeDicList(); + CodeResult codeResult = new CodeResult(); + for (int i = 0; i < codeDicList.size(); i++) { + codeResult.setItem(codeDicList.get(i).getBehaviorType()); + codeResult.setCode(codeDicList.get(i).getViewCode()); + + result.add(codeResult); + } + return result; + } else if (name.equals(BROWSER_CODE)) { + List codeDicList = codeBrowserTypeDicDao.getCodeDicList(); + CodeResult codeResult = new CodeResult(); + for (int i = 0; i < codeDicList.size(); i++) { + codeResult.setItem(codeDicList.get(i).getBrowserType()); + codeResult.setCode(codeDicList.get(i).getViewCode()); + + result.add(codeResult); + } + return result; + } else if (name.equals(OS_CODE)) { + List codeDicList = codeOsTypeDicDao.getCodeDicList(); + CodeResult codeResult = new CodeResult(); + for (int i = 0; i < codeDicList.size(); i++) { + codeResult.setItem(codeDicList.get(i).getOsType()); + codeResult.setCode(codeDicList.get(i).getViewCode()); + + result.add(codeResult); + } + return result; + } else if (name.equals(PROTOCOL_CODE)) { + List codeDicList = codeProtocolTypeDicDao.getCodeDicList(); + CodeResult codeResult = new CodeResult(); + for (int i = 0; i < codeDicList.size(); i++) { + codeResult.setItem(codeDicList.get(i).getProtocolType()); + codeResult.setCode(codeDicList.get(i).getViewCode()); + + result.add(codeResult); + } + return result; + } else if (name.equals(SERVICE_CODE)) { + List codeDicList = codeServiceTypeDicDao.getCodeDicList(); + CodeResult codeResult = new CodeResult(); + for (int i = 0; i < codeDicList.size(); i++) { + codeResult.setItem(codeDicList.get(i).getServiceType()); + codeResult.setCode(codeDicList.get(i).getViewCode()); + + result.add(codeResult); + } + return result; + } else if (name.equals(WEB_CODE)) { + List codeDicList = codeWebServiceDicDao.getCodeDicList(); + CodeResult codeResult = new CodeResult(); + for (int i = 0; i < codeDicList.size(); i++) { + codeResult.setItem(codeDicList.get(i).getWebsite()); + codeResult.setCode(codeDicList.get(i).getViewCode()); + + result.add(codeResult); + } + return result; + } + return result; + } + public static void main(String[] args) { + getCodeList(APP_CODE); + } +} diff --git a/src/main/resources/nis.properties b/src/main/resources/nis.properties index a4dfa3c5a..b99f71e81 100644 --- a/src/main/resources/nis.properties +++ b/src/main/resources/nis.properties @@ -320,7 +320,7 @@ redirect_response_code_startwith=30 sample_upload_url_keyword=/av digest_upload_url_keyword=/fileTransfer #样例和摘要文件大小类型设置 -sample_file_type=,mp4,flv,ivf,mp2v, +sample_file_type=,mp4,flv,ivf,mp2v,jpg, #10M 10485760 sample_single_file_max_size=10485760 #12M 12582912 @@ -329,4 +329,20 @@ digest_file_type=,txt,doc,img, #10M10485760 digest_single_file_max_size=10485760 #12M12582912 -digest_total_file_max_size=12582912 \ No newline at end of file +digest_total_file_max_size=12582912 +#YSP文件保存路径 +av_file_path=d:\\ysp\\ +#YSP文件特征类型 +av_sample_audio_region=av_sample_audio +av_sample_vedio_region=av_sample_vedio +av_sample_pitrue_region=av_sample_pitrue +av_sample_voip_region=av_sample_voip +#样例文件生成程序 +audio_sample_create_proc=java -jar d:\\sampleTest.jar +vedio_sample_create_proc=java -jar d:\\sampleTest.jar +picture_sample_create_proc=java -jar d:\\sampleTest.jar +#http自定义域相关参数 +http_header_user_region_key=HTTP_HEADER +http_header_dict_module=REQUEST_HEADER_DISTRICT +#dns自定义域参数key +dns_strategy_user_region_key=DNS_STRATEGY \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/sitemesh3.xml b/src/main/webapp/WEB-INF/sitemesh3.xml index bc2cb8810..d57d007a7 100644 --- a/src/main/webapp/WEB-INF/sitemesh3.xml +++ b/src/main/webapp/WEB-INF/sitemesh3.xml @@ -27,6 +27,7 @@ + /articles/* diff --git a/src/main/webapp/WEB-INF/tags/sys/message.tag b/src/main/webapp/WEB-INF/tags/sys/message.tag index 99c78df76..d497b8c17 100644 --- a/src/main/webapp/WEB-INF/tags/sys/message.tag +++ b/src/main/webapp/WEB-INF/tags/sys/message.tag @@ -11,7 +11,7 @@ - +
\ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/log/ntc/dnsList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/dnsList.jsp index 20d39dbec..0f3767798 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/dnsList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/dnsList.jsp @@ -241,11 +241,7 @@ ${_log.sPort } ${_log.dIp } ${_log.dPort } - - - ${logProtocol.itemValue} - - + ${_log.transProto } diff --git a/src/main/webapp/WEB-INF/views/log/ntc/ftpList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/ftpList.jsp index bc38bea87..824956ea5 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/ftpList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/ftpList.jsp @@ -173,7 +173,7 @@ $(document).ready(function(){ - + @@ -202,11 +202,7 @@ $(document).ready(function(){ ${log.foundTime} ${log.recvTime} - - - - - + ${log.transProto} diff --git a/src/main/webapp/WEB-INF/views/log/ntc/httpList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/httpList.jsp index 4b08e0c2d..e0aeaa43a 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/httpList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/httpList.jsp @@ -207,11 +207,7 @@ ${_log.sPort } ${_log.dIp } ${_log.dPort } - - - ${logProtocol.itemValue} - - + ${_log.transProto } diff --git a/src/main/webapp/WEB-INF/views/log/ntc/ipList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/ipList.jsp index c6cc81926..9935fe8f5 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/ipList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/ipList.jsp @@ -192,11 +192,7 @@ ${_log.sPort } ${_log.dIp } ${_log.dPort } - - - ${logProtocol.itemValue} - - + ${_log.transProto } diff --git a/src/main/webapp/WEB-INF/views/log/ntc/ipsecList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/ipsecList.jsp index 0511bc72c..655d1e02b 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/ipsecList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/ipsecList.jsp @@ -196,11 +196,7 @@ $(document).ready(function(){ ${log.foundTime} ${log.recvTime} - - - - - + ${log.transProto} diff --git a/src/main/webapp/WEB-INF/views/log/ntc/openVpnList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/openVpnList.jsp index d5ccb3331..006cc08cc 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/openVpnList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/openVpnList.jsp @@ -204,11 +204,7 @@ $(document).ready(function(){ ${log.foundTime} ${log.recvTime} - - - - - + ${log.transProto} diff --git a/src/main/webapp/WEB-INF/views/log/ntc/sshList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/sshList.jsp index e8ec0c00a..dfa079e04 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/sshList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/sshList.jsp @@ -206,11 +206,7 @@ $(document).ready(function(){ ${log.foundTime} ${log.recvTime} - - - - - + ${log.transProto} diff --git a/src/main/webapp/WEB-INF/views/report/attrType.jsp b/src/main/webapp/WEB-INF/views/report/attrType.jsp index 015959889..68caa5aaf 100644 --- a/src/main/webapp/WEB-INF/views/report/attrType.jsp +++ b/src/main/webapp/WEB-INF/views/report/attrType.jsp @@ -1,42 +1,31 @@ <%@ page contentType="text/html;charset=UTF-8"%> <%@ include file="/WEB-INF/include/taglib.jsp"%> -
- +
- - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + +
性质总量0点1点2点3点4点5点6点7点8点9点10点11点12点14点15点16点17点18点19点20点21点22点23点${title}
+ ${xz.itemValue} + ${cloumn}
-
${page}
-
\ No newline at end of file +
${page}
\ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/report/destIp.jsp b/src/main/webapp/WEB-INF/views/report/destIp.jsp index e65b43edc..a89db3906 100644 --- a/src/main/webapp/WEB-INF/views/report/destIp.jsp +++ b/src/main/webapp/WEB-INF/views/report/destIp.jsp @@ -4,39 +4,27 @@ $(function(){ }); -
- +
- - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + +
所属国家总量0点1点2点3点4点5点6点7点8点9点10点11点12点14点15点16点17点18点19点20点21点22点23点${title}
${key}${cloumn}
-
${page}
-
\ No newline at end of file +
${page}
\ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/report/entranceId.jsp b/src/main/webapp/WEB-INF/views/report/entranceId.jsp index e6b77f476..970d3d807 100644 --- a/src/main/webapp/WEB-INF/views/report/entranceId.jsp +++ b/src/main/webapp/WEB-INF/views/report/entranceId.jsp @@ -4,39 +4,27 @@ $(function(){ }); -
- +
- - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + +
局点总量0点1点2点3点4点5点6点7点8点9点10点11点12点14点15点16点17点18点19点20点21点22点23点${title}
${key}${cloumn}
-
${page}
-
\ No newline at end of file +
${page}
\ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/report/label.jsp b/src/main/webapp/WEB-INF/views/report/label.jsp index 7d2cca059..46a92074c 100644 --- a/src/main/webapp/WEB-INF/views/report/label.jsp +++ b/src/main/webapp/WEB-INF/views/report/label.jsp @@ -4,39 +4,29 @@ $(function(){ }); -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
标签总量0点1点2点3点4点5点6点7点8点9点10点11点12点14点15点16点17点18点19点20点21点22点23点
-
${page}
-
\ No newline at end of file + + + + + + + + + + + + + + + + + + + + +
${title}
+ + ${label.itemValue} + + ${cloumn}
+
${page}
diff --git a/src/main/webapp/WEB-INF/views/report/list.jsp b/src/main/webapp/WEB-INF/views/report/list.jsp index ec468546b..51c2d88c1 100644 --- a/src/main/webapp/WEB-INF/views/report/list.jsp +++ b/src/main/webapp/WEB-INF/views/report/list.jsp @@ -7,6 +7,11 @@ $(document).ready(function() { //筛选功能初始化 filterActionInit(); + //日期类型初始化 + changeReportType("${bean.reportType}", true); + $("#reportType").change(function(){ + changeReportType($("#reportType", false).val()); + }); //reset $("#resetBtn").on("click",function(){ $("select.selectpicker").each(function(){ @@ -17,7 +22,23 @@ $(".Wdate").attr("value",''); $("#searchForm")[0].reset(); }); - $("input[name='reportType']").each(function(){ + if(!"${bean.reportBusinessType}"){//default + $("#reportBusinessType").val("label_report"); + ajaxReport("/report/ajaxNtcTagReport","#label"); + }else if("${bean.reportBusinessType}"=="label_report"){ + ajaxReport("/report/ajaxNtcTagReport","#label"); + }else if("${bean.reportBusinessType}"=="lwhh_report"){ + ajaxReport("/report/ajaxNtcLwhhReport","#lwhh"); + }else if("${bean.reportBusinessType}"=="src_ip_report"){ + ajaxReport("/report/ajaxNtcSrcipDomesticReport","#srcIp"); + }else if("${bean.reportBusinessType}"=="attr_type_report"){ + ajaxReport("/report/ajaxNtcXzReport","#attrType"); + }else if("${bean.reportBusinessType}"=="dest_ip_report"){ + ajaxReport("/report/ajaxNtcDestIpReport","#destIp"); + }else if("${bean.reportBusinessType}"=="isp_report"){ + ajaxReport("/report/ajaxNtcIspReport","#entranceId"); + } + $("[name='reportType']").each(function(){ var type='${bean.reportType}'; if(type && type==$(this).val()){ $(this).parent(".btn").button("toggle"); @@ -25,18 +46,96 @@ }) $("a[data-toggle='tab']").on("click",function(){ $("#reportBusinessType").val($(this).data("bussiness")); + if(!$(this).parent("li").hasClass("active")){ + if($(this).data("bussiness")=="label_report"){ + ajaxReport("/report/ajaxNtcTagReport","#label"); + }else if($(this).data("bussiness")=="lwhh_report"){ + ajaxReport("/report/ajaxNtcLwhhReport","#lwhh"); + }else if($(this).data("bussiness")=="src_ip_report"){ + ajaxReport("/report/ajaxNtcSrcipDomesticReport","#srcIp"); + }else if($(this).data("bussiness")=="attr_type_report"){ + ajaxReport("/report/ajaxNtcXzReport","#attrType"); + }else if($(this).data("bussiness")=="dest_ip_report"){ + ajaxReport("/report/ajaxNtcDestIpReport","#destIp"); + }else if($(this).data("bussiness")=="isp_report"){ + ajaxReport("/report/ajaxNtcIspReport","#entranceId"); + } + } + }); + $(".service").each(function(){ + var target=$(this).find("span"); + var action=$(this).data("action"); + $.ajax({ + type:'post', + url:'${ctx}/report/ajaxNtcServiceReport', + data:{ + "action":action, + "reportType":$('[name="reportType"]').val(), + "reportTime":$('[name="reportTime"]').val() + }, + dataType:'json', + async:true, + success:function(data,textStatus){//处理返回结果 + if(textStatus=="success"){ + target.html(data[action]); + } + }, + complete:function(XMLHttpRequest,status){//超时设置 + if(status=="timeout"){ + target.html(timeout); + } + } + }); }); }); + + function changeReportType(reportType, init) { + $("#intype").remove(); + var reportTime = ""; + if (init) { + reportTime = "${bean.reportTime }"; + } + if(reportType == 1){//需删除元素后重新添加,直接更改onclick会出现缓存问题 + $("#reportTypeDiv").append(''); + } else if(reportType == 2){ + $("#reportTypeDiv").append(''); + } else if(reportType == 3){ + $("#reportTypeDiv").append(''); + } + } + +var ajaxReport=function(url,target){ + loading(''); + $.ajax({ + type:'post', + async:false, + url:'${ctx}'+url,///report/ajaxNtcTagReport + data:{ + "action":$('[name="action"]').val(), + "reportType":$('[name="reportType"]').val(), + "reportTime":$('[name="reportTime"]').val() + }, + dataType:"html", + success:function(data){ + $(target).html(data);//#label + closeTip(); + } + }); +}