Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
T
traffic-front
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangxiaoming
traffic-front
Commits
6ee2a5fd
Commit
6ee2a5fd
authored
Sep 28, 2018
by
neo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[dev] add page impl for input
parent
86e6a2a4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
2 deletions
+48
-2
RestResponsePage.java
...in/java/pwc/taxtech/atms/dto/vatdto/RestResponsePage.java
+45
-0
InputInvoiceDataImportServiceImpl.java
...s/vat/service/impl/InputInvoiceDataImportServiceImpl.java
+3
-2
No files found.
atms-api/src/main/java/pwc/taxtech/atms/dto/vatdto/RestResponsePage.java
0 → 100644
View file @
6ee2a5fd
package
pwc
.
taxtech
.
atms
.
dto
.
vatdto
;
import
lombok.Getter
;
import
lombok.Setter
;
import
org.springframework.data.domain.PageImpl
;
import
org.springframework.data.domain.PageRequest
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.data.domain.Sort
;
import
java.util.ArrayList
;
import
java.util.List
;
@Getter
@Setter
public
class
RestResponsePage
<
T
>
extends
PageImpl
<
T
>
{
private
int
number
;
private
int
size
;
private
int
totalPages
;
private
int
numberOfElements
;
private
long
totalElements
;
private
boolean
previousPage
;
private
boolean
first
;
private
boolean
nextPage
;
private
boolean
last
;
private
List
<
T
>
content
;
private
Sort
sort
;
public
RestResponsePage
(
List
<
T
>
content
,
Pageable
pageable
,
long
total
)
{
super
(
content
,
pageable
,
total
);
}
public
RestResponsePage
(
List
<
T
>
content
)
{
super
(
content
);
}
public
RestResponsePage
()
{
super
(
new
ArrayList
<
T
>());
}
public
PageImpl
<
T
>
pageImpl
()
{
return
new
PageImpl
<
T
>(
getContent
(),
new
PageRequest
(
getNumber
(),
getSize
(),
getSort
()),
getTotalElements
());
}
}
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/InputInvoiceDataImportServiceImpl.java
View file @
6ee2a5fd
...
...
@@ -21,6 +21,7 @@ import pwc.taxtech.atms.dto.FieldsMapper;
import
pwc.taxtech.atms.dto.OperationResultDto
;
import
pwc.taxtech.atms.dto.vatdto.InputInvoice
;
import
pwc.taxtech.atms.dto.vatdto.InputVATInvoiceDto
;
import
pwc.taxtech.atms.dto.vatdto.RestResponsePage
;
import
pwc.taxtech.atms.vat.dpo.InputInvoicePreviewQueryParam
;
import
pwc.taxtech.atms.vat.entity.InputVatInvoice
;
import
pwc.taxtech.atms.vat.entity.InputVatInvoiceExample
;
...
...
@@ -48,13 +49,13 @@ public class InputInvoiceDataImportServiceImpl extends VatAbstractService {
}
private
Page
<
InputInvoice
>
get
(
String
code
,
int
period
,
int
page
,
int
size
)
{
PageImpl
<
InputInvoice
>
pageInput
=
null
;
RestResponsePage
<
InputInvoice
>
pageInput
=
null
;
try
(
CloseableHttpClient
httpclient
=
HttpClients
.
createDefault
();)
{
HttpGet
httpget
=
new
HttpGet
(
"http://localhost:8089/input_invoices?page="
+
page
+
"&size="
+
size
+
"&code="
+
code
+
"&period="
+
period
);
try
(
CloseableHttpResponse
response
=
httpclient
.
execute
(
httpget
))
{
String
inputStr
=
EntityUtils
.
toString
(
response
.
getEntity
());
pageInput
=
JSONObject
.
parseObject
(
inputStr
,
new
TypeReference
<
PageImpl
<
InputInvoice
>>()
{
pageInput
=
JSONObject
.
parseObject
(
inputStr
,
new
TypeReference
<
RestResponsePage
<
InputInvoice
>>()
{
}.
getType
());
}
}
catch
(
IOException
e
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment