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
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
320 additions
and
41 deletions
+320
-41
TBDataImportController.java
...a/pwc/taxtech/atms/controller/TBDataImportController.java
+0
-0
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
This diff is collapsed.
Click to expand it.
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