Merge branch 'develop' of http://10.0.6.99/gwall/gwall.git into develop

This commit is contained in:
duandongmei
2018-07-10 16:49:52 +08:00
71 changed files with 2531 additions and 406 deletions

View File

@@ -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;
}
}

View File

@@ -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();
}
}

View File

@@ -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();
}
}

View File

@@ -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();
}
}

View File

@@ -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();
}
}

View File

@@ -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();
}
}

View File

@@ -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();
}
}

View File

@@ -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<SearchReport>{
private String reportBusinessType;
private String searchBusinessType;
private String searchReportStartTime;
private Date reportStartTime;
private String searchReportEndTime;
private Date reportEndTime;
private String searchService;
private HashMap<String,Object> searchCondition;
public static final String searchConditionSplitor=",";
@@ -44,7 +47,51 @@ public class SearchReport extends BaseEntity<SearchReport>{
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

View File

@@ -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<T> extends BaseEntity<T> {
public class BaseReport<T> extends BaseEntity<T> {
/**
* @Fields serialVersionUID:TODO用一句话描述这个变量表示什么
*

View File

@@ -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<ReportLog>{
public class LogReport extends BaseReport<LogReport>{
/**
* @Fields serialVersionUID:TODO用一句话描述这个变量表示什么
*

View File

@@ -0,0 +1,16 @@
package com.nis.domain.report;
public class NtcAttrTypeReport extends BaseReport<NtcAttrTypeReport>{
private static final long serialVersionUID = -4537371833119510177L;
private Integer attrType;
public Integer getAttrType() {
return attrType;
}
public void setAttrType(Integer attrType) {
this.attrType = attrType;
}
}

View File

@@ -0,0 +1,16 @@
package com.nis.domain.report;
public class NtcDestIpReport extends BaseReport<NtcDestIpReport>{
private static final long serialVersionUID = 8905927100915123026L;
private String destCountry;
public String getDestCountry() {
return destCountry;
}
public void setDestCountry(String destCountry) {
this.destCountry = destCountry;
}
}

View File

@@ -0,0 +1,16 @@
package com.nis.domain.report;
public class NtcEntranceReport extends BaseReport<NtcEntranceReport>{
private static final long serialVersionUID = -5042608104505377779L;
private Integer entranceId;
public Integer getEntranceId() {
return entranceId;
}
public void setEntranceId(Integer entranceId) {
this.entranceId = entranceId;
}
}

View File

@@ -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<NtcLwhhReport> {
/**
* @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;
}
}

View File

@@ -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<NtcServiceReport> {
/**
* @Fields serialVersionUID:TODO用一句话描述这个变量表示什么
*
* @since 1.0.0
*/
private static final long serialVersionUID = 5574384523786886920L;
}

View File

@@ -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<NtcSrcipDomesticReport> {
/**
* @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;
}
}

View File

@@ -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<NtcTagReport> {
/**
* @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;
}
}

View File

@@ -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<T extends BaseReportLog> extends RestfulResult{
public class ReportResult<T extends BaseReport> extends RestfulResult{
private Integer logSource;
private Page<T> data;
/**
@@ -62,13 +65,13 @@ public class ReportResultLog<T extends BaseReportLog> extends RestfulResult{
public void setData(Page<T> data) {
this.data = data;
}
public ReportResultLog<T> getReport(String reportUrl,SearchReport searchCondition) throws MaatConvertException{
if(StringUtils.isBlank(searchCondition.getSearchService())){
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>");
}
public ReportResult<T> getReport(String reportUrl,SearchReport searchCondition) throws MaatConvertException, UnsupportedEncodingException{
// if(StringUtils.isBlank(searchCondition.getSearchService())){
// throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>");
// }
String result = null;
ReportResultLog<T> bean = null;
StringBuffer url=new StringBuffer(reportUrl+"?");
ReportResult<T> 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<T extends BaseReportLog> 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<ReportResultLog<T>>(){
bean = gson.fromJson(result, new TypeToken<ReportResult<T>>(){
private static final long serialVersionUID = 7963055764864141968L;}.getType());
}else{
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+response.readEntity(String.class));
}
return bean;
}
public static void main(String[] args) {
}
}

View File

@@ -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<CodeResult> getCodeList(String name) {
// List<SysMenu> menuList = (List<SysMenu>)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<CodeResult> result = new ArrayList<>();
if (name.equals(APP_CODE)) {
List<CodeAppDic> codeDicList = (List<CodeAppDic>) 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<CodeBehaviorTypeDic> codeDicList = (List<CodeBehaviorTypeDic>) 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<CodeBrowserTypeDic> codeDicList = (List<CodeBrowserTypeDic>) 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<CodeOsTypeDic> codeDicList = (List<CodeOsTypeDic>) 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<CodeProtocolTypeDic> codeDicList = (List<CodeProtocolTypeDic>) 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<CodeServiceTypeDic> codeDicList = (List<CodeServiceTypeDic>) 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<CodeWebServiceDic> codeDicList = (List<CodeWebServiceDic>) 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);
}
}

View File

@@ -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<ReportLog> getReport(int type,String ids,String serviceIds,String searchReportStartTime,String searchReportEndTime) throws MaatConvertException{
public static ReportResult<LogReport> getReport(int type,String ids,String serviceIds,String searchReportStartTime,String searchReportEndTime) throws MaatConvertException{
if(StringUtils.isBlank(ids)||StringUtils.isBlank(serviceIds)){
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>");
}
String result = null;
ReportResultLog<ReportLog> bean = null;
ReportResult<LogReport> 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<ReportResultLog<ReportLog>>(){
bean = gson.fromJson(result, new TypeToken<ReportResult<LogReport>>(){
private static final long serialVersionUID = 7963055764864141968L;}.getType());
}else{
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+response.readEntity(String.class));

View File

@@ -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");
}

View File

@@ -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

View File

@@ -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) {

View File

@@ -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<RequestInfo> requestInfos=requestInfoService.getAllRequestInfo();
model.addAttribute("requestInfos", requestInfos);
List<ServiceDictInfo> fls=serviceDictInfoService.findAllFlDict();
model.addAttribute("fls", fls);
List<ServiceDictInfo> xzs=serviceDictInfoService.findAllXzDict();
model.addAttribute("xzs", xzs);
List<ServiceDictInfo> lables=serviceDictInfoService.findAllLableDict();
model.addAttribute("lables", lables);
List<FunctionRegionDict> regionList = DictUtils.getFunctionRegionDictList(report.getFunctionId());
model.addAttribute("regionList", regionList);
List<FunctionServiceDict> 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<String> getDateTitiles(SearchReport bean){
SimpleDateFormat sdf=new SimpleDateFormat(Constants.SEARCH_DATEFORMAT);
List<String> titles=new ArrayList<String>();
Calendar cal=Calendar.getInstance();
cal.setTime(bean.getReportStartTime());
while(cal.getTimeInMillis()<bean.getReportEndTime().getTime()){//构造标题
//报表时间单位加一
if(bean.getReportType()==Constants.REPORT_TYPE_HOUR){
titles.add(sdf.format(cal.getTime()).substring(0,13));
cal.add(Calendar.HOUR_OF_DAY, 1);
}else if(bean.getReportType()==Constants.REPORT_TYPE_DAY){
titles.add(sdf.format(cal.getTime()).substring(0,10));
cal.add(Calendar.DAY_OF_MONTH, 1);
}else if(bean.getReportType()==Constants.REPORT_TYPE_MONTH){
titles.add(sdf.format(cal.getTime()).substring(0,7));
cal.add(Calendar.MONTH, 1);
}
}
return titles;
}
public Date getReportTime(String reportTime) throws ParseException{
Pattern datePattern=Pattern.compile("^[0-9]{4}-[0-9]{2}-[0-9]{2}$");
Pattern monthPattern=Pattern.compile("^[0-9]{4}-[0-9]{2}$");
Pattern yearPattern=Pattern.compile("^[0-9]{4}$");
Matcher matcher=datePattern.matcher(reportTime);
if(matcher.matches()){
return new SimpleDateFormat("yyyy-MM-dd").parse(reportTime);
}else{
matcher=monthPattern.matcher(reportTime);
if(matcher.matches()){
return new SimpleDateFormat("yyyy-MM").parse(reportTime);
}else{
matcher=yearPattern.matcher(reportTime);
if(matcher.matches()){
return new SimpleDateFormat("yyyy").parse(reportTime);
}
}
}
return null;
}
}

View File

@@ -22,8 +22,8 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import com.nis.domain.FunctionServiceDict;
import com.nis.domain.log.ReportLog;
import com.nis.domain.log.ReportResultLog;
import com.nis.domain.report.LogReport;
import com.nis.domain.report.ReportResult;
import com.nis.util.ConfigServiceUtil;
import com.nis.util.Constants;
import com.nis.util.DictUtils;
@@ -43,7 +43,7 @@ public class NtcPzReportController extends BaseController{
@ResponseBody
public Map<String, Object> ajaxGetLogTotal(Model model,long endTime,int action,Integer functionId,Integer compileId){
Map<String, Object> data=new HashMap<String, Object>();
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);

View File

@@ -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<FunctionServiceDict> 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<serviceList.size();i++){
if(i==0){
serviceId.append(serviceList.get(i).getServiceId().toString());
}else{
serviceId.append(","+serviceList.get(i).getServiceId().toString());
}
}
bean.setSearchService(serviceId.toString());
}
bean.setSearchBusinessType("1");
// 调用服务接口...
bean.setPageSize(-1);
bean.setFields("destCountry,sum,reportTime");
try {
this.setReportSearchTime(bean);
} catch (ParseException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
List<String> titles=this.getDateTitiles(bean);
model.addAttribute("titles", titles);
HashMap<String,List<Long>> showData=new LinkedHashMap<>();//构造数据展示集合
List<Long> line= new ArrayList<Long>();
long total=0l;
for(String title:titles){
line.add(10000l);
total+=10000l;
}
List<Long> _line= new ArrayList<Long>();
_line.add(total);
_line.addAll(line);
for (int i = 0; i < 20; i++) {
showData.put("巴西"+i, _line);
}
model.addAttribute("datas", showData);
return "/report/destIp";
}
}

View File

@@ -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<FunctionServiceDict> 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<serviceList.size();i++){
if(i==0){
serviceId.append(serviceList.get(i).getServiceId().toString());
}else{
serviceId.append(","+serviceList.get(i).getServiceId().toString());
}
}
bean.setSearchService(serviceId.toString());
}
bean.setSearchBusinessType("1");
// 调用服务接口...
bean.setPageSize(-1);
bean.setFields("entranceId,sum,reportTime");
try {
this.setReportSearchTime(bean);
} catch (ParseException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
List<String> titles=this.getDateTitiles(bean);
model.addAttribute("titles", titles);
HashMap<String,List<Long>> showData=new LinkedHashMap<>();//构造数据展示集合
List<Long> line= new ArrayList<Long>();
long total=0l;
for(String title:titles){
line.add(10000l);
total+=10000l;
}
List<Long> _line= new ArrayList<Long>();
_line.add(total);
_line.addAll(line);
for (int i = 0; i < 20; i++) {
showData.put(""+i, _line);
}
model.addAttribute("datas", showData);
return "/report/entranceId";
}
}

View File

@@ -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<FunctionServiceDict> serviceList = DictUtils.getFunctionServiceDictList(bean.getFunctionId());
List<RequestInfo> 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<serviceList.size();i++){
if(i==0){
serviceId.append(serviceList.get(i).getServiceId().toString());
}else{
serviceId.append(","+serviceList.get(i).getServiceId().toString());
}
}
bean.setSearchService(serviceId.toString());
}
bean.setSearchBusinessType("1");
ReportResult<NtcLwhhReport> 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<String> titles=this.getDateTitiles(bean);
model.addAttribute("titles", titles);
// try {
// result=result.getReport(url.toString(), bean);
// Page<NtcLwhhReportLog> page=result.getData();
// List<NtcLwhhReportLog> list=page.getList();
// HashMap<String,Long> 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<String,List<Long>> showData=new LinkedHashMap<>();//构造数据展示集合
// for(RequestInfo requestInfo:requestInfos){
// List<Long> line= new ArrayList<Long>();
// 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<Long> _line= new ArrayList<Long>();
// _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<String,List<Long>> showData=new LinkedHashMap<>();//构造数据展示集合
for(RequestInfo requestInfo:requestInfos){
List<Long> line= new ArrayList<Long>();
long total=0l;
for(String title:titles){
line.add(10000l);
total+=10000l;
}
List<Long> _line= new ArrayList<Long>();
_line.add(total);
_line.addAll(line);
showData.put(requestInfo.getId().toString(), _line);
}
model.addAttribute("datas", showData);
return "/report/lwhh";
}
}

View File

@@ -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<String, Long> report(@ModelAttribute("bean") SearchReport bean,Model model, HttpServletRequest request, HttpServletResponse response) {
Map<String, Long> data=new HashMap<>();
List<FunctionServiceDict> 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<serviceList.size();i++){
if(i==0){
serviceId.append(serviceList.get(i).getServiceId().toString());
}else{
serviceId.append(","+serviceList.get(i).getServiceId().toString());
}
}
bean.setSearchService(serviceId.toString());
}
bean.setSearchBusinessType("1");
bean.setPageSize(-1);
try {
this.setReportSearchTime(bean);
} catch (ParseException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
ReportResult<NtcServiceReport> result=new ReportResult<>();
StringBuffer url=new StringBuffer(Constants.LOG_BASE_URL+Constants.NTC_SERVICE_REPORT+"?");
// try {
// result=result.getReport(url.toString(), bean);
// Page<NtcServiceReport> page=result.getData();
// List<NtcServiceReport> 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;
}
}

View File

@@ -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<FunctionServiceDict> 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<serviceList.size();i++){
if(i==0){
serviceId.append(serviceList.get(i).getServiceId().toString());
}else{
serviceId.append(","+serviceList.get(i).getServiceId().toString());
}
}
bean.setSearchService(serviceId.toString());
}
bean.setSearchBusinessType("1");
ReportResult<NtcSrcipDomesticReport> 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<String> titles=this.getDateTitiles(bean);
model.addAttribute("titles", titles);
// try {
// result=result.getReport(url.toString(), bean);
// Page<NtcSrcipDomesticReport> page=result.getData();
// List<NtcSrcipDomesticReport> list=page.getList();
// HashMap<String,Long> 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<String,List<Long>> showData=new HashMap<>();//构造数据展示集合
//
// for(String key:trimData.keySet()){
// List<Long> line= new ArrayList<Long>();
// 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<Long> _line= new ArrayList<Long>();
// _line.add(total);
// _line.addAll(line);
// showData.put(location, _line);
// }
// model.addAttribute("datas", showData);
// } catch (Exception e) {
// // TODO: handle exception
// e.printStackTrace();
// }
HashMap<String,List<Long>> showData=new LinkedHashMap<>();//构造数据展示集合
long total=0;
List<Long> line= new ArrayList<Long>();
for(String title:titles){
line.add(10000l);
total+=10000l;
}
List<Long> _line= new ArrayList<Long>();
_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";
}
}

View File

@@ -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<FunctionServiceDict> serviceList = DictUtils.getFunctionServiceDictList(bean.getFunctionId());
List<ServiceDictInfo> 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<serviceList.size();i++){
if(i==0){
serviceId.append(serviceList.get(i).getServiceId().toString());
}else{
serviceId.append(","+serviceList.get(i).getServiceId().toString());
}
}
bean.setSearchService(serviceId.toString());
}
bean.setSearchBusinessType("1");
ReportResult<NtcTagReport> 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<String> titles=this.getDateTitiles(bean);
model.addAttribute("titles", titles);
// try {
// result=result.getReport(url.toString(), bean);
// Page<NtcTagReportLog> page=result.getData();
// List<NtcTagReportLog> list=page.getList();
// HashMap<String,Long> 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<String,List<Long>> showData=new LinkedHashMap<>();//构造数据展示集合
// for(ServiceDictInfo label:lables){
// List<Long> line= new ArrayList<Long>();
// 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<Long> _line= new ArrayList<Long>();
// _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<String,List<Long>> showData=new LinkedHashMap<>();//构造数据展示集合
for(ServiceDictInfo label:labels){
List<Long> line= new ArrayList<Long>();
long total=0l;
for(String title:titles){
line.add(10000l);
total+=10000l;
}
List<Long> _line= new ArrayList<Long>();
_line.add(total);
_line.addAll(line);
showData.put(label.getServiceDictId().toString(), _line);
}
model.addAttribute("datas", showData);
return "/report/label";
}
}

View File

@@ -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<FunctionServiceDict> serviceList = DictUtils.getFunctionServiceDictList(bean.getFunctionId());
List<ServiceDictInfo> 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<serviceList.size();i++){
if(i==0){
serviceId.append(serviceList.get(i).getServiceId().toString());
}else{
serviceId.append(","+serviceList.get(i).getServiceId().toString());
}
}
bean.setSearchService(serviceId.toString());
}
bean.setSearchBusinessType("1");
// 调用服务接口...
bean.setPageSize(-1);
bean.setFields("attrType,sum,reportTime");
try {
this.setReportSearchTime(bean);
} catch (ParseException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
List<String> titles=this.getDateTitiles(bean);
model.addAttribute("titles", titles);
HashMap<String,List<Long>> showData=new LinkedHashMap<>();//构造数据展示集合
for(ServiceDictInfo xz:xzs){
List<Long> line= new ArrayList<Long>();
long total=0l;
for(String title:titles){
line.add(10000l);
total+=10000l;
}
List<Long> _line= new ArrayList<Long>();
_line.add(total);
_line.addAll(line);
showData.put(xz.getServiceDictId().toString(), _line);
}
model.addAttribute("datas", showData);
return "/report/attrType";
}
}

View File

@@ -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<TestBean> {
public class TestBean extends BaseReport<TestBean> {
/**
* @Fields serialVersionUID:TODO用一句话描述这个变量表示什么

View File

@@ -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<CodeAppDic> getCodeDicList();
}

View File

@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.nis.web.dao.dashboard.codedic.CodeAppDicDao">
<resultMap id="BaseResultMap" type="com.nis.domain.dashboard.codedic.CodeAppDic">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="app_name" jdbcType="VARCHAR" property="appName" />
<result column="app_name_zh" jdbcType="VARCHAR" property="appNameZh" />
<result column="view_code" jdbcType="VARCHAR" property="viewCode" />
<result column="icon" jdbcType="VARCHAR" property="icon" />
<result column="behavior" jdbcType="VARCHAR" property="behavior" />
<result column="core_app" jdbcType="INTEGER" property="coreApp" />
</resultMap>
<sql id="Base_Column_List">
id, app_name, app_name_zh, view_code, icon, behavior, core_app
</sql>
<select id="getCodeDicList" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from code_app_dic
</select>
</mapper>

View File

@@ -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<CodeBehaviorTypeDic> getCodeDicList();
}

View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.nis.web.dao.dashboard.codedic.CodeBehaviorTypeDicDao">
<resultMap id="BaseResultMap" type="com.nis.domain.dashboard.codedic.CodeBehaviorTypeDic">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="behavior_type" jdbcType="VARCHAR" property="behaviorType" />
<result column="view_code" jdbcType="VARCHAR" property="viewCode" />
</resultMap>
<sql id="Base_Column_List">
id, behavior_type, view_code
</sql>
<select id="getCodeDicList" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from code_behavior_type_dic
</select>
</mapper>

View File

@@ -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<CodeBrowserTypeDic> getCodeDicList();
}

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.nis.web.dao.dashboard.codedic.CodeBrowserTypeDicDao">
<resultMap id="BaseResultMap" type="com.nis.domain.dashboard.codedic.CodeBrowserTypeDic">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="browser_type" jdbcType="VARCHAR" property="browserType" />
<result column="view_code" jdbcType="VARCHAR" property="viewCode" />
<result column="icon" jdbcType="VARCHAR" property="icon" />
</resultMap>
<sql id="Base_Column_List">
id, browser_type, view_code, icon
</sql>
<select id="getCodeDicList" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from code_browser_type_dic
</select>
</mapper>

View File

@@ -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<CodeOsTypeDic> getCodeDicList();
}

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.nis.web.dao.dashboard.codedic.CodeOsTypeDicDao">
<resultMap id="BaseResultMap" type="com.nis.domain.dashboard.codedic.CodeOsTypeDic">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="os_type" jdbcType="VARCHAR" property="osType" />
<result column="view_code" jdbcType="VARCHAR" property="viewCode" />
<result column="icon" jdbcType="VARCHAR" property="icon" />
</resultMap>
<sql id="Base_Column_List">
id, os_type, view_code, icon
</sql>
<select id="getCodeDicList" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from code_os_type_dic
</select>
</mapper>

View File

@@ -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<CodeProtocolTypeDic> getCodeDicList();
}

View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.nis.web.dao.dashboard.codedic.CodeProtocolTypeDicDao">
<resultMap id="BaseResultMap" type="com.nis.domain.dashboard.codedic.CodeProtocolTypeDic">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="protocol_type" jdbcType="VARCHAR" property="protocolType" />
<result column="view_code" jdbcType="VARCHAR" property="viewCode" />
</resultMap>
<sql id="Base_Column_List">
id, protocol_type, view_code
</sql>
<select id="getCodeDicList" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from code_protocol_type_dic
</select>
</mapper>

View File

@@ -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;
}
}

View File

@@ -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<CodeServiceTypeDic> getCodeDicList();
}

View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.nis.web.dao.dashboard.codedic.CodeServiceTypeDicDao">
<resultMap id="BaseResultMap" type="com.nis.domain.dashboard.codedic.CodeServiceTypeDic">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="service_type" jdbcType="VARCHAR" property="serviceType" />
<result column="view_code" jdbcType="VARCHAR" property="viewCode" />
</resultMap>
<sql id="Base_Column_List">
id, service_type, view_code
</sql>
<select id="getCodeDicList" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from code_service_type_dic
</select>
</mapper>

View File

@@ -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<CodeWebServiceDic> getCodeDicList();
}

View File

@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.nis.web.dao.dashboard.codedic.CodeWebServiceDicDao">
<resultMap id="BaseResultMap" type="com.nis.domain.dashboard.codedic.CodeWebServiceDic">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="website" jdbcType="VARCHAR" property="website" />
<result column="domain_name" jdbcType="VARCHAR" property="domainName" />
<result column="view_code" jdbcType="VARCHAR" property="viewCode" />
<result column="icon" jdbcType="VARCHAR" property="icon" />
</resultMap>
<sql id="Base_Column_List">
id, website, domain_name, view_code, icon
</sql>
<select id="getCodeDicList" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from code_web_service_dic
</select>
</mapper>

View File

@@ -310,7 +310,7 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
maatCfg.initDefaultValue();
BeanUtils.copyProperties(cfg, maatCfg);
if(cfg.getIsAudit()==1){
if(cfg.getIsAudit()==Constants.AUDIT_YES){
maatBean.setOpAction(Constants.INSERT_ACTION);
Map<String,List> map = cfgConvert(ipRegionList,beans,1,cfg,groupRelationList);
groupRelationList=map.get("groupList");
@@ -343,10 +343,10 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
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());

View File

@@ -421,12 +421,12 @@ public class WebsiteCfgService extends CrudService<WebsiteCfgDao,CfgIndexInfo> {
//请求头域
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<WebsiteCfgDao,CfgIndexInfo> {
//应答头域
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<WebsiteCfgDao,CfgIndexInfo> {
// 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);

View File

@@ -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<CodeResult> getCodeList(String name) {
List<CodeResult> result = new ArrayList<>();
if (name.equals(APP_CODE)) {
List<CodeAppDic> 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<CodeBehaviorTypeDic> 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<CodeBrowserTypeDic> 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<CodeOsTypeDic> 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<CodeProtocolTypeDic> 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<CodeServiceTypeDic> 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<CodeWebServiceDic> 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);
}
}

View File

@@ -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
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

View File

@@ -27,6 +27,7 @@
<mapping path="/nis/ntc/other/ajax*" exclue="true"/>
<mapping path="/nis/proxy/control/httpRedirect/ajax*" exclue="true"/>
<mapping path="/nis/app/ajax*" exclue="true"/>
<mapping path="/nis/report/ajax*" exclue="true"/>
<!-- 对同一路径,启用多个装饰器 -->
<mapping>
<path>/articles/*</path>

View File

@@ -11,7 +11,7 @@
</style>
<script type="text/javascript">top.$.jBox.closeTip();</script>
<c:if test="${not empty content}">
<c:if test="${not empty type}"><c:set var="ctype" value="${type}"/></c:if><c:if test="${empty type}"><c:set var="ctype" value="${fn:indexOf(content,'失败') eq -1 && fn:indexOf(content,'failed') eq -1 && fn:indexOf(content,'Exception') eq -1?'success':'error'}"/></c:if>
<c:if test="${not empty type}"><c:set var="ctype" value="${type}"/></c:if><c:if test="${empty type}"><c:set var="ctype" value="${fn:indexOf(content,'失败') eq -1 && fn:indexOf(content,'failed') eq -1 && fn:indexOf(content,'Exception') eq -1 && fn:indexOf(content,'null') eq -1?'success':'error'}"/></c:if>
<div id="messageBox" class="alert alert-${ctype}"><button data-dismiss="alert" class="close">×</button><spring:message code="${content}"/></div>
<script type="text/javascript">if(!top.$.jBox.tip.mess) {top.$.jBox.tip.mess=1;top.$.jBox.tip("<spring:message code='${content}'/>","${ctype}",{persistent:true,opacity:0});$("#messageBox").show();}</script>
</c:if>

View File

@@ -241,11 +241,7 @@
<td>${_log.sPort }</td>
<td>${_log.dIp }</td>
<td>${_log.dPort }</td>
<td>
<c:forEach items="${fns:getDictList('LOG_PROTOCOL')}" var="logProtocol">
<c:if test="${logProtocol.itemCode eq _log.transProto}">${logProtocol.itemValue}</c:if>
</c:forEach>
</td>
<td>${_log.transProto }</td>
<td>
<c:forEach items="${fns:getDictList('ENTRANCE')}" var="entrance">
<c:if test="${entrance.itemCode eq _log.entranceId}"><spring:message code="${entrance.itemValue}"/></c:if>

View File

@@ -173,7 +173,7 @@ $(document).ready(function(){
<th><spring:message code='recv_time'/></th>
<th><spring:message code='protocol'/></th>
<th><spring:message code='addr_type'/></th>
<th><spring:message code='serverIp'/></th>
<th><spring:message code='serverip'/></th>
<th><spring:message code='clientip'/></th>
<th><spring:message code='serverport'/></th>
<th><spring:message code='clientport'/></th>
@@ -202,11 +202,7 @@ $(document).ready(function(){
</td>
<td>${log.foundTime}</td>
<td>${log.recvTime}</td>
<td>
<c:forEach items="${fns:getDictList('LOG_PROTOCOL')}" var="dic">
<c:if test="${log.transProto==dic.itemCode}"><spring:message code="${dic.itemValue }"/></c:if>
</c:forEach>
</td>
<td>${log.transProto}</td>
<td>
<c:forEach items="${fns:getDictList('IP_TYPE')}" var="dic">
<c:if test="${log.addrType==dic.itemCode}"><spring:message code="${dic.itemValue }"/></c:if>

View File

@@ -207,11 +207,7 @@
<td>${_log.sPort }</td>
<td>${_log.dIp }</td>
<td>${_log.dPort }</td>
<td>
<c:forEach items="${fns:getDictList('LOG_PROTOCOL')}" var="logProtocol">
<c:if test="${logProtocol.itemCode eq _log.transProto}">${logProtocol.itemValue}</c:if>
</c:forEach>
</td>
<td>${_log.transProto }</td>
<td>
<c:forEach items="${fns:getDictList('ENTRANCE')}" var="entrance">
<c:if test="${entrance.itemCode eq _log.entranceId}"><spring:message code="${entrance.itemValue}"/></c:if>

View File

@@ -192,11 +192,7 @@
<td>${_log.sPort }</td>
<td>${_log.dIp }</td>
<td>${_log.dPort }</td>
<td>
<c:forEach items="${fns:getDictList('LOG_PROTOCOL')}" var="logProtocol">
<c:if test="${logProtocol.itemCode eq _log.transProto}">${logProtocol.itemValue}</c:if>
</c:forEach>
</td>
<td>${_log.transProto }</td>
<td>
<c:forEach items="${fns:getDictList('ENTRANCE')}" var="entrance">
<c:if test="${entrance.itemCode eq _log.entranceId}"><spring:message code="${entrance.itemValue}"/></c:if>

View File

@@ -196,11 +196,7 @@ $(document).ready(function(){
</td>
<td>${log.foundTime}</td>
<td>${log.recvTime}</td>
<td>
<c:forEach items="${fns:getDictList('LOG_PROTOCOL')}" var="dic">
<c:if test="${log.transProto==dic.itemCode}"><spring:message code="${dic.itemValue }"/></c:if>
</c:forEach>
</td>
<td>${log.transProto}</td>
<td>
<c:forEach items="${fns:getDictList('IP_TYPE')}" var="dic">
<c:if test="${log.addrType==dic.itemCode}"><spring:message code="${dic.itemValue }"/></c:if>

View File

@@ -204,11 +204,7 @@ $(document).ready(function(){
</td>
<td>${log.foundTime}</td>
<td>${log.recvTime}</td>
<td>
<c:forEach items="${fns:getDictList('LOG_PROTOCOL')}" var="dic">
<c:if test="${log.transProto==dic.itemCode}"><spring:message code="${dic.itemValue }"/></c:if>
</c:forEach>
</td>
<td>${log.transProto}</td>
<td>
<c:forEach items="${fns:getDictList('IP_TYPE')}" var="dic">
<c:if test="${log.addrType==dic.itemCode}"><spring:message code="${dic.itemValue }"/></c:if>

View File

@@ -206,11 +206,7 @@ $(document).ready(function(){
</td>
<td>${log.foundTime}</td>
<td>${log.recvTime}</td>
<td>
<c:forEach items="${fns:getDictList('LOG_PROTOCOL')}" var="dic">
<c:if test="${log.transProto==dic.itemCode}"><spring:message code="${dic.itemValue }"/></c:if>
</c:forEach>
</td>
<td>${log.transProto}</td>
<td>
<c:forEach items="${fns:getDictList('IP_TYPE')}" var="dic">
<c:if test="${log.addrType==dic.itemCode}"><spring:message code="${dic.itemValue }"/></c:if>

View File

@@ -1,42 +1,31 @@
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/include/taglib.jsp"%>
<script type="text/javascript">
$(function(){
});
$(function() {
});
</script>
<div id="attrType" class="tab-pane fade">
<table id="contentTable1" class="table table-striped table-bordered table-condensed text-nowrap">
<table id="attrTypeTable"
class="table table-striped table-bordered table-condensed text-nowrap">
<thead>
<tr>
<th>性质</th>
<th>总量</th>
<th>0点</th>
<th>1点</th>
<th>2点</th>
<th>3点</th>
<th>4点</th>
<th>5点</th>
<th>6点</th>
<th>7点</th>
<th>8点</th>
<th>9点</th>
<th>10点</th>
<th>11点</th>
<th>12点</th>
<th>14点</th>
<th>15点</th>
<th>16点</th>
<th>17点</th>
<th>18点</th>
<th>19点</th>
<th>20点</th>
<th>21点</th>
<th>22点</th>
<th>23点</th>
<th><spring:message code="attribute" /></th>
<th><spring:message code="log_total" /></th>
<c:forEach items="${titles}" var="title">
<th>${title}</th>
</c:forEach>
</tr>
</thead>
<tbody>
<c:forEach items="${datas}" var="data">
<tr>
<td><c:forEach items="${xzs}" var="xz">
<c:if test="${xz.serviceDictId==data.key}">${xz.itemValue}</c:if>
</c:forEach></td>
<c:forEach items="${data.value}" var="cloumn" varStatus="status">
<td>${cloumn}</td>
</c:forEach>
</tr>
</c:forEach>
</tbody>
</table>
<div class="page">${page}</div>
</div>
<div class="page">${page}</div>

View File

@@ -4,39 +4,27 @@
$(function(){
});
</script>
<div id="destIp" class="tab-pane fade">
<table id="contentTable1" class="table table-striped table-bordered table-condensed text-nowrap">
<table id="destIpTable" class="table table-striped table-bordered table-condensed text-nowrap">
<thead>
<tr>
<th>所属国家</th>
<th>总量</th>
<th>0点</th>
<th>1点</th>
<th>2点</th>
<th>3点</th>
<th>4点</th>
<th>5点</th>
<th>6点</th>
<th>7点</th>
<th>8点</th>
<th>9点</th>
<th>10点</th>
<th>11点</th>
<th>12点</th>
<th>14点</th>
<th>15点</th>
<th>16点</th>
<th>17点</th>
<th>18点</th>
<th>19点</th>
<th>20点</th>
<th>21点</th>
<th>22点</th>
<th>23点</th>
<th><spring:message code="dest_country" /></th>
<th><spring:message code="log_total" /></th>
<c:forEach items="${titles}" var="title">
<th>${title}</th>
</c:forEach>
</tr>
</thead>
<tbody>
<c:forEach items="${datas}" var="data">
<tr>
<c:forEach items="${data.key}" var="key" varStatus="status">
<td>${key}</td>
</c:forEach>
<c:forEach items="${data.value}" var="cloumn" varStatus="status">
<td>${cloumn}</td>
</c:forEach>
</tr>
</c:forEach>
</tbody>
</table>
<div class="page">${page}</div>
</div>
<div class="page">${page}</div>

View File

@@ -4,39 +4,27 @@
$(function(){
});
</script>
<div id="entranceId" class="tab-pane fade">
<table id="contentTable1" class="table table-striped table-bordered table-condensed text-nowrap">
<table id="entranceIdTable" class="table table-striped table-bordered table-condensed text-nowrap">
<thead>
<tr>
<th>局点</th>
<th>总量</th>
<th>0点</th>
<th>1点</th>
<th>2点</th>
<th>3点</th>
<th>4点</th>
<th>5点</th>
<th>6点</th>
<th>7点</th>
<th>8点</th>
<th>9点</th>
<th>10点</th>
<th>11点</th>
<th>12点</th>
<th>14点</th>
<th>15点</th>
<th>16点</th>
<th>17点</th>
<th>18点</th>
<th>19点</th>
<th>20点</th>
<th>21点</th>
<th>22点</th>
<th>23点</th>
<th><spring:message code="entrance" /></th>
<th><spring:message code="log_total" /></th>
<c:forEach items="${titles}" var="title">
<th>${title}</th>
</c:forEach>
</tr>
</thead>
<tbody>
<c:forEach items="${datas}" var="data">
<tr>
<c:forEach items="${data.key}" var="key" varStatus="status">
<td>${key}</td>
</c:forEach>
<c:forEach items="${data.value}" var="cloumn" varStatus="status">
<td>${cloumn}</td>
</c:forEach>
</tr>
</c:forEach>
</tbody>
</table>
<div class="page">${page}</div>
</div>
<div class="page">${page}</div>

View File

@@ -4,39 +4,29 @@
$(function(){
});
</script>
<div id="label" class="tab-pane fade in active">
<table id="contentTable1" class="table table-striped table-bordered table-condensed text-nowrap">
<thead>
<tr>
<th>标签</th>
<th>总量</th>
<th>0点</th>
<th>1点</th>
<th>2点</th>
<th>3点</th>
<th>4点</th>
<th>5点</th>
<th>6点</th>
<th>7点</th>
<th>8点</th>
<th>9点</th>
<th>10点</th>
<th>11点</th>
<th>12点</th>
<th>14点</th>
<th>15点</th>
<th>16点</th>
<th>17点</th>
<th>18点</th>
<th>19点</th>
<th>20点</th>
<th>21点</th>
<th>22点</th>
<th>23点</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
<div class="page">${page}</div>
</div>
<table id="tagTable" class="table table-striped table-bordered table-condensed text-nowrap">
<thead>
<tr>
<th><spring:message code="label"/></th>
<th><spring:message code="log_total"/></th>
<c:forEach items="${titles}" var="title">
<th>${title}</th>
</c:forEach>
</tr>
</thead>
<tbody>
<c:forEach items="${datas}" var="data">
<tr>
<td>
<c:forEach items="${labels}" var="label">
<c:if test="${label.serviceDictId==data.key}">${label.itemValue}</c:if>
</c:forEach>
</td>
<c:forEach items="${data.value}" var="cloumn" varStatus="status">
<td>${cloumn}</td>
</c:forEach>
</tr>
</c:forEach>
</tbody>
</table>
<div class="page">${page}</div>

View File

@@ -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('<input id="intype" name="reportTime" class="form-control input-medium Wdate" type="text" value="' + reportTime + '" readonly="readonly" onclick=WdatePicker({dateFmt:"yyyy-MM-dd",isShowClear:true});>');
} else if(reportType == 2){
$("#reportTypeDiv").append('<input id="intype" name="reportTime" class="form-control input-medium Wdate" type="text" value="' + reportTime + '" readonly="readonly" onclick=WdatePicker({dateFmt:"yyyy-MM",isShowClear:true});>');
} else if(reportType == 3){
$("#reportTypeDiv").append('<input id="intype" name="reportTime" class="form-control input-medium Wdate" type="text" value="' + reportTime + '" readonly="readonly" onclick=WdatePicker({dateFmt:"yyyy",isShowClear:true});>');
}
}
var ajaxReport=function(url,target){
loading('<spring:message code="onloading"/>');
$.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();
}
});
}
</script>
</head>
<body>
<div class="page-content">
<div class="theme-panel hidden-xs hidden-sm">
<c:forEach items="${fns:getDictList('SERVICE_ACTION')}" var="action" >
<c:forEach items="${serviceList}" var="service" >
<c:forEach items="${fns:getDictList('SERVICE_ACTION')}" var="action">
<c:forEach items="${serviceList}" var="service" varStatus="status">
<c:if test="${service.functionId eq bean.functionId and action.itemCode eq service.action}">
<div class="btn btn-primary">
<spring:message code="${action.itemValue}"/>1000000
<div data-action="${service.action}" class="service btn
<c:if test="${status.index%2==0}">btn-primary</c:if>
<c:if test="${status.index%2!=0}">btn-default</c:if>">
<spring:message code="${action.itemValue}"/>
<spring:message code="log_total"/>
<span>0</span>
</div>
</c:if>
</c:forEach>
@@ -47,120 +146,146 @@
<small><spring:message code="report_list"/></small>
</h3>
<h5 class="page-header"></h5>
<div class="row">
<div class="col-md-12">
<div class="portlet">
<div class="portlet-body">
<div class="row" >
<form:form id="searchForm" modelAttribute="bean" action="${ctx}/report/list" method="post" class="form-search">
<input id="functionId" name="functionId" type="hidden" value="${bean.functionId}"/>
<input name="cfgName" type="hidden" value="${bean.cfgName}"/>
<input id="reportBusinessType" name="reportBusinessType" type="hidden" value="${bean.reportBusinessType}"/>
<!-- 筛选按钮展开状态-->
<input id="isFilterAction" name="isFilterAction" type="hidden" value="${bean.isFilterAction }"/>
<!-- 搜索内容与操作按钮栏 -->
<div class="col-md-12">
<div class="pull-left">
<form:select path="action" class="selectpicker select2 input-small">
<form:option value=""><spring:message code="action"/></form:option>
<c:forEach items="${fns:getDictList('SERVICE_ACTION')}" var="action" >
<c:forEach items="${serviceList}" var="service" >
<c:if test="${service.functionId eq bean.functionId and action.itemCode eq service.action}">
<form:option value="${action.itemCode}" ><spring:message code="${action.itemValue}"/></form:option>
</c:if>
</c:forEach>
<div class="col-md-12">
<div class="portlet">
<div class="portlet-body">
<div class="row" >
<form:form id="searchForm" modelAttribute="bean" action="${ctx}/report/list" method="post" class="form-search">
<input id="functionId" name="functionId" type="hidden" value="${bean.functionId}"/>
<input name="cfgName" type="hidden" value="${bean.cfgName}"/>
<input id="reportBusinessType" name="reportBusinessType" type="hidden" value="${bean.reportBusinessType}"/>
<!-- 筛选按钮展开状态-->
<input id="isFilterAction" name="isFilterAction" type="hidden" value="${bean.isFilterAction }"/>
<!-- 搜索内容与操作按钮栏 -->
<div class="col-md-12">
<div class="pull-left">
<form:select path="action" class="selectpicker select2 input-small">
<form:option value=""><spring:message code="action"/></form:option>
<c:forEach items="${fns:getDictList('SERVICE_ACTION')}" var="action" >
<c:forEach items="${serviceList}" var="service" >
<c:if test="${service.functionId eq bean.functionId and action.itemCode eq service.action}">
<form:option value="${action.itemCode}" ><spring:message code="${action.itemValue}"/></form:option>
</c:if>
</c:forEach>
</form:select>
</div>
<div class="pull-left">
<div class="btn-group" data-toggle="buttons">
<label class="btn btn-default">
<input type="radio" name="reportType" value="1"
<c:if test="${bean.reportType==1}">checked</c:if>
><spring:message code="小时报"/>
</label>
<label class="btn btn-default">
<input type="radio" name="reportType" value="2"
<c:if test="${bean.reportType==2}">checked</c:if>
><spring:message code="日报"/>
</label>
<label class="btn btn-default">
<input type="radio" name="reportType" value="3"
<c:if test="${bean.reportType==3}">checked</c:if>
><spring:message code="月报"/>
</label>
</div>
</div>
<div class="pull-left">
<button type="button" class="btn blue" onClick="return page()"> <i class="fa fa-search"></i> <spring:message code="search"/> </button>
<button type="button" class="btn btn-default" id="resetBtn" > <i class="fa fa-refresh"></i> <spring:message code="reset"/> </button>
<sys:delRow url="${ctx}/report/export?functionId=${cfg.functionId}" id="contentTable" label="export" maxRow="${page.maxExportSize}"></sys:delRow>
<button type="button" class="btn btn-default" id="filter-btn"> <spring:message code="filter"/><i class="fa fa-angle-double-down"></i></button>
</div>
<div class="pull-right">
<a class="btn btn-icon-only btn-default setfields tooltips"
data-container="body" data-placement="top" data-original-title=<spring:message code="custom_columns"/> href="javascript:;">
<i class="icon-wrench"></i>
</a>
</div>
</c:forEach>
</form:select>
</div>
<!-- 搜索内容与操作按钮栏 -->
<!-- 筛选搜索内容栏默认隐藏-->
<div class="col-md-12 filter-action-select-panle hide" >
<div class="pull-left">
<%-- <div class="btn-group" data-toggle="buttons">
<label class="btn btn-default">
<input type="radio" name="reportType" value="1"
<c:if test="${bean.reportType==1}">checked</c:if>
><spring:message code="小时报"/>
</label>
<label class="btn btn-default">
<input type="radio" name="reportType" value="2"
<c:if test="${bean.reportType==2}">checked</c:if>
><spring:message code="日报"/>
</label>
<label class="btn btn-default">
<input type="radio" name="reportType" value="3"
<c:if test="${bean.reportType==3}">checked</c:if>
><spring:message code="月报"/>
</label>
</div> --%>
<div id="reportTypeDiv" class="input-group">
<div class="input-group-btn">
<form:select path="reportType" class="selectpicker select2 input-small" >
<form:option value="1"><spring:message code="小时报"/></form:option>
<form:option value="2"><spring:message code="日报"/></form:option>
<form:option value="3"><spring:message code="月报"/></form:option>
</form:select>
</div>
<input id="intype" name="reportTime" class="form-control input-medium Wdate" type="text" value="${bean.reportTime }" readonly="readonly">
</div>
</div>
<!-- /筛选搜索内容栏 结束-->
</form:form>
</div>
<div class="table-responsive">
<sys:message content="${message}"/>
<br>
<ul class="nav nav-tabs nav-justified">
<!-- <li><a data-toggle="tab" href="#serviceType">业务类型</a></li> -->
<li
<c:if test="${bean.reportBusinessType eq 'label_report' or bean.reportBusinessType ==null}">
class="active"
</c:if>
><a data-bussiness="label_report" data-toggle="tab" href="#label"><spring:message code="label_report"/></a></li>
<li
<c:if test="${bean.reportBusinessType eq 'attr_type_report'}">
class="active"
</c:if>
><a data-bussiness="attr_type_report" data-toggle="tab" href="#attrType"><spring:message code="attr_type_report"/></a></li>
<li
<c:if test="${bean.reportBusinessType eq 'lwhh_report'}">
class="active"
</c:if>
><a data-bussiness="lwhh_report" data-toggle="tab" href="#lwhh"><spring:message code="lwhh_report"/></a></li>
<li
<c:if test="${bean.reportBusinessType eq 'src_ip_report'}">
class="active"
</c:if>
><a data-bussiness="src_ip_report" data-toggle="tab" href="#srcIp"><spring:message code="src_ip_report"/></a></li>
<li
<c:if test="${bean.reportBusinessType eq 'dest_ip_report'}">
class="active"
</c:if>
><a data-bussiness="dest_ip_report" data-toggle="tab" href="#destIp"><spring:message code="dest_ip_report"/></a></li>
<li
<c:if test="${bean.reportBusinessType eq 'isp_report'}">
class="active"
</c:if>
><a data-bussiness="isp_report" data-toggle="tab" href="#entranceId"><spring:message code="isp_report"/></a></li>
</ul>
<div class="tab-content">
<%@include file="/WEB-INF/views/report/label.jsp" %>
<%@include file="/WEB-INF/views/report/attrType.jsp" %>
<%@include file="/WEB-INF/views/report/lwhh.jsp" %>
<%@include file="/WEB-INF/views/report/srcIp.jsp" %>
<%@include file="/WEB-INF/views/report/destIp.jsp" %>
<%@include file="/WEB-INF/views/report/entranceId.jsp" %>
<div class="pull-left">
<button type="button" class="btn blue" onClick="return page()"> <i class="fa fa-search"></i> <spring:message code="search"/> </button>
<button type="button" class="btn btn-default" id="resetBtn" > <i class="fa fa-refresh"></i> <spring:message code="reset"/> </button>
<sys:delRow url="${ctx}/report/export?functionId=${cfg.functionId}" id="contentTable" label="export" maxRow="${page.maxExportSize}"></sys:delRow>
<button type="button" class="btn btn-default" id="filter-btn"> <spring:message code="filter"/><i class="fa fa-angle-double-down"></i></button>
</div>
<div class="pull-right">
<a class="btn btn-icon-only btn-default setfields tooltips"
data-container="body" data-placement="top" data-original-title=<spring:message code="custom_columns"/> href="javascript:;">
<i class="icon-wrench"></i>
</a>
</div>
</div>
<!-- 搜索内容与操作按钮栏 -->
<!-- 筛选搜索内容栏默认隐藏-->
<div class="col-md-12 filter-action-select-panle hide" >
</div>
<!-- /筛选搜索内容栏 结束-->
</form:form>
</div>
<div class="table-responsive">
<sys:message content="${message}"/>
<br>
<ul class="nav nav-tabs nav-justified">
<li
<c:if test="${bean.reportBusinessType eq 'label_report' or bean.reportBusinessType ==null}">
class="active"
</c:if>
><a data-bussiness="label_report" data-toggle="tab" href="#label"><spring:message code="label_report"/></a></li>
<li
<c:if test="${bean.reportBusinessType eq 'attr_type_report'}">
class="active"
</c:if>
><a data-bussiness="attr_type_report" data-toggle="tab" href="#attrType"><spring:message code="attr_type_report"/></a></li>
<li
<c:if test="${bean.reportBusinessType eq 'lwhh_report'}">
class="active"
</c:if>
><a data-bussiness="lwhh_report" data-toggle="tab" href="#lwhh"><spring:message code="lwhh_report"/></a></li>
<li
<c:if test="${bean.reportBusinessType eq 'src_ip_report'}">
class="active"
</c:if>
><a data-bussiness="src_ip_report" data-toggle="tab" href="#srcIp"><spring:message code="src_ip_report"/></a></li>
<li
<c:if test="${bean.reportBusinessType eq 'dest_ip_report'}">
class="active"
</c:if>
><a data-bussiness="dest_ip_report" data-toggle="tab" href="#destIp"><spring:message code="dest_ip_report"/></a></li>
<li
<c:if test="${bean.reportBusinessType eq 'isp_report'}">
class="active"
</c:if>
><a data-bussiness="isp_report" data-toggle="tab" href="#entranceId"><spring:message code="isp_report"/></a></li>
</ul>
<div class="tab-content">
<div id="label" class="tab-pane fade
<c:if test="${bean.reportBusinessType eq 'label_report' or bean.reportBusinessType ==null}">
in active
</c:if>"></div>
<div id="attrType" class="tab-pane fade
<c:if test="${bean.reportBusinessType eq 'attr_type_report'}">
in active
</c:if>"></div>
<div id="lwhh" class="tab-pane fade
<c:if test="${bean.reportBusinessType eq 'lwhh_report'}">
in active
</c:if>"></div>
<div id="srcIp" class="tab-pane fade
<c:if test="${bean.reportBusinessType eq 'src_ip_report'}">
in active
</c:if>"></div>
<div id="destIp" class="tab-pane fade
<c:if test="${bean.reportBusinessType eq 'dest_ip_report'}">
in active
</c:if>"></div>
<div id="entranceId" class="tab-pane fade
<c:if test="${bean.reportBusinessType eq 'isp_report'}">
in active
</c:if>"></div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
</html>

View File

@@ -4,39 +4,29 @@
$(function(){
});
</script>
<div id="lwhh" class="tab-pane fade">
<table id="contentTable1" class="table table-striped table-bordered table-condensed text-nowrap">
<thead>
<tr>
<th>性质</th>
<th>总量</th>
<th>0点</th>
<th>1点</th>
<th>2点</th>
<th>3点</th>
<th>4点</th>
<th>5点</th>
<th>6点</th>
<th>7点</th>
<th>8点</th>
<th>9点</th>
<th>10点</th>
<th>11点</th>
<th>12点</th>
<th>14点</th>
<th>15点</th>
<th>16点</th>
<th>17点</th>
<th>18点</th>
<th>19点</th>
<th>20点</th>
<th>21点</th>
<th>22点</th>
<th>23点</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
<div class="page">${page}</div>
</div>
<table id="lwhhTable" class="table table-striped table-bordered table-condensed text-nowrap">
<thead>
<tr>
<th><spring:message code="requestInfo"/></th>
<th><spring:message code="log_total"/></th>
<c:forEach items="${titles}" var="title">
<th>${title}</th>
</c:forEach>
</tr>
</thead>
<tbody>
<c:forEach items="${datas}" var="data">
<tr>
<td>
<c:forEach items="${requestInfos}" var="lwhh">
<c:if test="${lwhh.id eq data.key}">${lwhh.requestTitle}</c:if>
</c:forEach>
</td>
<c:forEach items="${data.value}" var="cloumn" varStatus="status">
<td>${cloumn}</td>
</c:forEach>
</tr>
</c:forEach>
</tbody>
</table>
<div class="page">${page}</div>

View File

@@ -4,40 +4,28 @@
$(function(){
});
</script>
<div id="srcIp" class="tab-pane fade">
<table id="contentTable1" class="table table-striped table-bordered table-condensed text-nowrap">
<thead>
<tr>
<th>所属省</th>
<th>所属市</th>
<th>总量</th>
<th>0点</th>
<th>1点</th>
<th>2点</th>
<th>3点</th>
<th>4点</th>
<th>5点</th>
<th>6点</th>
<th>7点</th>
<th>8点</th>
<th>9点</th>
<th>10点</th>
<th>11点</th>
<th>12点</th>
<th>14点</th>
<th>15点</th>
<th>16点</th>
<th>17点</th>
<th>18点</th>
<th>19点</th>
<th>20点</th>
<th>21点</th>
<th>22点</th>
<th>23点</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
<div class="page">${page}</div>
</div>
<table id="contentTable1" class="table table-striped table-bordered table-condensed text-nowrap">
<thead>
<tr>
<th><spring:message code="src_province"/></th>
<th><spring:message code="src_city"/></th>
<th><spring:message code="log_total"/></th>
<c:forEach items="${titles}" var="title">
<th>${title}</th>
</c:forEach>
</tr>
</thead>
<tbody>
<c:forEach items="${datas}" var="data">
<tr>
<c:forEach items="${fn:split(data.key,splitor)}" var="location">
<td>${location}</td>
</c:forEach>
<c:forEach items="${data.value}" var="cloumn" varStatus="status">
<td>${cloumn}</td>
</c:forEach>
</tr>
</c:forEach>
</tbody>
</table>
<div class="page">${page}</div>

View File

@@ -106,13 +106,13 @@
</div>
<span class="help-inline"><font color="red">*</font> </span>
</div>
<div class="form-group">
<input type="hidden" name="roleType" value="user"/>
<%-- <div class="form-group">
<label class="col-md-3 control-label"><spring:message code="role_type"/>:</label>
<div class="col-md-4"><%--
<div class="col-md-4">
<form:input path="roleType" htmlEscape="false" maxlength="50" class="required"/>
<span class="help-inline" title="activiti有3种预定义的组类型security-role、assignment、user 如果使用Activiti Explorer需要security-role才能看到manage页签需要assignment才能claim任务">
工作流组用户组类型security-role管理员、assignment可进行任务分配、user普通用户</span> --%>
工作流组用户组类型security-role管理员、assignment可进行任务分配、user普通用户</span>
<form:select path="roleType" class="form-control">
<form:option value="assignment"><spring:message code="task_allot"/></form:option>
<form:option value="security-role"><spring:message code="manager"/></form:option>
@@ -122,7 +122,7 @@
<spring:message code="role_type_info"/></span>
</div>
</div>
--%>
<div class="form-group">
<label class="col-md-3 control-label"><spring:message code="data_range"/>:</label>
@@ -130,7 +130,7 @@
<form:select path="dataScope" class="form-control">
<form:options items="${fns:getDictList('SYS_DATA_SCOPE')}" itemLabel="itemValue" itemValue="itemCode" htmlEscape="false"/>
</form:select>
<span class="help-inline"><spring:message code="data_range_info"/></span>
<%-- <span class="help-inline"><spring:message code="data_range_info"/></span> --%>
</div>
</div>
<div class="form-group">

View File

@@ -238,6 +238,7 @@ $(function(){
width:$(tagsInputSettings).find(".form-control").width(),
defaultText:'please input keywords',
'delimiter':'***and***',//特殊字符串分隔与表达式的多关键词
maxCount:4,
onAddTag:function(tag,size){
//var keywordValue = "";
var objNamePrefix = $(this).attr("name").split("cfgKeywords")[0];

View File

@@ -15,7 +15,7 @@
*/
(function($) {
var kaiOptions = new Array();
var delimiter = new Array();
var tags_callbacks = new Array();
$.fn.doAutosize = function(o){
@@ -82,6 +82,11 @@
tagslist = new Array();
}
var maxCount=kaiOptions[id]['maxCount'];
if(maxCount>0 && tagslist.length>maxCount-1){
$('#'+id+'_tag').addClass('not_valid');
return ;
}
value = jQuery.trim(value);
if (options.unique) {
@@ -190,6 +195,7 @@
placeholderColor:'#666666',
autosize: true,
comfortZone: 20,
maxCount:0,
inputPadding: 6*2
},options);
@@ -210,6 +216,8 @@
fake_input: '#'+id+'_tag'
},settings);
kaiOptions[id] = new Array();
kaiOptions[id]['maxCount']=settings.maxCount;
delimiter[id] = data.delimiter;
if (settings.onAddTag || settings.onRemoveTag || settings.onChange) {