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
680df9b8
Commit
680df9b8
authored
Nov 14, 2018
by
sherlock
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
little bug
parent
b5c11386
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
21 deletions
+23
-21
ExcelUtil.java
.../src/main/java/pwc/taxtech/atms/thirdparty/ExcelUtil.java
+5
-3
ReportGeneratorImpl.java
...wc/taxtech/atms/vat/service/impl/ReportGeneratorImpl.java
+17
-17
ReportServiceImpl.java
.../pwc/taxtech/atms/vat/service/impl/ReportServiceImpl.java
+1
-1
No files found.
atms-api/src/main/java/pwc/taxtech/atms/thirdparty/ExcelUtil.java
View file @
680df9b8
...
...
@@ -3,9 +3,8 @@ package pwc.taxtech.atms.thirdparty;
import
java.io.IOException
;
import
java.io.OutputStream
;
import
java.lang.reflect.Field
;
import
java.text.MessageFormat
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.math.BigDecimal
;
import
java.text.*
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Collection
;
...
...
@@ -50,6 +49,7 @@ public class ExcelUtil {
private
static
Logger
LG
=
LoggerFactory
.
getLogger
(
ExcelUtil
.
class
);
private
static
final
DecimalFormat
DECIMAL_FORMAT
=
new
DecimalFormat
(
"###,###.00"
);
/**
* 用来验证excel与Vo中的类型是否一致 <br>
* Map<栏位类型,只能是哪些Cell类型>
...
...
@@ -343,6 +343,8 @@ public class ExcelUtil {
if
(
value
instanceof
Integer
)
{
int
intValue
=
(
Integer
)
value
;
cell
.
setCellValue
(
intValue
);
}
else
if
(
value
instanceof
BigDecimal
){
textValue
=
DECIMAL_FORMAT
.
format
(
value
);
}
else
if
(
value
instanceof
Float
)
{
float
fValue
=
(
Float
)
value
;
cell
.
setCellValue
(
fValue
);
...
...
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/ReportGeneratorImpl.java
View file @
680df9b8
...
...
@@ -199,24 +199,24 @@ public class ReportGeneratorImpl {
dataSource
.
setColumnIndex
(
colNum
-
1
);
dataSource
.
setRowIndex
(
rowNum
-
1
);
if
(((
XSSFCell
)
cell
).
getRawValue
()
!=
"#VALUE!"
)
{
if
(
StringUtils
.
isNotBlank
(
cell
.
getStringCellValue
())
&&
StringUtils
.
isNumeric
(
cell
.
getStringCellValue
().
replace
(
"."
,
""
))){
dataSource
.
setAmount
(
new
BigDecimal
(
cell
.
getStringCellValue
()));
}
else
if
(
StringUtils
.
isBlank
(
cell
.
getStringCellValue
())){
dataSource
.
setAmount
(
new
BigDecimal
(
Double
.
toString
(
cell
.
getNumericCellValue
())));
}
// else {
// cell.setCellFormula(cell.getStringCellValue());
// FormulaEvaluator formulaEvaluator = new XSSFFormulaEvaluator((XSSFWorkbook) workbook);
// dataSource.setAmount(new BigDecimal(formulaEvaluator.evaluate(cell).getNumberValue()));
// if(StringUtils.isNotBlank(cell.getStringCellValue())
// && StringUtils.isNumeric(cell.getStringCellValue().replace(".", ""))){
// dataSource.setAmount(new BigDecimal(cell.getStringCellValue()));
// }
// else if(StringUtils.isBlank(cell.getStringCellValue())){
// dataSource.setAmount(new BigDecimal(Double.toString(cell.getNumericCellValue())));
// }
// dataSource.setAmount(new BigDecimal(
// ((XSSFCell) cell).getRawValue() != null ?
// ((XSSFCell) cell).getRawValue()
// : (StringUtils.isNotBlank(cell.getStringCellValue())) ?
// cell.getStringCellValue()
// : Double.toString(cell.getNumericCellValue())));
//// else {
//// cell.setCellFormula(cell.getStringCellValue());
//// FormulaEvaluator formulaEvaluator = new XSSFFormulaEvaluator((XSSFWorkbook) workbook);
//// dataSource.setAmount(new BigDecimal(formulaEvaluator.evaluate(cell).getNumberValue()));
//// }
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"
));
}
...
...
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/ReportServiceImpl.java
View file @
680df9b8
...
...
@@ -122,7 +122,7 @@ public class ReportServiceImpl {
periodTemplateList
.
stream
().
forEach
(
x
->
ids
.
add
(
x
.
getTemplateId
()
+
""
));
List
<
ReportDto
>
reportDtos
=
result
.
getData
().
stream
().
filter
(
x
->
{
return
ids
.
contains
(
x
.
getTemplateId
());
return
x
.
getId
()
!=
null
&&
ids
.
contains
(
x
.
getTemplateId
());
}).
collect
(
Collectors
.
toList
());
result
.
setData
(
reportDtos
);
return
result
;
...
...
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