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
0bf47e57
Commit
0bf47e57
authored
Jun 25, 2018
by
neo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[DEV] input invoice get item impl
parent
d9a990d2
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
51 deletions
+37
-51
InputInvoiceImportController.java
...taxtech/atms/controller/InputInvoiceImportController.java
+24
-10
InputVATInvoiceItemDto.java
...a/pwc/taxtech/atms/dto/vatdto/InputVATInvoiceItemDto.java
+0
-4
InputInvoiceDataImportService.java
...xtech/atms/vat/service/InputInvoiceDataImportService.java
+0
-16
InputInvoiceDataImportServiceImpl.java
...s/vat/service/impl/InputInvoiceDataImportServiceImpl.java
+13
-21
No files found.
atms-api/src/main/java/pwc/taxtech/atms/controller/InputInvoiceImportController.java
View file @
0bf47e57
...
...
@@ -4,23 +4,35 @@ import org.apache.http.HttpStatus;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.*
;
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
pwc.taxtech.atms.dto.vatdto.*
;
import
pwc.taxtech.atms.dto.vatdto.InputInvoicePreviewQueryParam
;
import
pwc.taxtech.atms.dto.vatdto.InputVATInvoiceBaseDto
;
import
pwc.taxtech.atms.dto.vatdto.InputVATInvoiceDto
;
import
pwc.taxtech.atms.thirdparty.ExcelSheet
;
import
pwc.taxtech.atms.thirdparty.ExcelUtil
;
import
pwc.taxtech.atms.vat.service.InputInvoiceDataImportService
;
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.*
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.UUID
;
@RestController
@RequestMapping
(
value
=
"api/v1/inputInvoiceImport"
)
public
class
InputInvoiceImportController
{
@Autowired
InputInvoiceDataImportService
inputInvoiceDataImportService
;
InputInvoiceDataImportService
Impl
inputInvoiceDataImportService
;
@RequestMapping
(
value
=
"inputInvoicePreviewList"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
@ResponseBody
...
...
@@ -55,6 +67,11 @@ public class InputInvoiceImportController {
return
ResponseEntity
.
ok
().
body
(
inputInvoiceDataImportService
.
getInputInvoiceList
(
period
));
}
@RequestMapping
(
value
=
"getInputInvoiceItemList/{period}"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
ResponseEntity
getInputInvoiceItemList
(
@PathVariable
Integer
period
)
{
return
ResponseEntity
.
ok
().
body
(
inputInvoiceDataImportService
.
getInputInvoiceItemList
(
period
));
}
private
int
getDownloadFilePath
(
InputInvoicePreviewQueryParam
paras
,
OutputStream
outputStream
)
{
List
<
InputVATInvoiceDto
>
list
=
inputInvoiceDataImportService
.
getInputInvoiceTreeViewData
(
paras
).
getList
();
if
(
list
.
size
()
==
0
)
{
...
...
@@ -90,12 +107,9 @@ public class InputInvoiceImportController {
excelSheetB
.
setHeaders
(
header2
);
excelSheetB
.
setSheetName
(
"sheetB"
);
List
<
InputVATInvoiceItem
Dto
>
inputInvoiceItemList
=
new
ArrayList
<>();
List
<
InputVATInvoiceItem
>
inputInvoiceItemList
=
new
ArrayList
<>();
for
(
InputVATInvoiceDto
item
:
list
)
{
List
<
InputVATInvoiceItemDto
>
tempResult
=
inputInvoiceDataImportService
.
getInputInvoiceItemTreeViewData
(
item
.
getID
());
for
(
InputVATInvoiceItemDto
r
:
tempResult
)
{
inputInvoiceItemList
.
add
(
r
);
}
inputInvoiceItemList
.
addAll
(
inputInvoiceDataImportService
.
getInputInvoiceItemTreeViewData
(
item
.
getID
()));
}
excelSheetB
.
setDataset
(
inputInvoiceItemList
);
List
<
ExcelSheet
<
InputVATInvoiceBaseDto
>>
sheets
=
new
ArrayList
<>();
...
...
atms-api/src/main/java/pwc/taxtech/atms/dto/vatdto/InputVATInvoiceItemDto.java
deleted
100644 → 0
View file @
d9a990d2
package
pwc
.
taxtech
.
atms
.
dto
.
vatdto
;
public
class
InputVATInvoiceItemDto
extends
InputVATInvoiceBaseDto
{
}
atms-api/src/main/java/pwc/taxtech/atms/vat/service/InputInvoiceDataImportService.java
deleted
100644 → 0
View file @
d9a990d2
package
pwc
.
taxtech
.
atms
.
vat
.
service
;
import
pwc.taxtech.atms.dto.PagingResultDto
;
import
pwc.taxtech.atms.dto.vatdto.InputInvoicePreviewQueryParam
;
import
pwc.taxtech.atms.dto.vatdto.InputVATInvoiceDto
;
import
pwc.taxtech.atms.dto.vatdto.InputVATInvoiceItemDto
;
import
java.util.List
;
public
interface
InputInvoiceDataImportService
{
PagingResultDto
<
InputVATInvoiceDto
>
getInputInvoiceTreeViewData
(
InputInvoicePreviewQueryParam
paras
);
List
<
InputVATInvoiceItemDto
>
getInputInvoiceItemTreeViewData
(
String
id
);
List
<
InputVATInvoiceDto
>
getInputInvoiceList
(
Integer
period
);
}
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/InputInvoiceDataImportServiceImpl.java
View file @
0bf47e57
...
...
@@ -3,26 +3,21 @@ package pwc.taxtech.atms.vat.service.impl;
import
org.springframework.stereotype.Service
;
import
pwc.taxtech.atms.common.CommonUtils
;
import
pwc.taxtech.atms.dto.FieldsMapper
;
import
pwc.taxtech.atms.dto.OperationResultDto
;
import
pwc.taxtech.atms.dto.PagingResultDto
;
import
pwc.taxtech.atms.dto.vatdto.InputInvoicePreviewQueryParam
;
import
pwc.taxtech.atms.dto.vatdto.InputVATInvoiceDto
;
import
pwc.taxtech.atms.dto.vatdto.InputVATInvoiceItemDto
;
import
pwc.taxtech.atms.dto.vatdto.QueryOutputDto
;
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.service.InputInvoiceDataImportService
;
import
java.util.ArrayList
;
import
java.util.Comparator
;
import
java.util.List
;
@Service
public
class
InputInvoiceDataImportServiceImpl
extends
VatAbstractService
implements
InputInvoiceDataImportService
{
public
class
InputInvoiceDataImportServiceImpl
extends
VatAbstractService
{
@Override
public
PagingResultDto
<
InputVATInvoiceDto
>
getInputInvoiceTreeViewData
(
InputInvoicePreviewQueryParam
paras
)
{
PagingResultDto
<
InputVATInvoiceDto
>
qResult
=
new
PagingResultDto
<>();
qResult
.
setPageInfo
(
paras
.
getPageInfo
());
...
...
@@ -42,34 +37,25 @@ public class InputInvoiceDataImportServiceImpl extends VatAbstractService implem
return
qResult
;
}
@Override
public
List
<
InputVATInvoiceItemDto
>
getInputInvoiceItemTreeViewData
(
String
id
)
{
public
List
<
InputVATInvoiceItem
>
getInputInvoiceItemTreeViewData
(
String
id
)
{
InputVATInvoiceItemExample
example
=
new
InputVATInvoiceItemExample
();
example
.
createCriteria
().
andInputVATInvoiceIDEqualTo
(
id
);
List
<
InputVATInvoiceItem
>
list
=
inputVATInvoiceItemMapper
.
selectByExample
(
example
);
List
<
InputVATInvoiceItemDto
>
result
=
new
ArrayList
<>();
list
.
forEach
(
a
->
{
InputVATInvoiceItemDto
dto
=
new
InputVATInvoiceItemDto
();
CommonUtils
.
copyProperties
(
a
,
dto
);
result
.
add
(
dto
);
});
return
result
;
return
inputVATInvoiceItemMapper
.
selectByExample
(
example
);
}
@Override
public
List
<
InputVATInvoiceDto
>
getInputInvoiceList
(
Integer
period
)
{
InputVATInvoiceExample
inputVATInvoiceExample
=
new
InputVATInvoiceExample
();
inputVATInvoiceExample
.
createCriteria
().
andPeriodIDEqualTo
(
period
.
intValue
());
List
<
InputVATInvoice
>
inputVatEntity
=
inputVATInvoiceMapper
.
selectByExample
(
inputVATInvoiceExample
);
List
<
InputVATInvoice
>
inputVatEntity
=
inputVATInvoiceMapper
.
selectByExample
(
inputVATInvoiceExample
);
inputVatEntity
.
sort
(
Comparator
.
comparing
(
InputVATInvoice:
:
getInvoiceNumber
));
inputVatEntity
.
sort
(
Comparator
.
comparing
(
InputVATInvoice:
:
getCreateTime
));
List
<
InputVATInvoiceDto
>
result
=
new
ArrayList
<>(
inputVatEntity
.
size
());
inputVatEntity
.
forEach
(
m
->
{
InputVATInvoiceDto
dto
=
new
InputVATInvoiceDto
();
inputVatEntity
.
forEach
(
m
->
{
InputVATInvoiceDto
dto
=
new
InputVATInvoiceDto
();
try
{
FieldsMapper
.
map
(
m
,
dto
);
FieldsMapper
.
map
(
m
,
dto
);
}
catch
(
ClassNotFoundException
e
)
{
e
.
printStackTrace
();
//TODO:should be fixed with exception filter (neo)
}
catch
(
IllegalAccessException
e
)
{
...
...
@@ -80,4 +66,10 @@ public class InputInvoiceDataImportServiceImpl extends VatAbstractService implem
return
result
;
}
public
List
<
InputVATInvoiceItem
>
getInputInvoiceItemList
(
Integer
period
)
{
InputVATInvoiceItemExample
example
=
new
InputVATInvoiceItemExample
();
example
.
createCriteria
().
andPeriodIDEqualTo
(
period
.
intValue
());
return
inputVATInvoiceItemMapper
.
selectByExample
(
example
);
}
}
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