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
3ba9ce87
Commit
3ba9ce87
authored
Jun 08, 2018
by
frank.xa.zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add code for data preview module
parent
2aaba395
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
573 additions
and
76 deletions
+573
-76
TBDataImportController.java
...a/pwc/taxtech/atms/controller/TBDataImportController.java
+253
-35
BalanceSubTotalDto.java
.../java/pwc/taxtech/atms/dto/vatdto/BalanceSubTotalDto.java
+79
-0
BalanceWithSubTotalsResultDto.java
...axtech/atms/dto/vatdto/BalanceWithSubTotalsResultDto.java
+27
-0
JsonTrialBalanceTreeNode.java
...pwc/taxtech/atms/dto/vatdto/JsonTrialBalanceTreeNode.java
+172
-0
TrialBalanceFilter.java
.../java/pwc/taxtech/atms/dto/vatdto/TrialBalanceFilter.java
+3
-3
TBDataImportServiceImpl.java
...axtech/atms/vat/service/impl/TBDataImportServiceImpl.java
+39
-38
No files found.
atms-api/src/main/java/pwc/taxtech/atms/controller/TBDataImportController.java
View file @
3ba9ce87
...
...
@@ -8,59 +8,53 @@ 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.RestController
;
import
pwc.taxtech.atms.
dto.vatdto.TrialBalanceDto
;
import
pwc.taxtech.atms.dto.vatdto.
TrialBalanceFilter
;
import
pwc.taxtech.atms.
common.CommonUtils
;
import
pwc.taxtech.atms.dto.vatdto.
*
;
import
pwc.taxtech.atms.vat.service.TBDataImportService
;
import
java.math.BigDecimal
;
import
java.util.ArrayList
;
import
java.util.Comparator
;
import
java.util.List
;
import
java.util.*
;
import
java.util.stream.Collectors
;
@RequestMapping
(
value
=
"api/v1/DataImport"
)
@RestController
public
class
TBDataImportController
{
private
final
String
CIT_CATEGORY
=
"CIT"
;
@Autowired
TBDataImportService
tbDataImportService
;
@RequestMapping
(
value
=
"GetBalanceDataForDisplay"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
String
G
etBalanceDataForDisplay
(
@RequestBody
JSONObject
param
)
{
public
String
g
etBalanceDataForDisplay
(
@RequestBody
JSONObject
param
)
{
String
category
=
param
.
get
(
"category"
).
toString
();
int
fromPeriod
=
Integer
.
parseInt
(
param
.
get
(
"fromPeriod"
).
toString
());
int
toPeriod
=
Integer
.
parseInt
(
param
.
get
(
"toPeriod"
).
toString
());
String
criteria
=
param
.
get
(
"criteria"
).
toString
();
TrialBalanceFilter
filter
=
new
TrialBalanceFilter
();
if
(
StringUtils
.
isBlank
(
criteria
)
&&
!
criteria
.
equals
(
"null"
))
{
if
(
StringUtils
.
isBlank
(
criteria
)
&&
!
"null"
.
equals
(
criteria
))
{
JSONObject
jsonObject
=
new
JSONObject
();
filter
=
jsonObject
.
getObject
(
criteria
,
TrialBalanceFilter
.
class
);
}
else
{
filter
=
null
;
}
// String passResponse =
return
""
;
return
convertBalanceDataToUiGridTree
(
fromPeriod
,
toPeriod
,
filter
,
category
);
}
private
String
C
onvertBalanceDataToUiGridTree
(
int
fromPeriod
,
int
toPeriod
,
TrialBalanceFilter
filter
,
String
category
)
{
private
String
c
onvertBalanceDataToUiGridTree
(
int
fromPeriod
,
int
toPeriod
,
TrialBalanceFilter
filter
,
String
category
)
{
String
result
=
""
;
List
<
TrialBalanceDto
>
balanceList
=
new
ArrayList
<>();
if
(
category
.
equals
(
CIT_CATEGORY
))
{
String
citCategory
=
"CIT"
;
if
(
category
.
equals
(
citCategory
))
{
balanceList
=
tbDataImportService
.
getTrialBalanceData
(
fromPeriod
,
toPeriod
);
}
else
{
balanceList
=
tbDataImportService
.
getTrialBalanceStdData
(
fromPeriod
,
toPeriod
);
}
if
(
filter
!=
null
&&
!
balanceList
.
isEmpty
())
{
balanceList
=
filterTrialBalanceList
(
filter
,
balanceList
);
}
if
(!
balanceList
.
isEmpty
())
{
...
...
@@ -96,7 +90,7 @@ public class TBDataImportController {
||
filter
.
getDebitClosingBalanceFrom
()
!=
null
))
{
isFilterEmpty
=
false
;
List
<
String
>
primaryList
=
subTotalList
.
stream
().
filter
(
x
->
x
.
getParentCode
().
equals
(
"0"
)).
map
(
TrialBalanceDto:
:
getAcctCode
).
collect
(
Collectors
.
toList
());
List
<
String
>
primaryList
=
subTotalList
.
stream
().
filter
(
x
->
"0"
.
equals
(
x
.
getParentCode
()
)).
map
(
TrialBalanceDto:
:
getAcctCode
).
collect
(
Collectors
.
toList
());
if
(!
primaryList
.
isEmpty
())
{
...
...
@@ -109,35 +103,259 @@ public class TBDataImportController {
}
if
(!
subTotalList
.
isEmpty
())
{
subTotalBegCreditBal
=
BigDecimal
.
valueOf
(
subTotalList
.
stream
().
mapToDouble
(
y
->
y
.
getBegCreditBal
(
).
doubleValue
()).
summaryStatistics
().
getSum
());
subTotalBegDebitBal
=
BigDecimal
.
valueOf
(
subTotalList
.
stream
().
mapToDouble
(
y
->
y
.
getBegDebitBal
(
).
doubleValue
()).
summaryStatistics
().
getSum
());
subTotalEndCreditBal
=
BigDecimal
.
valueOf
(
subTotalList
.
stream
().
mapToDouble
(
y
->
y
.
getEndCreditBal
(
).
doubleValue
()).
summaryStatistics
().
getSum
());
subTotalEndDebitBal
=
BigDecimal
.
valueOf
(
subTotalList
.
stream
().
mapToDouble
(
y
->
y
.
getEndDebitBal
(
).
doubleValue
()).
summaryStatistics
().
getSum
());
subTotalCreditBal
=
BigDecimal
.
valueOf
(
subTotalList
.
stream
().
mapToDouble
(
y
->
y
.
getCreditBal
(
).
doubleValue
()).
summaryStatistics
().
getSum
());
subTotalDebitBal
=
BigDecimal
.
valueOf
(
subTotalList
.
stream
().
mapToDouble
(
y
->
y
.
getDebitBal
(
).
doubleValue
()).
summaryStatistics
().
getSum
());
subTotalBegCreditBal
=
BigDecimal
.
valueOf
(
subTotalList
.
stream
().
mapToDouble
(
y
->
Objects
.
requireNonNull
(
y
.
getBegCreditBal
()
).
doubleValue
()).
summaryStatistics
().
getSum
());
subTotalBegDebitBal
=
BigDecimal
.
valueOf
(
subTotalList
.
stream
().
mapToDouble
(
y
->
Objects
.
requireNonNull
(
y
.
getBegDebitBal
()
).
doubleValue
()).
summaryStatistics
().
getSum
());
subTotalEndCreditBal
=
BigDecimal
.
valueOf
(
subTotalList
.
stream
().
mapToDouble
(
y
->
Objects
.
requireNonNull
(
y
.
getEndCreditBal
()
).
doubleValue
()).
summaryStatistics
().
getSum
());
subTotalEndDebitBal
=
BigDecimal
.
valueOf
(
subTotalList
.
stream
().
mapToDouble
(
y
->
Objects
.
requireNonNull
(
y
.
getEndDebitBal
()
).
doubleValue
()).
summaryStatistics
().
getSum
());
subTotalCreditBal
=
BigDecimal
.
valueOf
(
subTotalList
.
stream
().
mapToDouble
(
y
->
Objects
.
requireNonNull
(
y
.
getCreditBal
()
).
doubleValue
()).
summaryStatistics
().
getSum
());
subTotalDebitBal
=
BigDecimal
.
valueOf
(
subTotalList
.
stream
().
mapToDouble
(
y
->
Objects
.
requireNonNull
(
y
.
getDebitBal
()
).
doubleValue
()).
summaryStatistics
().
getSum
());
}
}
else
{
subTotalBegCreditBal
=
BigDecimal
.
valueOf
(
subTotalList
.
stream
().
mapToDouble
(
y
->
y
.
getBegCreditBal
(
).
doubleValue
()).
summaryStatistics
().
getSum
());
subTotalBegDebitBal
=
BigDecimal
.
valueOf
(
subTotalList
.
stream
().
mapToDouble
(
y
->
y
.
getBegDebitBal
(
).
doubleValue
()).
summaryStatistics
().
getSum
());
subTotalEndCreditBal
=
BigDecimal
.
valueOf
(
subTotalList
.
stream
().
mapToDouble
(
y
->
y
.
getEndCreditBal
(
).
doubleValue
()).
summaryStatistics
().
getSum
());
subTotalEndDebitBal
=
BigDecimal
.
valueOf
(
subTotalList
.
stream
().
mapToDouble
(
y
->
y
.
getEndDebitBal
(
).
doubleValue
()).
summaryStatistics
().
getSum
());
subTotalCreditBal
=
BigDecimal
.
valueOf
(
subTotalList
.
stream
().
mapToDouble
(
y
->
y
.
getCreditBal
(
).
doubleValue
()).
summaryStatistics
().
getSum
());
subTotalDebitBal
=
BigDecimal
.
valueOf
(
subTotalList
.
stream
().
mapToDouble
(
y
->
y
.
getDebitBal
(
).
doubleValue
()).
summaryStatistics
().
getSum
());
subTotalBegCreditBal
=
BigDecimal
.
valueOf
(
subTotalList
.
stream
().
mapToDouble
(
y
->
Objects
.
requireNonNull
(
y
.
getBegCreditBal
()
).
doubleValue
()).
summaryStatistics
().
getSum
());
subTotalBegDebitBal
=
BigDecimal
.
valueOf
(
subTotalList
.
stream
().
mapToDouble
(
y
->
Objects
.
requireNonNull
(
y
.
getBegDebitBal
()
).
doubleValue
()).
summaryStatistics
().
getSum
());
subTotalEndCreditBal
=
BigDecimal
.
valueOf
(
subTotalList
.
stream
().
mapToDouble
(
y
->
Objects
.
requireNonNull
(
y
.
getEndCreditBal
()
).
doubleValue
()).
summaryStatistics
().
getSum
());
subTotalEndDebitBal
=
BigDecimal
.
valueOf
(
subTotalList
.
stream
().
mapToDouble
(
y
->
Objects
.
requireNonNull
(
y
.
getEndDebitBal
()
).
doubleValue
()).
summaryStatistics
().
getSum
());
subTotalCreditBal
=
BigDecimal
.
valueOf
(
subTotalList
.
stream
().
mapToDouble
(
y
->
Objects
.
requireNonNull
(
y
.
getCreditBal
()
).
doubleValue
()).
summaryStatistics
().
getSum
());
subTotalDebitBal
=
BigDecimal
.
valueOf
(
subTotalList
.
stream
().
mapToDouble
(
y
->
Objects
.
requireNonNull
(
y
.
getDebitBal
()
).
doubleValue
()).
summaryStatistics
().
getSum
());
}
}
else
{
isFilterEmpty
=
true
;
subTotalBegCreditBal
=
BigDecimal
.
valueOf
(
subTotalList
.
stream
().
filter
(
x
->
x
.
getParentCode
().
equals
(
"0"
)).
mapToDouble
(
y
->
y
.
getBegCreditBal
().
doubleValue
()).
summaryStatistics
().
getSum
());
subTotalBegDebitBal
=
BigDecimal
.
valueOf
(
subTotalList
.
stream
().
filter
(
x
->
x
.
getParentCode
().
equals
(
"0"
)).
mapToDouble
(
y
->
y
.
getBegDebitBal
().
doubleValue
()).
summaryStatistics
().
getSum
());
subTotalEndCreditBal
=
BigDecimal
.
valueOf
(
subTotalList
.
stream
().
filter
(
x
->
x
.
getParentCode
().
equals
(
"0"
)).
mapToDouble
(
y
->
y
.
getEndCreditBal
().
doubleValue
()).
summaryStatistics
().
getSum
());
subTotalEndDebitBal
=
BigDecimal
.
valueOf
(
subTotalList
.
stream
().
filter
(
x
->
x
.
getParentCode
().
equals
(
"0"
)).
mapToDouble
(
y
->
y
.
getEndDebitBal
().
doubleValue
()).
summaryStatistics
().
getSum
());
subTotalCreditBal
=
BigDecimal
.
valueOf
(
subTotalList
.
stream
().
filter
(
x
->
x
.
getParentCode
().
equals
(
"0"
)).
mapToDouble
(
y
->
y
.
getCreditBal
().
doubleValue
()).
summaryStatistics
().
getSum
());
subTotalDebitBal
=
BigDecimal
.
valueOf
(
subTotalList
.
stream
().
filter
(
x
->
x
.
getParentCode
().
equals
(
"0"
)).
mapToDouble
(
y
->
y
.
getDebitBal
().
doubleValue
()).
summaryStatistics
().
getSum
());
subTotalBegCreditBal
=
BigDecimal
.
valueOf
(
subTotalList
.
stream
().
filter
(
x
->
"0"
.
equals
(
x
.
getParentCode
()))
.
mapToDouble
(
y
->
Objects
.
requireNonNull
(
y
.
getBegCreditBal
()).
doubleValue
()).
summaryStatistics
().
getSum
());
subTotalBegDebitBal
=
BigDecimal
.
valueOf
(
subTotalList
.
stream
().
filter
(
x
->
"0"
.
equals
(
x
.
getParentCode
()))
.
mapToDouble
(
y
->
Objects
.
requireNonNull
(
y
.
getBegDebitBal
()).
doubleValue
()).
summaryStatistics
().
getSum
());
subTotalEndCreditBal
=
BigDecimal
.
valueOf
(
subTotalList
.
stream
().
filter
(
x
->
"0"
.
equals
(
x
.
getParentCode
()))
.
mapToDouble
(
y
->
Objects
.
requireNonNull
(
y
.
getEndCreditBal
()).
doubleValue
()).
summaryStatistics
().
getSum
());
subTotalEndDebitBal
=
BigDecimal
.
valueOf
(
subTotalList
.
stream
().
filter
(
x
->
"0"
.
equals
(
x
.
getParentCode
()))
.
mapToDouble
(
y
->
Objects
.
requireNonNull
(
y
.
getEndDebitBal
()).
doubleValue
()).
summaryStatistics
().
getSum
());
subTotalCreditBal
=
BigDecimal
.
valueOf
(
subTotalList
.
stream
().
filter
(
x
->
"0"
.
equals
(
x
.
getParentCode
()))
.
mapToDouble
(
y
->
Objects
.
requireNonNull
(
y
.
getCreditBal
()).
doubleValue
()).
summaryStatistics
().
getSum
());
subTotalDebitBal
=
BigDecimal
.
valueOf
(
subTotalList
.
stream
().
filter
(
x
->
"0"
.
equals
(
x
.
getParentCode
()))
.
mapToDouble
(
y
->
Objects
.
requireNonNull
(
y
.
getDebitBal
()).
doubleValue
()).
summaryStatistics
().
getSum
());
}
//todo: add the code below here
List
<
JsonTrialBalanceTreeNode
>
tree
=
new
ArrayList
<>();
List
<
JsonTrialBalanceTreeNode
>
balanceTree
=
new
ArrayList
<>();
JsonTrialBalanceTreeNode
note
;
for
(
TrialBalanceDto
item
:
balanceList
)
{
note
=
new
JsonTrialBalanceTreeNode
();
note
.
setAcctCode
(
item
.
getAcctCode
());
note
.
setAccountName
(
item
.
getAccountName
());
note
.
setBalanceId
(
item
.
getBalanceId
());
note
.
setBegCreditBal
(
Objects
.
requireNonNull
(
item
.
getBegCreditBal
()).
toString
());
note
.
setBegDebitBal
(
Objects
.
requireNonNull
(
item
.
getBegDebitBal
()).
toString
());
note
.
setEndCreditBal
(
Objects
.
requireNonNull
(
item
.
getEndCreditBal
()).
toString
());
note
.
setEndDebitBal
(
Objects
.
requireNonNull
(
item
.
getEndDebitBal
()).
toString
());
note
.
setParentCode
(
item
.
getParentCode
());
note
.
setCreditBal
(
Objects
.
requireNonNull
(
item
.
getCreditBal
()).
toString
());
note
.
setDebitBal
(
Objects
.
requireNonNull
(
item
.
getDebitBal
()).
toString
());
note
.
setAcctProp
(
item
.
getAcctProp
()
!=
null
?
item
.
getAcctProp
().
toString
()
:
"7"
);
// 7 means "Other" category
note
.
setDirection
(
Integer
.
toString
(
item
.
getDirection
()));
balanceTree
.
add
(
note
);
}
BalanceWithSubTotalsResultDto
<
JsonTrialBalanceTreeNode
>
balanceWithSubTotalsInfo
=
new
BalanceWithSubTotalsResultDto
<>();
BalanceSubTotalDto
subtotalsInfo
=
new
BalanceSubTotalDto
();
subtotalsInfo
.
setBegCreditBal
(
subTotalBegCreditBal
.
toString
());
subtotalsInfo
.
setBegDebitBal
(
subTotalBegDebitBal
.
toString
());
subtotalsInfo
.
setEndCreditBal
(
subTotalEndCreditBal
.
toString
());
subtotalsInfo
.
setEndDebitBal
(
subTotalEndDebitBal
.
toString
());
subtotalsInfo
.
setCreditBal
(
subTotalCreditBal
.
toString
());
subtotalsInfo
.
setDebitBal
(
subTotalDebitBal
.
toString
());
if
(
isFilterEmpty
)
{
initTree
(
tree
,
"0"
,
balanceTree
);
}
else
{
JsonTrialBalanceTreeNode
tempNode
;
if
(!
balanceTree
.
isEmpty
())
{
for
(
JsonTrialBalanceTreeNode
row
:
balanceTree
)
{
tempNode
=
new
JsonTrialBalanceTreeNode
();
CommonUtils
.
copyProperties
(
row
,
tempNode
);
tempNode
.
setAccountName
(
StringUtils
.
removeStart
(
row
.
getAccountName
(),
"@"
));
tempNode
.
setChildren
(
new
ArrayList
<>());
tree
.
add
(
tempNode
);
}
}
}
balanceWithSubTotalsInfo
.
setList
(
tree
.
stream
()
.
sorted
(
Comparator
.
comparing
(
JsonTrialBalanceTreeNode:
:
getAcctCode
)
.
thenComparing
(
JsonTrialBalanceTreeNode:
:
getAcctCodeLength
))
.
collect
(
Collectors
.
toList
()));
balanceWithSubTotalsInfo
.
setSubTotals
(
subtotalsInfo
);
result
=
JSONObject
.
toJSONString
(
balanceWithSubTotalsInfo
);
return
result
;
}
private
void
initTree
(
List
<
JsonTrialBalanceTreeNode
>
nodes
,
String
parentCode
,
List
<
JsonTrialBalanceTreeNode
>
sources
)
{
JsonTrialBalanceTreeNode
tempNode
;
//递归寻找子节点
List
<
JsonTrialBalanceTreeNode
>
tempTree
=
sources
.
stream
().
filter
(
item
->
item
.
getParentCode
().
equals
(
parentCode
)).
collect
(
Collectors
.
toList
());
for
(
JsonTrialBalanceTreeNode
row
:
tempTree
)
{
tempNode
=
new
JsonTrialBalanceTreeNode
();
CommonUtils
.
copyProperties
(
row
,
tempNode
);
tempNode
.
setChildren
(
new
ArrayList
<>());
nodes
.
add
(
tempNode
);
initTree
(
tempNode
.
getChildren
(),
row
.
getAcctCode
(),
sources
);
}
}
private
static
List
<
TrialBalanceDto
>
filterTrialBalanceList
(
TrialBalanceFilter
filter
,
List
<
TrialBalanceDto
>
balanceList
)
{
// Account Code: support multiple codes seperated by space:
if
(
StringUtils
.
isNotBlank
(
filter
.
getAccountCode
()))
{
List
<
String
>
codes
=
new
ArrayList
<>(
Arrays
.
asList
(
filter
.
getAccountCode
().
split
(
" "
)));
balanceList
=
balanceList
.
stream
().
filter
(
x
->
codes
.
contains
(
x
.
getAcctCode
())).
collect
(
Collectors
.
toList
());
}
// Account Name: support multiple codes seperated by space:
if
(
StringUtils
.
isNotBlank
(
filter
.
getAccountName
()))
{
List
<
String
>
names
=
new
ArrayList
<>(
Arrays
.
asList
(
filter
.
getAccountName
().
split
(
" "
)));
List
<
TrialBalanceDto
>
ds
=
new
ArrayList
<>();
for
(
String
name
:
names
)
{
ds
.
addAll
(
balanceList
.
stream
().
filter
(
x
->
x
.
getAccountName
().
contains
(
name
)).
collect
(
Collectors
.
toList
()));
}
balanceList
=
ds
;
}
// Debit Opening Balance:
if
(
filter
.
getDebitOpeningBalanceFrom
()
!=
null
||
filter
.
getDebitOpeningBalanceTo
()
!=
null
)
{
if
(
filter
.
getDebitOpeningBalanceFrom
()
!=
null
&&
filter
.
getDebitOpeningBalanceTo
()
!=
null
)
{
balanceList
=
balanceList
.
stream
()
.
filter
(
x
->
x
.
getBegDebitBal
()
!=
null
&&
x
.
getBegDebitBal
().
doubleValue
()
>=
filter
.
getDebitOpeningBalanceFrom
().
doubleValue
()
&&
x
.
getBegDebitBal
().
doubleValue
()
<=
filter
.
getDebitOpeningBalanceTo
().
doubleValue
())
.
collect
(
Collectors
.
toList
());
}
else
if
(
filter
.
getDebitOpeningBalanceFrom
()
!=
null
)
{
balanceList
=
balanceList
.
stream
()
.
filter
(
x
->
x
.
getBegDebitBal
()
!=
null
&&
x
.
getBegDebitBal
().
doubleValue
()
>=
filter
.
getDebitOpeningBalanceFrom
().
doubleValue
())
.
collect
(
Collectors
.
toList
());
}
else
{
balanceList
=
balanceList
.
stream
().
filter
(
x
->
x
.
getBegDebitBal
()
!=
null
&&
x
.
getBegDebitBal
().
doubleValue
()
<=
filter
.
getDebitOpeningBalanceTo
().
doubleValue
())
.
collect
(
Collectors
.
toList
());
}
}
// Credit Opening Balance:
if
(
filter
.
getCreditOpeningBalanceFrom
()
!=
null
||
filter
.
getCreditOpeningBalanceTo
()
!=
null
)
{
if
(
filter
.
getCreditOpeningBalanceFrom
()
!=
null
&&
filter
.
getCreditOpeningBalanceTo
()
!=
null
)
{
balanceList
=
balanceList
.
stream
()
.
filter
(
x
->
x
.
getBegDebitBal
()
!=
null
&&
x
.
getBegDebitBal
().
doubleValue
()
>=
filter
.
getCreditOpeningBalanceFrom
().
doubleValue
()
&&
x
.
getBegDebitBal
().
doubleValue
()
<=
filter
.
getCreditOpeningBalanceTo
().
doubleValue
())
.
collect
(
Collectors
.
toList
());
}
else
if
(
filter
.
getCreditOpeningBalanceFrom
()
!=
null
)
{
balanceList
=
balanceList
.
stream
()
.
filter
(
x
->
x
.
getBegDebitBal
()
!=
null
&&
x
.
getBegDebitBal
().
doubleValue
()
>=
filter
.
getCreditOpeningBalanceFrom
().
doubleValue
())
.
collect
(
Collectors
.
toList
());
}
else
{
balanceList
=
balanceList
.
stream
().
filter
(
x
->
x
.
getBegDebitBal
()
!=
null
&&
x
.
getBegDebitBal
().
doubleValue
()
<=
filter
.
getCreditOpeningBalanceTo
().
doubleValue
())
.
collect
(
Collectors
.
toList
());
}
}
// Accumulated Debit Balance:
if
(
filter
.
getAccumulatedDebitAmountFrom
()
!=
null
||
filter
.
getAccumulatedDebitAmountTo
()
!=
null
)
{
if
(
filter
.
getAccumulatedDebitAmountFrom
()
!=
null
&&
filter
.
getAccumulatedDebitAmountTo
()
!=
null
)
{
balanceList
=
balanceList
.
stream
()
.
filter
(
x
->
x
.
getBegDebitBal
()
!=
null
&&
x
.
getBegDebitBal
().
doubleValue
()
>=
filter
.
getAccumulatedDebitAmountFrom
().
doubleValue
()
&&
x
.
getBegDebitBal
().
doubleValue
()
<=
filter
.
getAccumulatedDebitAmountTo
().
doubleValue
())
.
collect
(
Collectors
.
toList
());
}
else
if
(
filter
.
getAccumulatedDebitAmountFrom
()
!=
null
)
{
balanceList
=
balanceList
.
stream
()
.
filter
(
x
->
x
.
getBegDebitBal
()
!=
null
&&
x
.
getBegDebitBal
().
doubleValue
()
>=
filter
.
getAccumulatedDebitAmountFrom
().
doubleValue
())
.
collect
(
Collectors
.
toList
());
}
else
{
balanceList
=
balanceList
.
stream
().
filter
(
x
->
x
.
getBegDebitBal
()
!=
null
&&
x
.
getBegDebitBal
().
doubleValue
()
<=
filter
.
getAccumulatedDebitAmountTo
().
doubleValue
())
.
collect
(
Collectors
.
toList
());
}
}
// Accumulated Credit Balance:
if
(
filter
.
getAccumulatedCreditAmountFrom
()
!=
null
||
filter
.
getAccumulatedCreditAmountTo
()
!=
null
)
{
if
(
filter
.
getAccumulatedCreditAmountFrom
()
!=
null
&&
filter
.
getAccumulatedCreditAmountTo
()
!=
null
)
{
balanceList
=
balanceList
.
stream
()
.
filter
(
x
->
x
.
getBegDebitBal
()
!=
null
&&
x
.
getBegDebitBal
().
doubleValue
()
>=
filter
.
getAccumulatedCreditAmountFrom
().
doubleValue
()
&&
x
.
getBegDebitBal
().
doubleValue
()
<=
filter
.
getAccumulatedCreditAmountTo
().
doubleValue
())
.
collect
(
Collectors
.
toList
());
}
else
if
(
filter
.
getAccumulatedCreditAmountFrom
()
!=
null
)
{
balanceList
=
balanceList
.
stream
()
.
filter
(
x
->
x
.
getBegDebitBal
()
!=
null
&&
x
.
getBegDebitBal
().
doubleValue
()
>=
filter
.
getAccumulatedCreditAmountFrom
().
doubleValue
())
.
collect
(
Collectors
.
toList
());
}
else
{
balanceList
=
balanceList
.
stream
().
filter
(
x
->
x
.
getBegDebitBal
()
!=
null
&&
x
.
getBegDebitBal
().
doubleValue
()
<=
filter
.
getAccumulatedCreditAmountTo
().
doubleValue
())
.
collect
(
Collectors
.
toList
());
}
}
// Closing Debit Balance:
if
(
filter
.
getDebitClosingBalanceFrom
()
!=
null
||
filter
.
getDebitClosingBalanceTo
()
!=
null
)
{
if
(
filter
.
getDebitClosingBalanceFrom
()
!=
null
&&
filter
.
getDebitClosingBalanceTo
()
!=
null
)
{
balanceList
=
balanceList
.
stream
()
.
filter
(
x
->
x
.
getBegDebitBal
()
!=
null
&&
x
.
getBegDebitBal
().
doubleValue
()
>=
filter
.
getDebitClosingBalanceFrom
().
doubleValue
()
&&
x
.
getBegDebitBal
().
doubleValue
()
<=
filter
.
getDebitClosingBalanceTo
().
doubleValue
())
.
collect
(
Collectors
.
toList
());
}
else
if
(
filter
.
getDebitClosingBalanceFrom
()
!=
null
)
{
balanceList
=
balanceList
.
stream
()
.
filter
(
x
->
x
.
getBegDebitBal
()
!=
null
&&
x
.
getBegDebitBal
().
doubleValue
()
>=
filter
.
getAccumulatedCreditAmountFrom
().
doubleValue
())
.
collect
(
Collectors
.
toList
());
}
else
{
balanceList
=
balanceList
.
stream
().
filter
(
x
->
x
.
getBegDebitBal
()
!=
null
&&
x
.
getBegDebitBal
().
doubleValue
()
<=
filter
.
getDebitClosingBalanceTo
().
doubleValue
())
.
collect
(
Collectors
.
toList
());
}
}
// Closing Credit Balance:
if
(
filter
.
getCreditClosingBalanceFrom
()
!=
null
||
filter
.
getCreditClosingBalanceTo
()
!=
null
)
{
if
(
filter
.
getCreditClosingBalanceFrom
()
!=
null
&&
filter
.
getCreditClosingBalanceTo
()
!=
null
)
{
balanceList
=
balanceList
.
stream
()
.
filter
(
x
->
x
.
getBegDebitBal
()
!=
null
&&
x
.
getBegDebitBal
().
doubleValue
()
>=
filter
.
getCreditClosingBalanceFrom
().
doubleValue
()
&&
x
.
getBegDebitBal
().
doubleValue
()
<=
filter
.
getCreditClosingBalanceTo
().
doubleValue
())
.
collect
(
Collectors
.
toList
());
}
else
if
(
filter
.
getDebitClosingBalanceFrom
()
!=
null
)
{
balanceList
=
balanceList
.
stream
()
.
filter
(
x
->
x
.
getBegDebitBal
()
!=
null
&&
x
.
getBegDebitBal
().
doubleValue
()
>=
filter
.
getCreditClosingBalanceFrom
().
doubleValue
())
.
collect
(
Collectors
.
toList
());
}
else
{
balanceList
=
balanceList
.
stream
().
filter
(
x
->
x
.
getBegDebitBal
()
!=
null
&&
x
.
getBegDebitBal
().
doubleValue
()
<=
filter
.
getCreditClosingBalanceTo
().
doubleValue
())
.
collect
(
Collectors
.
toList
());
}
}
assert
filter
.
isHideAllZeroRecords
()
!=
null
;
if
(
filter
.
isHideAllZeroRecords
())
{
balanceList
=
balanceList
.
stream
()
.
filter
(
x
->
((
x
.
getBegCreditBal
()
!=
null
&&
x
.
getBegCreditBal
().
doubleValue
()
!=
0
)
||
(
x
.
getEndDebitBal
()
!=
null
&&
x
.
getEndDebitBal
().
doubleValue
()
!=
0
)
||
(
x
.
getBegDebitBal
()
!=
null
&&
x
.
getBegDebitBal
().
doubleValue
()
!=
0
)
||
(
x
.
getEndDebitBal
()
!=
null
&&
x
.
getEndDebitBal
().
doubleValue
()
!=
0
)
||
(
x
.
getCreditBal
()
!=
null
&&
x
.
getCreditBal
().
doubleValue
()
!=
0
)
||
(
x
.
getDebitBal
()
!=
null
&&
x
.
getDebitBal
().
doubleValue
()
!=
0
)))
.
collect
(
Collectors
.
toList
());
}
return
balanceList
;
}
}
atms-api/src/main/java/pwc/taxtech/atms/dto/vatdto/BalanceSubTotalDto.java
0 → 100644
View file @
3ba9ce87
package
pwc
.
taxtech
.
atms
.
dto
.
vatdto
;
import
java.util.Collection
;
public
class
BalanceSubTotalDto
{
private
String
begCreditBal
;
private
String
begDebitBal
;
private
String
endCreditBal
;
private
String
endDebitBal
;
private
String
yearCreditBal
;
private
String
yearDebitBal
;
private
String
debitBal
;
private
String
creditBal
;
public
String
getBegCreditBal
()
{
return
begCreditBal
;
}
public
void
setBegCreditBal
(
String
begCreditBal
)
{
this
.
begCreditBal
=
begCreditBal
;
}
public
String
getBegDebitBal
()
{
return
begDebitBal
;
}
public
void
setBegDebitBal
(
String
begDebitBal
)
{
this
.
begDebitBal
=
begDebitBal
;
}
public
String
getEndCreditBal
()
{
return
endCreditBal
;
}
public
void
setEndCreditBal
(
String
endCreditBal
)
{
this
.
endCreditBal
=
endCreditBal
;
}
public
String
getEndDebitBal
()
{
return
endDebitBal
;
}
public
void
setEndDebitBal
(
String
endDebitBal
)
{
this
.
endDebitBal
=
endDebitBal
;
}
public
String
getYearCreditBal
()
{
return
yearCreditBal
;
}
public
void
setYearCreditBal
(
String
yearCreditBal
)
{
this
.
yearCreditBal
=
yearCreditBal
;
}
public
String
getYearDebitBal
()
{
return
yearDebitBal
;
}
public
void
setYearDebitBal
(
String
yearDebitBal
)
{
this
.
yearDebitBal
=
yearDebitBal
;
}
public
String
getDebitBal
()
{
return
debitBal
;
}
public
void
setDebitBal
(
String
debitBal
)
{
this
.
debitBal
=
debitBal
;
}
public
String
getCreditBal
()
{
return
creditBal
;
}
public
void
setCreditBal
(
String
creditBal
)
{
this
.
creditBal
=
creditBal
;
}
}
atms-api/src/main/java/pwc/taxtech/atms/dto/vatdto/BalanceWithSubTotalsResultDto.java
0 → 100644
View file @
3ba9ce87
package
pwc
.
taxtech
.
atms
.
dto
.
vatdto
;
import
java.util.Collection
;
public
class
BalanceWithSubTotalsResultDto
<
T
>
{
private
Collection
<
T
>
list
;
private
BalanceSubTotalDto
subTotals
;
public
Collection
<
T
>
getList
()
{
return
list
;
}
public
void
setList
(
Collection
<
T
>
list
)
{
this
.
list
=
list
;
}
public
BalanceSubTotalDto
getSubTotals
()
{
return
subTotals
;
}
public
void
setSubTotals
(
BalanceSubTotalDto
subTotals
)
{
this
.
subTotals
=
subTotals
;
}
}
atms-api/src/main/java/pwc/taxtech/atms/dto/vatdto/JsonTrialBalanceTreeNode.java
0 → 100644
View file @
3ba9ce87
package
pwc
.
taxtech
.
atms
.
dto
.
vatdto
;
import
java.util.List
;
public
class
JsonTrialBalanceTreeNode
{
private
String
balanceId
;
private
Integer
periodId
;
private
String
direction
;
private
String
customerCode
;
private
String
begDebitBal
;
private
String
begCreditBal
;
private
String
begBal
;
private
String
endBal
;
private
String
endDebitBal
;
private
String
endCreditBal
;
private
Integer
monthID
;
private
String
debitBal
;
private
String
creditBal
;
private
String
accountName
;
private
String
acctProp
;
private
String
acctCode
;
private
String
parentCode
;
private
List
<
JsonTrialBalanceTreeNode
>
children
;
public
String
getBalanceId
()
{
return
balanceId
;
}
public
void
setBalanceId
(
String
balanceId
)
{
this
.
balanceId
=
balanceId
;
}
public
Integer
getPeriodId
()
{
return
periodId
;
}
public
void
setPeriodId
(
Integer
periodId
)
{
this
.
periodId
=
periodId
;
}
public
String
getDirection
()
{
return
direction
;
}
public
void
setDirection
(
String
direction
)
{
this
.
direction
=
direction
;
}
public
String
getCustomerCode
()
{
return
customerCode
;
}
public
void
setCustomerCode
(
String
customerCode
)
{
this
.
customerCode
=
customerCode
;
}
public
String
getBegDebitBal
()
{
return
begDebitBal
;
}
public
void
setBegDebitBal
(
String
begDebitBal
)
{
this
.
begDebitBal
=
begDebitBal
;
}
public
String
getBegCreditBal
()
{
return
begCreditBal
;
}
public
void
setBegCreditBal
(
String
begCreditBal
)
{
this
.
begCreditBal
=
begCreditBal
;
}
public
String
getBegBal
()
{
return
begBal
;
}
public
void
setBegBal
(
String
begBal
)
{
this
.
begBal
=
begBal
;
}
public
String
getEndBal
()
{
return
endBal
;
}
public
void
setEndBal
(
String
endBal
)
{
this
.
endBal
=
endBal
;
}
public
String
getEndDebitBal
()
{
return
endDebitBal
;
}
public
void
setEndDebitBal
(
String
endDebitBal
)
{
this
.
endDebitBal
=
endDebitBal
;
}
public
String
getEndCreditBal
()
{
return
endCreditBal
;
}
public
void
setEndCreditBal
(
String
endCreditBal
)
{
this
.
endCreditBal
=
endCreditBal
;
}
public
Integer
getMonthID
()
{
return
monthID
;
}
public
void
setMonthID
(
Integer
monthID
)
{
this
.
monthID
=
monthID
;
}
public
String
getDebitBal
()
{
return
debitBal
;
}
public
void
setDebitBal
(
String
debitBal
)
{
this
.
debitBal
=
debitBal
;
}
public
String
getCreditBal
()
{
return
creditBal
;
}
public
void
setCreditBal
(
String
creditBal
)
{
this
.
creditBal
=
creditBal
;
}
public
String
getAccountName
()
{
return
accountName
;
}
public
void
setAccountName
(
String
accountName
)
{
this
.
accountName
=
accountName
;
}
public
String
getAcctProp
()
{
return
acctProp
;
}
public
void
setAcctProp
(
String
acctProp
)
{
this
.
acctProp
=
acctProp
;
}
public
String
getAcctCode
()
{
return
acctCode
;
}
public
int
getAcctCodeLength
()
{
return
acctCode
.
length
();
}
public
void
setAcctCode
(
String
acctCode
)
{
this
.
acctCode
=
acctCode
;
}
public
String
getParentCode
()
{
return
parentCode
;
}
public
void
setParentCode
(
String
parentCode
)
{
this
.
parentCode
=
parentCode
;
}
public
List
<
JsonTrialBalanceTreeNode
>
getChildren
()
{
return
children
;
}
public
void
setChildren
(
List
<
JsonTrialBalanceTreeNode
>
children
)
{
this
.
children
=
children
;
}
}
atms-api/src/main/java/pwc/taxtech/atms/dto/vatdto/TrialBalanceFilter.java
View file @
3ba9ce87
...
...
@@ -31,7 +31,7 @@ public class TrialBalanceFilter {
@Nullable
private
BigDecimal
creditClosingBalanceTo
;
@Nullable
private
b
oolean
hideAllZeroRecords
;
private
B
oolean
hideAllZeroRecords
;
public
String
getAccountCode
()
{
return
accountCode
;
...
...
@@ -158,11 +158,11 @@ public class TrialBalanceFilter {
}
@Nullable
public
b
oolean
isHideAllZeroRecords
()
{
public
B
oolean
isHideAllZeroRecords
()
{
return
hideAllZeroRecords
;
}
public
void
setHideAllZeroRecords
(
@Nullable
b
oolean
hideAllZeroRecords
)
{
public
void
setHideAllZeroRecords
(
@Nullable
B
oolean
hideAllZeroRecords
)
{
this
.
hideAllZeroRecords
=
hideAllZeroRecords
;
}
}
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/TBDataImportServiceImpl.java
View file @
3ba9ce87
...
...
@@ -27,15 +27,15 @@ public class TBDataImportServiceImpl extends VatAbstractService implements TBDat
TrialBalanceDto
trialBalanceDto
=
new
TrialBalanceDto
();
trialBalanceDto
.
setAcctCode
(
item
.
getAcctCode
());
trialBalanceDto
.
setCustomerCode
(
item
.
getCustomerCode
());
trialBalanceDto
.
setBegDebitBal
(
item
.
getPeriodId
()
.
intValue
()
==
fromPeriod
?
item
.
getBegDebitBal
()
:
BigDecimal
.
ZERO
);
trialBalanceDto
.
setBegCreditBal
(
item
.
getPeriodId
()
.
intValue
()
==
fromPeriod
?
item
.
getBegCreditBal
()
:
BigDecimal
.
ZERO
);
trialBalanceDto
.
setBegBal
(
item
.
getPeriodId
()
.
intValue
()
==
fromPeriod
?
item
.
getBegBal
()
:
BigDecimal
.
ZERO
);
trialBalanceDto
.
setEndBal
(
item
.
getPeriodId
()
.
intValue
()
==
toPeriod
?
item
.
getEndBal
()
:
BigDecimal
.
ZERO
);
trialBalanceDto
.
setEndDebitBal
(
item
.
getPeriodId
()
.
intValue
()
==
toPeriod
?
item
.
getEndDebitBal
()
:
BigDecimal
.
ZERO
);
trialBalanceDto
.
setEndCreditBal
(
item
.
getPeriodId
()
.
intValue
()
==
toPeriod
?
item
.
getEndCreditBal
()
:
BigDecimal
.
ZERO
);
double
summaryA
=
b
.
stream
().
mapToDouble
(
c
->
c
.
getDebitBal
(
).
doubleValue
()).
summaryStatistics
().
getSum
();
trialBalanceDto
.
setBegDebitBal
(
item
.
getPeriodId
()
==
fromPeriod
?
item
.
getBegDebitBal
()
:
BigDecimal
.
ZERO
);
trialBalanceDto
.
setBegCreditBal
(
item
.
getPeriodId
()
==
fromPeriod
?
item
.
getBegCreditBal
()
:
BigDecimal
.
ZERO
);
trialBalanceDto
.
setBegBal
(
item
.
getPeriodId
()
==
fromPeriod
?
item
.
getBegBal
()
:
BigDecimal
.
ZERO
);
trialBalanceDto
.
setEndBal
(
item
.
getPeriodId
()
==
toPeriod
?
item
.
getEndBal
()
:
BigDecimal
.
ZERO
);
trialBalanceDto
.
setEndDebitBal
(
item
.
getPeriodId
()
==
toPeriod
?
item
.
getEndDebitBal
()
:
BigDecimal
.
ZERO
);
trialBalanceDto
.
setEndCreditBal
(
item
.
getPeriodId
()
==
toPeriod
?
item
.
getEndCreditBal
()
:
BigDecimal
.
ZERO
);
double
summaryA
=
b
.
stream
().
mapToDouble
(
c
->
Objects
.
requireNonNull
(
c
.
getDebitBal
()
).
doubleValue
()).
summaryStatistics
().
getSum
();
trialBalanceDto
.
setDebitBal
(
BigDecimal
.
valueOf
(
summaryA
));
double
summaryB
=
b
.
stream
().
mapToDouble
(
c
->
c
.
getCreditBal
(
).
doubleValue
()).
summaryStatistics
().
getSum
();
double
summaryB
=
b
.
stream
().
mapToDouble
(
c
->
Objects
.
requireNonNull
(
c
.
getCreditBal
()
).
doubleValue
()).
summaryStatistics
().
getSum
();
trialBalanceDto
.
setCreditBal
(
BigDecimal
.
valueOf
(
summaryB
));
trialBalanceDto
.
setParentCode
(
item
.
getParentCode
());
trialBalanceDto
.
setAccountName
(
item
.
getAccountName
());
...
...
@@ -60,15 +60,15 @@ public class TBDataImportServiceImpl extends VatAbstractService implements TBDat
TrialBalanceDto
trialBalanceDto
=
new
TrialBalanceDto
();
trialBalanceDto
.
setAcctCode
(
item
.
getAcctCode
());
trialBalanceDto
.
setCustomerCode
(
item
.
getCustomerCode
());
trialBalanceDto
.
setBegDebitBal
(
item
.
getPeriodId
()
.
intValue
()
==
fromPeriod
?
item
.
getBegDebitBal
()
:
BigDecimal
.
ZERO
);
trialBalanceDto
.
setBegCreditBal
(
item
.
getPeriodId
()
.
intValue
()
==
fromPeriod
?
item
.
getBegCreditBal
()
:
BigDecimal
.
ZERO
);
trialBalanceDto
.
setBegBal
(
item
.
getPeriodId
()
.
intValue
()
==
fromPeriod
?
item
.
getBegBal
()
:
BigDecimal
.
ZERO
);
trialBalanceDto
.
setEndBal
(
item
.
getPeriodId
()
.
intValue
()
==
toPeriod
?
item
.
getEndBal
()
:
BigDecimal
.
ZERO
);
trialBalanceDto
.
setEndDebitBal
(
item
.
getPeriodId
()
.
intValue
()
==
toPeriod
?
item
.
getEndDebitBal
()
:
BigDecimal
.
ZERO
);
trialBalanceDto
.
setEndCreditBal
(
item
.
getPeriodId
()
.
intValue
()
==
toPeriod
?
item
.
getEndCreditBal
()
:
BigDecimal
.
ZERO
);
double
summaryA
=
b
.
stream
().
mapToDouble
(
c
->
c
.
getDebitBal
(
).
doubleValue
()).
summaryStatistics
().
getSum
();
trialBalanceDto
.
setBegDebitBal
(
item
.
getPeriodId
()
==
fromPeriod
?
item
.
getBegDebitBal
()
:
BigDecimal
.
ZERO
);
trialBalanceDto
.
setBegCreditBal
(
item
.
getPeriodId
()
==
fromPeriod
?
item
.
getBegCreditBal
()
:
BigDecimal
.
ZERO
);
trialBalanceDto
.
setBegBal
(
item
.
getPeriodId
()
==
fromPeriod
?
item
.
getBegBal
()
:
BigDecimal
.
ZERO
);
trialBalanceDto
.
setEndBal
(
item
.
getPeriodId
()
==
toPeriod
?
item
.
getEndBal
()
:
BigDecimal
.
ZERO
);
trialBalanceDto
.
setEndDebitBal
(
item
.
getPeriodId
()
==
toPeriod
?
item
.
getEndDebitBal
()
:
BigDecimal
.
ZERO
);
trialBalanceDto
.
setEndCreditBal
(
item
.
getPeriodId
()
==
toPeriod
?
item
.
getEndCreditBal
()
:
BigDecimal
.
ZERO
);
double
summaryA
=
b
.
stream
().
mapToDouble
(
c
->
Objects
.
requireNonNull
(
c
.
getDebitBal
()
).
doubleValue
()).
summaryStatistics
().
getSum
();
trialBalanceDto
.
setDebitBal
(
BigDecimal
.
valueOf
(
summaryA
));
double
summaryB
=
b
.
stream
().
mapToDouble
(
c
->
c
.
getCreditBal
(
).
doubleValue
()).
summaryStatistics
().
getSum
();
double
summaryB
=
b
.
stream
().
mapToDouble
(
c
->
Objects
.
requireNonNull
(
c
.
getCreditBal
()
).
doubleValue
()).
summaryStatistics
().
getSum
();
trialBalanceDto
.
setCreditBal
(
BigDecimal
.
valueOf
(
summaryB
));
trialBalanceDto
.
setParentCode
(
item
.
getParentCode
());
trialBalanceDto
.
setAccountName
(
item
.
getAccountName
());
...
...
@@ -79,80 +79,81 @@ public class TBDataImportServiceImpl extends VatAbstractService implements TBDat
return
result
;
}
@Deprecated
private
List
<
TrialBalanceDto
>
dealNullValue
(
List
<
TrialBalanceDto
>
dataList
)
{
int
BegDebitBal
=
0
,
BegCreditBal
=
0
,
BegBal
=
0
,
E
ndBal
=
0
;
int
EndDebitBal
=
0
,
EndCreditBal
=
0
,
DebitBal
=
0
,
CreditBal
=
0
,
MonthId
=
0
,
C
ustomerCode
=
0
;
int
begDebitBal
=
0
,
begCreditBal
=
0
,
begBal
=
0
,
e
ndBal
=
0
;
int
endDebitBal
=
0
,
endCreditBal
=
0
,
debitBal
=
0
,
creditBal
=
0
,
monthId
=
0
,
c
ustomerCode
=
0
;
if
(
dataList
!=
null
&&
!
dataList
.
isEmpty
())
{
if
(
dataList
.
stream
().
anyMatch
(
a
->
a
.
getMonthId
()
!=
null
))
{
M
onthId
=
1
;
m
onthId
=
1
;
}
if
(
dataList
.
stream
().
anyMatch
(
a
->
StringUtils
.
isNotBlank
(
a
.
getCustomerCode
())))
{
C
ustomerCode
=
1
;
c
ustomerCode
=
1
;
}
if
(
dataList
.
stream
().
anyMatch
(
p
->
p
.
getBegDebitBal
()
!=
null
))
{
B
egDebitBal
=
1
;
b
egDebitBal
=
1
;
}
if
(
dataList
.
stream
().
anyMatch
(
p
->
p
.
getBegCreditBal
()
!=
null
))
{
B
egCreditBal
=
1
;
b
egCreditBal
=
1
;
}
if
(
dataList
.
stream
().
anyMatch
(
p
->
p
.
getBegBal
()
!=
null
))
{
B
egBal
=
1
;
b
egBal
=
1
;
}
if
(
dataList
.
stream
().
anyMatch
(
p
->
p
.
getEndBal
()
!=
null
))
{
E
ndBal
=
1
;
e
ndBal
=
1
;
}
if
(
dataList
.
stream
().
anyMatch
(
p
->
p
.
getEndDebitBal
()
!=
null
))
{
E
ndDebitBal
=
1
;
e
ndDebitBal
=
1
;
}
if
(
dataList
.
stream
().
anyMatch
(
p
->
p
.
getEndCreditBal
()
!=
null
))
{
E
ndCreditBal
=
1
;
e
ndCreditBal
=
1
;
}
if
(
dataList
.
stream
().
anyMatch
(
p
->
p
.
getDebitBal
()
!=
null
))
{
D
ebitBal
=
1
;
d
ebitBal
=
1
;
}
if
(
dataList
.
stream
().
anyMatch
(
p
->
p
.
getCreditBal
()
!=
null
))
{
C
reditBal
=
1
;
c
reditBal
=
1
;
}
for
(
TrialBalanceDto
compbalance
:
dataList
)
{
if
(
compbalance
.
getMonthId
()
==
null
&&
M
onthId
==
1
)
{
if
(
compbalance
.
getMonthId
()
==
null
&&
m
onthId
==
1
)
{
compbalance
.
setMonthId
(
0
);
}
if
(
C
ustomerCode
==
0
)
{
if
(
c
ustomerCode
==
0
)
{
compbalance
.
setCustomerCode
(
null
);
}
if
(
compbalance
.
getBegDebitBal
()
==
null
&&
B
egDebitBal
==
1
)
{
if
(
compbalance
.
getBegDebitBal
()
==
null
&&
b
egDebitBal
==
1
)
{
compbalance
.
setBegDebitBal
(
BigDecimal
.
ZERO
);
}
if
(
compbalance
.
getBegCreditBal
()
==
null
&&
B
egCreditBal
==
1
)
{
if
(
compbalance
.
getBegCreditBal
()
==
null
&&
b
egCreditBal
==
1
)
{
compbalance
.
setBegCreditBal
(
BigDecimal
.
ZERO
);
}
if
(
compbalance
.
getBegBal
()
==
null
&&
B
egBal
==
1
)
{
if
(
compbalance
.
getBegBal
()
==
null
&&
b
egBal
==
1
)
{
compbalance
.
setBegBal
(
BigDecimal
.
ZERO
);
}
if
(
compbalance
.
getEndBal
()
==
null
&&
E
ndBal
==
1
)
{
if
(
compbalance
.
getEndBal
()
==
null
&&
e
ndBal
==
1
)
{
compbalance
.
setEndBal
(
BigDecimal
.
ZERO
);
}
if
(
compbalance
.
getEndDebitBal
()
==
null
&&
E
ndDebitBal
==
1
)
{
if
(
compbalance
.
getEndDebitBal
()
==
null
&&
e
ndDebitBal
==
1
)
{
compbalance
.
setEndDebitBal
(
BigDecimal
.
ZERO
);
}
if
(
compbalance
.
getEndCreditBal
()
==
null
&&
E
ndCreditBal
==
1
)
{
if
(
compbalance
.
getEndCreditBal
()
==
null
&&
e
ndCreditBal
==
1
)
{
compbalance
.
setEndCreditBal
(
BigDecimal
.
ZERO
);
}
if
(
compbalance
.
getDebitBal
()
==
null
&&
D
ebitBal
==
1
)
{
if
(
compbalance
.
getDebitBal
()
==
null
&&
d
ebitBal
==
1
)
{
compbalance
.
setDebitBal
(
BigDecimal
.
ZERO
);
}
if
(
compbalance
.
getCreditBal
()
==
null
&&
C
reditBal
==
1
)
{
if
(
compbalance
.
getCreditBal
()
==
null
&&
c
reditBal
==
1
)
{
compbalance
.
setCreditBal
(
BigDecimal
.
ZERO
);
}
}
...
...
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