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
0933ef59
Commit
0933ef59
authored
Mar 13, 2019
by
kevin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#
parent
b0658e9d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
6 deletions
+10
-6
FormulaAgent.java
.../java/pwc/taxtech/atms/vat/service/impl/FormulaAgent.java
+10
-6
No files found.
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/FormulaAgent.java
View file @
0933ef59
...
...
@@ -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 "
+
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
));
...
...
@@ -183,13 +183,13 @@ public class FormulaAgent {
sql
+=
" and tms_period = "
+
Integer
.
parseInt
(
year
+
_period
);
}
else
if
(
period
==
-
99
)
{
sql
+=
" and tms_period between "
+
Integer
.
parseInt
(
year
+
"01"
)
+
" and "
+
Integer
.
parseInt
(
year
+
per
);
sql
+=
" and tms_period between "
+
Integer
.
parseInt
(
year
+
"01"
)
+
" and "
+
Integer
.
parseInt
(
year
+
per
);
}
else
if
(
period
==
99
)
{
sql
+=
" and tms_period between "
+
Integer
.
parseInt
(
year
+
"01"
)
+
" and "
+
Integer
.
parseInt
(
year
+
_period
);
sql
+=
" and tms_period between "
+
Integer
.
parseInt
(
year
+
"01"
)
+
" and "
+
Integer
.
parseInt
(
year
+
_period
);
}
else
{
if
(
period
>
0
)
throw
new
Exception
(
"参数不正确"
);
sql
+=
" and tms_period between "
+
Integer
.
parseInt
(
year
+
_p
)
+
" and "
+
Integer
.
parseInt
(
year
+
per
);
sql
+=
" and tms_period between "
+
Integer
.
parseInt
(
year
+
_p
)
+
" and "
+
Integer
.
parseInt
(
year
+
per
);
}
}
if
(
bool
)
...
...
@@ -219,15 +219,19 @@ public class FormulaAgent {
}
public
double
getTableDataByName
(
String
tableName
,
String
getField
,
String
filter
,
String
filterValue
,
Integer
period
,
String
year
,
FormulaContext
formulaContext
)
{
List
<
Map
<
String
,
Object
>>
stringObjectMap
=
jdbcTemplate
.
queryForList
(
buildSql
(
TableRule
.
map
.
get
(
tableName
),
getField
,
filter
,
filterValue
,
period
,
year
,
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
++)
{
/*
for (int i = 0, j = stringObjectMap.size(); i < j; i++) {
if (i == 1) {
rev = Long.parseLong(String.valueOf(stringObjectMap.get(i).get(StringUtil.underline2Camel(getField))));
} else {
rev = rev + Long.parseLong(String.valueOf(stringObjectMap.get(i).get(StringUtil.underline2Camel(getField))));
}
}
*/
if
(
stringObjectMap
.
get
(
StringUtil
.
underline2Camel
(
getField
))
!=
null
){
return
(
double
)
stringObjectMap
.
get
(
StringUtil
.
underline2Camel
(
getField
));
}
return
rev
;
}
}
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