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