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
55d2266d
Commit
55d2266d
authored
Jul 22, 2018
by
neo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[DEV] SaveInvoiceMappings impl
parent
510679e9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
67 additions
and
9 deletions
+67
-9
InvoiceMappingDto.java
...n/java/pwc/taxtech/atms/dto/vatdto/InvoiceMappingDto.java
+22
-8
VoucherInvoiceMappingServiceImpl.java
...ms/vat/service/impl/VoucherInvoiceMappingServiceImpl.java
+45
-1
No files found.
atms-api/src/main/java/pwc/taxtech/atms/dto/vatdto/InvoiceMappingDto.java
View file @
55d2266d
package
pwc
.
taxtech
.
atms
.
dto
.
vatdto
;
import
pwc.taxtech.atms.vat.entity.InvoiceMapping
;
import
java.util.Date
;
public
class
InvoiceMappingDto
{
public
String
ID
;
public
String
TranCode
;
public
String
InvoiceCode
;
public
String
InvoiceNumber
;
public
Integer
Period
;
public
String
CreatorID
;
public
Date
CreateTime
;
public
Boolean
IsDuplicate
;
public
String
ID
;
public
String
TranCode
;
public
String
InvoiceCode
;
public
String
InvoiceNumber
;
public
Integer
Period
;
public
String
CreatorID
;
public
Date
CreateTime
;
public
Boolean
IsDuplicate
;
public
InvoiceMapping
extractInvoiceMapping
()
{
InvoiceMapping
invoiceMapping
=
new
InvoiceMapping
();
invoiceMapping
.
setID
(
ID
);
invoiceMapping
.
setTranCode
(
TranCode
);
invoiceMapping
.
setInvoiceCode
(
InvoiceCode
);
invoiceMapping
.
setInvoiceNumber
(
InvoiceNumber
);
invoiceMapping
.
setPeriod
(
Period
);
invoiceMapping
.
setCreatorID
(
CreatorID
);
invoiceMapping
.
setCreateTime
(
CreateTime
);
return
invoiceMapping
;
}
}
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/VoucherInvoiceMappingServiceImpl.java
View file @
55d2266d
...
...
@@ -98,6 +98,50 @@ public class VoucherInvoiceMappingServiceImpl {
public
OperationResultDto
<
List
<
OperationResultDto
<
List
<
InvoiceMappingDto
>>>>
SaveInvoiceMappings
(
List
<
InvoiceMappingDto
>
list
,
int
period
,
boolean
isAddition
)
{
return
null
;
OperationResultDto
<
List
<
OperationResultDto
<
List
<
InvoiceMappingDto
>>>>
result
=
new
OperationResultDto
<>();
result
.
setResult
(
true
);
result
.
setData
(
new
ArrayList
<
OperationResultDto
<
List
<
InvoiceMappingDto
>>>());
List
<
InvoiceMappingDto
>
emptyItems
=
list
.
stream
().
filter
(
m
->
StringUtils
.
isEmptyOrWhitespaceOnly
(
m
.
TranCode
)
||
StringUtils
.
isEmptyOrWhitespaceOnly
(
m
.
InvoiceCode
)
||
StringUtils
.
isEmptyOrWhitespaceOnly
(
m
.
InvoiceNumber
)).
collect
(
Collectors
.
toList
());
if
(
emptyItems
.
size
()
>
0
)
{
result
.
setResult
(
false
);
OperationResultDto
<
List
<
InvoiceMappingDto
>>
rr
=
new
OperationResultDto
<>();
rr
.
setData
(
emptyItems
);
rr
.
setResult
(
false
);
rr
.
setResultMsg
(
DataImport
.
EmptyField
);
result
.
getData
().
add
(
rr
);
}
emptyItems
=
list
.
stream
().
filter
(
dto
->
dto
.
TranCode
!=
null
&&
dto
.
TranCode
.
length
()
>
50
||
(
dto
.
InvoiceCode
!=
null
&&
dto
.
InvoiceCode
.
length
()
>
50
)
||
(
dto
.
InvoiceNumber
!=
null
&&
dto
.
InvoiceNumber
.
length
()
>
50
)
).
collect
(
Collectors
.
toList
());
if
(
emptyItems
.
size
()
>
0
)
{
result
.
setResult
(
false
);
OperationResultDto
<
List
<
InvoiceMappingDto
>>
rr
=
new
OperationResultDto
<>();
rr
.
setData
(
emptyItems
);
rr
.
setResult
(
false
);
rr
.
setResultMsg
(
DataImport
.
OverLengthField
);
result
.
getData
().
add
(
rr
);
}
if
(
result
.
getResult
())
{
if
(!
isAddition
)
{
InvoiceMappingExample
invoiceMappingExample
=
new
InvoiceMappingExample
();
invoiceMappingExample
.
createCriteria
().
andPeriodEqualTo
(
period
);
invoiceMappingMapper
.
deleteByExample
(
invoiceMappingExample
);
}
list
.
forEach
(
m
->
invoiceMappingMapper
.
insert
(
m
.
extractInvoiceMapping
()));
}
// ValidDBInvoiceMapping(period);todo:[validation] to be continue (neo)
return
result
;
}
}
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