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
ad2f589b
Commit
ad2f589b
authored
Sep 04, 2018
by
neo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[bugfix] bb formula save double datasource item
parent
3d06b96c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
46 deletions
+35
-46
ReportCellDataSourceDto.java
.../pwc/taxtech/atms/dto/vatdto/ReportCellDataSourceDto.java
+27
-31
FormulaAgent.java
.../java/pwc/taxtech/atms/vat/service/impl/FormulaAgent.java
+6
-12
BB.java
...wc/taxtech/atms/vat/service/impl/report/functions/BB.java
+2
-3
No files found.
atms-api/src/main/java/pwc/taxtech/atms/dto/vatdto/ReportCellDataSourceDto.java
View file @
ad2f589b
...
...
@@ -45,41 +45,37 @@ public class ReportCellDataSourceDto extends DataSourceDto {
return
nulDataSource
;
}
public
static
ReportCellDataSourceDto
extractFromGroup
(
BBParasBo
bbParasBo
,
CurrentPeriodBo
currentPeriodBo
,
public
void
extractFromGroup
(
BBParasBo
bbParasBo
,
CurrentPeriodBo
currentPeriodBo
,
CellData
cellData
,
CellTemplatePerGroupDto
cellTemplateData
)
{
ReportCellDataSourceDto
dataSource
=
new
ReportCellDataSourceDto
();
dataSource
.
name
=
DataSourceName
.
ReportDataSource
;
dataSource
.
year
=
currentPeriodBo
.
curYear
;
dataSource
.
period
=
currentPeriodBo
.
curPeriod
;
dataSource
.
columnIndex
=
bbParasBo
.
getColumnIndex
()
-
1
;
dataSource
.
columnName
=
cellTemplateData
.
getColumnName
();
dataSource
.
rowIndex
=
bbParasBo
.
getRowIndex
()
-
1
;
dataSource
.
rowName
=
cellTemplateData
.
getRowName
();
dataSource
.
reportTemplateID
=
cellTemplateData
.
getReportTemplateID
();
dataSource
.
cellDataID
=
cellData
.
getId
()
+
""
;
dataSource
.
cellTemplateID
=
cellData
.
getCellTemplateId
()
+
""
;
dataSource
.
resultType
=
cellTemplateData
.
getResultType
();
dataSource
.
isOnlyManualInput
=
false
;
dataSource
.
reportName
=
bbParasBo
.
getReportCode
();
return
dataSource
;
this
.
name
=
DataSourceName
.
ReportDataSource
;
this
.
year
=
currentPeriodBo
.
curYear
;
this
.
period
=
currentPeriodBo
.
curPeriod
;
this
.
columnIndex
=
bbParasBo
.
getColumnIndex
()
-
1
;
this
.
columnName
=
cellTemplateData
.
getColumnName
();
this
.
rowIndex
=
bbParasBo
.
getRowIndex
()
-
1
;
this
.
rowName
=
cellTemplateData
.
getRowName
();
this
.
reportTemplateID
=
cellTemplateData
.
getReportTemplateID
();
this
.
cellDataID
=
cellData
.
getId
()
+
""
;
this
.
cellTemplateID
=
cellData
.
getCellTemplateId
()
+
""
;
this
.
resultType
=
cellTemplateData
.
getResultType
();
this
.
isOnlyManualInput
=
false
;
this
.
reportName
=
bbParasBo
.
getReportCode
();
}
public
static
ReportCellDataSourceDto
extractFromGroup
(
BBParasBo
bbParasBo
,
Integer
period
,
Integer
year
,
public
void
extractFromGroup
(
BBParasBo
bbParasBo
,
Integer
period
,
Integer
year
,
CellTemplatePerGroupDto
cellTemplateData
)
{
ReportCellDataSourceDto
dataSource
=
new
ReportCellDataSourceDto
();
dataSource
.
name
=
DataSourceName
.
ReportDataSource
;
dataSource
.
year
=
year
;
dataSource
.
period
=
period
;
dataSource
.
columnIndex
=
bbParasBo
.
getColumnIndex
()
-
1
;
dataSource
.
columnName
=
cellTemplateData
.
getColumnName
();
dataSource
.
rowIndex
=
bbParasBo
.
getRowIndex
()
-
1
;
dataSource
.
rowName
=
cellTemplateData
.
getRowName
();
dataSource
.
reportTemplateID
=
cellTemplateData
.
getReportTemplateID
();
dataSource
.
cellTemplateID
=
cellTemplateData
.
getCellTemplateID
()
+
""
;
dataSource
.
resultType
=
cellTemplateData
.
getResultType
();
dataSource
.
isOnlyManualInput
=
false
;
dataSource
.
reportName
=
bbParasBo
.
getReportCode
();
return
dataSource
;
this
.
name
=
DataSourceName
.
ReportDataSource
;
this
.
year
=
year
;
this
.
period
=
period
;
this
.
columnIndex
=
bbParasBo
.
getColumnIndex
()
-
1
;
this
.
columnName
=
cellTemplateData
.
getColumnName
();
this
.
rowIndex
=
bbParasBo
.
getRowIndex
()
-
1
;
this
.
rowName
=
cellTemplateData
.
getRowName
();
this
.
reportTemplateID
=
cellTemplateData
.
getReportTemplateID
();
this
.
cellTemplateID
=
cellTemplateData
.
getCellTemplateID
()
+
""
;
this
.
resultType
=
cellTemplateData
.
getResultType
();
this
.
isOnlyManualInput
=
false
;
this
.
reportName
=
bbParasBo
.
getReportCode
();
}
public
void
fixedWithGroup
(
CellTemplatePerGroupDto
dto
)
{
...
...
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/FormulaAgent.java
View file @
ad2f589b
...
...
@@ -2,14 +2,11 @@ package pwc.taxtech.atms.vat.service.impl;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Service
;
import
pwc.taxtech.atms.common.datasource.ShardingContextHolder
;
import
pwc.taxtech.atms.common.util.MyAsserts
;
import
pwc.taxtech.atms.constant.enums.EnumServiceType
;
import
pwc.taxtech.atms.dao.FormulaAdminMapper
;
import
pwc.taxtech.atms.dto.GroupId
;
import
pwc.taxtech.atms.dto.vatdto.CellTemplatePerGroupDto
;
import
pwc.taxtech.atms.dto.vatdto.ReportCellDataSourceDto
;
import
pwc.taxtech.atms.entitiy.ProjectServiceType
;
import
pwc.taxtech.atms.entitiy.ProjectServiceTypeExample
;
import
pwc.taxtech.atms.exception.Exceptions
;
...
...
@@ -18,12 +15,9 @@ import pwc.taxtech.atms.vat.dao.FormulaProjectMapper;
import
pwc.taxtech.atms.vat.dao.ReportMapper
;
import
pwc.taxtech.atms.vat.entity.CellData
;
import
pwc.taxtech.atms.vat.entity.CellDataExample
;
import
pwc.taxtech.atms.vat.entity.DataSource
;
import
pwc.taxtech.atms.vat.entity.Report
;
import
pwc.taxtech.atms.vat.entity.ReportExample
;
import
java.math.BigDecimal
;
import
java.util.Date
;
import
java.util.List
;
import
static
pwc
.
taxtech
.
atms
.
constant
.
Constant
.
FIRST_OR_DEFAULT
;
...
...
@@ -82,13 +76,13 @@ public class FormulaAgent extends VatAbstractService {
return
adminMp
.
getPastProjectDbName
(
year
,
orgId
);
}
public
CellData
getCellData
(
String
templateId
,
String
cellId
,
int
periodId
)
{
Report
report
=
getReportByTemplate
(
templateId
,
periodId
);
MyAsserts
.
assertNotNull
(
report
,
Exceptions
.
BB_REPORT_NULL
);
public
CellData
getCellData
(
String
templateId
,
String
cellId
,
int
periodId
)
{
Report
report
=
getReportByTemplate
(
templateId
,
periodId
);
MyAsserts
.
assertNotNull
(
report
,
Exceptions
.
BB_REPORT_NULL
);
CellData
cellData
=
getCellDataListByTemplate
(
cellId
,
report
.
getId
());
MyAsserts
.
assertNotNull
(
cellData
,
Exceptions
.
BB_CELL_DATA_NULL
);
return
cellData
;
CellData
cellData
=
getCellDataListByTemplate
(
cellId
,
report
.
getId
());
MyAsserts
.
assertNotNull
(
cellData
,
Exceptions
.
BB_CELL_DATA_NULL
);
return
cellData
;
}
}
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/report/functions/BB.java
View file @
ad2f589b
...
...
@@ -102,7 +102,7 @@ public class BB extends FunctionBase implements FreeRefFunction {
bo
.
putPeriodCellTempate
(
formulaContext
.
getPeriod
(),
Long
.
parseLong
(
cellTemplateData
.
getCellTemplateID
()));
cellValue
=
new
BigDecimal
(
OperandResolver
.
coerceValueToDouble
(
eval
));
nullCellDto
=
ReportCellDataSourceDto
.
extractFromGroup
(
bo
,
formulaContext
.
getPeriod
(),
formulaContext
.
getYear
(),
cellTemplateData
);
nullCellDto
.
extractFromGroup
(
bo
,
formulaContext
.
getPeriod
(),
formulaContext
.
getYear
(),
cellTemplateData
);
nullCellDto
.
setAmount
(
cellValue
);
dataSource
.
add
(
nullCellDto
);
return
cellValue
;
...
...
@@ -132,8 +132,7 @@ public class BB extends FunctionBase implements FreeRefFunction {
}
}
nullCellDto
=
ReportCellDataSourceDto
.
extractFromGroup
(
bo
,
curPeriod
,
cellData
,
cellTemplateData
);
dataSource
.
add
(
nullCellDto
);
nullCellDto
.
extractFromGroup
(
bo
,
curPeriod
,
cellData
,
cellTemplateData
);
// todo: fix datasource name by templateList(neo)
MyAsserts
.
assertNotNull
(
cellData
.
getData
(),
Exceptions
.
BB_CELL_DATA_NULL
);
...
...
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