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
4c98efa8
Commit
4c98efa8
authored
Jul 17, 2018
by
frank.xa.zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add code for fwnd, need debug later
parent
b6ba1fd7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
0 deletions
+49
-0
SpringContextUtil.java
.../java/pwc/taxtech/atms/common/util/SpringContextUtil.java
+3
-0
FWND.java
.../taxtech/atms/vat/service/impl/report/functions/FWND.java
+46
-0
No files found.
atms-api/src/main/java/pwc/taxtech/atms/common/util/SpringContextUtil.java
View file @
4c98efa8
...
...
@@ -5,6 +5,7 @@ import org.springframework.context.ApplicationContext;
import
org.springframework.context.ApplicationContextAware
;
import
org.springframework.stereotype.Component
;
import
pwc.taxtech.atms.dao.FormulaAdminMapper
;
import
pwc.taxtech.atms.dao.ProjectMapper
;
import
pwc.taxtech.atms.dao.ProjectServiceTypeMapper
;
import
pwc.taxtech.atms.dao.dao.ProjectDao
;
import
pwc.taxtech.atms.service.impl.DistributedIDService
;
...
...
@@ -41,6 +42,7 @@ public class SpringContextUtil implements ApplicationContextAware {
public
static
InputVatInvoiceDao
inputVatInvoiceDao
;
public
static
InputVATInvoiceMapper
inputVATInvoiceMapper
;
public
static
AssetsListMapper
assetsListMapper
;
public
static
ProjectMapper
projectMapper
;
/**
* 获取bean
...
...
@@ -79,5 +81,6 @@ public class SpringContextUtil implements ApplicationContextAware {
inputVatInvoiceDao
=
webApplicationContext
.
getBean
(
InputVatInvoiceDao
.
class
);
inputVATInvoiceMapper
=
webApplicationContext
.
getBean
(
InputVATInvoiceMapper
.
class
);
assetsListMapper
=
webApplicationContext
.
getBean
(
AssetsListMapper
.
class
);
projectMapper
=
webApplicationContext
.
getBean
(
ProjectMapper
.
class
);
}
}
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/report/functions/FWND.java
0 → 100644
View file @
4c98efa8
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
;
import
pwc.taxtech.atms.common.util.SpringContextUtil
;
import
pwc.taxtech.atms.entitiy.Project
;
import
pwc.taxtech.atms.entitiy.ProjectExample
;
import
java.math.BigDecimal
;
import
java.util.List
;
/// <summary>
/// 名称:FWND
/// 功能:某年度我team是否为该客户提供该项服务,取本机构本服务中某一年度系统中是否存在项目卡片,若存在返回值为1,若不存在 返回值为0
/// 备注:如今年为2017,FWND(ND(-1))=0,表示此公司在本服务下没有2016年的卡片,ND(-1)=2016表示上一年。
/// </summary>
/// <param name="year">年份</param>
/// <returns></returns>
public
class
FWND
extends
FunctionBase
implements
FreeRefFunction
{
public
FWND
(
FormulaContext
formulaContext
)
{
super
(
formulaContext
);
}
@Override
public
ValueEval
evaluate
(
ValueEval
[]
args
,
OperationEvaluationContext
ec
)
{
if
(
args
.
length
<
1
)
{
return
NumberEval
.
ZERO
;
}
int
year
=
getIntParam
(
args
[
0
],
ec
);
String
formulaExpression
=
"FWND("
+
year
+
")"
;
logger
.
debug
(
formulaExpression
);
ProjectExample
example
=
new
ProjectExample
();
example
.
createCriteria
().
andOrganizationIDEqualTo
(
formulaContext
.
getOrganizationID
()).
andYearEqualTo
(
year
);
List
<
Project
>
projects
=
SpringContextUtil
.
projectMapper
.
selectByExample
(
example
);
if
(
projects
!=
null
&&
projects
.
size
()
>
0
)
{
saveFormulaBlock
(
0
,
ec
,
formulaExpression
,
new
BigDecimal
(
"1"
),
0
);
return
new
NumberEval
(
1
);
}
else
{
saveFormulaBlock
(
0
,
ec
,
formulaExpression
,
new
BigDecimal
(
"0"
),
0
);
return
new
NumberEval
(
0
);
}
}
}
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