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
5c36f7f5
Commit
5c36f7f5
authored
Sep 28, 2018
by
neo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dev replate gson parase jsonstr
parent
7665e2f0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
3 deletions
+11
-3
pom.xml
atms-api/pom.xml
+7
-0
InputInvoiceDataImportServiceImpl.java
...s/vat/service/impl/InputInvoiceDataImportServiceImpl.java
+4
-3
No files found.
atms-api/pom.xml
View file @
5c36f7f5
...
...
@@ -337,6 +337,13 @@
<artifactId>
spring-data-commons
</artifactId>
<version>
2.1.0.RELEASE
</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.google.code.gson/gson -->
<dependency>
<groupId>
com.google.code.gson
</groupId>
<artifactId>
gson
</artifactId>
<version>
2.8.5
</version>
</dependency>
</dependencies>
<profiles>
...
...
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/InputInvoiceDataImportServiceImpl.java
View file @
5c36f7f5
package
pwc
.
taxtech
.
atms
.
vat
.
service
.
impl
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.TypeReference
;
import
com.google.gson.Gson
;
import
org.apache.http.client.methods.CloseableHttpResponse
;
import
org.apache.http.client.methods.HttpGet
;
import
org.apache.http.impl.client.CloseableHttpClient
;
...
...
@@ -51,8 +51,9 @@ public class InputInvoiceDataImportServiceImpl extends VatAbstractService {
HttpGet
httpget
=
new
HttpGet
(
"http://localhost:8089/input_invoices?page="
+
page
+
"&size="
+
size
+
"&code="
+
code
+
"&period="
+
period
);
try
(
CloseableHttpResponse
response
=
httpclient
.
execute
(
httpget
))
{
pageInput
=
JSONObject
.
parseObject
(
EntityUtils
.
toString
(
response
.
getEntity
()),
new
TypeReference
<
Page
<
InputInvoice
>>()
{
});
String
inputStr
=
EntityUtils
.
toString
(
response
.
getEntity
());
pageInput
=
new
Gson
().
fromJson
(
inputStr
,
new
TypeReference
<
Page
<
InputInvoice
>>()
{
}.
getType
());
}
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
...
...
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