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
472dc359
Commit
472dc359
authored
Aug 01, 2018
by
frank.xa.zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed report generate issue
parent
f69410c1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
8 deletions
+30
-8
ReportController.java
...in/java/pwc/taxtech/atms/controller/ReportController.java
+4
-4
ReportGeneratorImpl.java
...wc/taxtech/atms/vat/service/impl/ReportGeneratorImpl.java
+19
-3
ReportServiceImpl.java
.../pwc/taxtech/atms/vat/service/impl/ReportServiceImpl.java
+7
-1
No files found.
atms-api/src/main/java/pwc/taxtech/atms/controller/ReportController.java
View file @
472dc359
...
@@ -26,10 +26,10 @@ public class ReportController {
...
@@ -26,10 +26,10 @@ public class ReportController {
@RequestMapping
(
value
=
"updateConfig/{projectId}/{ifDeleteManualDataSource}/{period}"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
@RequestMapping
(
value
=
"updateConfig/{projectId}/{ifDeleteManualDataSource}/{period}"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
OperationResultDto
updateConfig
(
@PathVariable
String
projectId
,
@PathVariable
Boolean
ifDeleteManualDataSource
,
@PathVariable
Integer
period
,
@RequestParam
String
generator
)
{
public
OperationResultDto
updateConfig
(
@PathVariable
String
projectId
,
@PathVariable
Boolean
ifDeleteManualDataSource
,
@PathVariable
Integer
period
,
@RequestParam
String
generator
)
{
//
return reportService.updateConfig(projectId, period, ifDeleteManualDataSource, generator);
return
reportService
.
updateConfig
(
projectId
,
period
,
ifDeleteManualDataSource
,
generator
);
OperationResultDto
operationResultDto
=
new
OperationResultDto
();
//
OperationResultDto operationResultDto = new OperationResultDto();
operationResultDto
.
setResult
(
true
);
//
operationResultDto.setResult(true);
return
operationResultDto
;
//
return operationResultDto;
}
}
@RequestMapping
(
value
=
"generateByTotal/{projectId}/{ifDeleteManualDataSource}/{period}"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
@RequestMapping
(
value
=
"generateByTotal/{projectId}/{ifDeleteManualDataSource}/{period}"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
...
...
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/ReportGeneratorImpl.java
View file @
472dc359
...
@@ -7,6 +7,7 @@ import org.apache.poi.ss.formula.udf.AggregatingUDFFinder;
...
@@ -7,6 +7,7 @@ import org.apache.poi.ss.formula.udf.AggregatingUDFFinder;
import
org.apache.poi.ss.formula.udf.DefaultUDFFinder
;
import
org.apache.poi.ss.formula.udf.DefaultUDFFinder
;
import
org.apache.poi.ss.formula.udf.UDFFinder
;
import
org.apache.poi.ss.formula.udf.UDFFinder
;
import
org.apache.poi.ss.usermodel.*
;
import
org.apache.poi.ss.usermodel.*
;
import
org.apache.poi.xssf.usermodel.XSSFCell
;
import
org.apache.poi.xssf.usermodel.XSSFWorkbook
;
import
org.apache.poi.xssf.usermodel.XSSFWorkbook
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
...
@@ -275,7 +276,16 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen
...
@@ -275,7 +276,16 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen
dataSource
.
setId
(
distributedIDService
.
nextId
());
dataSource
.
setId
(
distributedIDService
.
nextId
());
dataSource
.
setColumnIndex
(
colNum
-
1
);
dataSource
.
setColumnIndex
(
colNum
-
1
);
dataSource
.
setRowIndex
(
rowNum
-
1
);
dataSource
.
setRowIndex
(
rowNum
-
1
);
dataSource
.
setAmount
(
new
BigDecimal
(
cell
.
getNumericCellValue
()));
if
(((
XSSFCell
)
cell
).
getRawValue
()
!=
"#VALUE!"
)
{
dataSource
.
setAmount
(
new
BigDecimal
(
((
XSSFCell
)
cell
).
getRawValue
()
!=
null
?
((
XSSFCell
)
cell
).
getRawValue
()
:
(
StringUtils
.
isNotBlank
(
cell
.
getStringCellValue
()))
?
cell
.
getStringCellValue
()
:
Double
.
toString
(
cell
.
getNumericCellValue
())));
}
else
{
dataSource
.
setAmount
(
new
BigDecimal
(
"0.0"
));
}
dataSource
.
setName
(
"ReportDataSource"
);
dataSource
.
setName
(
"ReportDataSource"
);
dataSource
.
setDescription
(
findStr
);
dataSource
.
setDescription
(
findStr
);
dataSource
.
setCreateTime
(
createTime
);
dataSource
.
setCreateTime
(
createTime
);
...
@@ -309,8 +319,14 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen
...
@@ -309,8 +319,14 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen
if
(
sheet
.
getRow
(
tempPeriodCellTemplate
.
get
().
getRowIndex
())
!=
null
if
(
sheet
.
getRow
(
tempPeriodCellTemplate
.
get
().
getRowIndex
())
!=
null
&&
sheet
.
getRow
(
tempPeriodCellTemplate
.
get
().
getRowIndex
())
&&
sheet
.
getRow
(
tempPeriodCellTemplate
.
get
().
getRowIndex
())
.
getCell
(
tempPeriodCellTemplate
.
get
().
getColumnIndex
())
!=
null
)
{
.
getCell
(
tempPeriodCellTemplate
.
get
().
getColumnIndex
())
!=
null
)
{
data
=
Double
.
toString
(
sheet
.
getRow
(
tempPeriodCellTemplate
.
get
().
getRowIndex
())
Cell
cell
=
sheet
.
getRow
(
tempPeriodCellTemplate
.
get
().
getRowIndex
())
.
getCell
(
tempPeriodCellTemplate
.
get
().
getColumnIndex
()).
getNumericCellValue
());
.
getCell
(
tempPeriodCellTemplate
.
get
().
getColumnIndex
());
data
=
((
XSSFCell
)
cell
).
getRawValue
();
// if (cell.getCellTypeEnum().equals(CellType.NUMERIC)||cell.getCellTypeEnum().equals(CellType.FORMULA)) {
// data = Double.toString(cell.getNumericCellValue());
// } else {
// data = cell.getStringCellValue();
// }
}
else
{
}
else
{
data
=
EMPTY
;
data
=
EMPTY
;
}
}
...
...
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/ReportServiceImpl.java
View file @
472dc359
...
@@ -640,6 +640,7 @@ public class ReportServiceImpl extends VatAbstractService implements ReportServi
...
@@ -640,6 +640,7 @@ public class ReportServiceImpl extends VatAbstractService implements ReportServi
updateCellValueForDataSourceChange
(
cellDataSource
.
getCellDataId
(),
new
BigDecimal
(
"0"
),
data
.
getAmount
());
updateCellValueForDataSourceChange
(
cellDataSource
.
getCellDataId
(),
new
BigDecimal
(
"0"
),
data
.
getAmount
());
dataSourceMapper
.
insertSelective
(
dataSourceModel
);
dataSourceMapper
.
insertSelective
(
dataSourceModel
);
cellDataSourceMapper
.
insertSelective
(
cellDataSource
);
cellDataSourceMapper
.
insertSelective
(
cellDataSource
);
dataSourceExtendDtos
=
dataSourceMapper
.
getManualDataSource
(
data
.
getCellId
());
}
}
//todo: update the reference cell's data, such as if formula is ND(1)+A2,
//todo: update the reference cell's data, such as if formula is ND(1)+A2,
...
@@ -677,7 +678,12 @@ public class ReportServiceImpl extends VatAbstractService implements ReportServi
...
@@ -677,7 +678,12 @@ public class ReportServiceImpl extends VatAbstractService implements ReportServi
dataSource
.
setUpdateBy
(
"admin"
);
dataSource
.
setUpdateBy
(
"admin"
);
dataSource
.
setUpdateTime
(
new
Date
());
dataSource
.
setUpdateTime
(
new
Date
());
dataSourceMapper
.
updateByPrimaryKeySelective
(
dataSource
);
dataSourceMapper
.
updateByPrimaryKeySelective
(
dataSource
);
cellData
.
setData
(
new
BigDecimal
(
cellData
.
getData
()).
add
(
changeValue
).
toString
());
if
(!
cellData
.
getData
().
equals
(
"#VALUE!"
))
{
cellData
.
setData
(
new
BigDecimal
(
cellData
.
getData
()).
add
(
changeValue
).
toString
());
}
else
{
cellData
.
setData
(
new
BigDecimal
(
"0.0"
).
add
(
changeValue
).
toString
());
}
//cellData.setFormulaExp(cellData.getData());
//cellData.setFormulaExp(cellData.getData());
cellData
.
setUpdateTime
(
new
Date
());
cellData
.
setUpdateTime
(
new
Date
());
cellDataMapper
.
updateByPrimaryKeySelective
(
cellData
);
cellDataMapper
.
updateByPrimaryKeySelective
(
cellData
);
...
...
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