LogReport更名为NtcPzReport
This commit is contained in:
@@ -17,7 +17,7 @@ import java.util.Date;
|
||||
* @date 2018年6月13日 下午2:21:04
|
||||
* @version V1.0
|
||||
*/
|
||||
public class LogReport extends BaseReport<LogReport>{
|
||||
public class NtcPzReport extends BaseReport<NtcPzReport>{
|
||||
/**
|
||||
* @Fields serialVersionUID:TODO(用一句话描述这个变量表示什么)
|
||||
*
|
||||
@@ -26,8 +26,6 @@ public class LogReport extends BaseReport<LogReport>{
|
||||
|
||||
private static final long serialVersionUID = 7079305499220977782L;
|
||||
private Long configId;
|
||||
private Long sum;
|
||||
private Integer service;
|
||||
private Date statTime;
|
||||
/**
|
||||
* configId
|
||||
@@ -43,34 +41,6 @@ public class LogReport extends BaseReport<LogReport>{
|
||||
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
|
||||
@@ -18,7 +18,7 @@ import org.slf4j.LoggerFactory;
|
||||
import com.google.common.reflect.TypeToken;
|
||||
import com.google.gson.Gson;
|
||||
import com.nis.domain.maat.ToMaatResult;
|
||||
import com.nis.domain.report.LogReport;
|
||||
import com.nis.domain.report.NtcPzReport;
|
||||
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 ReportResult<LogReport> getReport(int type,String ids,String serviceIds,String searchReportStartTime,String searchReportEndTime) throws MaatConvertException{
|
||||
public static ReportResult<NtcPzReport> 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;
|
||||
ReportResult<LogReport> bean = null;
|
||||
ReportResult<NtcPzReport> 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<ReportResult<LogReport>>(){
|
||||
bean = gson.fromJson(result, new TypeToken<ReportResult<NtcPzReport>>(){
|
||||
private static final long serialVersionUID = 7963055764864141968L;}.getType());
|
||||
}else{
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+response.readEntity(String.class));
|
||||
|
||||
@@ -9,22 +9,27 @@
|
||||
package com.nis.web.controller.report;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
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.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import com.nis.domain.FunctionServiceDict;
|
||||
import com.nis.domain.report.LogReport;
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.basics.ServiceDictInfo;
|
||||
import com.nis.domain.log.SearchReport;
|
||||
import com.nis.domain.report.NtcPzReport;
|
||||
import com.nis.domain.report.ReportResult;
|
||||
import com.nis.util.ConfigServiceUtil;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.DictUtils;
|
||||
import com.nis.web.controller.BaseController;
|
||||
@@ -69,5 +74,42 @@ public class NtcPzReportController extends BaseController{
|
||||
// }
|
||||
return data;
|
||||
}
|
||||
@RequestMapping("/ntcPzReport")
|
||||
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());
|
||||
}
|
||||
ReportResult<NtcPzReport> result=new ReportResult<>();
|
||||
StringBuffer url=new StringBuffer(Constants.LOG_BASE_URL+Constants.NTC_PZ_REPORT+"?");
|
||||
|
||||
List<String> titles=this.getDateTitiles(bean);
|
||||
model.addAttribute("titles", titles);
|
||||
try {
|
||||
result=result.getReport(url.toString(), bean);
|
||||
Page<NtcPzReport> page=result.getData();
|
||||
List<NtcPzReport> list=page.getList();
|
||||
model.addAttribute("datas", list);
|
||||
} catch (Exception e) {
|
||||
// TODO: handle exception
|
||||
e.printStackTrace();
|
||||
}
|
||||
return "/report/pz";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user