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
ccaa0add
Commit
ccaa0add
authored
Jul 22, 2018
by
neo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[dev] QueryAuditAdjust impl
parent
a3a74c96
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
10 deletions
+43
-10
JournalEntryImportServiceImpl.java
.../atms/vat/service/impl/JournalEntryImportServiceImpl.java
+43
-10
No files found.
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/JournalEntryImportServiceImpl.java
View file @
ccaa0add
...
@@ -4,6 +4,8 @@ import com.google.common.collect.Lists;
...
@@ -4,6 +4,8 @@ import com.google.common.collect.Lists;
import
com.mysql.jdbc.StringUtils
;
import
com.mysql.jdbc.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
pwc.taxtech.atms.common.PagingList
;
import
pwc.taxtech.atms.constant.Constant
;
import
pwc.taxtech.atms.constant.DataImport
;
import
pwc.taxtech.atms.constant.DataImport
;
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
;
...
@@ -26,10 +28,13 @@ import java.math.BigDecimal;
...
@@ -26,10 +28,13 @@ import java.math.BigDecimal;
import
java.text.SimpleDateFormat
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.Collections
;
import
java.util.Comparator
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Set
;
import
java.util.Set
;
import
java.util.UUID
;
import
java.util.UUID
;
import
java.util.function.ToDoubleFunction
;
import
java.util.function.ToIntFunction
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
static
pwc
.
taxtech
.
atms
.
constant
.
Constant
.
WholeYear
;
import
static
pwc
.
taxtech
.
atms
.
constant
.
Constant
.
WholeYear
;
...
@@ -166,7 +171,7 @@ public class JournalEntryImportServiceImpl {
...
@@ -166,7 +171,7 @@ public class JournalEntryImportServiceImpl {
List
<
VoucherDtoOnlyForImport
>
emptyItems
=
voucherList
.
stream
().
filter
(
dto
->
StringUtils
.
isEmptyOrWhitespaceOnly
(
dto
.
AcctCode
)
List
<
VoucherDtoOnlyForImport
>
emptyItems
=
voucherList
.
stream
().
filter
(
dto
->
StringUtils
.
isEmptyOrWhitespaceOnly
(
dto
.
AcctCode
)
||
dto
.
Credit
==
null
||
dto
.
Debit
==
null
).
collect
(
Collectors
.
toList
());
||
dto
.
Credit
==
null
||
dto
.
Debit
==
null
).
collect
(
Collectors
.
toList
());
if
(
emptyItems
.
size
()>
0
)
{
if
(
emptyItems
.
size
()
>
0
)
{
result
.
setResult
(
false
);
result
.
setResult
(
false
);
OperationResultDto
<
List
<
VoucherDtoOnlyForImport
>>
rr
=
new
OperationResultDto
<>();
OperationResultDto
<
List
<
VoucherDtoOnlyForImport
>>
rr
=
new
OperationResultDto
<>();
rr
.
setData
(
emptyItems
);
rr
.
setData
(
emptyItems
);
...
@@ -175,9 +180,9 @@ public class JournalEntryImportServiceImpl {
...
@@ -175,9 +180,9 @@ public class JournalEntryImportServiceImpl {
result
.
getData
().
add
(
rr
);
result
.
getData
().
add
(
rr
);
}
}
emptyItems
=
voucherList
.
stream
().
filter
(
dto
->
(
dto
.
AcctCode
!=
null
&&
dto
.
AcctCode
.
length
()
>
50
)
emptyItems
=
voucherList
.
stream
().
filter
(
dto
->
(
dto
.
AcctCode
!=
null
&&
dto
.
AcctCode
.
length
()
>
50
)
||
(
dto
.
Summary
!=
null
&&
dto
.
Summary
.
length
()
>
500
)).
collect
(
Collectors
.
toList
());
||
(
dto
.
Summary
!=
null
&&
dto
.
Summary
.
length
()
>
500
)).
collect
(
Collectors
.
toList
());
if
(
emptyItems
.
size
()>
0
)
{
if
(
emptyItems
.
size
()
>
0
)
{
result
.
setResult
(
false
);
result
.
setResult
(
false
);
result
.
setResult
(
false
);
result
.
setResult
(
false
);
OperationResultDto
<
List
<
VoucherDtoOnlyForImport
>>
rr
=
new
OperationResultDto
<>();
OperationResultDto
<
List
<
VoucherDtoOnlyForImport
>>
rr
=
new
OperationResultDto
<>();
...
@@ -187,8 +192,8 @@ public class JournalEntryImportServiceImpl {
...
@@ -187,8 +192,8 @@ public class JournalEntryImportServiceImpl {
result
.
getData
().
add
(
rr
);
result
.
getData
().
add
(
rr
);
}
}
if
(
result
.
getResult
())
{
if
(
result
.
getResult
())
{
if
(
importType
==
EnumTbImportType
.
CoverImport
.
getCode
())
{
if
(
importType
==
EnumTbImportType
.
CoverImport
.
getCode
())
{
Set
<
Integer
>
perods
=
voucherList
.
stream
().
collect
(
Collectors
.
groupingBy
(
VoucherDtoOnlyForImport:
:
getPeriod
,
Set
<
Integer
>
perods
=
voucherList
.
stream
().
collect
(
Collectors
.
groupingBy
(
VoucherDtoOnlyForImport:
:
getPeriod
,
Collectors
.
counting
())).
keySet
();
Collectors
.
counting
())).
keySet
();
...
@@ -197,18 +202,46 @@ public class JournalEntryImportServiceImpl {
...
@@ -197,18 +202,46 @@ public class JournalEntryImportServiceImpl {
voucherMapper
.
deleteByExample
(
example
);
voucherMapper
.
deleteByExample
(
example
);
}
}
voucherList
.
forEach
(
m
->
voucherMapper
.
insert
(
m
.
extractVoucher
()));
voucherList
.
forEach
(
m
->
voucherMapper
.
insert
(
m
.
extractVoucher
()));
}
}
return
result
;
return
result
;
}
}
public
List
<
VoucherDto
>
GetAuditAdjust
(
int
period
)
{
public
List
<
Voucher
>
GetAuditAdjust
(
int
period
)
{
return
null
;
VoucherExample
example
=
new
VoucherExample
();
example
.
createCriteria
().
andPeriodEqualTo
(
period
).
andImportTypeEqualTo
(
VatImportType
.
AuditAdjust
.
getCode
());
List
<
Voucher
>
result
=
voucherMapper
.
selectByExample
(
example
);
result
.
stream
().
sorted
(
Comparator
.
comparing
(
Voucher:
:
getAcctCode
));
return
result
;
}
}
public
PagingResultDto
<
VoucherDto
>
QueryAuditAdjust
(
QueryJeDto
queryDto
)
{
public
PagingResultDto
<
Voucher
>
QueryAuditAdjust
(
QueryJeDto
queryDto
)
{
return
null
;
PagingResultDto
<
Voucher
>
qRsult
=
new
PagingResultDto
<>();
qRsult
.
setPageInfo
(
queryDto
.
getPageInfo
());
qRsult
.
setList
(
new
ArrayList
<>());
qRsult
.
setCalculateData
(
new
Voucher
());
VoucherExample
example
=
new
VoucherExample
();
VoucherExample
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andImportTypeEqualTo
(
VatImportType
.
AuditAdjust
.
getCode
());
if
(
queryDto
.
getPeriodId
()
>
Constant
.
WholeYear
)
criteria
.
andPeriodEqualTo
(
queryDto
.
getPeriodId
());
List
<
Voucher
>
query
=
voucherMapper
.
selectByExample
(
example
);
qRsult
.
getPageInfo
().
setTotalCount
(
query
.
size
());
BigDecimal
sumDebit
=
new
BigDecimal
(
0
);
BigDecimal
sumCredit
=
new
BigDecimal
(
0
);
if
(
query
.
size
()
>
0
)
for
(
Voucher
v
:
query
)
{
sumDebit
=
sumDebit
.
add
(
v
.
getDebit
());
sumCredit
=
sumCredit
.
add
(
v
.
getCredit
());
}
qRsult
.
getCalculateData
().
setDebit
(
sumDebit
);
qRsult
.
getCalculateData
().
setCredit
(
sumCredit
);
if
(
qRsult
.
getPageInfo
().
getTotalCount
()>
0
){
PagingList
pagingList
=
new
PagingList
(
query
,
qRsult
.
getPageInfo
());
qRsult
.
setList
(
pagingList
.
getPagingList
());
}
return
qRsult
;
}
}
}
}
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