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
5986f68a
Commit
5986f68a
authored
Aug 29, 2018
by
neo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[dev] fixed bb parsed formula had it data
parent
b8415682
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
68 additions
and
8 deletions
+68
-8
BBParasBo.java
.../src/main/java/pwc/taxtech/atms/dto/vatdto/BBParasBo.java
+47
-6
BB.java
...wc/taxtech/atms/vat/service/impl/report/functions/BB.java
+1
-1
FunctionBase.java
.../atms/vat/service/impl/report/functions/FunctionBase.java
+20
-1
No files found.
atms-api/src/main/java/pwc/taxtech/atms/dto/vatdto/BBParasBo.java
View file @
5986f68a
...
...
@@ -19,6 +19,7 @@ public class BBParasBo {
private
Integer
rowIndex
;
private
Integer
period
;
private
Integer
year
;
private
String
formulaExpression
;
private
List
<
PeriodCellDataTemplate
>
expressionData
=
new
ArrayList
<>();
public
static
class
PeriodCellDataTemplate
{
...
...
@@ -44,12 +45,18 @@ public class BBParasBo {
}
public
BBParasBo
(
ValueEval
[]
args
,
OperationEvaluationContext
ec
)
throws
EvaluationException
{
StringBuilder
expression
=
new
StringBuilder
(
""
);
begin
(
expression
);
reportCode
=
resolverString
(
args
,
ec
,
0
);
concatPara
(
expression
,
reportCode
);
try
{
columnIndex
=
resolverInteger
(
args
,
ec
,
1
);
split
(
expression
);
concatPara
(
expression
,
columnIndex
);
}
catch
(
Exception
e
)
{
String
columnStr
=
resolverString
(
args
,
ec
,
1
);
split
(
expression
);
concatPara
(
expression
,
columnStr
);
int
rtn
=
0
;
columnStr
=
columnStr
.
toUpperCase
();
char
[]
excelCol
=
columnStr
.
toCharArray
();
...
...
@@ -63,13 +70,40 @@ public class BBParasBo {
columnIndex
=
rtn
;
}
rowIndex
=
resolverInteger
(
args
,
ec
,
2
);
split
(
expression
);
concatPara
(
expression
,
rowIndex
);
period
=
args
.
length
>=
4
?
resolverInteger
(
args
,
ec
,
3
)
:
0
;
year
=
args
.
length
==
5
?
resolverInteger
(
args
,
ec
,
4
)
:
0
;
if
(
args
.
length
>=
4
)
{
split
(
expression
);
concatPara
(
expression
,
period
);
}
if
(
args
.
length
==
5
)
{
split
(
expression
);
concatPara
(
expression
,
year
);
}
formulaExpression
=
expression
.
toString
();
}
private
StringBuilder
begin
(
StringBuilder
expression
)
{
return
expression
.
append
(
"BB("
);
}
private
StringBuilder
end
(
StringBuilder
expression
)
{
return
expression
.
append
(
")"
);
}
private
StringBuilder
split
(
StringBuilder
expression
)
{
return
expression
.
append
(
","
);
}
public
void
disCount
()
{
rowIndex
--;
columnIndex
--;
private
StringBuilder
concatPara
(
StringBuilder
expression
,
String
para
)
{
return
expression
.
append
(
"\""
).
append
(
para
).
append
(
"\""
);
}
private
StringBuilder
concatPara
(
StringBuilder
expression
,
Integer
para
)
{
return
expression
.
append
(
para
);
}
public
BBParasBo
(
BBParasBo
otherBo
,
int
period
,
int
curYear
)
{
...
...
@@ -78,13 +112,20 @@ public class BBParasBo {
this
.
rowIndex
=
otherBo
.
rowIndex
;
this
.
period
=
period
;
this
.
year
=
curYear
;
this
.
formulaExpression
=
otherBo
.
formulaExpression
;
}
public
String
expression
()
{
return
formulaExpression
;
}
public
String
expressionData
()
{
if
(!
expressionData
.
isEmpty
())
{
StringBuilder
builder
=
new
StringBuilder
(
"PCT("
);
for
(
PeriodCellDataTemplate
pc
:
expressionData
)
{
builder
.
append
(
pc
.
toString
()).
append
(
","
);
for
(
int
i
=
0
;
i
<
expressionData
.
size
();
i
++)
{
builder
.
append
(
expressionData
.
get
(
i
).
toString
());
if
(
i
<
expressionData
.
size
()
-
1
)
builder
.
append
(
","
);
}
builder
.
append
(
")"
);
return
builder
.
toString
();
...
...
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/report/functions/BB.java
View file @
5986f68a
...
...
@@ -150,7 +150,7 @@ public class BB extends FunctionBase implements FreeRefFunction {
cellValue
,
formulaContext
.
getPeriod
(),
formulaContext
.
getReportTemplateGroupID
(),
bo
.
getColumnIndex
()
-
1
,
bo
.
getRowIndex
()
-
1
);
saveFormulaBlock
(
formulaContext
.
getPeriod
(),
ec
,
bo
.
expression
(),
cellValue
,
dataSourceID
);
bo
.
expression
(),
bo
.
expressionData
()
,
dataSourceID
);
}
}
}
...
...
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/report/functions/FunctionBase.java
View file @
5986f68a
...
...
@@ -152,7 +152,7 @@ public class FunctionBase {
}
public
void
saveFormulaBlock
(
int
period
,
OperationEvaluationContext
ec
,
String
formulaExpression
,
BigDecimal
val
,
Long
dataSourceID
)
{
String
formulaExpression
,
BigDecimal
val
,
Long
dataSourceID
)
{
Long
cellTemplateID
=
getCellTemplateID
(
period
,
ec
);
Date
creatime
=
new
Date
();
PeriodFormulaBlock
periodFormulaBlock
=
new
PeriodFormulaBlock
();
...
...
@@ -170,4 +170,23 @@ public class FunctionBase {
SpringContextUtil
.
periodFormulaBlockMapper
.
insertSelective
(
periodFormulaBlock
);
}
public
void
saveFormulaBlock
(
int
period
,
OperationEvaluationContext
ec
,
String
formulaExpression
,
String
val
,
Long
dataSourceID
)
{
Long
cellTemplateID
=
getCellTemplateID
(
period
,
ec
);
Date
creatime
=
new
Date
();
PeriodFormulaBlock
periodFormulaBlock
=
new
PeriodFormulaBlock
();
periodFormulaBlock
.
setId
(
SpringContextUtil
.
distributedIDService
.
nextId
());
periodFormulaBlock
.
setPeriod
(
period
);
periodFormulaBlock
.
setReportId
(
0L
);
periodFormulaBlock
.
setCellTemplateId
(
cellTemplateID
);
periodFormulaBlock
.
setFormulaExpression
(
formulaExpression
);
periodFormulaBlock
.
setData
(
val
);
periodFormulaBlock
.
setDataSourceId
(
dataSourceID
);
periodFormulaBlock
.
setCreateBy
(
"Admin"
);
periodFormulaBlock
.
setCreateTime
(
creatime
);
periodFormulaBlock
.
setUpdateBy
(
"Admin"
);
periodFormulaBlock
.
setUpdateTime
(
creatime
);
SpringContextUtil
.
periodFormulaBlockMapper
.
insertSelective
(
periodFormulaBlock
);
}
}
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