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
8e7fed59
Commit
8e7fed59
authored
Aug 27, 2018
by
frank.xa.zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed formula cell data can't display issue
parent
eb111dbe
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
30 additions
and
20 deletions
+30
-20
ReportGeneratorImpl.java
...wc/taxtech/atms/vat/service/impl/ReportGeneratorImpl.java
+2
-2
ReportServiceImpl.java
.../pwc/taxtech/atms/vat/service/impl/ReportServiceImpl.java
+2
-2
FunctionBase.java
.../atms/vat/service/impl/report/functions/FunctionBase.java
+20
-10
JXFP.java
.../taxtech/atms/vat/service/impl/report/functions/JXFP.java
+5
-5
CreateProjectDB.sql
...main/resources/RuntimeDbScripts/MYSQL/CreateProjectDB.sql
+1
-1
No files found.
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/ReportGeneratorImpl.java
View file @
8e7fed59
...
...
@@ -243,7 +243,7 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen
List
<
PeriodFormulaBlock
>
periodFormulaBlocks
=
periodFormulaBlockMapper
.
selectByExample
(
periodFormulaBlockExample2
);
//TODO:如果formula 为 ND(100) +ND(22) ,需要使用正则表达式拆分出自定义公式,然后根据自定义公式取formulablock 的数据进行替换
String
regex
=
"[A-Z]*\\([A-Za-z0-9\\\"\\,\\.\\u4e00-\\u9fa5\\%]*\\)"
;
String
regex
=
"[A-Z]*\\([
\\-
A-Za-z0-9\\\"\\,\\.\\u4e00-\\u9fa5\\%]*\\)"
;
Pattern
p
=
Pattern
.
compile
(
regex
);
String
sourceFormula
=
periodCellTemplateConfig
.
getFormula
();
String
resultFormula
=
periodCellTemplateConfig
.
getFormula
();
...
...
@@ -348,7 +348,7 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen
}
else
{
data
=
EMPTY
;
}
cellData
.
setData
(
data
);
cellData
.
setData
(
new
BigDecimal
(
data
).
toString
()
);
PeriodFormulaBlockExample
periodFormulaBlockExample
=
new
PeriodFormulaBlockExample
();
periodFormulaBlockExample
.
createCriteria
().
andPeriodEqualTo
(
period
)
.
andCellTemplateIdEqualTo
(
tempPeriodCellTemplate
.
get
().
getCellTemplateId
());
...
...
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/ReportServiceImpl.java
View file @
8e7fed59
...
...
@@ -213,7 +213,7 @@ public class ReportServiceImpl extends VatAbstractService implements ReportServi
for
(
CellTemplateConfig
cellTemplateConfig
:
cellTemplateConfigList
)
{
i
++;
Long
startTime
=
System
.
currentTimeMillis
();
logger
.
debug
(
"cellTemplateConfig copy start: "
+
startTime
);
//
logger.debug("cellTemplateConfig copy start: " + startTime);
PeriodCellTemplateConfig
periodCellTemplateConfig
=
new
PeriodCellTemplateConfig
();
CommonUtils
.
copyProperties
(
cellTemplateConfig
,
periodCellTemplateConfig
);
periodCellTemplateConfig
.
setId
(
distributedIDService
.
nextId
());
...
...
@@ -252,7 +252,7 @@ public class ReportServiceImpl extends VatAbstractService implements ReportServi
}
}
periodCellTemplateConfigList
.
add
(
periodCellTemplateConfig
);
logger
.
debug
(
"cellTemplateConfig copy end,used time: "
+
(
System
.
currentTimeMillis
()
-
startTime
)
+
" ms"
);
//
logger.debug("cellTemplateConfig copy end,used time: " + (System.currentTimeMillis() - startTime) + " ms");
}
logger
.
debug
(
"cellTemplateConfigs copy end,used: "
+
(
System
.
currentTimeMillis
()
-
startTimeOut
)
+
" ms, copy: "
+
i
+
" items"
);
...
...
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/report/functions/FunctionBase.java
View file @
8e7fed59
...
...
@@ -15,11 +15,10 @@ 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.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.*
;
public
class
FunctionBase
{
protected
final
Logger
logger
=
LoggerFactory
.
getLogger
(
this
.
getClass
());
...
...
@@ -131,12 +130,23 @@ public class FunctionBase {
dataSource
.
setPeriod
(
period
);
SpringContextUtil
.
dataSourceMapper
.
insertSelective
(
dataSource
);
for
(
Object
obj
:
dataSourceList
)
{
DataSourceDetail
dataSourceDetail
=
new
DataSourceDetail
();
dataSourceDetail
.
setId
(
SpringContextUtil
.
distributedIDService
.
nextId
());
dataSourceDetail
.
setDataSourceId
(
dataSourceID
);
dataSourceDetail
.
setDataSourceType
(
formulaDataSourceDetailType
.
getCode
());
dataSourceDetail
.
setItemValue
(
JSON
.
toJSONString
(
obj
));
SpringContextUtil
.
dataSourceDetailMapper
.
insertSelective
(
dataSourceDetail
);
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
);
dataSourceDetail
.
setDataSourceType
(
formulaDataSourceDetailType
.
getCode
());
dataSourceDetail
.
setItemValue
(
JSON
.
toJSONString
(
obj2
));
SpringContextUtil
.
dataSourceDetailMapper
.
insertSelective
(
dataSourceDetail
);
}
}
else
{
DataSourceDetail
dataSourceDetail
=
new
DataSourceDetail
();
dataSourceDetail
.
setId
(
SpringContextUtil
.
distributedIDService
.
nextId
());
dataSourceDetail
.
setDataSourceId
(
dataSourceID
);
dataSourceDetail
.
setDataSourceType
(
formulaDataSourceDetailType
.
getCode
());
dataSourceDetail
.
setItemValue
(
JSON
.
toJSONString
(
obj
));
SpringContextUtil
.
dataSourceDetailMapper
.
insertSelective
(
dataSourceDetail
);
}
}
return
dataSourceID
;
}
...
...
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/report/functions/JXFP.java
View file @
8e7fed59
...
...
@@ -150,21 +150,21 @@ 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
),
period
,
formulaContext
.
getReportTemplateGroupID
());
saveFormulaBlock
(
period
,
ec
,
formulaExpression
,
BigDecimal
.
valueOf
(
val
),
dataSourceId
);
BigDecimal
.
valueOf
(
val
),
formulaContext
.
getPeriod
()
,
formulaContext
.
getReportTemplateGroupID
());
saveFormulaBlock
(
formulaContext
.
getPeriod
()
,
ec
,
formulaExpression
,
BigDecimal
.
valueOf
(
val
),
dataSourceId
);
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
),
period
,
formulaContext
.
getReportTemplateGroupID
());
saveFormulaBlock
(
period
,
ec
,
formulaExpression
,
BigDecimal
.
valueOf
(
val
),
dataSourceId
);
BigDecimal
.
valueOf
(
val
),
formulaContext
.
getPeriod
()
,
formulaContext
.
getReportTemplateGroupID
());
saveFormulaBlock
(
formulaContext
.
getPeriod
()
,
ec
,
formulaExpression
,
BigDecimal
.
valueOf
(
val
),
dataSourceId
);
return
new
NumberEval
(
val
);
}
else
if
(
resultType
==
2
)
{
double
val
=
dataSource
.
size
();
Long
dataSourceId
=
saveDataSource
(
ec
,
Collections
.
singletonList
(
dataSource
),
FormulaDataSourceDetailType
.
InputInvoiceDataSourceDto
,
BigDecimal
.
valueOf
(
val
),
period
,
formulaContext
.
getReportTemplateGroupID
());
BigDecimal
.
valueOf
(
val
),
formulaContext
.
getPeriod
()
,
formulaContext
.
getReportTemplateGroupID
());
saveFormulaBlock
(
period
,
ec
,
formulaExpression
,
BigDecimal
.
valueOf
(
val
),
dataSourceId
);
return
new
NumberEval
(
val
);
}
...
...
atms-api/src/main/resources/RuntimeDbScripts/MYSQL/CreateProjectDB.sql
View file @
8e7fed59
...
...
@@ -958,7 +958,7 @@ CREATE TABLE IF NOT EXISTS `DBKeyword_ProjectDbName`.`data_source_detail` (
`id`
bigint
(
18
)
unsigned
NOT
NULL
,
`data_source_id`
bigint
(
18
)
unsigned
NOT
NULL
DEFAULT
'0'
,
`data_source_type`
int
(
11
)
unsigned
NOT
NULL
DEFAULT
'0'
,
`item_value`
varchar
(
5
00
)
NOT
NULL
DEFAULT
''
,
`item_value`
varchar
(
10
00
)
NOT
NULL
DEFAULT
''
,
PRIMARY
KEY
(
`id`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
;
...
...
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