Commit b890e51c authored by neo's avatar neo

[dev] user pageImpl to deserliazer

parent 5c36f7f5
...@@ -46,6 +46,7 @@ public class InputInvoiceImportController { ...@@ -46,6 +46,7 @@ public class InputInvoiceImportController {
public @ResponseBody public @ResponseBody
Page<InputInvoice> getInputInvoiceTreeViewData(@RequestBody InputInvoicePreviewQueryParam paras) { Page<InputInvoice> getInputInvoiceTreeViewData(@RequestBody InputInvoicePreviewQueryParam paras) {
Page<InputInvoice> result = inputInvoiceDataImportService.getInputInvoiceTreeViewData(paras); Page<InputInvoice> result = inputInvoiceDataImportService.getInputInvoiceTreeViewData(paras);
if (result == null) return Page.empty();
return result; return result;
} }
......
...@@ -12,6 +12,7 @@ import org.apache.ibatis.session.SqlSession; ...@@ -12,6 +12,7 @@ import org.apache.ibatis.session.SqlSession;
import org.mybatis.spring.SqlSessionTemplate; import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import pwc.taxtech.atms.constant.enums.EnumTbImportType; import pwc.taxtech.atms.constant.enums.EnumTbImportType;
import pwc.taxtech.atms.constant.enums.EnumValidationType; import pwc.taxtech.atms.constant.enums.EnumValidationType;
...@@ -46,19 +47,19 @@ public class InputInvoiceDataImportServiceImpl extends VatAbstractService { ...@@ -46,19 +47,19 @@ public class InputInvoiceDataImportServiceImpl extends VatAbstractService {
} }
private Page<InputInvoice> get(String code, int period, int page, int size) { private Page<InputInvoice> get(String code, int period, int page, int size) {
Page<InputInvoice> pageInput = Page.empty(); PageImpl<InputInvoice> pageInput;
try (CloseableHttpClient httpclient = HttpClients.createDefault();) { try (CloseableHttpClient httpclient = HttpClients.createDefault();) {
HttpGet httpget = new HttpGet("http://localhost:8089/input_invoices?page=" + page + "&size=" + size HttpGet httpget = new HttpGet("http://localhost:8089/input_invoices?page=" + page + "&size=" + size
+ "&code=" + code + "&period=" + period); + "&code=" + code + "&period=" + period);
try (CloseableHttpResponse response = httpclient.execute(httpget)) { try (CloseableHttpResponse response = httpclient.execute(httpget)) {
String inputStr = EntityUtils.toString(response.getEntity()); String inputStr = EntityUtils.toString(response.getEntity());
pageInput = new Gson().fromJson(inputStr, new TypeReference<Page<InputInvoice>>() { pageInput = new Gson().fromJson(inputStr, new TypeReference<PageImpl<InputInvoice>>() {
}.getType()); }.getType());
} }
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
} }
return pageInput; return null;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment