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
ed2e5e3b
Commit
ed2e5e3b
authored
Aug 24, 2018
by
neo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[dev] bb formula for refs formual cacls
parent
cd15f312
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
BB.java
...wc/taxtech/atms/vat/service/impl/report/functions/BB.java
+9
-3
No files found.
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/report/functions/BB.java
View file @
ed2e5e3b
package
pwc
.
taxtech
.
atms
.
vat
.
service
.
impl
.
report
.
functions
;
import
org.apache.poi.ss.formula.OperationEvaluationContext
;
import
org.apache.poi.ss.formula.WorkbookEvaluator
;
import
org.apache.poi.ss.formula.eval.NumberEval
;
import
org.apache.poi.ss.formula.eval.OperandResolver
;
import
org.apache.poi.ss.formula.eval.StringEval
;
import
org.apache.poi.ss.formula.eval.ValueEval
;
import
org.apache.poi.ss.formula.functions.FreeRefFunction
;
...
...
@@ -18,6 +20,7 @@ import pwc.taxtech.atms.exception.Exceptions;
import
pwc.taxtech.atms.exception.FormulaException
;
import
pwc.taxtech.atms.vat.entity.CellData
;
import
java.lang.reflect.Field
;
import
java.math.BigDecimal
;
import
java.util.ArrayList
;
import
java.util.List
;
...
...
@@ -88,9 +91,12 @@ public class BB extends FunctionBase implements FreeRefFunction {
return
returnEval
;
}
else
if
(
bo
.
getPeriod
().
intValue
()
==
0
)
{
cellValue
=
new
BigDecimal
(
ec
.
getWorkbook
().
getSheet
(
ec
.
getWorkbook
().
getSheetIndex
(
bo
.
getReportCode
()))
.
getCell
(
bo
.
getRowIndex
()
-
1
,
bo
.
getColumnIndex
()
-
1
).
getNumericCellValue
());
return
cellValue
;
Field
evaluatorField
=
OperationEvaluationContext
.
class
.
getDeclaredField
(
"_bookEvaluator"
);
evaluatorField
.
setAccessible
(
true
);
WorkbookEvaluator
evaluator
=(
WorkbookEvaluator
)
evaluatorField
.
get
(
ec
);
ValueEval
eval
=
evaluator
.
evaluate
(
ec
.
getWorkbook
().
getSheet
(
ec
.
getWorkbook
().
getSheetIndex
(
bo
.
getReportCode
()))
.
getCell
(
bo
.
getRowIndex
()
-
1
,
bo
.
getColumnIndex
()
-
1
));
return
cellValue
=
new
BigDecimal
(
OperandResolver
.
coerceValueToDouble
(
eval
));
}
...
...
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