新建package report,所有报表的pojo放入其中
This commit is contained in:
@@ -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(用一句话描述这个变量表示什么)
|
||||
*
|
||||
@@ -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(用一句话描述这个变量表示什么)
|
||||
*
|
||||
@@ -6,7 +6,7 @@
|
||||
*@date 2018年7月9日 上午8:57:01
|
||||
*@version 版本号
|
||||
*/
|
||||
package com.nis.domain.log;
|
||||
package com.nis.domain.report;
|
||||
|
||||
/**
|
||||
* @ClassName: NtcServiceReportLog.java
|
||||
@@ -15,7 +15,7 @@ package com.nis.domain.log;
|
||||
* @date 2018年7月9日 上午8:57:01
|
||||
* @version V1.0
|
||||
*/
|
||||
public class NtcLwhhReportLog extends BaseReportLog<NtcLwhhReportLog> {
|
||||
public class NtcLwhhReport extends BaseReport<NtcLwhhReport> {
|
||||
|
||||
/**
|
||||
* @Fields serialVersionUID:TODO(用一句话描述这个变量表示什么)
|
||||
@@ -6,7 +6,7 @@
|
||||
*@date 2018年7月9日 上午8:57:01
|
||||
*@version 版本号
|
||||
*/
|
||||
package com.nis.domain.log;
|
||||
package com.nis.domain.report;
|
||||
|
||||
/**
|
||||
* @ClassName: NtcServiceReportLog.java
|
||||
@@ -15,7 +15,7 @@ package com.nis.domain.log;
|
||||
* @date 2018年7月9日 上午8:57:01
|
||||
* @version V1.0
|
||||
*/
|
||||
public class NtcServiceReportLog extends BaseReportLog<NtcServiceReportLog> {
|
||||
public class NtcServiceReport extends BaseReport<NtcServiceReport> {
|
||||
|
||||
/**
|
||||
* @Fields serialVersionUID:TODO(用一句话描述这个变量表示什么)
|
||||
@@ -6,7 +6,7 @@
|
||||
*@date 2018年7月9日 上午8:57:01
|
||||
*@version 版本号
|
||||
*/
|
||||
package com.nis.domain.log;
|
||||
package com.nis.domain.report;
|
||||
|
||||
/**
|
||||
* @ClassName: NtcServiceReportLog.java
|
||||
@@ -15,7 +15,7 @@ package com.nis.domain.log;
|
||||
* @date 2018年7月9日 上午8:57:01
|
||||
* @version V1.0
|
||||
*/
|
||||
public class NtcTagReportLog extends BaseReportLog<NtcTagReportLog> {
|
||||
public class NtcTagReport extends BaseReport<NtcTagReport> {
|
||||
|
||||
/**
|
||||
* @Fields serialVersionUID:TODO(用一句话描述这个变量表示什么)
|
||||
@@ -6,7 +6,7 @@
|
||||
*@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;
|
||||
@@ -21,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;
|
||||
@@ -33,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;
|
||||
/**
|
||||
@@ -64,12 +65,12 @@ 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, UnsupportedEncodingException{
|
||||
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;
|
||||
ReportResult<T> bean = null;
|
||||
StringBuffer url=new StringBuffer(reportUrl);
|
||||
url.append("searchBusinessType=").append(searchCondition.getSearchBusinessType())
|
||||
.append("&searchService=").append(searchCondition.getSearchService());
|
||||
@@ -103,14 +104,11 @@ public class ReportResultLog<T extends BaseReportLog> extends RestfulResult{
|
||||
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) {
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user