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
a34a02c0
Commit
a34a02c0
authored
Sep 29, 2018
by
neo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[dev] add project id for period formula block
parent
9e7efe14
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
67 additions
and
45 deletions
+67
-45
ReportGeneratorImpl.java
...wc/taxtech/atms/vat/service/impl/ReportGeneratorImpl.java
+6
-5
ReportServiceImpl.java
.../pwc/taxtech/atms/vat/service/impl/ReportServiceImpl.java
+2
-1
BB.java
...wc/taxtech/atms/vat/service/impl/report/functions/BB.java
+1
-1
FSJZ.java
.../taxtech/atms/vat/service/impl/report/functions/FSJZ.java
+2
-2
FWND.java
.../taxtech/atms/vat/service/impl/report/functions/FWND.java
+2
-2
FunctionBase.java
.../atms/vat/service/impl/report/functions/FunctionBase.java
+11
-7
GZSD.java
.../taxtech/atms/vat/service/impl/report/functions/GZSD.java
+3
-3
JXFP.java
.../taxtech/atms/vat/service/impl/report/functions/JXFP.java
+21
-12
JXFPMX.java
...axtech/atms/vat/service/impl/report/functions/JXFPMX.java
+10
-6
XXFP.java
.../taxtech/atms/vat/service/impl/report/functions/XXFP.java
+4
-4
ZC.java
...wc/taxtech/atms/vat/service/impl/report/functions/ZC.java
+1
-1
PeriodFormulaBlockMapper.java
...va/pwc/taxtech/atms/vat/dao/PeriodFormulaBlockMapper.java
+3
-1
PeriodFormulaBlockExtendsMapper.xml
.../atms/vat/dao/extends/PeriodFormulaBlockExtendsMapper.xml
+1
-0
No files found.
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/ReportGeneratorImpl.java
View file @
a34a02c0
...
...
@@ -249,12 +249,13 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen
.
map
(
PeriodCellTemplateConfig:
:
getCellTemplateId
)
.
collect
(
Collectors
.
toList
());
if
(
cellTemplateConfigIds
.
size
()
>
0
)
{
periodFormulaBlockMapper
.
updateReportId
(
reportId
,
cellTemplateConfigIds
,
period
);
periodFormulaBlockMapper
.
updateReportId
(
reportId
,
cellTemplateConfigIds
,
period
,
projectId
);
}
for
(
PeriodCellTemplateConfig
periodCellTemplateConfig
:
periodCellTemplateConfigs
)
{
PeriodFormulaBlockExample
periodFormulaBlockExample2
=
new
PeriodFormulaBlockExample
();
periodFormulaBlockExample2
.
createCriteria
()
.
andProjectIdEqualTo
(
projectId
)
.
andCellTemplateIdEqualTo
(
periodCellTemplateConfig
.
getCellTemplateId
())
.
andReportIdEqualTo
(
reportId
)
.
andPeriodEqualTo
(
period
);
...
...
@@ -263,11 +264,11 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen
//TODO:如果formula 为 ND(100) +ND(22) ,需要使用正则表达式拆分出自定义公式,然后根据自定义公式取formulablock 的数据进行替换
String
regex
=
"[A-Z]*\\([\\-A-Za-z0-9\\\"\\,\\.\\u4e00-\\u9fa5\\%]*\\)"
;
Pattern
p
=
Pattern
.
compile
(
regex
);
String
sourceFormula
=
StringUtils
.
isNotBlank
(
periodCellTemplateConfig
.
getKeyValueParsedFormula
())?
periodCellTemplateConfig
.
getKeyValueParsedFormula
():
String
sourceFormula
=
StringUtils
.
isNotBlank
(
periodCellTemplateConfig
.
getKeyValueParsedFormula
())
?
periodCellTemplateConfig
.
getKeyValueParsedFormula
()
:
periodCellTemplateConfig
.
getFormula
();
String
resultFormula
=
StringUtils
.
isNotBlank
(
periodCellTemplateConfig
.
getKeyValueParsedFormula
())?
periodCellTemplateConfig
.
getKeyValueParsedFormula
():
String
resultFormula
=
StringUtils
.
isNotBlank
(
periodCellTemplateConfig
.
getKeyValueParsedFormula
())
?
periodCellTemplateConfig
.
getKeyValueParsedFormula
()
:
periodCellTemplateConfig
.
getFormula
();
Matcher
m
=
p
.
matcher
(
sourceFormula
);
Boolean
isFind
=
false
;
...
...
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/ReportServiceImpl.java
View file @
a34a02c0
...
...
@@ -444,7 +444,8 @@ public class ReportServiceImpl extends VatAbstractService implements ReportServi
List
<
CellData
>
currentCellDataList
=
cellDataMapper
.
selectByExample
(
cellDataExample
);
PeriodFormulaBlockExample
periodFormulaBlockExample
=
new
PeriodFormulaBlockExample
();
periodFormulaBlockExample
.
createCriteria
().
andPeriodEqualTo
(
report
.
getPeriod
()).
andReportIdEqualTo
(
reportId
);
periodFormulaBlockExample
.
createCriteria
().
andProjectIdEqualTo
(
projectId
).
andPeriodEqualTo
(
report
.
getPeriod
())
.
andReportIdEqualTo
(
reportId
);
List
<
PeriodFormulaBlock
>
formulaBlocks
=
periodFormulaBlockMapper
.
selectByExample
(
periodFormulaBlockExample
);
dataDto
.
setFormulaBlocks
(
formulaBlocks
);
//todo: 关键字数据源稍后再加
...
...
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/report/functions/BB.java
View file @
a34a02c0
...
...
@@ -140,7 +140,7 @@ public class BB extends FunctionBase implements FreeRefFunction {
cellValue
,
formulaContext
.
getPeriod
(),
formulaContext
.
getReportTemplateGroupId
(),
bo
.
getColumnIndex
()
-
1
,
bo
.
getRowIndex
()
-
1
);
saveFormulaBlock
(
formulaContext
.
getPeriod
(),
ec
,
bo
.
expression
(),
bo
.
expressionData
(),
dataSourceId
);
bo
.
expression
(),
bo
.
expressionData
(),
dataSourceId
,
formulaContext
.
getProjectId
()
);
}
}
}
...
...
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/report/functions/FSJZ.java
View file @
a34a02c0
...
...
@@ -135,7 +135,7 @@ public class FSJZ extends FunctionBase implements FreeRefFunction {
//save datasource
Long
dataSourceId
=
saveDataSource
(
ec
,
formulaDataSourceDtoList
,
FormulaDataSourceDetailType
.
BSPLFormulaDataSourceDto
,
val
,
period
,
formulaContext
.
getReportTemplateGroupId
());
//save formulablock
saveFormulaBlock
(
period
,
ec
,
formulaExpression
,
val
,
dataSourceId
);
saveFormulaBlock
(
period
,
ec
,
formulaExpression
,
val
,
dataSourceId
,
formulaContext
.
getProjectId
()
);
return
new
NumberEval
(
val
.
doubleValue
());
}
else
{
...
...
@@ -199,7 +199,7 @@ public class FSJZ extends FunctionBase implements FreeRefFunction {
Long
dataSourceId
=
saveDataSource
(
ec
,
dsList
,
FormulaDataSourceDetailType
.
BSPLFormulaDataSourceDto
,
val
,
period
,
formulaContext
.
getReportTemplateGroupId
());
//save formulablock
saveFormulaBlock
(
period
,
ec
,
formulaExpression
,
val
,
dataSourceId
);
saveFormulaBlock
(
period
,
ec
,
formulaExpression
,
val
,
dataSourceId
,
formulaContext
.
getProjectId
()
);
return
new
NumberEval
(
val
.
doubleValue
());
}
}
...
...
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/report/functions/FWND.java
View file @
a34a02c0
...
...
@@ -36,10 +36,10 @@ public class FWND extends FunctionBase implements FreeRefFunction {
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"
),
0L
);
saveFormulaBlock
(
0
,
ec
,
formulaExpression
,
new
BigDecimal
(
"1"
),
0L
,
formulaContext
.
getProjectId
()
);
return
new
NumberEval
(
1
);
}
else
{
saveFormulaBlock
(
0
,
ec
,
formulaExpression
,
new
BigDecimal
(
"0"
),
0L
);
saveFormulaBlock
(
0
,
ec
,
formulaExpression
,
new
BigDecimal
(
"0"
),
0L
,
formulaContext
.
getProjectId
()
);
return
new
NumberEval
(
0
);
}
}
...
...
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/report/functions/FunctionBase.java
View file @
a34a02c0
...
...
@@ -15,10 +15,12 @@ import pwc.taxtech.atms.vat.entity.DataSourceDetail;
import
pwc.taxtech.atms.vat.entity.PeriodFormulaBlock
;
import
pwc.taxtech.atms.vat.service.impl.FormulaAgent
;
import
javax.tools.JavaCompiler
;
import
java.lang.reflect.Array
;
import
java.math.BigDecimal
;
import
java.util.*
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
public
class
FunctionBase
{
protected
final
Logger
logger
=
LoggerFactory
.
getLogger
(
this
.
getClass
());
...
...
@@ -130,8 +132,8 @@ public class FunctionBase {
dataSource
.
setPeriod
(
period
);
SpringContextUtil
.
dataSourceMapper
.
insertSelective
(
dataSource
);
for
(
Object
obj
:
dataSourceList
)
{
if
(
obj
.
getClass
()
==
java
.
util
.
ArrayList
.
class
)
{
for
(
Object
obj2
:
(
ArrayList
<
Object
>)
obj
)
{
if
(
obj
.
getClass
()
==
java
.
util
.
ArrayList
.
class
)
{
for
(
Object
obj2
:
(
ArrayList
<
Object
>)
obj
)
{
DataSourceDetail
dataSourceDetail
=
new
DataSourceDetail
();
dataSourceDetail
.
setId
(
SpringContextUtil
.
distributedIdService
.
nextId
());
dataSourceDetail
.
setDataSourceId
(
dataSourceId
);
...
...
@@ -152,11 +154,12 @@ public class FunctionBase {
}
public
void
saveFormulaBlock
(
int
period
,
OperationEvaluationContext
ec
,
String
formulaExpression
,
BigDecimal
val
,
Long
dataSource
Id
)
{
String
formulaExpression
,
BigDecimal
val
,
Long
dataSourceId
,
String
project
Id
)
{
Long
cellTemplateId
=
getCellTemplateId
(
period
,
ec
);
Date
creatime
=
new
Date
();
PeriodFormulaBlock
periodFormulaBlock
=
new
PeriodFormulaBlock
();
periodFormulaBlock
.
setId
(
SpringContextUtil
.
distributedIdService
.
nextId
());
periodFormulaBlock
.
setProjectId
(
projectId
);
periodFormulaBlock
.
setPeriod
(
period
);
periodFormulaBlock
.
setReportId
(
0L
);
periodFormulaBlock
.
setCellTemplateId
(
cellTemplateId
);
...
...
@@ -171,10 +174,11 @@ public class FunctionBase {
}
public
void
saveFormulaBlock
(
int
period
,
OperationEvaluationContext
ec
,
String
formulaExpression
,
String
val
,
Long
dataSourceId
)
{
String
formulaExpression
,
String
val
,
Long
dataSourceId
,
String
projectId
)
{
Long
cellTemplateId
=
getCellTemplateId
(
period
,
ec
);
Date
creatime
=
new
Date
();
PeriodFormulaBlock
periodFormulaBlock
=
new
PeriodFormulaBlock
();
periodFormulaBlock
.
setProjectId
(
projectId
);
periodFormulaBlock
.
setId
(
SpringContextUtil
.
distributedIdService
.
nextId
());
periodFormulaBlock
.
setPeriod
(
period
);
periodFormulaBlock
.
setReportId
(
0L
);
...
...
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/report/functions/GZSD.java
View file @
a34a02c0
...
...
@@ -89,7 +89,7 @@ public class GZSD extends FunctionBase implements FreeRefFunction {
Long
dataSourceId
=
saveDataSource
(
ec
,
Collections
.
singletonList
(
dataSourceDtoList
),
FormulaDataSourceDetailType
.
FormulaDataSourceDto
,
decimal_zero
,
formulaContext
.
getPeriod
(),
formulaContext
.
getReportTemplateGroupId
());
saveFormulaBlock
(
formulaContext
.
getPeriod
(),
ec
,
formulaExpression
,
decimal_zero
,
dataSourceId
);
saveFormulaBlock
(
formulaContext
.
getPeriod
(),
ec
,
formulaExpression
,
decimal_zero
,
dataSourceId
,
formulaContext
.
getProjectId
()
);
return
NumberEval
.
ZERO
;
}
}
...
...
@@ -112,7 +112,7 @@ public class GZSD extends FunctionBase implements FreeRefFunction {
Long
dataSourceId
=
saveDataSource
(
ec
,
Collections
.
singletonList
(
dataSourceDtoList
),
FormulaDataSourceDetailType
.
FormulaDataSourceDto
,
val
,
formulaContext
.
getPeriod
(),
formulaContext
.
getReportTemplateGroupId
());
saveFormulaBlock
(
formulaContext
.
getPeriod
(),
ec
,
formulaExpression
,
val
,
dataSourceId
);
saveFormulaBlock
(
formulaContext
.
getPeriod
(),
ec
,
formulaExpression
,
val
,
dataSourceId
,
formulaContext
.
getProjectId
()
);
return
new
NumberEval
(
val
.
doubleValue
());
}
else
{
//todo: @本期应(实)纳税额 ,@GDZC.BQ.QMYE 这种类型的数据,重新计算,按照keyvalue的配置
...
...
@@ -131,7 +131,7 @@ public class GZSD extends FunctionBase implements FreeRefFunction {
Long
dataSourceId
=
saveDataSource
(
ec
,
Collections
.
singletonList
(
dataSourceDtoList
),
FormulaDataSourceDetailType
.
FormulaDataSourceDto
,
decimal_zero
,
formulaContext
.
getPeriod
(),
formulaContext
.
getReportTemplateGroupId
());
saveFormulaBlock
(
formulaContext
.
getPeriod
(),
ec
,
formulaExpression
,
decimal_zero
,
dataSourceId
);
saveFormulaBlock
(
formulaContext
.
getPeriod
(),
ec
,
formulaExpression
,
decimal_zero
,
dataSourceId
,
formulaContext
.
getProjectId
()
);
return
NumberEval
.
ZERO
;
}
...
...
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/report/functions/JXFP.java
View file @
a34a02c0
...
...
@@ -13,7 +13,12 @@ import pwc.taxtech.atms.dto.vatdto.InputInvoiceDataSourceDto;
import
pwc.taxtech.atms.vat.entity.InputVatInvoice
;
import
java.math.BigDecimal
;
import
java.util.*
;
import
java.util.ArrayList
;
import
java.util.Calendar
;
import
java.util.Collections
;
import
java.util.Comparator
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/// <summary>
...
...
@@ -58,13 +63,13 @@ public class JXFP extends FunctionBase implements FreeRefFunction {
certificationPeriod
=
getPeriod
(
certificationPeriod
,
yearOffset
);
if
(
yearOffset
<
0
)
{
saveFormulaBlock
(
period
,
ec
,
formulaExpression
,
new
BigDecimal
(
"0.0"
),
0L
);
saveFormulaBlock
(
period
,
ec
,
formulaExpression
,
new
BigDecimal
(
"0.0"
),
0L
,
formulaContext
.
getProjectId
()
);
return
NumberEval
.
ZERO
;
}
period
=
getPeriod
(
period
,
yearOffset
);
if
(
yearOffset
<
0
)
{
saveFormulaBlock
(
period
,
ec
,
formulaExpression
,
new
BigDecimal
(
"0.0"
),
0L
);
saveFormulaBlock
(
period
,
ec
,
formulaExpression
,
new
BigDecimal
(
"0.0"
),
0L
,
formulaContext
.
getProjectId
()
);
return
NumberEval
.
ZERO
;
}
...
...
@@ -94,13 +99,13 @@ public class JXFP extends FunctionBase implements FreeRefFunction {
inputVATInvoices
=
SpringContextUtil
.
inputVatInvoiceDao
.
getInputVATInvoice
(
period
,
invoiceType
,
null
,
null
,
Constant
.
InputInvoiceCertificationResult
.
NotPass
);
}
else
{
saveFormulaBlock
(
period
,
ec
,
formulaExpression
,
new
BigDecimal
(
"0.0"
),
0L
);
saveFormulaBlock
(
period
,
ec
,
formulaExpression
,
new
BigDecimal
(
"0.0"
),
0L
,
formulaContext
.
getProjectId
()
);
return
NumberEval
.
ZERO
;
}
if
(
certificationPeriod
!=
-
99
&&
certificationPeriod
!=
99
&&
(
certificationPeriod
<
1
||
certificationPeriod
>
12
))
{
saveFormulaBlock
(
period
,
ec
,
formulaExpression
,
new
BigDecimal
(
"0.0"
),
0L
);
saveFormulaBlock
(
period
,
ec
,
formulaExpression
,
new
BigDecimal
(
"0.0"
),
0L
,
formulaContext
.
getProjectId
()
);
return
NumberEval
.
ZERO
;
}
else
if
(!
formulaContext
.
getIsYear
())
{
if
(
certificationPeriod
==
-
99
)
{
...
...
@@ -154,25 +159,29 @@ public class JXFP extends FunctionBase implements FreeRefFunction {
double
val
=
dataSource
.
stream
().
mapToDouble
(
a
->
a
.
getAmount
().
doubleValue
()).
sum
();
Long
dataSourceId
=
saveDataSource
(
ec
,
Collections
.
singletonList
(
dataSource
),
FormulaDataSourceDetailType
.
InputInvoiceDataSourceDto
,
BigDecimal
.
valueOf
(
val
),
formulaContext
.
getPeriod
(),
formulaContext
.
getReportTemplateGroupId
());
saveFormulaBlock
(
formulaContext
.
getPeriod
(),
ec
,
formulaExpression
,
BigDecimal
.
valueOf
(
val
),
dataSourceId
);
BigDecimal
.
valueOf
(
val
),
formulaContext
.
getPeriod
(),
formulaContext
.
getReportTemplateGroupId
());
saveFormulaBlock
(
formulaContext
.
getPeriod
(),
ec
,
formulaExpression
,
BigDecimal
.
valueOf
(
val
),
dataSourceId
,
formulaContext
.
getProjectId
());
return
new
NumberEval
(
val
);
}
else
if
(
resultType
==
1
)
{
double
val
=
dataSource
.
stream
().
mapToDouble
(
a
->
a
.
getTaxAmount
().
doubleValue
()).
sum
();
Long
dataSourceId
=
saveDataSource
(
ec
,
Collections
.
singletonList
(
dataSource
),
FormulaDataSourceDetailType
.
InputInvoiceDataSourceDto
,
BigDecimal
.
valueOf
(
val
),
formulaContext
.
getPeriod
(),
formulaContext
.
getReportTemplateGroupId
());
saveFormulaBlock
(
formulaContext
.
getPeriod
(),
ec
,
formulaExpression
,
BigDecimal
.
valueOf
(
val
),
dataSourceId
);
BigDecimal
.
valueOf
(
val
),
formulaContext
.
getPeriod
(),
formulaContext
.
getReportTemplateGroupId
());
saveFormulaBlock
(
formulaContext
.
getPeriod
(),
ec
,
formulaExpression
,
BigDecimal
.
valueOf
(
val
),
dataSourceId
,
formulaContext
.
getProjectId
());
return
new
NumberEval
(
val
);
}
else
if
(
resultType
==
2
)
{
double
val
=
dataSource
.
size
();
Long
dataSourceId
=
saveDataSource
(
ec
,
Collections
.
singletonList
(
dataSource
),
FormulaDataSourceDetailType
.
InputInvoiceDataSourceDto
,
BigDecimal
.
valueOf
(
val
),
formulaContext
.
getPeriod
(),
formulaContext
.
getReportTemplateGroupId
());
saveFormulaBlock
(
period
,
ec
,
formulaExpression
,
BigDecimal
.
valueOf
(
val
),
dataSourceId
);
BigDecimal
.
valueOf
(
val
),
formulaContext
.
getPeriod
(),
formulaContext
.
getReportTemplateGroupId
());
saveFormulaBlock
(
period
,
ec
,
formulaExpression
,
BigDecimal
.
valueOf
(
val
),
dataSourceId
,
formulaContext
.
getProjectId
());
return
new
NumberEval
(
val
);
}
saveFormulaBlock
(
period
,
ec
,
formulaExpression
,
new
BigDecimal
(
"0.0"
),
0L
);
saveFormulaBlock
(
period
,
ec
,
formulaExpression
,
new
BigDecimal
(
"0.0"
),
0L
,
formulaContext
.
getProjectId
());
return
NumberEval
.
ZERO
;
}
}
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/report/functions/JXFPMX.java
View file @
a34a02c0
...
...
@@ -14,7 +14,11 @@ import pwc.taxtech.atms.dto.vatdto.InputInvoiceDetailDataSourceDto;
import
pwc.taxtech.atms.vat.dpo.InputVATInvoiceResultDto
;
import
java.math.BigDecimal
;
import
java.util.*
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Collections
;
import
java.util.Comparator
;
import
java.util.List
;
import
java.util.stream.Collectors
;
...
...
@@ -84,7 +88,7 @@ public class JXFPMX extends FunctionBase implements FreeRefFunction {
if
(!
goodsName
.
equals
(
"99"
))
{
inputInvoice
=
inputInvoice
.
stream
()
.
filter
(
a
->
a
.
getGoodsMapping
()
!=
null
&&
a
.
getGoodsMapping
().
getStdGoodsName
()!=
null
&&
a
.
getGoodsMapping
().
getStdGoodsName
().
equals
(
goodsName
))
.
filter
(
a
->
a
.
getGoodsMapping
()
!=
null
&&
a
.
getGoodsMapping
().
getStdGoodsName
()
!=
null
&&
a
.
getGoodsMapping
().
getStdGoodsName
().
equals
(
goodsName
))
.
collect
(
Collectors
.
toList
());
}
...
...
@@ -133,15 +137,15 @@ public class JXFPMX extends FunctionBase implements FreeRefFunction {
double
val
=
dataSouce
.
stream
().
mapToDouble
(
a
->
a
.
getAmount
().
doubleValue
()).
sum
();
Long
dataSourceId
=
saveDataSource
(
ec
,
Collections
.
singletonList
(
dataSouce
),
FormulaDataSourceDetailType
.
InputInvoiceDetailDataSourceDto
,
new
BigDecimal
(
val
),
period
,
formulaContext
.
getReportTemplateGroupId
());
saveFormulaBlock
(
period
,
ec
,
formulaExpression
,
new
BigDecimal
(
val
),
dataSourceId
);
new
BigDecimal
(
val
),
period
,
formulaContext
.
getReportTemplateGroupId
());
saveFormulaBlock
(
period
,
ec
,
formulaExpression
,
new
BigDecimal
(
val
),
dataSourceId
,
formulaContext
.
getProjectId
()
);
return
new
NumberEval
(
val
);
}
else
if
(
amountType
==
1
)
{
double
val
=
dataSouce
.
stream
().
mapToDouble
(
a
->
a
.
getTaxAmount
().
doubleValue
()).
sum
();
Long
dataSourceId
=
saveDataSource
(
ec
,
Collections
.
singletonList
(
dataSouce
),
FormulaDataSourceDetailType
.
InputInvoiceDetailDataSourceDto
,
new
BigDecimal
(
val
),
period
,
formulaContext
.
getReportTemplateGroupId
());
saveFormulaBlock
(
period
,
ec
,
formulaExpression
,
new
BigDecimal
(
val
),
dataSourceId
);
new
BigDecimal
(
val
),
period
,
formulaContext
.
getReportTemplateGroupId
());
saveFormulaBlock
(
period
,
ec
,
formulaExpression
,
new
BigDecimal
(
val
),
dataSourceId
,
formulaContext
.
getProjectId
()
);
return
new
NumberEval
(
val
);
}
...
...
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/report/functions/XXFP.java
View file @
a34a02c0
...
...
@@ -115,15 +115,15 @@ public class XXFP extends FunctionBase implements FreeRefFunction {
double
val
=
dataSource
.
stream
().
mapToDouble
(
a
->
a
.
getAmount
().
doubleValue
()).
sum
();
Long
dataSoureId
=
saveDataSource
(
ec
,
Collections
.
singletonList
(
dataSource
),
FormulaDataSourceDetailType
.
OutputInvoiceDataSourceDto
,
new
BigDecimal
(
val
),
period
,
formulaContext
.
getReportTemplateGroupId
());
saveFormulaBlock
(
period
,
ec
,
formulaExpression
,
new
BigDecimal
(
val
),
dataSoureId
);
new
BigDecimal
(
val
),
period
,
formulaContext
.
getReportTemplateGroupId
());
saveFormulaBlock
(
period
,
ec
,
formulaExpression
,
new
BigDecimal
(
val
),
dataSoureId
,
formulaContext
.
getProjectId
()
);
return
new
NumberEval
(
val
);
}
else
if
(
amountType
==
1
)
{
double
val
=
dataSource
.
stream
().
mapToDouble
(
a
->
a
.
getTaxAmount
().
doubleValue
()).
sum
();
Long
dataSoureId
=
saveDataSource
(
ec
,
Collections
.
singletonList
(
dataSource
),
FormulaDataSourceDetailType
.
OutputInvoiceDataSourceDto
,
new
BigDecimal
(
val
),
period
,
formulaContext
.
getReportTemplateGroupId
());
saveFormulaBlock
(
period
,
ec
,
formulaExpression
,
new
BigDecimal
(
val
),
dataSoureId
);
new
BigDecimal
(
val
),
period
,
formulaContext
.
getReportTemplateGroupId
());
saveFormulaBlock
(
period
,
ec
,
formulaExpression
,
new
BigDecimal
(
val
),
dataSoureId
,
formulaContext
.
getProjectId
()
);
return
new
NumberEval
(
val
);
}
return
NumberEval
.
ZERO
;
...
...
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/report/functions/ZC.java
View file @
a34a02c0
...
...
@@ -129,7 +129,7 @@ public class ZC extends FunctionBase implements FreeRefFunction {
Long
dataSourceId
=
saveDataSource
(
ec
,
Collections
.
singletonList
(
dataSource
),
FormulaDataSourceDetailType
.
AssetDetailDataSourceDto
,
totalData
,
formulaContext
.
getPeriod
(),
formulaContext
.
getReportTemplateGroupId
());
saveFormulaBlock
(
0
,
ec
,
formulaExpression
,
totalData
,
dataSourceId
);
saveFormulaBlock
(
0
,
ec
,
formulaExpression
,
totalData
,
dataSourceId
,
formulaContext
.
getProjectId
()
);
return
new
NumberEval
(
totalData
.
doubleValue
());
}
}
atms-dao/src/main/java/pwc/taxtech/atms/vat/dao/PeriodFormulaBlockMapper.java
View file @
a34a02c0
...
...
@@ -107,5 +107,6 @@ public interface PeriodFormulaBlockMapper extends MyVatMapper {
*/
int
updateByPrimaryKey
(
PeriodFormulaBlock
record
);
void
updateReportId
(
@Param
(
"reportId"
)
Long
reportId
,
@Param
(
"cellTemplateConfigIds"
)
List
<
Long
>
cellTemplateConfigIds
,
@Param
(
"period"
)
Integer
period
);
void
updateReportId
(
@Param
(
"reportId"
)
Long
reportId
,
@Param
(
"cellTemplateConfigIds"
)
List
<
Long
>
cellTemplateConfigIds
,
@Param
(
"period"
)
Integer
period
,
@Param
(
"projectId"
)
String
projectId
);
}
\ No newline at end of file
atms-dao/src/main/resources/pwc/taxtech/atms/vat/dao/extends/PeriodFormulaBlockExtendsMapper.xml
View file @
a34a02c0
...
...
@@ -9,6 +9,7 @@
REPORT_ID= #{reportId,jdbcType=BIGINT}
WHERE
PERIOD= #{period,jdbcType=INTEGER}
AND PROJECT_ID= #{projectId,jdbcType=INTEGER}
AND CELL_TEMPLATE_ID IN
<foreach
collection=
"cellTemplateConfigIds"
open=
"("
close=
")"
separator=
","
item=
"item"
>
#{item}
...
...
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