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
2a574d0b
Commit
2a574d0b
authored
Sep 28, 2018
by
neo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[dev] add mypage for invoice
parent
6ee2a5fd
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
58 additions
and
24 deletions
+58
-24
pom.xml
atms-api/pom.xml
+0
-7
InputInvoiceImportController.java
...taxtech/atms/controller/InputInvoiceImportController.java
+4
-7
InputInvoiceDataImportServiceImpl.java
...s/vat/service/impl/InputInvoiceDataImportServiceImpl.java
+5
-7
pom.xml
atms-invoice/pom.xml
+5
-0
PagingDto.java
...e/src/main/java/pwc/taxtech/invoice/common/PagingDto.java
+18
-0
PagingResultDto.java
...main/java/pwc/taxtech/invoice/common/PagingResultDto.java
+17
-0
InputInvoiceController.java
...ava/pwc/taxtech/invoice/input/InputInvoiceController.java
+9
-3
No files found.
atms-api/pom.xml
View file @
2a574d0b
...
@@ -337,13 +337,6 @@
...
@@ -337,13 +337,6 @@
<artifactId>
spring-data-commons
</artifactId>
<artifactId>
spring-data-commons
</artifactId>
<version>
2.1.0.RELEASE
</version>
<version>
2.1.0.RELEASE
</version>
</dependency>
</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>
</dependencies>
<profiles>
<profiles>
...
...
atms-api/src/main/java/pwc/taxtech/atms/controller/InputInvoiceImportController.java
View file @
2a574d0b
package
pwc
.
taxtech
.
atms
.
controller
;
package
pwc
.
taxtech
.
atms
.
controller
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PathVariable
;
...
@@ -10,6 +9,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
...
@@ -10,6 +9,7 @@ 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.ResponseBody
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
pwc.taxtech.atms.dto.PagingResultDto
;
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
;
import
pwc.taxtech.atms.dto.vatdto.InputInvoice
;
import
pwc.taxtech.atms.dto.vatdto.InputInvoice
;
...
@@ -29,7 +29,6 @@ import java.util.HashMap;
...
@@ -29,7 +29,6 @@ import java.util.HashMap;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.UUID
;
import
java.util.UUID
;
import
java.util.stream.Collectors
;
import
static
javax
.
servlet
.
http
.
HttpServletResponse
.
SC_NO_CONTENT
;
import
static
javax
.
servlet
.
http
.
HttpServletResponse
.
SC_NO_CONTENT
;
import
static
javax
.
servlet
.
http
.
HttpServletResponse
.
SC_OK
;
import
static
javax
.
servlet
.
http
.
HttpServletResponse
.
SC_OK
;
...
@@ -44,10 +43,8 @@ public class InputInvoiceImportController {
...
@@ -44,10 +43,8 @@ public class InputInvoiceImportController {
@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
@ResponseBody
Page
<
InputInvoice
>
getInputInvoiceTreeViewData
(
@RequestBody
InputInvoicePreviewQueryParam
paras
)
{
PagingResultDto
<
InputInvoice
>
getInputInvoiceTreeViewData
(
@RequestBody
InputInvoicePreviewQueryParam
paras
)
{
Page
<
InputInvoice
>
result
=
inputInvoiceDataImportService
.
getInputInvoiceTreeViewData
(
paras
);
return
inputInvoiceDataImportService
.
getInputInvoiceTreeViewData
(
paras
);
if
(
result
==
null
)
return
Page
.
empty
();
return
result
;
}
}
@RequestMapping
(
value
=
"exportQueryData/get"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
@RequestMapping
(
value
=
"exportQueryData/get"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
...
@@ -83,7 +80,7 @@ public class InputInvoiceImportController {
...
@@ -83,7 +80,7 @@ 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
).
get
List
(
);
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 @
2a574d0b
...
@@ -2,7 +2,6 @@ package pwc.taxtech.atms.vat.service.impl;
...
@@ -2,7 +2,6 @@ package pwc.taxtech.atms.vat.service.impl;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.TypeReference
;
import
com.alibaba.fastjson.TypeReference
;
import
com.google.gson.Gson
;
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
;
...
@@ -12,13 +11,12 @@ import org.apache.ibatis.jdbc.ScriptRunner;
...
@@ -12,13 +11,12 @@ 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.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
;
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.PagingResultDto
;
import
pwc.taxtech.atms.dto.vatdto.InputInvoice
;
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.dto.vatdto.RestResponsePage
;
import
pwc.taxtech.atms.dto.vatdto.RestResponsePage
;
...
@@ -44,18 +42,18 @@ public class InputInvoiceDataImportServiceImpl extends VatAbstractService {
...
@@ -44,18 +42,18 @@ public class InputInvoiceDataImportServiceImpl extends VatAbstractService {
@Autowired
@Autowired
private
SqlSessionTemplate
dynamicSqlSessionTemplate
;
private
SqlSessionTemplate
dynamicSqlSessionTemplate
;
public
Pag
e
<
InputInvoice
>
getInputInvoiceTreeViewData
(
InputInvoicePreviewQueryParam
paras
)
{
public
Pag
ingResultDto
<
InputInvoice
>
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
Pag
e
<
InputInvoice
>
get
(
String
code
,
int
period
,
int
page
,
int
size
)
{
private
Pag
ingResultDto
<
InputInvoice
>
get
(
String
code
,
int
period
,
int
page
,
int
size
)
{
RestResponsePage
<
InputInvoice
>
pageInput
=
null
;
PagingResultDto
<
InputInvoice
>
pageInput
=
null
;
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
=
JSONObject
.
parseObject
(
inputStr
,
new
TypeReference
<
RestResponsePage
<
InputInvoice
>>()
{
pageInput
=
JSONObject
.
parseObject
(
inputStr
,
new
TypeReference
<
PagingResultDto
<
InputInvoice
>>()
{
}.
getType
());
}.
getType
());
}
}
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
...
...
atms-invoice/pom.xml
View file @
2a574d0b
...
@@ -77,6 +77,11 @@
...
@@ -77,6 +77,11 @@
<artifactId>
guava
</artifactId>
<artifactId>
guava
</artifactId>
<version>
23.0
</version>
<version>
23.0
</version>
</dependency>
</dependency>
<dependency>
<groupId>
com.alibaba
</groupId>
<artifactId>
fastjson
</artifactId>
<version>
1.2.40
</version>
</dependency>
</dependencies>
</dependencies>
<dependencyManagement>
<dependencyManagement>
...
...
atms-invoice/src/main/java/pwc/taxtech/invoice/common/PagingDto.java
0 → 100644
View file @
2a574d0b
package
pwc
.
taxtech
.
invoice
.
common
;
import
lombok.Getter
;
import
lombok.Setter
;
@Getter
@Setter
public
class
PagingDto
{
private
Integer
TotalCount
;
private
Integer
PageIndex
;
private
Integer
PageSize
;
public
PagingDto
(
Integer
totalCount
,
Integer
pageIndex
,
Integer
pageSize
)
{
TotalCount
=
totalCount
;
PageIndex
=
pageIndex
;
PageSize
=
pageSize
;
}
}
atms-invoice/src/main/java/pwc/taxtech/invoice/common/PagingResultDto.java
0 → 100644
View file @
2a574d0b
package
pwc
.
taxtech
.
invoice
.
common
;
import
com.alibaba.fastjson.annotation.JSONField
;
import
lombok.Getter
;
import
lombok.Setter
;
import
java.util.List
;
@Getter
@Setter
public
class
PagingResultDto
<
T
>
{
@JSONField
(
name
=
"List"
)
private
List
<
T
>
list
;
@JSONField
(
name
=
"PageInfo"
)
private
PagingDto
pageInfo
;
private
T
calculateData
;
}
atms-invoice/src/main/java/pwc/taxtech/invoice/input/InputInvoiceController.java
View file @
2a574d0b
...
@@ -6,6 +6,8 @@ import org.springframework.data.domain.PageRequest;
...
@@ -6,6 +6,8 @@ import org.springframework.data.domain.PageRequest;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
pwc.taxtech.invoice.common.PagingDto
;
import
pwc.taxtech.invoice.common.PagingResultDto
;
import
static
org
.
springframework
.
web
.
bind
.
annotation
.
RequestMethod
.
GET
;
import
static
org
.
springframework
.
web
.
bind
.
annotation
.
RequestMethod
.
GET
;
...
@@ -16,8 +18,12 @@ public class InputInvoiceController {
...
@@ -16,8 +18,12 @@ public class InputInvoiceController {
InputInvoiceRepository
repository
;
InputInvoiceRepository
repository
;
@RequestMapping
(
method
=
GET
)
@RequestMapping
(
method
=
GET
)
public
Page
<
InputInvoice
>
getAll
(
@RequestParam
(
defaultValue
=
"0"
)
int
page
,
@RequestParam
(
defaultValue
=
"20"
)
int
size
)
{
public
PagingResultDto
<
InputInvoice
>
getAll
(
@RequestParam
(
defaultValue
=
"0"
)
int
page
,
@RequestParam
(
defaultValue
=
"20"
)
int
size
)
{
if
(
page
<
0
)
page
=
0
;
if
(
page
<
0
)
page
=
0
;
return
repository
.
findAll
(
PageRequest
.
of
(
page
-
1
,
size
));
Page
<
InputInvoice
>
pageResult
=
repository
.
findAll
(
PageRequest
.
of
(
page
-
1
,
size
));
PagingResultDto
<
InputInvoice
>
pageReturn
=
new
PagingResultDto
();
pageReturn
.
setList
(
pageResult
.
getContent
());
pageReturn
.
setPageInfo
(
new
PagingDto
(
pageResult
.
getTotalPages
(),
pageResult
.
getPageable
().
getPageNumber
(),
pageResult
.
getPageable
().
getPageSize
()));
return
pageReturn
;
}
}
}
}
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