From e5af29716fc7476ace12628586d7267f290050d0 Mon Sep 17 00:00:00 2001 From: wangxin Date: Wed, 13 Jun 2018 15:56:29 +0800 Subject: [PATCH] =?UTF-8?q?(1)=E5=8A=A0=E8=BD=BD=E4=B8=AD=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E6=8F=90=E4=BA=A4=20(2)=E6=9F=A5=E8=AF=A2=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E6=80=BB=E9=87=8FController=E6=8F=90=E4=BA=A4=20?= =?UTF-8?q?=E5=BE=85=E6=8E=A5=E5=8F=A3=E5=8F=AF=E7=94=A8=E5=90=8E=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/nis/domain/log/ReportLog.java | 91 +++++++++++++++++++ .../com/nis/domain/log/ReportResultLog.java | 76 +--------------- .../log/ntc/NtcPzReportController.java | 59 ++++++++++++ .../webapp/WEB-INF/views/cfg/iplist/list.jsp | 10 +- .../webapp/static/global/css/components.css | 8 ++ 5 files changed, 162 insertions(+), 82 deletions(-) create mode 100644 src/main/java/com/nis/domain/log/ReportLog.java create mode 100644 src/main/java/com/nis/web/controller/log/ntc/NtcPzReportController.java diff --git a/src/main/java/com/nis/domain/log/ReportLog.java b/src/main/java/com/nis/domain/log/ReportLog.java new file mode 100644 index 000000000..d912e813b --- /dev/null +++ b/src/main/java/com/nis/domain/log/ReportLog.java @@ -0,0 +1,91 @@ +/** + *@Title: ReportLog.java + *@Package com.nis.domain.log + *@Description TODO + *@author dell + *@date 2018年6月13日 下午2:21:04 + *@version 版本号 + */ +package com.nis.domain.log; + +import java.util.Date; + +import com.nis.domain.BaseEntity; + +/** + * @ClassName: ReportLog.java + * @Description: TODO + * @author (dell) + * @date 2018年6月13日 下午2:21:04 + * @version V1.0 + */ +public class ReportLog extends BaseEntity{ + /** + * @Fields serialVersionUID:TODO(用一句话描述这个变量表示什么) + * + * @since 1.0.0 + */ + + private static final long serialVersionUID = 7079305499220977782L; + private Long configId; + private Long sum; + private Integer service; + private Date statTime; + /** + * configId + * @return configId + */ + + public Long getConfigId() { + return configId; + } + /** + * @param configId the configId to set + */ + public void setConfigId(Long configId) { + this.configId = configId; + } + /** + * sum + * @return sum + */ + + public Long getSum() { + return sum; + } + /** + * @param sum the sum to set + */ + public void setSum(Long sum) { + this.sum = sum; + } + /** + * service + * @return service + */ + + public Integer getService() { + return service; + } + /** + * @param service the service to set + */ + public void setService(Integer service) { + this.service = service; + } + /** + * statTime + * @return statTime + */ + + public Date getStatTime() { + return statTime; + } + /** + * @param statTime the statTime to set + */ + public void setStatTime(Date statTime) { + this.statTime = statTime; + } + +} diff --git a/src/main/java/com/nis/domain/log/ReportResultLog.java b/src/main/java/com/nis/domain/log/ReportResultLog.java index 38cc46bea..19b50d3dc 100644 --- a/src/main/java/com/nis/domain/log/ReportResultLog.java +++ b/src/main/java/com/nis/domain/log/ReportResultLog.java @@ -24,7 +24,7 @@ import com.nis.domain.RestfulResult; */ public class ReportResultLog extends RestfulResult{ private Integer logSource; - private List> data; + private Page data; /** * logSource * @return logSource @@ -44,84 +44,14 @@ public class ReportResultLog extends RestfulResult{ * @return data */ - public List> getData() { + public Page getData() { return data; } /** * @param data the data to set */ - public void setData(List> data) { + public void setData(Page data) { this.data = data; } -} -class ReportLog extends BaseEntity{ - /** - * @Fields serialVersionUID:TODO(用一句话描述这个变量表示什么) - * - * @since 1.0.0 - */ - - private static final long serialVersionUID = 7079305499220977782L; - private Long configId; - private Long sum; - private Integer service; - private Date statTime; - /** - * configId - * @return configId - */ - - public Long getConfigId() { - return configId; - } - /** - * @param configId the configId to set - */ - public void setConfigId(Long configId) { - this.configId = configId; - } - /** - * sum - * @return sum - */ - - public Long getSum() { - return sum; - } - /** - * @param sum the sum to set - */ - public void setSum(Long sum) { - this.sum = sum; - } - /** - * service - * @return service - */ - - public Integer getService() { - return service; - } - /** - * @param service the service to set - */ - public void setService(Integer service) { - this.service = service; - } - /** - * statTime - * @return statTime - */ - - public Date getStatTime() { - return statTime; - } - /** - * @param statTime the statTime to set - */ - public void setStatTime(Date statTime) { - this.statTime = statTime; - } - } \ No newline at end of file diff --git a/src/main/java/com/nis/web/controller/log/ntc/NtcPzReportController.java b/src/main/java/com/nis/web/controller/log/ntc/NtcPzReportController.java new file mode 100644 index 000000000..26a9206c1 --- /dev/null +++ b/src/main/java/com/nis/web/controller/log/ntc/NtcPzReportController.java @@ -0,0 +1,59 @@ +/** + *@Title: NtcPzReportController.java + *@Package com.nis.web.controller.log.ntc + *@Description TODO + *@author dell + *@date 2018年6月12日 下午2:09:41 + *@version 版本号 + */ +package com.nis.web.controller.log.ntc; + +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; + +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.RequestMapping; +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.util.ConfigServiceUtil; +import com.nis.util.Constants; +import com.nis.util.DictUtils; +import com.nis.web.controller.BaseController; + +/** + * @ClassName: NtcPzReportController.java + * @Description: TODO + * @author (dell) + * @date 2018年6月12日 下午2:09:41 + * @version V1.0 + */ +@Controller +@RequestMapping("${adminPath}/logs") +public class NtcPzReportController extends BaseController{ + @RequestMapping(value="ajaxGetLogTotal") + @ResponseBody + public String ajaxGetLogTotal(Model model,long endTime,int action,Integer functionId,String compileIds){ + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mi:ss"); + int interval=Constants.LOG_TIME_RANGE; + Date endDate=new Date(endTime); + Date startDate=new Date(endTime-interval); + int serviceId=0; + List serviceList=DictUtils.getFunctionServiceDictList(functionId.intValue()); + for(FunctionServiceDict service:serviceList){ + if(service.getAction().intValue()==action){ + serviceId=service.getServiceId().intValue(); + break; + } + } + ReportResultLog result=ConfigServiceUtil.getReport(Constants.BUSINESSTYPE_CONFIG, compileIds, String.valueOf(serviceId), sdf.format(startDate), sdf.format(endDate)); + if(result.getData()!=null&&result.getData().getList()!=null){ + model.addAttribute("data", result.getData().getList()); + } + return "success"; + } +} diff --git a/src/main/webapp/WEB-INF/views/cfg/iplist/list.jsp b/src/main/webapp/WEB-INF/views/cfg/iplist/list.jsp index 735d83504..b6fca1c44 100644 --- a/src/main/webapp/WEB-INF/views/cfg/iplist/list.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/iplist/list.jsp @@ -311,7 +311,7 @@ - 0 +
${cfg.creatorName } ${cfg.editorName } @@ -328,13 +328,5 @@ - \ No newline at end of file diff --git a/src/main/webapp/static/global/css/components.css b/src/main/webapp/static/global/css/components.css index acab99555..b7b607612 100644 --- a/src/main/webapp/static/global/css/components.css +++ b/src/main/webapp/static/global/css/components.css @@ -22569,4 +22569,12 @@ span[id^='open']{ } span[id^='close']{ cursor:pointer; +} +.loading-total{ + width:50px; + height:10px; + position:relative; + background:url(../img/loading.gif) no-repeat center center; + opacity:0.7; + filter:progid:DXImageTransform.Microsoft.Alpha(opacity=70); } \ No newline at end of file