新建package report,所有报表的pojo放入其中
This commit is contained in:
@@ -6,7 +6,7 @@
|
|||||||
*@date 2018年7月5日 上午11:12:48
|
*@date 2018年7月5日 上午11:12:48
|
||||||
*@version 版本号
|
*@version 版本号
|
||||||
*/
|
*/
|
||||||
package com.nis.domain.log;
|
package com.nis.domain.report;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
@@ -19,7 +19,7 @@ import com.nis.domain.BaseEntity;
|
|||||||
* @date 2018年7月5日 上午11:12:48
|
* @date 2018年7月5日 上午11:12:48
|
||||||
* @version V1.0
|
* @version V1.0
|
||||||
*/
|
*/
|
||||||
public class BaseReportLog<T> extends BaseEntity<T> {
|
public class BaseReport<T> extends BaseEntity<T> {
|
||||||
/**
|
/**
|
||||||
* @Fields serialVersionUID:TODO(用一句话描述这个变量表示什么)
|
* @Fields serialVersionUID:TODO(用一句话描述这个变量表示什么)
|
||||||
*
|
*
|
||||||
@@ -6,7 +6,7 @@
|
|||||||
*@date 2018年6月13日 下午2:21:04
|
*@date 2018年6月13日 下午2:21:04
|
||||||
*@version 版本号
|
*@version 版本号
|
||||||
*/
|
*/
|
||||||
package com.nis.domain.log;
|
package com.nis.domain.report;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
@@ -17,7 +17,7 @@ import java.util.Date;
|
|||||||
* @date 2018年6月13日 下午2:21:04
|
* @date 2018年6月13日 下午2:21:04
|
||||||
* @version V1.0
|
* @version V1.0
|
||||||
*/
|
*/
|
||||||
public class ReportLog extends BaseReportLog<ReportLog>{
|
public class LogReport extends BaseReport<LogReport>{
|
||||||
/**
|
/**
|
||||||
* @Fields serialVersionUID:TODO(用一句话描述这个变量表示什么)
|
* @Fields serialVersionUID:TODO(用一句话描述这个变量表示什么)
|
||||||
*
|
*
|
||||||
@@ -6,7 +6,7 @@
|
|||||||
*@date 2018年7月9日 上午8:57:01
|
*@date 2018年7月9日 上午8:57:01
|
||||||
*@version 版本号
|
*@version 版本号
|
||||||
*/
|
*/
|
||||||
package com.nis.domain.log;
|
package com.nis.domain.report;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ClassName: NtcServiceReportLog.java
|
* @ClassName: NtcServiceReportLog.java
|
||||||
@@ -15,7 +15,7 @@ package com.nis.domain.log;
|
|||||||
* @date 2018年7月9日 上午8:57:01
|
* @date 2018年7月9日 上午8:57:01
|
||||||
* @version V1.0
|
* @version V1.0
|
||||||
*/
|
*/
|
||||||
public class NtcLwhhReportLog extends BaseReportLog<NtcLwhhReportLog> {
|
public class NtcLwhhReport extends BaseReport<NtcLwhhReport> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Fields serialVersionUID:TODO(用一句话描述这个变量表示什么)
|
* @Fields serialVersionUID:TODO(用一句话描述这个变量表示什么)
|
||||||
@@ -6,7 +6,7 @@
|
|||||||
*@date 2018年7月9日 上午8:57:01
|
*@date 2018年7月9日 上午8:57:01
|
||||||
*@version 版本号
|
*@version 版本号
|
||||||
*/
|
*/
|
||||||
package com.nis.domain.log;
|
package com.nis.domain.report;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ClassName: NtcServiceReportLog.java
|
* @ClassName: NtcServiceReportLog.java
|
||||||
@@ -15,7 +15,7 @@ package com.nis.domain.log;
|
|||||||
* @date 2018年7月9日 上午8:57:01
|
* @date 2018年7月9日 上午8:57:01
|
||||||
* @version V1.0
|
* @version V1.0
|
||||||
*/
|
*/
|
||||||
public class NtcServiceReportLog extends BaseReportLog<NtcServiceReportLog> {
|
public class NtcServiceReport extends BaseReport<NtcServiceReport> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Fields serialVersionUID:TODO(用一句话描述这个变量表示什么)
|
* @Fields serialVersionUID:TODO(用一句话描述这个变量表示什么)
|
||||||
@@ -6,7 +6,7 @@
|
|||||||
*@date 2018年7月9日 上午8:57:01
|
*@date 2018年7月9日 上午8:57:01
|
||||||
*@version 版本号
|
*@version 版本号
|
||||||
*/
|
*/
|
||||||
package com.nis.domain.log;
|
package com.nis.domain.report;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ClassName: NtcServiceReportLog.java
|
* @ClassName: NtcServiceReportLog.java
|
||||||
@@ -15,7 +15,7 @@ package com.nis.domain.log;
|
|||||||
* @date 2018年7月9日 上午8:57:01
|
* @date 2018年7月9日 上午8:57:01
|
||||||
* @version V1.0
|
* @version V1.0
|
||||||
*/
|
*/
|
||||||
public class NtcTagReportLog extends BaseReportLog<NtcTagReportLog> {
|
public class NtcTagReport extends BaseReport<NtcTagReport> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Fields serialVersionUID:TODO(用一句话描述这个变量表示什么)
|
* @Fields serialVersionUID:TODO(用一句话描述这个变量表示什么)
|
||||||
@@ -6,7 +6,7 @@
|
|||||||
*@date 2018年6月11日 下午2:04:09
|
*@date 2018年6月11日 下午2:04:09
|
||||||
*@version 版本号
|
*@version 版本号
|
||||||
*/
|
*/
|
||||||
package com.nis.domain.log;
|
package com.nis.domain.report;
|
||||||
|
|
||||||
import java.io.UnsupportedEncodingException;
|
import java.io.UnsupportedEncodingException;
|
||||||
import java.net.URLEncoder;
|
import java.net.URLEncoder;
|
||||||
@@ -21,6 +21,7 @@ import com.google.common.reflect.TypeToken;
|
|||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.nis.domain.Page;
|
import com.nis.domain.Page;
|
||||||
import com.nis.domain.RestfulResult;
|
import com.nis.domain.RestfulResult;
|
||||||
|
import com.nis.domain.log.SearchReport;
|
||||||
import com.nis.exceptions.MaatConvertException;
|
import com.nis.exceptions.MaatConvertException;
|
||||||
import com.nis.util.Constants;
|
import com.nis.util.Constants;
|
||||||
import com.nis.util.StringUtils;
|
import com.nis.util.StringUtils;
|
||||||
@@ -33,7 +34,7 @@ import com.nis.util.httpclient.ClientUtil;
|
|||||||
* @date 2018年6月11日 下午2:04:09
|
* @date 2018年6月11日 下午2:04:09
|
||||||
* @version V1.0
|
* @version V1.0
|
||||||
*/
|
*/
|
||||||
public class ReportResultLog<T extends BaseReportLog> extends RestfulResult{
|
public class ReportResult<T extends BaseReport> extends RestfulResult{
|
||||||
private Integer logSource;
|
private Integer logSource;
|
||||||
private Page<T> data;
|
private Page<T> data;
|
||||||
/**
|
/**
|
||||||
@@ -64,12 +65,12 @@ public class ReportResultLog<T extends BaseReportLog> extends RestfulResult{
|
|||||||
public void setData(Page<T> data) {
|
public void setData(Page<T> data) {
|
||||||
this.data = data;
|
this.data = data;
|
||||||
}
|
}
|
||||||
public ReportResultLog<T> getReport(String reportUrl,SearchReport searchCondition) throws MaatConvertException, UnsupportedEncodingException{
|
public ReportResult<T> getReport(String reportUrl,SearchReport searchCondition) throws MaatConvertException, UnsupportedEncodingException{
|
||||||
// if(StringUtils.isBlank(searchCondition.getSearchService())){
|
// if(StringUtils.isBlank(searchCondition.getSearchService())){
|
||||||
// throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>");
|
// throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>");
|
||||||
// }
|
// }
|
||||||
String result = null;
|
String result = null;
|
||||||
ReportResultLog<T> bean = null;
|
ReportResult<T> bean = null;
|
||||||
StringBuffer url=new StringBuffer(reportUrl);
|
StringBuffer url=new StringBuffer(reportUrl);
|
||||||
url.append("searchBusinessType=").append(searchCondition.getSearchBusinessType())
|
url.append("searchBusinessType=").append(searchCondition.getSearchBusinessType())
|
||||||
.append("&searchService=").append(searchCondition.getSearchService());
|
.append("&searchService=").append(searchCondition.getSearchService());
|
||||||
@@ -103,14 +104,11 @@ public class ReportResultLog<T extends BaseReportLog> extends RestfulResult{
|
|||||||
if( response.getStatus() == 200){
|
if( response.getStatus() == 200){
|
||||||
result= response.readEntity(String.class);
|
result= response.readEntity(String.class);
|
||||||
Gson gson=Constants.gsonbuilder.create();
|
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());
|
private static final long serialVersionUID = 7963055764864141968L;}.getType());
|
||||||
}else{
|
}else{
|
||||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+response.readEntity(String.class));
|
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+response.readEntity(String.class));
|
||||||
}
|
}
|
||||||
return bean;
|
return bean;
|
||||||
}
|
}
|
||||||
public static void main(String[] args) {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -17,9 +17,9 @@ import org.slf4j.LoggerFactory;
|
|||||||
|
|
||||||
import com.google.common.reflect.TypeToken;
|
import com.google.common.reflect.TypeToken;
|
||||||
import com.google.gson.Gson;
|
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.maat.ToMaatResult;
|
||||||
|
import com.nis.domain.report.LogReport;
|
||||||
|
import com.nis.domain.report.ReportResult;
|
||||||
import com.nis.exceptions.MaatConvertException;
|
import com.nis.exceptions.MaatConvertException;
|
||||||
import com.nis.util.httpclient.ClientUtil;
|
import com.nis.util.httpclient.ClientUtil;
|
||||||
|
|
||||||
@@ -309,12 +309,12 @@ public class ConfigServiceUtil {
|
|||||||
* @exception
|
* @exception
|
||||||
* @since 1.0.0
|
* @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)){
|
if(StringUtils.isBlank(ids)||StringUtils.isBlank(serviceIds)){
|
||||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>");
|
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>");
|
||||||
}
|
}
|
||||||
String result = null;
|
String result = null;
|
||||||
ReportResultLog<ReportLog> bean = null;
|
ReportResult<LogReport> bean = null;
|
||||||
StringBuffer url=new StringBuffer(Constants.SERVICE_URL+Constants.NTC_PZ_REPORT+"?");
|
StringBuffer url=new StringBuffer(Constants.SERVICE_URL+Constants.NTC_PZ_REPORT+"?");
|
||||||
url.append("searchBusinessType=").append(type)
|
url.append("searchBusinessType=").append(type)
|
||||||
.append("&searchService=").append(serviceIds).append("&searchCfgId=").append(ids);
|
.append("&searchService=").append(serviceIds).append("&searchCfgId=").append(ids);
|
||||||
@@ -331,7 +331,7 @@ public class ConfigServiceUtil {
|
|||||||
if( response.getStatus() == 200){
|
if( response.getStatus() == 200){
|
||||||
result= response.readEntity(String.class);
|
result= response.readEntity(String.class);
|
||||||
Gson gson=Constants.gsonbuilder.create();
|
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());
|
private static final long serialVersionUID = 7963055764864141968L;}.getType());
|
||||||
}else{
|
}else{
|
||||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+response.readEntity(String.class));
|
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+response.readEntity(String.class));
|
||||||
|
|||||||
@@ -22,8 +22,8 @@ import org.springframework.web.bind.annotation.RequestMethod;
|
|||||||
import org.springframework.web.bind.annotation.ResponseBody;
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
|
||||||
import com.nis.domain.FunctionServiceDict;
|
import com.nis.domain.FunctionServiceDict;
|
||||||
import com.nis.domain.log.ReportLog;
|
import com.nis.domain.report.LogReport;
|
||||||
import com.nis.domain.log.ReportResultLog;
|
import com.nis.domain.report.ReportResult;
|
||||||
import com.nis.util.ConfigServiceUtil;
|
import com.nis.util.ConfigServiceUtil;
|
||||||
import com.nis.util.Constants;
|
import com.nis.util.Constants;
|
||||||
import com.nis.util.DictUtils;
|
import com.nis.util.DictUtils;
|
||||||
|
|||||||
@@ -19,9 +19,9 @@ import com.nis.domain.FunctionServiceDict;
|
|||||||
import com.nis.domain.Page;
|
import com.nis.domain.Page;
|
||||||
import com.nis.domain.basics.ServiceDictInfo;
|
import com.nis.domain.basics.ServiceDictInfo;
|
||||||
import com.nis.domain.configuration.RequestInfo;
|
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.domain.log.SearchReport;
|
||||||
|
import com.nis.domain.report.NtcLwhhReport;
|
||||||
|
import com.nis.domain.report.ReportResult;
|
||||||
import com.nis.util.Constants;
|
import com.nis.util.Constants;
|
||||||
import com.nis.util.DictUtils;
|
import com.nis.util.DictUtils;
|
||||||
import com.nis.web.controller.BaseController;
|
import com.nis.web.controller.BaseController;
|
||||||
@@ -52,7 +52,7 @@ public class NtcLwhhReportController extends BaseController {
|
|||||||
bean.setSearchService(serviceId.toString());
|
bean.setSearchService(serviceId.toString());
|
||||||
}
|
}
|
||||||
bean.setSearchBusinessType("1");
|
bean.setSearchBusinessType("1");
|
||||||
ReportResultLog<NtcLwhhReportLog> result=new ReportResultLog<>();
|
ReportResult<NtcLwhhReport> result=new ReportResult<>();
|
||||||
StringBuffer url=new StringBuffer(Constants.LOG_BASE_URL+Constants.NTC_SERVICE_REPORT+"?");
|
StringBuffer url=new StringBuffer(Constants.LOG_BASE_URL+Constants.NTC_SERVICE_REPORT+"?");
|
||||||
bean.setPageSize(-1);
|
bean.setPageSize(-1);
|
||||||
bean.setFields("lwhh,sum,reportTime");
|
bean.setFields("lwhh,sum,reportTime");
|
||||||
|
|||||||
@@ -11,9 +11,9 @@ import org.springframework.web.bind.annotation.ModelAttribute;
|
|||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
||||||
import com.nis.domain.Page;
|
import com.nis.domain.Page;
|
||||||
import com.nis.domain.log.NtcServiceReportLog;
|
|
||||||
import com.nis.domain.log.ReportResultLog;
|
|
||||||
import com.nis.domain.log.SearchReport;
|
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.exceptions.MaatConvertException;
|
||||||
import com.nis.util.Constants;
|
import com.nis.util.Constants;
|
||||||
import com.nis.web.controller.BaseController;
|
import com.nis.web.controller.BaseController;
|
||||||
@@ -24,7 +24,7 @@ public class NtcServiceReportController extends BaseController {
|
|||||||
@RequestMapping("/ntcLabelReport")
|
@RequestMapping("/ntcLabelReport")
|
||||||
public String list(@ModelAttribute("bean") SearchReport bean,Model model, HttpServletRequest request, HttpServletResponse response) {
|
public String list(@ModelAttribute("bean") SearchReport bean,Model model, HttpServletRequest request, HttpServletResponse response) {
|
||||||
initReportCondition(model, bean);
|
initReportCondition(model, bean);
|
||||||
ReportResultLog<NtcServiceReportLog> result=new ReportResultLog<>();
|
ReportResult<NtcServiceReport> result=new ReportResult<>();
|
||||||
StringBuffer url=new StringBuffer(Constants.LOG_BASE_URL+Constants.NTC_SERVICE_REPORT+"?");
|
StringBuffer url=new StringBuffer(Constants.LOG_BASE_URL+Constants.NTC_SERVICE_REPORT+"?");
|
||||||
try {
|
try {
|
||||||
result=result.getReport(url.toString(), bean);
|
result=result.getReport(url.toString(), bean);
|
||||||
@@ -35,7 +35,7 @@ public class NtcServiceReportController extends BaseController {
|
|||||||
// TODO Auto-generated catch block
|
// TODO Auto-generated catch block
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
Page<NtcServiceReportLog> page=result.getData();
|
Page<NtcServiceReport> page=result.getData();
|
||||||
model.addAttribute("page", page);
|
model.addAttribute("page", page);
|
||||||
return "/report/list";
|
return "/report/list";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,9 +19,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||||||
import com.nis.domain.FunctionServiceDict;
|
import com.nis.domain.FunctionServiceDict;
|
||||||
import com.nis.domain.Page;
|
import com.nis.domain.Page;
|
||||||
import com.nis.domain.basics.ServiceDictInfo;
|
import com.nis.domain.basics.ServiceDictInfo;
|
||||||
import com.nis.domain.log.NtcTagReportLog;
|
|
||||||
import com.nis.domain.log.ReportResultLog;
|
|
||||||
import com.nis.domain.log.SearchReport;
|
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.Constants;
|
||||||
import com.nis.util.DictUtils;
|
import com.nis.util.DictUtils;
|
||||||
import com.nis.web.controller.BaseController;
|
import com.nis.web.controller.BaseController;
|
||||||
@@ -52,7 +52,7 @@ public class NtcTagReportController extends BaseController {
|
|||||||
bean.setSearchService(serviceId.toString());
|
bean.setSearchService(serviceId.toString());
|
||||||
}
|
}
|
||||||
bean.setSearchBusinessType("1");
|
bean.setSearchBusinessType("1");
|
||||||
ReportResultLog<NtcTagReportLog> result=new ReportResultLog<>();
|
ReportResult<NtcTagReport> result=new ReportResult<>();
|
||||||
StringBuffer url=new StringBuffer(Constants.LOG_BASE_URL+Constants.NTC_SERVICE_REPORT+"?");
|
StringBuffer url=new StringBuffer(Constants.LOG_BASE_URL+Constants.NTC_SERVICE_REPORT+"?");
|
||||||
bean.setPageSize(-1);
|
bean.setPageSize(-1);
|
||||||
bean.setFields("tag,sum,reportTime");
|
bean.setFields("tag,sum,reportTime");
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.nis.web.controller.report;
|
package com.nis.web.controller.report;
|
||||||
|
|
||||||
import com.nis.domain.log.BaseReportLog;
|
import com.nis.domain.report.BaseReport;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ClassName: TestBean.java
|
* @ClassName: TestBean.java
|
||||||
@@ -17,7 +17,7 @@ import com.nis.domain.log.BaseReportLog;
|
|||||||
* @date 2018年7月6日 上午9:20:48
|
* @date 2018年7月6日 上午9:20:48
|
||||||
* @version V1.0
|
* @version V1.0
|
||||||
*/
|
*/
|
||||||
public class TestBean extends BaseReportLog<TestBean> {
|
public class TestBean extends BaseReport<TestBean> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Fields serialVersionUID:TODO(用一句话描述这个变量表示什么)
|
* @Fields serialVersionUID:TODO(用一句话描述这个变量表示什么)
|
||||||
|
|||||||
Reference in New Issue
Block a user