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
1d2cb258
Commit
1d2cb258
authored
Nov 20, 2018
by
sherlock
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DFFS periodName filter
parent
c1ae7f3b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
7 deletions
+10
-7
DFFS.java
.../taxtech/atms/vat/service/impl/report/functions/DFFS.java
+10
-7
No files found.
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/report/functions/DFFS.java
View file @
1d2cb258
...
@@ -53,12 +53,11 @@ public class DFFS extends FunctionBase implements FreeRefFunction {
...
@@ -53,12 +53,11 @@ public class DFFS extends FunctionBase implements FreeRefFunction {
period
=
FormulaHelper
.
getPeriod
(
period
,
yearOffset
,
formulaContext
);
period
=
FormulaHelper
.
getPeriod
(
period
,
yearOffset
,
formulaContext
);
String
orgId
=
formulaContext
.
getOrganizationId
();
String
orgId
=
formulaContext
.
getOrganizationId
();
year
=
year
+
yearOffset
;
year
=
year
+
yearOffset
;
Date
date
=
DateUtils
.
strToDate
(
year
+
"-"
+
period
+
"-"
+
15
);
List
<
ReportCellDataSourceDto
>
dataSource
=
Lists
.
newArrayList
();
List
<
ReportCellDataSourceDto
>
dataSource
=
Lists
.
newArrayList
();
if
(
type
==
0
){
if
(
type
==
0
){
EnterpriseAccountSetOrgExample
example
=
new
EnterpriseAccountSetOrgExample
();
EnterpriseAccountSetOrgExample
example
=
new
EnterpriseAccountSetOrgExample
();
example
.
createCriteria
().
andEffectiveDateLessThanOrEqualTo
(
date
).
andExpiredDateGreaterThanOrEqualTo
(
date
).
andOrganizationIdEqualTo
(
orgId
);
example
.
createCriteria
().
andEffectiveDateLessThanOrEqualTo
(
DateUtils
.
getNow
()).
andExpiredDateGreaterThanOrEqualTo
(
DateUtils
.
getNow
()
).
andOrganizationIdEqualTo
(
orgId
);
List
<
EnterpriseAccountSetOrg
>
enterpriseAccountSetOrgs
=
SpringContextUtil
.
enterpriseAccountSetOrgMapper
.
selectByExample
(
example
);
List
<
EnterpriseAccountSetOrg
>
enterpriseAccountSetOrgs
=
SpringContextUtil
.
enterpriseAccountSetOrgMapper
.
selectByExample
(
example
);
if
(
CollectionUtils
.
isEmpty
(
enterpriseAccountSetOrgs
)){
if
(
CollectionUtils
.
isEmpty
(
enterpriseAccountSetOrgs
)){
return
NumberEval
.
ZERO
;
return
NumberEval
.
ZERO
;
...
@@ -69,7 +68,7 @@ public class DFFS extends FunctionBase implements FreeRefFunction {
...
@@ -69,7 +68,7 @@ public class DFFS extends FunctionBase implements FreeRefFunction {
double
result
=
0
;
double
result
=
0
;
for
(
AccountMapping
a
:
accountMappings
){
for
(
AccountMapping
a
:
accountMappings
){
result
+=
count
(
a
.
getEnterpriseAccountCode
(),
dataSource
,
period
);
result
+=
count
(
a
.
getEnterpriseAccountCode
(),
dataSource
,
period
,
year
);
}
}
Long
dataSoureId
=
saveDataSource
(
ec
,
Collections
.
singletonList
(
dataSource
),
Long
dataSoureId
=
saveDataSource
(
ec
,
Collections
.
singletonList
(
dataSource
),
FormulaDataSourceDetailType
.
FormulaDataSourceDto
,
FormulaDataSourceDetailType
.
FormulaDataSourceDto
,
...
@@ -79,7 +78,7 @@ public class DFFS extends FunctionBase implements FreeRefFunction {
...
@@ -79,7 +78,7 @@ public class DFFS extends FunctionBase implements FreeRefFunction {
return
new
NumberEval
(
result
);
return
new
NumberEval
(
result
);
}
else
if
(
type
==
1
){
}
else
if
(
type
==
1
){
double
result
=
count
(
code
,
dataSource
,
period
);
double
result
=
count
(
code
,
dataSource
,
period
,
year
);
Long
dataSoureId
=
saveDataSource
(
ec
,
Collections
.
singletonList
(
dataSource
),
Long
dataSoureId
=
saveDataSource
(
ec
,
Collections
.
singletonList
(
dataSource
),
FormulaDataSourceDetailType
.
FormulaDataSourceDto
,
FormulaDataSourceDetailType
.
FormulaDataSourceDto
,
new
BigDecimal
(
result
),
period
,
formulaContext
.
getReportTemplateGroupId
(),
formulaContext
.
getProjectId
());
new
BigDecimal
(
result
),
period
,
formulaContext
.
getReportTemplateGroupId
(),
formulaContext
.
getProjectId
());
...
@@ -90,10 +89,14 @@ public class DFFS extends FunctionBase implements FreeRefFunction {
...
@@ -90,10 +89,14 @@ public class DFFS extends FunctionBase implements FreeRefFunction {
return
NumberEval
.
ZERO
;
return
NumberEval
.
ZERO
;
}
}
private
double
count
(
String
code
,
List
<
ReportCellDataSourceDto
>
contain
,
int
period
){
private
String
periodName
(
int
period
,
int
year
){
return
year
+
"-"
+
(
period
>
9
?
period
:
(
"0"
+
period
));
}
private
double
count
(
String
code
,
List
<
ReportCellDataSourceDto
>
contain
,
int
period
,
int
year
){
GlBalanceExample
glBalanceExample
=
new
GlBalanceExample
();
GlBalanceExample
glBalanceExample
=
new
GlBalanceExample
();
GlBalanceExample
.
Criteria
c1
=
glBalanceExample
.
createCriteria
().
andSegment3EqualTo
(
code
);
GlBalanceExample
.
Criteria
c1
=
glBalanceExample
.
createCriteria
().
andSegment3EqualTo
(
code
)
.
andPeriodNameEqualTo
(
periodName
(
period
,
year
))
;
GlBalanceExample
.
Criteria
c2
=
glBalanceExample
.
createCriteria
().
andSegment4EqualTo
(
code
);
GlBalanceExample
.
Criteria
c2
=
glBalanceExample
.
createCriteria
().
andSegment4EqualTo
(
code
)
.
andPeriodNameEqualTo
(
periodName
(
period
,
year
))
;
glBalanceExample
.
or
(
c2
);
glBalanceExample
.
or
(
c2
);
List
<
GlBalance
>
list
=
SpringContextUtil
.
glBalanceMapper
.
selectByExample
(
glBalanceExample
);
List
<
GlBalance
>
list
=
SpringContextUtil
.
glBalanceMapper
.
selectByExample
(
glBalanceExample
);
if
(
CollectionUtils
.
isEmpty
(
list
)){
if
(
CollectionUtils
.
isEmpty
(
list
)){
...
...
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