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
b8415682
Commit
b8415682
authored
Aug 29, 2018
by
neo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[dev] add parsed formula for bb
parent
3f956b4f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
9 deletions
+16
-9
ReportGeneratorImpl.java
...wc/taxtech/atms/vat/service/impl/ReportGeneratorImpl.java
+16
-9
No files found.
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/ReportGeneratorImpl.java
View file @
b8415682
...
...
@@ -6,14 +6,18 @@ import org.apache.poi.ss.formula.functions.FreeRefFunction;
import
org.apache.poi.ss.formula.udf.AggregatingUDFFinder
;
import
org.apache.poi.ss.formula.udf.DefaultUDFFinder
;
import
org.apache.poi.ss.formula.udf.UDFFinder
;
import
org.apache.poi.ss.usermodel.*
;
import
org.apache.poi.ss.usermodel.Cell
;
import
org.apache.poi.ss.usermodel.FormulaEvaluator
;
import
org.apache.poi.ss.usermodel.Row
;
import
org.apache.poi.ss.usermodel.Sheet
;
import
org.apache.poi.ss.usermodel.Workbook
;
import
org.apache.poi.ss.usermodel.WorkbookFactory
;
import
org.apache.poi.xssf.usermodel.XSSFCell
;
import
org.apache.poi.xssf.usermodel.XSSFWorkbook
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Service
;
import
pwc.taxtech.atms.common.POIUtil
;
import
pwc.taxtech.atms.common.util.SpringContextUtil
;
import
pwc.taxtech.atms.constant.enums.CellDataSourceType
;
...
...
@@ -31,7 +35,12 @@ import java.io.File;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.math.BigDecimal
;
import
java.util.*
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Optional
;
import
java.util.regex.Matcher
;
import
java.util.regex.Pattern
;
import
java.util.stream.Collectors
;
...
...
@@ -263,10 +272,8 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen
//如果有正则匹配就进行更新公式解析
// if (isFind) {
if
(!
resultFormula
.
startsWith
(
"BB("
))
{
//add by neo (bb do not nedd parsed formual)
periodCellTemplateConfig
.
setParsedFormula
(
resultFormula
);
periodCellTemplateConfigMapper
.
updateByPrimaryKey
(
periodCellTemplateConfig
);
}
periodCellTemplateConfig
.
setParsedFormula
(
resultFormula
);
periodCellTemplateConfigMapper
.
updateByPrimaryKey
(
periodCellTemplateConfig
);
// }
...
...
@@ -456,10 +463,10 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen
* @param workbook 工作簿
*/
private
void
addFunctionsToWorkbook
(
Workbook
workbook
,
FormulaContext
formulaContext
)
{
String
[]
functionNames
=
{
"SGSR"
,
"FSJZ"
,
"ND"
,
"BB"
,
"XXFP"
,
"GZSD"
,
"ProjectContext"
,
"JXFPMX"
,
"JXFP"
};
String
[]
functionNames
=
{
"SGSR"
,
"FSJZ"
,
"ND"
,
"BB"
,
"XXFP"
,
"GZSD"
,
"ProjectContext"
,
"JXFPMX"
,
"JXFP"
};
FreeRefFunction
[]
functionImpls
=
{
new
SGSR
(
formulaContext
),
new
FSJZ
(
formulaContext
),
new
ND
(
formulaContext
),
new
BB
(
formulaContext
),
new
XXFP
(
formulaContext
),
new
GZSD
(
formulaContext
),
new
ProjectContext
(
formulaContext
)
,
new
JXFPMX
(
formulaContext
),
new
JXFP
(
formulaContext
)};
,
new
JXFPMX
(
formulaContext
),
new
JXFP
(
formulaContext
)};
UDFFinder
udfs
=
new
DefaultUDFFinder
(
functionNames
,
functionImpls
);
UDFFinder
udfToolpack
=
new
AggregatingUDFFinder
(
udfs
);
workbook
.
addToolPack
(
udfToolpack
);
...
...
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