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
f0cb87c6
Commit
f0cb87c6
authored
Oct 12, 2018
by
neo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[dev] fixed input and output invoice from datasource not jpa api
parent
08771f7f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
69 deletions
+30
-69
InputInvoiceImportController.java
...taxtech/atms/controller/InputInvoiceImportController.java
+6
-15
OutputInvoiceController.java
.../pwc/taxtech/atms/controller/OutputInvoiceController.java
+3
-2
InputInvoiceDataImportServiceImpl.java
...s/vat/service/impl/InputInvoiceDataImportServiceImpl.java
+11
-33
OutputInvoiceServiceImpl.java
...xtech/atms/vat/service/impl/OutputInvoiceServiceImpl.java
+10
-19
No files found.
atms-api/src/main/java/pwc/taxtech/atms/controller/InputInvoiceImportController.java
View file @
f0cb87c6
package
pwc
.
taxtech
.
atms
.
controller
;
import
com.github.pagehelper.PageInfo
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.ResponseEntity
;
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.PagingResultDto
;
import
org.springframework.web.bind.annotation.*
;
import
pwc.taxtech.atms.dto.vatdto.ImportInputInvoiceDto
;
import
pwc.taxtech.atms.dto.vatdto.ImportInputInvoiceItemDto
;
import
pwc.taxtech.atms.dto.vatdto.InputInvoice
;
import
pwc.taxtech.atms.dto.vatdto.InputVATInvoiceBaseDto
;
import
pwc.taxtech.atms.service.impl.IdentityServiceImpl
;
import
pwc.taxtech.atms.thirdparty.ExcelSheet
;
import
pwc.taxtech.atms.thirdparty.ExcelUtil
;
import
pwc.taxtech.atms.vat.dpo.InputInvoicePreviewQueryParam
;
import
pwc.taxtech.atms.vat.entity.InputInvoice
;
import
pwc.taxtech.atms.vat.entity.InputVatInvoiceItem
;
import
pwc.taxtech.atms.vat.service.impl.InputInvoiceDataImportServiceImpl
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.IOException
;
import
java.io.OutputStream
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.UUID
;
import
java.util.*
;
import
static
javax
.
servlet
.
http
.
HttpServletResponse
.
SC_NO_CONTENT
;
import
static
javax
.
servlet
.
http
.
HttpServletResponse
.
SC_OK
;
...
...
@@ -46,7 +37,7 @@ public class InputInvoiceImportController {
@RequestMapping
(
value
=
"inputInvoicePreviewList"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
@ResponseBody
Pag
ingResultDt
o
<
InputInvoice
>
getInputInvoiceTreeViewData
(
@RequestBody
InputInvoicePreviewQueryParam
paras
)
{
Pag
eInf
o
<
InputInvoice
>
getInputInvoiceTreeViewData
(
@RequestBody
InputInvoicePreviewQueryParam
paras
)
{
return
inputInvoiceDataImportService
.
getInputInvoiceTreeViewData
(
paras
);
}
...
...
@@ -119,7 +110,7 @@ public class InputInvoiceImportController {
List
<
InputVatInvoiceItem
>
inputInvoiceItemList
=
new
ArrayList
<>();
for
(
InputInvoice
item
:
list
)
{
inputInvoiceItemList
.
addAll
(
inputInvoiceDataImportService
.
getInputInvoiceItemTreeViewData
(
item
.
getI
d
()));
inputInvoiceItemList
.
addAll
(
inputInvoiceDataImportService
.
getInputInvoiceItemTreeViewData
(
item
.
getI
D
()));
}
excelSheetB
.
setDataset
(
inputInvoiceItemList
);
List
<
ExcelSheet
<
InputVATInvoiceBaseDto
>>
sheets
=
new
ArrayList
<>();
...
...
atms-api/src/main/java/pwc/taxtech/atms/controller/OutputInvoiceController.java
View file @
f0cb87c6
package
pwc
.
taxtech
.
atms
.
controller
;
import
com.github.pagehelper.PageInfo
;
import
com.github.pagehelper.util.StringUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.MediaType
;
...
...
@@ -13,13 +14,13 @@ import org.springframework.web.multipart.MultipartHttpServletRequest;
import
pwc.taxtech.atms.constant.enums.EnumModule
;
import
pwc.taxtech.atms.dpo.PagingResultDto
;
import
pwc.taxtech.atms.dto.vatdto.ImportOutputInvoiceDto
;
import
pwc.taxtech.atms.dto.vatdto.OutputInvoice
;
import
pwc.taxtech.atms.dto.vatdto.QueryEvidenceDto
;
import
pwc.taxtech.atms.service.impl.IdentityServiceImpl
;
import
pwc.taxtech.atms.thirdparty.ExcelUtil
;
import
pwc.taxtech.atms.vat.dpo.OutputVATInvoiceInfoDto
;
import
pwc.taxtech.atms.vat.dpo.QueryOutputDto
;
import
pwc.taxtech.atms.vat.entity.ImportFile
;
import
pwc.taxtech.atms.vat.entity.OutputInvoice
;
import
pwc.taxtech.atms.vat.service.impl.FileUploadAdapter
;
import
pwc.taxtech.atms.vat.service.impl.OutputInvoiceServiceImpl
;
...
...
@@ -49,7 +50,7 @@ public class OutputInvoiceController {
private
FileUploadAdapter
fileUploadAdapter
;
@RequestMapping
(
value
=
"queryOutputInvoiceList"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
Pag
ingResultDt
o
<
OutputInvoice
>
queryOutputInvoiceList
(
@RequestBody
QueryOutputDto
queryDto
)
{
public
Pag
eInf
o
<
OutputInvoice
>
queryOutputInvoiceList
(
@RequestBody
QueryOutputDto
queryDto
)
{
return
outputInvoiceService
.
queryOutputInvoiceList
(
queryDto
);
}
...
...
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/InputInvoiceDataImportServiceImpl.java
View file @
f0cb87c6
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
;
import
org.apache.http.impl.client.HttpClients
;
import
org.apache.http.util.EntityUtils
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
org.apache.ibatis.jdbc.ScriptRunner
;
import
org.apache.ibatis.session.SqlSession
;
import
org.mybatis.spring.SqlSessionTemplate
;
...
...
@@ -16,18 +11,13 @@ 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.PagingResultDto
;
import
pwc.taxtech.atms.dto.vatdto.InputInvoice
;
import
pwc.taxtech.atms.dto.vatdto.InputVATInvoiceDto
;
import
pwc.taxtech.atms.invoice.InputInvoiceMapper
;
import
pwc.taxtech.atms.vat.dao.InputVatInvoiceItemMapper
;
import
pwc.taxtech.atms.vat.dao.InputVatInvoiceMapper
;
import
pwc.taxtech.atms.vat.dpo.InputInvoicePreviewQueryParam
;
import
pwc.taxtech.atms.vat.entity.InputVatInvoice
;
import
pwc.taxtech.atms.vat.entity.InputVatInvoiceExample
;
import
pwc.taxtech.atms.vat.entity.InputVatInvoiceItem
;
import
pwc.taxtech.atms.vat.entity.InputVatInvoiceItemExample
;
import
pwc.taxtech.atms.vat.entity.*
;
import
java.io.IOException
;
import
java.io.StringReader
;
import
java.util.*
;
...
...
@@ -43,28 +33,16 @@ public class InputInvoiceDataImportServiceImpl {
private
SqlSessionTemplate
dynamicSqlSessionTemplate
;
@Autowired
private
InputVatInvoiceItemMapper
inputVATInvoiceItemMapper
;
@Autowired
private
InputInvoiceMapper
inputInvoiceMapper
;
public
PagingResultDto
<
InputInvoice
>
getInputInvoiceTreeViewData
(
InputInvoicePreviewQueryParam
paras
)
{
return
get
(
paras
.
getInvoiceCode
(),
paras
.
getPeriodStart
(),
paras
.
getPageInfo
().
getPageIndex
(),
paras
.
getPageInfo
().
getPageSize
());
}
private
PagingResultDto
<
InputInvoice
>
get
(
String
code
,
int
period
,
int
page
,
int
size
)
{
PagingResultDto
<
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
<
PagingResultDto
<
InputInvoice
>>()
{
}.
getType
());
}
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
return
pageInput
;
public
PageInfo
<
InputInvoice
>
getInputInvoiceTreeViewData
(
InputInvoicePreviewQueryParam
paras
)
{
PageHelper
.
startPage
(
paras
.
getPageInfo
().
getPageIndex
(),
paras
.
getPageInfo
().
getPageSize
());
List
<
InputInvoice
>
invoices
=
inputInvoiceMapper
.
selectByExample
(
new
InputInvoiceExample
());
PageInfo
<
InputInvoice
>
pageInfo
=
new
PageInfo
<>(
invoices
);
return
pageInfo
;
}
public
List
<
InputVatInvoiceItem
>
getInputInvoiceItemTreeViewData
(
String
id
)
{
InputVatInvoiceItemExample
example
=
new
InputVatInvoiceItemExample
();
example
.
createCriteria
().
andInputVATInvoiceIdEqualTo
(
id
);
...
...
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/OutputInvoiceServiceImpl.java
View file @
f0cb87c6
...
...
@@ -2,6 +2,8 @@ package pwc.taxtech.atms.vat.service.impl;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.TypeReference
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.http.client.methods.CloseableHttpResponse
;
import
org.apache.http.client.methods.HttpGet
;
...
...
@@ -19,8 +21,8 @@ import pwc.taxtech.atms.constant.enums.EnumTbImportType;
import
pwc.taxtech.atms.dpo.PagingResultDto
;
import
pwc.taxtech.atms.dto.OperationResultDto
;
import
pwc.taxtech.atms.dto.vatdto.ImportOutputInvoiceDto
;
import
pwc.taxtech.atms.dto.vatdto.OutputInvoice
;
import
pwc.taxtech.atms.dto.vatdto.QueryEvidenceDto
;
import
pwc.taxtech.atms.invoice.OutputInvoiceMapper
;
import
pwc.taxtech.atms.vat.dao.ImportFileMapper
;
import
pwc.taxtech.atms.vat.dao.OutputVatInvoiceItemMapper
;
import
pwc.taxtech.atms.vat.dao.OutputVatInvoiceMapper
;
...
...
@@ -48,25 +50,14 @@ public class OutputInvoiceServiceImpl {
private
OutputVatInvoiceMapper
outputVATInvoiceMapper
;
@Autowired
private
OutputVatInvoiceItemMapper
outputVATInvoiceItemMapper
;
@Autowired
private
OutputInvoiceMapper
outputInvoiceMapper
;
public
PagingResultDto
<
OutputInvoice
>
queryOutputInvoiceList
(
QueryOutputDto
queryDto
)
{
return
get
(
""
,
queryDto
.
getPeriodStart
(),
queryDto
.
getPageInfo
().
getPageIndex
(),
queryDto
.
getPageInfo
().
getPageSize
());
}
private
PagingResultDto
<
OutputInvoice
>
get
(
String
code
,
int
period
,
int
page
,
int
size
)
{
PagingResultDto
<
OutputInvoice
>
pageInput
=
null
;
try
(
CloseableHttpClient
httpclient
=
HttpClients
.
createDefault
();)
{
HttpGet
httpget
=
new
HttpGet
(
"http://localhost:8089/output_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
<
PagingResultDto
<
OutputInvoice
>>()
{
}.
getType
());
}
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
return
pageInput
;
public
PageInfo
<
OutputInvoice
>
queryOutputInvoiceList
(
QueryOutputDto
queryDto
)
{
PageHelper
.
startPage
(
queryDto
.
getPageInfo
().
getPageIndex
(),
queryDto
.
getPageInfo
().
getPageSize
());
List
<
OutputInvoice
>
invoices
=
outputInvoiceMapper
.
selectByExample
(
new
OutputInvoiceExample
());
PageInfo
<
OutputInvoice
>
pageInfo
=
new
PageInfo
<>(
invoices
);
return
pageInfo
;
}
public
OperationResultDto
<
List
<
OutputVATInvoiceInfoDto
>>
getExportOutputInvoiceList
(
QueryOutputDto
queryDto
)
{
...
...
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