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
310468b7
Commit
310468b7
authored
Mar 13, 2019
by
kevin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#
parent
5d9addb7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
7 deletions
+6
-7
FormulaAgent.java
.../java/pwc/taxtech/atms/vat/service/impl/FormulaAgent.java
+5
-6
TABLESUMIF.java
...ch/atms/vat/service/impl/report/functions/TABLESUMIF.java
+1
-1
No files found.
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/FormulaAgent.java
View file @
310468b7
...
...
@@ -174,7 +174,7 @@ public class FormulaAgent {
public
static
String
_buildSql
(
String
getField
,
String
tableName
,
String
filter
,
String
filterValue
,
Integer
period
,
FormulaContext
formulaContext
,
String
year
,
boolean
bool
)
throws
Exception
{
String
sql
=
"select sum
("
+
getField
+
") as "
+
getField
+
" from "
+
tableName
+
" where 1=1 and "
+
filter
+
filterValue
;
String
sql
=
"select sum("
+
getField
+
") as "
+
getField
+
" from "
+
tableName
+
" where 1=1 and "
+
filter
+
filterValue
;
String
_p
=
insertZero
(
formulaContext
.
getPeriod
()
-
Math
.
abs
(
period
));
String
_period
=
insertZero
(
formulaContext
.
getPeriod
());
String
per
=
insertZero
((
formulaContext
.
getPeriod
()
-
1
));
...
...
@@ -218,9 +218,8 @@ public class FormulaAgent {
formulaAgent
.
getTableDataByName
(
"CIT_TBAM"
,
"ending_balance"
,
"attribute"
,
"= '销售费用-财产损耗、盘亏及毁损损失'"
,
0
,
"2018"
,
formulaContext
);
}
public
double
getTableDataByName
(
String
tableName
,
String
getField
,
String
filter
,
String
filterValue
,
Integer
period
,
String
year
,
FormulaContext
formulaContext
)
{
public
BigDecimal
getTableDataByName
(
String
tableName
,
String
getField
,
String
filter
,
String
filterValue
,
Integer
period
,
String
year
,
FormulaContext
formulaContext
)
{
Map
<
String
,
Object
>
stringObjectMap
=
jdbcTemplate
.
queryForMap
(
buildSql
(
TableRule
.
map
.
get
(
tableName
),
getField
,
filter
,
filterValue
,
period
,
year
,
formulaContext
));
double
rev
=
0.00
;
/* for (int i = 0, j = stringObjectMap.size(); i < j; i++) {
if (i == 1) {
if(stringObjectMap.get(i).get(StringUtil.underline2Camel(getField)) == null){
...
...
@@ -238,9 +237,9 @@ public class FormulaAgent {
}
}
*/
if
(
stringObjectMap
.
get
(
StringUtil
.
underline2Camel
(
getField
)
)
!=
null
){
return
(
double
)
stringObjectMap
.
get
(
StringUtil
.
underline2Camel
(
getField
));
if
(
stringObjectMap
.
get
(
getField
)
!=
null
){
return
new
BigDecimal
(
stringObjectMap
.
get
(
getField
).
toString
(
));
}
return
rev
;
return
new
BigDecimal
(
0
)
;
}
}
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/report/functions/TABLESUMIF.java
View file @
310468b7
...
...
@@ -56,7 +56,7 @@ public class TABLESUMIF extends FunctionBase implements FreeRefFunction {
String
filterValue
=
resolverString
(
args
,
ec
,
3
);
period
=
resolverInteger
(
args
,
ec
,
4
);
//会计期间
year
=
resolverString
(
args
,
ec
,
5
);
//会计年度
new
NumberEval
(
agent
.
getTableDataByName
(
tableName
,
getField
,
filter
,
filterValue
,
period
,
year
,
formulaContext
));
new
NumberEval
(
agent
.
getTableDataByName
(
tableName
,
getField
,
filter
,
filterValue
,
period
,
year
,
formulaContext
)
.
doubleValue
()
);
}
catch
(
EvaluationException
e
)
{
e
.
printStackTrace
();
return
new
NumberEval
(
0.00
);
...
...
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