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
6e55d634
Commit
6e55d634
authored
Nov 20, 2018
by
eddie.woo
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev_oracle' of
http://code.tech.tax.asia.pwcinternal.com/root/atms
into dev_oracle
parents
e39ec0d6
15c40587
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
10 deletions
+9
-10
PSUM.java
.../taxtech/atms/vat/service/impl/report/functions/PSUM.java
+9
-10
No files found.
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/report/functions/PSUM.java
View file @
6e55d634
...
...
@@ -68,26 +68,25 @@ public class PSUM extends FunctionBase implements FreeRefFunction {
ValueEval
eval
=
evaluator
.
evaluate
(
ec
.
getWorkbook
().
getSheet
(
ec
.
getSheetIndex
())
.
getCell
(
pCell
.
rowIndex
-
1
,
pCell
.
columnIndex
-
1
));
List
<
CellTemplatePerGroupDto
>
cellTemplateDataList
=
agent
.
getCellTemplateGroupDto
(
formulaContext
.
getReportTemplateGroupId
(),
formulaContext
.
getProjectId
(),
ec
.
getWorkbook
().
getSheetName
(
ec
.
getSheetIndex
()),
pCell
.
rowIndex
-
1
,
pCell
.
columnIndex
-
1
,
formulaContext
.
getPeriod
());
List
<
CellTemplatePerGroupDto
>
cellTemplateDataList
=
agent
.
getCellTemplateGroupDto
(
formulaContext
.
getReportTemplateGroupId
(),
formulaContext
.
getProjectId
(),
ec
.
getWorkbook
().
getSheetName
(
ec
.
getSheetIndex
()),
pCell
.
rowIndex
-
1
,
pCell
.
columnIndex
-
1
,
formulaContext
.
getPeriod
());
MyAsserts
.
assertNotEmpty
(
cellTemplateDataList
,
Exceptions
.
PSUM_CELL_TEMP_NULL
);
CellTemplatePerGroupDto
cellTemplateData
=
cellTemplateDataList
.
get
(
0
);
List
<
PeriodDataSource
>
dss
=
agent
.
queryManualDataSource
(
Long
.
parseLong
(
cellTemplateData
.
getCellTemplateId
()),
formulaContext
.
getProjectId
(),
formulaContext
.
getPeriod
());
BigDecimal
cellValue
=
new
BigDecimal
(
0
);
BigDecimal
cellValue
=
new
BigDecimal
(
0
);
if
(
eval
instanceof
ErrorEval
||
eval
==
null
||
eval
instanceof
BlankEval
)
{
LOGGER
.
warn
(
"[PSUM_Exception] error eval for pcell {} and error code {} and error String {}"
,
pCell
.
toString
(),
((
ErrorEval
)
eval
).
getErrorCode
(),
((
ErrorEval
)
eval
).
getErrorString
());
if
(!
dss
.
isEmpty
())
cellValue
=
dss
.
get
(
0
).
getAmount
();
if
(!
dss
.
isEmpty
())
cellValue
=
dss
.
get
(
0
).
getAmount
();
}
else
{
String
evalStr
=
OperandResolver
.
coerceValueToString
(
eval
);
logger
.
debug
(
"[PSUM_debug] eval other cell value {}"
,
evalStr
);
try
{
cellValue
=
new
BigDecimal
(
evalStr
).
setScale
(
4
,
BigDecimal
.
ROUND_HALF_DOWN
);
cellValue
=
new
BigDecimal
(
evalStr
);
if
(!
dss
.
isEmpty
())
cellValue
=
cellValue
.
add
(
dss
.
get
(
0
).
getAmount
());
}
catch
(
Exception
e
)
{
...
...
@@ -98,17 +97,17 @@ public class PSUM extends FunctionBase implements FreeRefFunction {
}
ReportCellDataSourceDto
dto
=
new
ReportCellDataSourceDto
();
dto
.
fixedWithGroup
(
cellTemplateData
);
dto
.
fixedWithGroup
(
cellTemplateData
);
dto
.
setAmount
(
cellValue
);
dto
.
setPeriod
(
formulaContext
.
getPeriod
());
dto
.
setProjectId
(
formulaContext
.
getProjectId
());
dto
.
setReportName
(
cellTemplateData
.
getReportCode
());
dataSource
.
add
(
dto
);
bigDecimal
=
bigDecimal
.
add
(
cellValue
);
bigDecimal
=
bigDecimal
.
add
(
cellValue
);
}
return
bigDecimal
;
return
bigDecimal
.
setScale
(
4
,
BigDecimal
.
ROUND_HALF_DOWN
)
;
}
public
static
class
PCell
{
...
...
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