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
e1f76cee
Commit
e1f76cee
authored
Jul 16, 2018
by
frank.xa.zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed null to NumberEval.ZERO
parent
18ffb5bf
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
61 additions
and
18 deletions
+61
-18
FSJZ.java
.../taxtech/atms/vat/service/impl/report/functions/FSJZ.java
+3
-3
GZSD.java
.../taxtech/atms/vat/service/impl/report/functions/GZSD.java
+3
-3
JXFP.java
.../taxtech/atms/vat/service/impl/report/functions/JXFP.java
+5
-5
JXFPMX.java
...axtech/atms/vat/service/impl/report/functions/JXFPMX.java
+42
-0
SGSR.java
.../taxtech/atms/vat/service/impl/report/functions/SGSR.java
+5
-4
XXFP.java
.../taxtech/atms/vat/service/impl/report/functions/XXFP.java
+3
-3
No files found.
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/report/functions/FSJZ.java
View file @
e1f76cee
...
...
@@ -46,7 +46,7 @@ public class FSJZ extends FunctionBase implements FreeRefFunction {
String
accountCode
,
keyParam
;
if
(
args
.
length
<
5
)
{
return
null
;
return
NumberEval
.
ZERO
;
}
accountType
=
this
.
getIntParam
(
args
[
0
],
ec
);
...
...
@@ -70,7 +70,7 @@ public class FSJZ extends FunctionBase implements FreeRefFunction {
//标准账套
VatStandardAccount
vatStandardAccount
=
SpringContextUtil
.
vatStandardAccountMapper
.
selectOneByAccountCode
(
accountCode
);
if
(
vatStandardAccount
==
null
)
{
return
null
;
return
NumberEval
.
ZERO
;
}
BalanceStdManual
balanceStdManual
=
null
;
...
...
@@ -145,7 +145,7 @@ public class FSJZ extends FunctionBase implements FreeRefFunction {
.
getListByAccountCode
(
accountCode
);
if
(
vatEnterpriseAccountList
==
null
)
{
return
null
;
return
NumberEval
.
ZERO
;
}
Balance
balance
=
null
;
...
...
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/report/functions/GZSD.java
View file @
e1f76cee
...
...
@@ -73,8 +73,8 @@ public class GZSD extends FunctionBase implements FreeRefFunction {
if
(!
matchedRule
.
isPresent
())
{
matchedRule
=
Optional
.
ofNullable
(
taxRuleSettings
.
get
(
0
));
if
(
matchedRule
.
isPresent
())
{
return
null
;
if
(
!
matchedRule
.
isPresent
())
{
return
NumberEval
.
ZERO
;
}
}
...
...
@@ -101,6 +101,6 @@ public class GZSD extends FunctionBase implements FreeRefFunction {
//return new NumberEval(matchedRule.get().getTaxBase());
}
return
null
;
return
NumberEval
.
ZERO
;
}
}
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/report/functions/JXFP.java
View file @
e1f76cee
...
...
@@ -58,12 +58,12 @@ public class JXFP extends FunctionBase implements FreeRefFunction {
certificationPeriod
=
getPeriod
(
certificationPeriod
,
yearOffset
);
if
(
yearOffset
[
0
]
<
0
)
{
return
null
;
return
NumberEval
.
ZERO
;
}
period
=
getPeriod
(
period
,
yearOffset
);
if
(
yearOffset
[
0
]
<
0
)
{
return
null
;
return
NumberEval
.
ZERO
;
}
Calendar
calendar
=
Calendar
.
getInstance
();
...
...
@@ -92,12 +92,12 @@ public class JXFP extends FunctionBase implements FreeRefFunction {
inputVATInvoices
=
SpringContextUtil
.
inputVatInvoiceDao
.
getInputVATInvoice
(
period
,
invoiceType
,
null
,
null
,
Constant
.
InputInvoiceCertificationResult
.
NotPass
);
}
else
{
return
null
;
return
NumberEval
.
ZERO
;
}
if
(
certificationPeriod
!=
-
99
&&
certificationPeriod
!=
99
&&
(
certificationPeriod
<
1
||
certificationPeriod
>
12
))
{
return
null
;
return
NumberEval
.
ZERO
;
}
else
if
(!
formulaContext
.
getIsYear
())
{
if
(
certificationPeriod
==
-
99
)
{
calendar
.
set
(
formulaContext
.
getYear
(),
formulaContext
.
getPeriod
(),
1
);
...
...
@@ -162,6 +162,6 @@ public class JXFP extends FunctionBase implements FreeRefFunction {
saveFormulaBlock
(
period
,
ec
,
formulaExpression
,
BigDecimal
.
valueOf
(
val
),
dataSourceId
);
return
new
NumberEval
(
val
);
}
return
null
;
return
NumberEval
.
ZERO
;
}
}
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/report/functions/JXFPMX.java
0 → 100644
View file @
e1f76cee
package
pwc
.
taxtech
.
atms
.
vat
.
service
.
impl
.
report
.
functions
;
import
org.apache.poi.ss.formula.OperationEvaluationContext
;
import
org.apache.poi.ss.formula.eval.NumberEval
;
import
org.apache.poi.ss.formula.eval.ValueEval
;
import
org.apache.poi.ss.formula.functions.FreeRefFunction
;
/// <summary>
/// 名称:进项发票明细
/// 功能:从发票取数,一般取发票金额或税额汇总数
/// </summary>
/// <param name="taxRate">税率——取值为17%,13%,11%,6%, 5%,3%,1.5%, 其他(其他表示除了17%,13%,11%,6%,5%,3%的税率)</param>
/// <param name="goodsName">货物名称——精确匹配引号中的值,99代表所有值(包括空值)</param>
/// <param name="amountType">取值——两种取值结果“金额” 0 和“税额” 1</param>
/// <param name="period">会计期间——三种取值结果 “-1”指上期,“0”当期,“99”当前累计(从期初到目前)</param>
/// <returns></returns>
public
class
JXFPMX
extends
FunctionBase
implements
FreeRefFunction
{
public
JXFPMX
(
FormulaContext
formulaContext
)
{
super
(
formulaContext
);
}
@Override
public
ValueEval
evaluate
(
ValueEval
[]
args
,
OperationEvaluationContext
ec
)
{
if
(
args
.
length
<
4
)
{
return
null
;
}
String
taxRate
=
getStringParam
(
args
[
0
],
ec
);
String
goodsName
=
getStringParam
(
args
[
1
],
ec
);
int
amountType
=
getIntParam
(
args
[
2
],
ec
);
int
period
=
getIntParam
(
args
[
3
],
ec
);
String
formulaExpression
=
"JXFPMX(\""
+
taxRate
+
"\",\""
+
goodsName
+
"\","
+
amountType
+
","
+
period
+
")"
;
logger
.
debug
(
formulaExpression
);
return
NumberEval
.
ZERO
;
}
}
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/report/functions/SGSR.java
View file @
e1f76cee
...
...
@@ -2,6 +2,7 @@ package pwc.taxtech.atms.vat.service.impl.report.functions;
import
org.apache.poi.ss.formula.OperationEvaluationContext
;
import
org.apache.poi.ss.formula.eval.EvaluationException
;
import
org.apache.poi.ss.formula.eval.NumberEval
;
import
org.apache.poi.ss.formula.eval.OperandResolver
;
import
org.apache.poi.ss.formula.eval.ValueEval
;
import
org.apache.poi.ss.formula.functions.FreeRefFunction
;
...
...
@@ -34,7 +35,7 @@ public class SGSR implements FreeRefFunction {
}
else
if
(
valueEvals
.
length
==
4
)
{
year
=
0
;
}
else
{
return
null
;
return
NumberEval
.
ZERO
;
}
ValueEval
v1
=
OperandResolver
.
getSingleValue
(
valueEvals
[
0
],
...
...
@@ -68,7 +69,7 @@ public class SGSR implements FreeRefFunction {
curYear
=
FormulaHelper
.
getYear
(
year
,
formulaContext
);
curPeriod
=
0
;
}
else
{
return
null
;
return
NumberEval
.
ZERO
;
}
List
<
CellTemplatePerGroupDto
>
cellTemplatePerGroupDtoList
=
SpringContextUtil
.
periodTemplateMapper
...
...
@@ -82,7 +83,7 @@ public class SGSR implements FreeRefFunction {
.
findFirst
();
if
(
cellTemplatePerGroupDto
==
null
)
{
return
null
;
return
NumberEval
.
ZERO
;
}
//配置的行号列号都比 DB 中+1
...
...
@@ -93,6 +94,6 @@ public class SGSR implements FreeRefFunction {
}
catch
(
EvaluationException
e
)
{
e
.
printStackTrace
();
}
return
null
;
return
NumberEval
.
ZERO
;
}
}
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/report/functions/XXFP.java
View file @
e1f76cee
...
...
@@ -58,14 +58,14 @@ public class XXFP extends FunctionBase implements FreeRefFunction {
if
(
taxRate
.
equals
(
"99"
))
{
taxRateVal
=
new
BigDecimal
(
"99"
);
}
else
{
return
null
;
return
NumberEval
.
ZERO
;
}
}
else
{
taxRate
=
StringUtils
.
removeEnd
(
taxRate
,
"%"
);
try
{
taxRateVal
=
BigDecimal
.
valueOf
(
Double
.
parseDouble
(
taxRate
));
}
catch
(
NumberFormatException
ex
)
{
return
null
;
return
NumberEval
.
ZERO
;
}
taxRateVal
=
taxRateVal
.
divide
(
new
BigDecimal
(
"100"
),
2
,
BigDecimal
.
ROUND_HALF_UP
);
//保留两位小数,然后四舍五入
}
...
...
@@ -124,6 +124,6 @@ public class XXFP extends FunctionBase implements FreeRefFunction {
saveFormulaBlock
(
period
,
ec
,
formulaExpression
,
new
BigDecimal
(
val
),
dataSoureId
);
return
new
NumberEval
(
val
);
}
return
null
;
return
NumberEval
.
ZERO
;
}
}
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