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
7665e2f0
Commit
7665e2f0
authored
Sep 28, 2018
by
neo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[dev] fix queyr for input page
parent
5240c0d7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
8 deletions
+16
-8
InputInvoiceImportController.java
...taxtech/atms/controller/InputInvoiceImportController.java
+6
-4
InputInvoiceDataImportServiceImpl.java
...s/vat/service/impl/InputInvoiceDataImportServiceImpl.java
+10
-4
No files found.
atms-api/src/main/java/pwc/taxtech/atms/controller/InputInvoiceImportController.java
View file @
7665e2f0
...
...
@@ -8,6 +8,7 @@ import org.springframework.web.bind.annotation.PathVariable;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.bind.annotation.RestController
;
import
pwc.taxtech.atms.dto.vatdto.ImportInputInvoiceDto
;
import
pwc.taxtech.atms.dto.vatdto.ImportInputInvoiceItemDto
;
...
...
@@ -42,8 +43,10 @@ public class InputInvoiceImportController {
private
IdentityService
identityService
;
@RequestMapping
(
value
=
"inputInvoicePreviewList"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
String
getInputInvoiceTreeViewData
(
@RequestBody
InputInvoicePreviewQueryParam
paras
)
{
return
inputInvoiceDataImportService
.
getInputInvoiceTreeViewData
(
paras
);
public
@ResponseBody
Page
<
InputInvoice
>
getInputInvoiceTreeViewData
(
@RequestBody
InputInvoicePreviewQueryParam
paras
)
{
Page
<
InputInvoice
>
result
=
inputInvoiceDataImportService
.
getInputInvoiceTreeViewData
(
paras
);
return
result
;
}
@RequestMapping
(
value
=
"exportQueryData/get"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
...
...
@@ -79,8 +82,7 @@ public class InputInvoiceImportController {
}
private
int
getDownloadFilePath
(
InputInvoicePreviewQueryParam
paras
,
OutputStream
outputStream
)
{
// List<InputInvoice> list = inputInvoiceDataImportService.getInputInvoiceTreeViewData(paras);
List
<
InputInvoice
>
list
=
new
ArrayList
<>();
List
<
InputInvoice
>
list
=
inputInvoiceDataImportService
.
getInputInvoiceTreeViewData
(
paras
).
get
().
collect
(
Collectors
.
toList
());
if
(
list
.
size
()
==
0
)
{
return
0
;
}
...
...
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/InputInvoiceDataImportServiceImpl.java
View file @
7665e2f0
package
pwc
.
taxtech
.
atms
.
vat
.
service
.
impl
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.TypeReference
;
import
org.apache.http.client.methods.CloseableHttpResponse
;
import
org.apache.http.client.methods.HttpGet
;
import
org.apache.http.impl.client.CloseableHttpClient
;
...
...
@@ -9,11 +11,13 @@ import org.apache.ibatis.jdbc.ScriptRunner;
import
org.apache.ibatis.session.SqlSession
;
import
org.mybatis.spring.SqlSessionTemplate
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
import
org.springframework.stereotype.Service
;
import
pwc.taxtech.atms.constant.enums.EnumTbImportType
;
import
pwc.taxtech.atms.constant.enums.EnumValidationType
;
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.vat.dpo.InputInvoicePreviewQueryParam
;
import
pwc.taxtech.atms.vat.entity.InputVatInvoice
;
...
...
@@ -37,21 +41,23 @@ public class InputInvoiceDataImportServiceImpl extends VatAbstractService {
@Autowired
private
SqlSessionTemplate
dynamicSqlSessionTemplate
;
public
String
getInputInvoiceTreeViewData
(
InputInvoicePreviewQueryParam
paras
)
{
public
Page
<
InputInvoice
>
getInputInvoiceTreeViewData
(
InputInvoicePreviewQueryParam
paras
)
{
return
get
(
paras
.
getInvoiceCode
(),
paras
.
getPeriodStart
(),
paras
.
getPageInfo
().
getPageIndex
(),
paras
.
getPageInfo
().
getPageSize
());
}
private
String
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
();
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
))
{
return
EntityUtils
.
toString
(
response
.
getEntity
());
pageInput
=
JSONObject
.
parseObject
(
EntityUtils
.
toString
(
response
.
getEntity
()),
new
TypeReference
<
Page
<
InputInvoice
>>()
{
});
}
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
return
""
;
return
pageInput
;
}
...
...
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