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
2ace9b19
Commit
2ace9b19
authored
Jul 08, 2019
by
Eddie.Wu
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev_mysql_chase_bug_1' into 'dev_mysql'
fix 报表计算小数位问题 See merge request root/atms!446
parents
6d9665a9
b38ab489
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
2 deletions
+15
-2
ReportGeneratorImpl.java
...wc/taxtech/atms/vat/service/impl/ReportGeneratorImpl.java
+15
-2
No files found.
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/ReportGeneratorImpl.java
View file @
2ace9b19
...
...
@@ -174,6 +174,13 @@ public class ReportGeneratorImpl {
//如果有正则匹配就进行更新公式解析
if
(
isFind
)
{
periodCellTemplateConfig
.
setParsedFormula
(
StringUtils
.
isNotBlank
(
resultFormula
)
?
resultFormula
:
null
);
if
(
StringUtils
.
isNotBlank
(
resultFormula
))
{
Pattern
pattern
=
Pattern
.
compile
(
"[0-9.]*"
);
Matcher
isNum
=
pattern
.
matcher
(
resultFormula
);
if
(
isNum
.
matches
())
{
periodCellTemplateConfig
.
setParsedFormula
(
new
BigDecimal
(
resultFormula
).
setScale
(
2
,
BigDecimal
.
ROUND_CEILING
).
toString
());
}
}
periodCellTemplateConfigMapper
.
updateByPrimaryKeySelective
(
periodCellTemplateConfig
);
}
...
...
@@ -211,7 +218,7 @@ public class ReportGeneratorImpl {
Pattern
pattern
=
Pattern
.
compile
(
"[0-9.]*"
);
Matcher
isNum
=
pattern
.
matcher
(
data
);
if
(
isNum
.
matches
())
{
cellData
.
setData
(
new
BigDecimal
(
data
).
toString
());
cellData
.
setData
(
new
BigDecimal
(
data
).
setScale
(
2
,
BigDecimal
.
ROUND_CEILING
).
toString
());
}
else
{
cellData
.
setData
(
data
);
}
...
...
@@ -275,7 +282,13 @@ public class ReportGeneratorImpl {
cellData
.
setData
(
"0.0"
);
if
(
StringUtils
.
isEmpty
(
cellData
.
getFormulaExp
().
trim
()))
cellData
.
setFormulaExp
(
"0.0"
);
if
(
StringUtils
.
isNotBlank
(
cellData
.
getData
()))
{
Pattern
pattern
=
Pattern
.
compile
(
"[0-9.]*"
);
Matcher
isNum
=
pattern
.
matcher
(
cellData
.
getData
());
if
(
isNum
.
matches
())
{
cellData
.
setData
(
new
BigDecimal
(
cellData
.
getData
()).
setScale
(
2
,
BigDecimal
.
ROUND_CEILING
).
toString
());
}
}
PeriodCellDataSource
cellDataSource
=
new
PeriodCellDataSource
();
cellDataSource
.
setId
(
distributedIdService
.
nextId
());
cellDataSource
.
setCellTemplateId
(
keyInCellTemplateConfig
.
getCellTemplateId
());
...
...
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