diff --git a/src/main/java/com/nis/domain/log/NtcLwhhReportLog.java b/src/main/java/com/nis/domain/log/NtcLwhhReportLog.java new file mode 100644 index 000000000..1a432cc64 --- /dev/null +++ b/src/main/java/com/nis/domain/log/NtcLwhhReportLog.java @@ -0,0 +1,43 @@ +/** + *@Title: NtcServiceReportLog.java + *@Package com.nis.domain.log + *@Description TODO + *@author dell + *@date 2018年7月9日 上午8:57:01 + *@version 版本号 + */ +package com.nis.domain.log; + +/** + * @ClassName: NtcServiceReportLog.java + * @Description: TODO + * @author (dell) + * @date 2018年7月9日 上午8:57:01 + * @version V1.0 + */ +public class NtcLwhhReportLog extends BaseReportLog { + + /** + * @Fields serialVersionUID:TODO(用一句话描述这个变量表示什么) + * + * @since 1.0.0 + */ + + private static final long serialVersionUID = 2245672277797057001L; + private Integer lwhh; + /** + * lwhh + * @return lwhh + */ + + public Integer getLwhh() { + return lwhh; + } + /** + * @param lwhh the lwhh to set + */ + public void setLwhh(Integer lwhh) { + this.lwhh = lwhh; + } + +} diff --git a/src/main/java/com/nis/domain/log/SearchReport.java b/src/main/java/com/nis/domain/log/SearchReport.java index 55e0feedf..fdb60bf07 100644 --- a/src/main/java/com/nis/domain/log/SearchReport.java +++ b/src/main/java/com/nis/domain/log/SearchReport.java @@ -44,7 +44,23 @@ public class SearchReport extends BaseEntity{ private Integer pageSize; private String orderBy; private String fields; + //界面查询的时间 + private String reportTime; + /** + * reportTime + * @return reportTime + */ + + public String getReportTime() { + return reportTime; + } + /** + * @param reportTime the reportTime to set + */ + public void setReportTime(String reportTime) { + this.reportTime = reportTime; + } /** * pageNo * @return pageNo diff --git a/src/main/java/com/nis/web/controller/report/NtcLwhhReportController.java b/src/main/java/com/nis/web/controller/report/NtcLwhhReportController.java new file mode 100644 index 000000000..ae7f7b9a6 --- /dev/null +++ b/src/main/java/com/nis/web/controller/report/NtcLwhhReportController.java @@ -0,0 +1,158 @@ +package com.nis.web.controller.report; + +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.HashMap; +import java.util.List; + +import 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.NtcLwhhReportLog; +import com.nis.domain.log.ReportResultLog; +import com.nis.domain.log.SearchReport; +import com.nis.util.Constants; +import com.nis.util.DictUtils; +import com.nis.web.controller.BaseController; + +@Controller +@RequestMapping("${adminPath}/report") +public class NtcLwhhReportController extends BaseController { + @RequestMapping("/ajaxNtcLwhhReport") + public String list(@ModelAttribute("bean") SearchReport bean,Model model, HttpServletRequest request, HttpServletResponse response) { + List serviceList = DictUtils.getFunctionServiceDictList(bean.getFunctionId()); + List requestInfos=requestInfoService.getAllRequestInfo(); + model.addAttribute("requestInfos", requestInfos); + if(bean.getAction()!=null){ + for(FunctionServiceDict service:serviceList){ + if(service.getAction().intValue()==bean.getAction().intValue()){ + bean.setSearchService(service.getServiceId().toString()); + } + } + }else{ + StringBuffer serviceId=new StringBuffer(); + for(int i=0;i result=new ReportResultLog<>(); + StringBuffer url=new StringBuffer(Constants.LOG_BASE_URL+Constants.NTC_SERVICE_REPORT+"?"); + bean.setPageSize(-1); + bean.setFields("lwhh,sum,reportTime"); + String format=Constants.SEARCH_DATEFORMAT; + SimpleDateFormat sdf=new SimpleDateFormat(format); + Date date=new Date(); + bean.setSearchReportEndTime(sdf.format(date)); + Calendar cal=Calendar.getInstance(); + cal.set(Calendar.MINUTE, 0); + cal.set(Calendar.SECOND, 0); + cal.set(Calendar.MILLISECOND, 0); + if(bean.getReportType()==Constants.REPORT_TYPE_HOUR){ + cal.set(Calendar.HOUR_OF_DAY, 0); + }else if(bean.getReportType()==Constants.REPORT_TYPE_DAY){ + cal.set(Calendar.HOUR_OF_DAY, 0); + cal.set(Calendar.DAY_OF_MONTH, 1); + }else if(bean.getReportType()==Constants.REPORT_TYPE_MONTH){ + cal.set(Calendar.HOUR_OF_DAY, 0); + cal.set(Calendar.DAY_OF_MONTH, 1); + cal.set(Calendar.MONTH, 0); + } + logger.info("search start time "+sdf.format(cal.getTime())); + logger.info("search end time "+sdf.format(date)); + bean.setSearchReportStartTime(sdf.format(cal.getTime())); + List titles=new ArrayList(); + while(cal.getTime().getTime() page=result.getData(); +// List list=page.getList(); +// HashMap trimData=new HashMap<>();//数据累加去重 +// for(NtcLwhhReportLog report:list){ +// String trimStr=""; +// if(bean.getReportType()==Constants.REPORT_TYPE_HOUR){ +// trimStr=report.getLwhh().intValue()+Constants.REPORT_TRIM_CONNECTOR+ +// sdf.format(cal.getTime()).substring(0,13); +// +// }else if(bean.getReportType()==Constants.REPORT_TYPE_DAY){ +// trimStr=report.getLwhh().intValue()+Constants.REPORT_TRIM_CONNECTOR+ +// sdf.format(cal.getTime()).substring(0,10); +// +// }else if(bean.getReportType()==Constants.REPORT_TYPE_MONTH){ +// trimStr=report.getLwhh().intValue()+Constants.REPORT_TRIM_CONNECTOR+ +// sdf.format(cal.getTime()).substring(0,7); +// } +// if(trimData.containsKey(trimStr)){ +// trimData.put(trimStr, trimData.get(trimStr)+report.getSum().longValue()); +// }else{ +// trimData.put(trimStr, report.getSum().longValue()); +// } +// } +// HashMap> showData=new HashMap<>();//构造数据展示集合 +// for(RequestInfo requestInfo:requestInfos){ +// List line= new ArrayList(); +// long total=0; +// for(String title:titles){ +// if(trimData.containsKey(requestInfo.getId().longValue()+Constants.REPORT_TRIM_CONNECTOR+title)){ +// line.add(trimData.get(requestInfo.getId().longValue()+Constants.REPORT_TRIM_CONNECTOR+title)); +// total+=trimData.get(requestInfo.getId().longValue()+Constants.REPORT_TRIM_CONNECTOR+title).longValue(); +// }else{ +// line.add(0l); +// } +// } +// List _line= new ArrayList(); +// _line.add(total); +// _line.addAll(line); +// showData.put(requestInfo.getId().toString(), _line); +// } +// model.addAttribute("datas", showData); +// } catch (Exception e) { +// // TODO: handle exception +// e.printStackTrace(); +// } + HashMap> showData=new HashMap<>();//构造数据展示集合 + for(RequestInfo requestInfo:requestInfos){ + List line= new ArrayList(); + long total=0l; + for(String title:titles){ + line.add(10000l); + total+=10000l; + } + List _line= new ArrayList(); + _line.add(total); + _line.addAll(line); + showData.put(requestInfo.getId().toString(), _line); + } + model.addAttribute("datas", showData); + return "/report/lwhh"; + } +} diff --git a/src/main/java/com/nis/web/controller/report/NtcTagReportController.java b/src/main/java/com/nis/web/controller/report/NtcTagReportController.java index b8d0a274a..0fda1438e 100644 --- a/src/main/java/com/nis/web/controller/report/NtcTagReportController.java +++ b/src/main/java/com/nis/web/controller/report/NtcTagReportController.java @@ -31,7 +31,6 @@ import com.nis.web.controller.BaseController; public class NtcTagReportController extends BaseController { @RequestMapping("/ajaxNtcTagReport") public String list(@ModelAttribute("bean") SearchReport bean,Model model, HttpServletRequest request, HttpServletResponse response) { - initReportCondition(model, bean); List serviceList = DictUtils.getFunctionServiceDictList(bean.getFunctionId()); List labels=serviceDictInfoService.findAllLableDict(); model.addAttribute("labels", labels); diff --git a/src/main/webapp/WEB-INF/views/report/list.jsp b/src/main/webapp/WEB-INF/views/report/list.jsp index 515d02eeb..8ecbef2eb 100644 --- a/src/main/webapp/WEB-INF/views/report/list.jsp +++ b/src/main/webapp/WEB-INF/views/report/list.jsp @@ -21,6 +21,8 @@ ajaxGetLabelReport(); }else if("${bean.reportBusinessType}"=="label_report"){ ajaxGetLabelReport(); + }else if("${bean.reportBusinessType}"=="lwhh_report"){ + ajaxGetLwhhReport(); } $("input[name='reportType']").each(function(){ var type='${bean.reportType}'; @@ -36,6 +38,8 @@ var reportType=$('input[name="reportType"]:checked').val(); if($(this).data("bussiness")=="label_report"){ ajaxGetLabelReport(); + }else if($(this).data("bussiness")=="lwhh_report"){ + ajaxGetLwhhReport(); } } }); @@ -55,6 +59,21 @@ var ajaxGetLabelReport=function(){ } }); } +var ajaxGetLwhhReport=function(){ + $.ajax({ + type:'post', + async:false, + url:'${ctx}/report/ajaxNtcLwhhReport', + data:{ + "action":$('select[name="action"]').val(), + "reportType":$('input[name="reportType"]:checked').val() + }, + dataType:"html", + success:function(data){ + $("#lwhh").html(data); + } + }); +} @@ -177,9 +196,15 @@ var ajaxGetLabelReport=function(){ >
-
+
+ in active + ">
<%@include file="/WEB-INF/views/report/attrType.jsp" %> - <%@include file="/WEB-INF/views/report/lwhh.jsp" %> +
+ in active + ">
<%@include file="/WEB-INF/views/report/srcIp.jsp" %> <%@include file="/WEB-INF/views/report/destIp.jsp" %> <%@include file="/WEB-INF/views/report/entranceId.jsp" %> diff --git a/src/main/webapp/WEB-INF/views/report/lwhh.jsp b/src/main/webapp/WEB-INF/views/report/lwhh.jsp index 1d2a8b5f8..6f241d27d 100644 --- a/src/main/webapp/WEB-INF/views/report/lwhh.jsp +++ b/src/main/webapp/WEB-INF/views/report/lwhh.jsp @@ -4,39 +4,29 @@ $(function(){ }); -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
性质总量0点1点2点3点4点5点6点7点8点9点10点11点12点14点15点16点17点18点19点20点21点22点23点
-
${page}
-
\ No newline at end of file + + + + + + + + + + + + + + + + + + + + +
${title}
+ + ${lwhh.requestTitle} + + ${cloumn}
+
${page}