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
310b7040
Commit
310b7040
authored
Aug 09, 2018
by
neo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[bugfix] add bb log info
parent
022e2975
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
7 deletions
+13
-7
BB.java
...wc/taxtech/atms/vat/service/impl/report/functions/BB.java
+13
-7
No files found.
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/report/functions/BB.java
View file @
310b7040
...
...
@@ -15,6 +15,7 @@ import pwc.taxtech.atms.dto.vatdto.CellTemplatePerGroupDto;
import
pwc.taxtech.atms.dto.vatdto.CurrentPeriodBo
;
import
pwc.taxtech.atms.dto.vatdto.ReportCellDataSourceDto
;
import
pwc.taxtech.atms.exception.Exceptions
;
import
pwc.taxtech.atms.exception.FormulaException
;
import
pwc.taxtech.atms.vat.entity.CellData
;
import
java.math.BigDecimal
;
...
...
@@ -35,7 +36,9 @@ public class BB extends FunctionBase implements FreeRefFunction {
try
{
return
wrapExceptionEval
(
args
,
ec
);
}
catch
(
Exception
e
)
{
LOGGER
.
warn
(
"un expect exception"
,
e
);
if
(
e
instanceof
FormulaException
)
LOGGER
.
warn
(
"Formula Exception || "
,
e
);
else
e
.
printStackTrace
();
return
defaultEval
;
}
...
...
@@ -46,6 +49,7 @@ public class BB extends FunctionBase implements FreeRefFunction {
}
public
BigDecimal
bb
(
BBParasBo
bo
,
OperationEvaluationContext
ec
)
throws
Exception
{
List
<
Object
>
ds
=
new
ArrayList
<>();
CurrentPeriodBo
curPeriod
=
CurrentPeriodBo
.
getPeriod
(
bo
.
getPeriod
().
intValue
(),
formulaContext
.
getPeriod
());
curPeriod
.
fixedCurYear
(
getYear
(
bo
.
getYear
()));
...
...
@@ -56,7 +60,8 @@ public class BB extends FunctionBase implements FreeRefFunction {
CellTemplatePerGroupDto
cellTemplateData
=
agent
.
getCellTemplateGroupDto
(
formulaContext
.
getReportTemplateGroupID
(),
formulaContext
.
getProjectID
()).
stream
().
filter
(
dto
->
dto
.
getRowIndex
()
==
bo
.
getColumnIndex
()
-
1
&&
dto
.
getColumnIndex
()
==
bo
.
getColumnIndex
()
-
1
).
findFirst
().
get
();
BigDecimal
cellValue
=
BigDecimal
.
ZERO
;
try
{
MyAsserts
.
assertNotNull
(
cellTemplateData
,
Exceptions
.
BB_CELL_TEMP_NULL
);
nullCellDto
.
fixedWithGroup
(
cellTemplateData
);
...
...
@@ -105,15 +110,16 @@ public class BB extends FunctionBase implements FreeRefFunction {
MyAsserts
.
assertNotNull
(
cellData
.
getData
(),
Exceptions
.
BB_CELL_DATA_NULL
);
// cellValue= RoundValue(cellValue, cellDataType)TODO:maybe fixd round by cellDataTyep(KV neo)
BigDecimal
cellValue
=
new
BigDecimal
(
cellData
.
getData
()).
setScale
(
4
,
cellValue
=
new
BigDecimal
(
cellData
.
getData
()).
setScale
(
4
,
BigDecimal
.
ROUND_HALF_DOWN
);
Long
dataSourceID
=
saveDataSource
(
ec
,
ds
,
FormulaDataSourceDetailType
.
ReportCellDataSourceDto
,
cellValue
,
curPeriod
.
getCurPeriod
(),
formulaContext
.
getReportTemplateGroupID
());
saveFormulaBlock
(
curPeriod
.
getCurPeriod
(),
ec
,
bo
.
expression
(
curPeriod
.
getCurPeriod
(),
curPeriod
.
getCurYear
()),
cellValue
,
dataSourceID
);
nullCellDto
.
setAmount
(
cellValue
);
LOGGER
.
debug
(
"cell static value "
);
return
cellValue
;
}
finally
{
Long
dataSourceID
=
saveDataSource
(
ec
,
ds
,
FormulaDataSourceDetailType
.
ReportCellDataSourceDto
,
cellValue
,
curPeriod
.
getCurPeriod
(),
formulaContext
.
getReportTemplateGroupID
());
saveFormulaBlock
(
curPeriod
.
getCurPeriod
(),
ec
,
bo
.
expression
(
curPeriod
.
getCurPeriod
(),
curPeriod
.
getCurYear
()),
cellValue
,
dataSourceID
);
}
}
}
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