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
2c57c3e5
Commit
2c57c3e5
authored
Nov 16, 2018
by
eddie.woo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decimal format
parent
c64c1e24
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
59 additions
and
31 deletions
+59
-31
PwCDecimalSerialize.java
...ava/pwc/taxtech/atms/common/util/PwCDecimalSerialize.java
+21
-0
Constant.java
...api/src/main/java/pwc/taxtech/atms/constant/Constant.java
+5
-0
TrialBalanceDto.java
...ain/java/pwc/taxtech/atms/dto/vatdto/TrialBalanceDto.java
+33
-31
No files found.
atms-api/src/main/java/pwc/taxtech/atms/common/util/PwCDecimalSerialize.java
0 → 100644
View file @
2c57c3e5
package
pwc
.
taxtech
.
atms
.
common
.
util
;
import
com.fasterxml.jackson.core.JsonGenerator
;
import
com.fasterxml.jackson.databind.JsonSerializer
;
import
com.fasterxml.jackson.databind.SerializerProvider
;
import
pwc.taxtech.atms.constant.Constant
;
import
java.io.IOException
;
import
java.math.BigDecimal
;
import
java.text.DecimalFormat
;
public
class
PwCDecimalSerialize
extends
JsonSerializer
<
BigDecimal
>
{
private
DecimalFormat
df
=
new
DecimalFormat
(
Constant
.
DECIMAL_FORMAT
);
@Override
public
void
serialize
(
BigDecimal
value
,
JsonGenerator
gen
,
SerializerProvider
serializers
)
throws
IOException
{
if
(
null
!=
value
)
{
gen
.
writeString
(
df
.
format
(
value
));
}
}
}
atms-api/src/main/java/pwc/taxtech/atms/constant/Constant.java
View file @
2c57c3e5
package
pwc
.
taxtech
.
atms
.
constant
;
package
pwc
.
taxtech
.
atms
.
constant
;
import
java.io.File
;
import
java.io.File
;
import
java.text.DecimalFormat
;
import
java.util.Locale
;
import
java.util.Locale
;
import
java.util.UUID
;
import
java.util.UUID
;
...
@@ -114,4 +115,7 @@ public final class Constant {
...
@@ -114,4 +115,7 @@ public final class Constant {
public
static
final
String
YEAR_MONTH
=
"yyyy-MM"
;
public
static
final
String
YEAR_MONTH
=
"yyyy-MM"
;
public
static
final
String
YYYY_MM_DD_HH_MM_SS
=
"yyyy-MM-dd HH:mm:ss"
;
public
static
final
String
YYYY_MM_DD_HH_MM_SS
=
"yyyy-MM-dd HH:mm:ss"
;
}
}
public
static
String
DECIMAL_FORMAT
=
"#,##0.00"
;
public
static
String
ZERO_STR
=
"0"
;
}
}
\ No newline at end of file
atms-api/src/main/java/pwc/taxtech/atms/dto/vatdto/TrialBalanceDto.java
View file @
2c57c3e5
package
pwc
.
taxtech
.
atms
.
dto
.
vatdto
;
package
pwc
.
taxtech
.
atms
.
dto
.
vatdto
;
import
javax.annotation.Nullable
;
import
com.fasterxml.jackson.databind.annotation.JsonSerialize
;
import
pwc.taxtech.atms.common.util.PwCDecimalSerialize
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.util.List
;
import
java.util.List
;
...
@@ -9,26 +11,26 @@ public class TrialBalanceDto {
...
@@ -9,26 +11,26 @@ public class TrialBalanceDto {
private
Integer
periodId
;
private
Integer
periodId
;
private
String
acctCode
;
private
String
acctCode
;
private
String
customerCode
;
private
String
customerCode
;
@
Nullable
@
JsonSerialize
(
using
=
PwCDecimalSerialize
.
class
)
private
BigDecimal
begDebitBal
;
private
BigDecimal
begDebitBal
;
@
Nullable
@
JsonSerialize
(
using
=
PwCDecimalSerialize
.
class
)
private
BigDecimal
begCreditBal
;
private
BigDecimal
begCreditBal
;
@
Nullable
@
JsonSerialize
(
using
=
PwCDecimalSerialize
.
class
)
private
BigDecimal
begBal
;
private
BigDecimal
begBal
;
@
Nullable
@
JsonSerialize
(
using
=
PwCDecimalSerialize
.
class
)
private
BigDecimal
endBal
;
private
BigDecimal
endBal
;
@
Nullable
@
JsonSerialize
(
using
=
PwCDecimalSerialize
.
class
)
private
BigDecimal
endDebitBal
;
private
BigDecimal
endDebitBal
;
@
Nullable
@
JsonSerialize
(
using
=
PwCDecimalSerialize
.
class
)
private
BigDecimal
endCreditBal
;
private
BigDecimal
endCreditBal
;
@
Nullable
@
JsonSerialize
(
using
=
PwCDecimalSerialize
.
class
)
private
BigDecimal
debitBal
;
private
BigDecimal
debitBal
;
@
Nullable
@
JsonSerialize
(
using
=
PwCDecimalSerialize
.
class
)
private
BigDecimal
creditBal
;
private
BigDecimal
creditBal
;
private
Integer
monthId
;
private
Integer
monthId
;
@
Nullable
@
JsonSerialize
(
using
=
PwCDecimalSerialize
.
class
)
private
BigDecimal
yearDebitBal
;
private
BigDecimal
yearDebitBal
;
@
Nullable
@
JsonSerialize
(
using
=
PwCDecimalSerialize
.
class
)
private
BigDecimal
yearCreditBal
;
private
BigDecimal
yearCreditBal
;
private
String
parentCode
;
private
String
parentCode
;
private
String
accountName
;
private
String
accountName
;
...
@@ -69,75 +71,75 @@ public class TrialBalanceDto {
...
@@ -69,75 +71,75 @@ public class TrialBalanceDto {
this
.
customerCode
=
customerCode
;
this
.
customerCode
=
customerCode
;
}
}
@Nullable
public
BigDecimal
getBegDebitBal
()
{
public
BigDecimal
getBegDebitBal
()
{
return
this
.
begDebitBal
;
return
this
.
begDebitBal
;
}
}
public
void
setBegDebitBal
(
@Nullable
BigDecimal
begDebitBal
)
{
public
void
setBegDebitBal
(
BigDecimal
begDebitBal
)
{
this
.
begDebitBal
=
begDebitBal
;
this
.
begDebitBal
=
begDebitBal
;
}
}
@Nullable
public
BigDecimal
getBegCreditBal
()
{
public
BigDecimal
getBegCreditBal
()
{
return
this
.
begCreditBal
;
return
this
.
begCreditBal
;
}
}
public
void
setBegCreditBal
(
@Nullable
BigDecimal
begCreditBal
)
{
public
void
setBegCreditBal
(
BigDecimal
begCreditBal
)
{
this
.
begCreditBal
=
begCreditBal
;
this
.
begCreditBal
=
begCreditBal
;
}
}
@Nullable
public
BigDecimal
getBegBal
()
{
public
BigDecimal
getBegBal
()
{
return
this
.
begBal
;
return
this
.
begBal
;
}
}
public
void
setBegBal
(
@Nullable
BigDecimal
begBal
)
{
public
void
setBegBal
(
BigDecimal
begBal
)
{
this
.
begBal
=
begBal
;
this
.
begBal
=
begBal
;
}
}
@Nullable
public
BigDecimal
getEndBal
()
{
public
BigDecimal
getEndBal
()
{
return
this
.
endBal
;
return
this
.
endBal
;
}
}
public
void
setEndBal
(
@Nullable
BigDecimal
endBal
)
{
public
void
setEndBal
(
BigDecimal
endBal
)
{
this
.
endBal
=
endBal
;
this
.
endBal
=
endBal
;
}
}
@Nullable
public
BigDecimal
getEndDebitBal
()
{
public
BigDecimal
getEndDebitBal
()
{
return
this
.
endDebitBal
;
return
this
.
endDebitBal
;
}
}
public
void
setEndDebitBal
(
@Nullable
BigDecimal
endDebitBal
)
{
public
void
setEndDebitBal
(
BigDecimal
endDebitBal
)
{
this
.
endDebitBal
=
endDebitBal
;
this
.
endDebitBal
=
endDebitBal
;
}
}
@Nullable
public
BigDecimal
getEndCreditBal
()
{
public
BigDecimal
getEndCreditBal
()
{
return
this
.
endCreditBal
;
return
this
.
endCreditBal
;
}
}
public
void
setEndCreditBal
(
@Nullable
BigDecimal
endCreditBal
)
{
public
void
setEndCreditBal
(
BigDecimal
endCreditBal
)
{
this
.
endCreditBal
=
endCreditBal
;
this
.
endCreditBal
=
endCreditBal
;
}
}
@Nullable
public
BigDecimal
getDebitBal
()
{
public
BigDecimal
getDebitBal
()
{
return
this
.
debitBal
;
return
this
.
debitBal
;
}
}
public
void
setDebitBal
(
@Nullable
BigDecimal
debitBal
)
{
public
void
setDebitBal
(
BigDecimal
debitBal
)
{
this
.
debitBal
=
debitBal
;
this
.
debitBal
=
debitBal
;
}
}
@Nullable
public
BigDecimal
getCreditBal
()
{
public
BigDecimal
getCreditBal
()
{
return
this
.
creditBal
;
return
this
.
creditBal
;
}
}
public
void
setCreditBal
(
@Nullable
BigDecimal
creditBal
)
{
public
void
setCreditBal
(
BigDecimal
creditBal
)
{
this
.
creditBal
=
creditBal
;
this
.
creditBal
=
creditBal
;
}
}
...
@@ -149,21 +151,21 @@ public class TrialBalanceDto {
...
@@ -149,21 +151,21 @@ public class TrialBalanceDto {
this
.
monthId
=
monthId
;
this
.
monthId
=
monthId
;
}
}
@Nullable
public
BigDecimal
getYearDebitBal
()
{
public
BigDecimal
getYearDebitBal
()
{
return
this
.
yearDebitBal
;
return
this
.
yearDebitBal
;
}
}
public
void
setYearDebitBal
(
@Nullable
BigDecimal
yearDebitBal
)
{
public
void
setYearDebitBal
(
BigDecimal
yearDebitBal
)
{
this
.
yearDebitBal
=
yearDebitBal
;
this
.
yearDebitBal
=
yearDebitBal
;
}
}
@Nullable
public
BigDecimal
getYearCreditBal
()
{
public
BigDecimal
getYearCreditBal
()
{
return
this
.
yearCreditBal
;
return
this
.
yearCreditBal
;
}
}
public
void
setYearCreditBal
(
@Nullable
BigDecimal
yearCreditBal
)
{
public
void
setYearCreditBal
(
BigDecimal
yearCreditBal
)
{
this
.
yearCreditBal
=
yearCreditBal
;
this
.
yearCreditBal
=
yearCreditBal
;
}
}
...
...
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