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
3765bc20
Commit
3765bc20
authored
Jul 05, 2018
by
neo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[DEV] delete bb reference formula cacls
parent
b22c475a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
69 deletions
+8
-69
EnumOperationType.java
...va/pwc/taxtech/atms/constant/enums/EnumOperationType.java
+0
-21
DataSourceAmount.java
...in/java/pwc/taxtech/atms/dto/vatdto/DataSourceAmount.java
+0
-8
FormulaProjectMapper.java
...n/java/pwc/taxtech/atms/vat/dao/FormulaProjectMapper.java
+0
-16
ReportFormulaFactory.java
...c/taxtech/atms/vat/service/impl/ReportFormulaFactory.java
+8
-24
No files found.
atms-api/src/main/java/pwc/taxtech/atms/constant/enums/EnumOperationType.java
deleted
100644 → 0
View file @
b22c475a
package
pwc
.
taxtech
.
atms
.
constant
.
enums
;
public
enum
EnumOperationType
{
Single
(
0
),
Add
(
1
),
Sub
(
2
),
Mul
(
3
),
Div
(
4
);
private
int
code
;
EnumOperationType
(
int
code
)
{
this
.
code
=
code
;
}
public
int
getCode
()
{
return
code
;
}
}
atms-api/src/main/java/pwc/taxtech/atms/dto/vatdto/DataSourceAmount.java
deleted
100644 → 0
View file @
b22c475a
package
pwc
.
taxtech
.
atms
.
dto
.
vatdto
;
import
java.math.BigDecimal
;
public
class
DataSourceAmount
{
public
BigDecimal
amount
;
public
Integer
operationType
;
}
atms-api/src/main/java/pwc/taxtech/atms/vat/dao/FormulaProjectMapper.java
View file @
3765bc20
package
pwc
.
taxtech
.
atms
.
vat
.
dao
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Select
;
import
pwc.taxtech.atms.MyVatMapper
;
import
pwc.taxtech.atms.dto.vatdto.DataSourceAmount
;
import
java.util.List
;
@Mapper
public
interface
FormulaProjectMapper
extends
MyVatMapper
{
@Select
(
"SELECT "
+
" ds.amount, cds.operation_type AS operationType "
+
"FROM "
+
" data_source ds "
+
" JOIN "
+
" cell_data_source cds ON ds.id = cds.data_source_id "
+
"WHERE "
+
" cds.cell_data_id = #{cellId} "
+
" AND ds.type != #{code} "
+
" AND ds.amount IS NOT NULL "
)
List
<
DataSourceAmount
>
queryDsAmount
(
@Param
(
"cellId"
)
Long
dataId
,
@Param
(
"code"
)
Integer
code
);
}
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/ReportFormulaFactory.java
View file @
3765bc20
...
...
@@ -4,26 +4,19 @@ import com.github.pagehelper.util.StringUtil;
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.StringEval
;
import
org.apache.poi.ss.formula.eval.StringValueEval
;
import
org.apache.poi.ss.formula.eval.ValueEval
;
import
org.apache.poi.ss.formula.functions.FreeRefFunction
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
pwc.taxtech.atms.common.datasource.ShardingContextHolder
;
import
pwc.taxtech.atms.constant.Constant
;
import
pwc.taxtech.atms.constant.enums.CellDataSourceType
;
import
pwc.taxtech.atms.constant.enums.EnumOperationType
;
import
pwc.taxtech.atms.constant.enums.EnumServiceType
;
import
pwc.taxtech.atms.dto.GroupId
;
import
pwc.taxtech.atms.dto.vatdto.BBParasBo
;
import
pwc.taxtech.atms.dto.vatdto.CellTemplatePerGroupDto
;
import
pwc.taxtech.atms.dto.vatdto.CloseableFormulaDataSource
;
import
pwc.taxtech.atms.dto.vatdto.CurrentPeriodBo
;
import
pwc.taxtech.atms.dto.vatdto.DataSourceAmount
;
import
pwc.taxtech.atms.dto.vatdto.ReportCellDataSourceDto
;
import
pwc.taxtech.atms.entitiy.ProjectExample
;
import
pwc.taxtech.atms.entitiy.ProjectServiceType
;
import
pwc.taxtech.atms.entitiy.ProjectServiceTypeExample
;
import
pwc.taxtech.atms.vat.entity.CellData
;
...
...
@@ -132,6 +125,8 @@ public class ReportFormulaFactory {
List
<
Report
>
reports
=
agent
.
reportMapper
.
selectByExample
(
example
);
if
(
reports
==
null
||
reports
.
isEmpty
())
{
LOGGER
.
warn
(
"report data is empty"
);
ShardingContextHolder
.
setDataSourceKey
(
currentProjectDb
);
return
defaultEval
;
}
...
...
@@ -141,6 +136,8 @@ public class ReportFormulaFactory {
List
<
CellData
>
cellDatas
=
agent
.
cellDataMapper
.
selectByExample
(
dataExample
);
if
(
cellDatas
==
null
||
cellDatas
.
isEmpty
())
{
LOGGER
.
warn
(
"cell data is empty"
);
ShardingContextHolder
.
setDataSourceKey
(
currentProjectDb
);
return
defaultEval
;
}
...
...
@@ -154,32 +151,19 @@ public class ReportFormulaFactory {
nullCellDto
.
setAmount
(
cellValue
);
LOGGER
.
debug
(
"cell static value "
);
ShardingContextHolder
.
setDataSourceKey
(
currentProjectDb
);
return
new
NumberEval
(
cellValue
.
doubleValue
());
}
ShardingContextHolder
.
setDataSourceKey
(
currentProjectDb
);
// Boolean hasValuedDataSource = false;//TODO: Calculate other referenced formula
// BigDecimal dataSourceAmount = new BigDecimal(0);
// List<DataSourceAmount> amounts = agent.projectMp.queryDsAmount(cellData.getId(),
// CellDataSourceType.Formula.getCode());
// if (amounts != null || !amounts.isEmpty())
// for (DataSourceAmount m : amounts)
// if (m.operationType.intValue() == EnumOperationType.Sub.getCode())
// dataSourceAmount = dataSourceAmount.subtract(m.amount);
// else dataSourceAmount = dataSourceAmount.add(m.amount);
//
// if (!StringUtil.isEmpty(cellTemplateData.getFormula())) {
//
// }
//TODO: Calculate other referenced formula
}
catch
(
EvaluationException
e
)
{
LOGGER
.
warn
(
"resole args some exception"
,
e
);
e
.
printStackTrace
();
}
catch
(
Exception
e
)
{
LOGGER
.
warn
(
"unsupport exception"
,
e
);
e
.
printStackTrace
();
}
return
nul
l
;
return
defaultEva
l
;
}
}
...
...
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