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
a8a6a5e8
Commit
a8a6a5e8
authored
Apr 23, 2019
by
chase
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix 导入报表中有公式无法导入bug
parent
cf8b3128
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
8 deletions
+30
-8
DataImportService.java
...java/pwc/taxtech/atms/service/impl/DataImportService.java
+28
-6
tax-document-list.html
...axDocumentManage/tax-document-list/tax-document-list.html
+2
-2
No files found.
atms-api/src/main/java/pwc/taxtech/atms/service/impl/DataImportService.java
View file @
a8a6a5e8
...
...
@@ -51,7 +51,6 @@ import pwc.taxtech.atms.vat.entity.*;
import
javax.annotation.Resource
;
import
java.io.InputStream
;
import
java.math.BigDecimal
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
import
java.util.concurrent.*
;
...
...
@@ -1059,6 +1058,8 @@ public class DataImportService extends BaseService {
try
{
InputStream
inputStream
=
file
.
getInputStream
();
Workbook
workbook
=
WorkbookFactory
.
create
(
inputStream
);
FormulaEvaluator
evaluator
=
workbook
.
getCreationHelper
().
createFormulaEvaluator
();
evaluator
.
evaluateAll
();
if
(
StringUtils
.
isBlank
(
periodDate
)
||
"null"
.
equals
(
periodDate
))
{
throw
new
ServiceException
(
ErrorMessageCN
.
DoNotSelectPeriod
);
}
...
...
@@ -1067,7 +1068,7 @@ public class DataImportService extends BaseService {
for
(
int
i
=
0
;
i
<
workbook
.
getNumberOfSheets
();
i
++)
{
Sheet
sheet
=
workbook
.
getSheetAt
(
i
);
if
(
isSheetEmpty
(
sheet
))
continue
;
List
<
AdjustmentTable
>
ats
=
generalATs
(
sheet
);
List
<
AdjustmentTable
>
ats
=
generalATs
(
sheet
,
evaluator
);
if
(
ats
.
size
()
<
1
)
continue
;
// 根据主体分组处理
Map
<
String
,
List
<
AdjustmentTable
>>
atsGroupRes
=
...
...
@@ -1863,7 +1864,7 @@ public class DataImportService extends BaseService {
return
fg
;
}
private
List
<
AdjustmentTable
>
generalATs
(
Sheet
sheet
)
{
private
List
<
AdjustmentTable
>
generalATs
(
Sheet
sheet
,
FormulaEvaluator
evaluator
)
{
List
<
AdjustmentTable
>
ats
=
Lists
.
newArrayList
();
for
(
int
j
=
1
;
j
<=
sheet
.
getLastRowNum
();
j
++)
{
AdjustmentTable
at
=
new
AdjustmentTable
();
...
...
@@ -1905,9 +1906,9 @@ public class DataImportService extends BaseService {
at
.
setSegment8Name
(
getCellStringValue
(
row
.
getCell
(
18
)));
at
.
setSegment9Name
(
getCellStringValue
(
row
.
getCell
(
19
)));
at
.
setSegment10Name
(
getCellStringValue
(
row
.
getCell
(
20
)));
at
.
setPeriodDrBeq
(
getCellBigDecimalValue
(
row
.
getCell
(
2
1
)
));
at
.
setPeriodCrBeq
(
getCellBigDecimalValue
(
row
.
getCell
(
22
)));
at
.
setEndBalBeq
(
getCellBigDecimalValue
(
row
.
getCell
(
23
)));
at
.
setPeriodDrBeq
(
getCellBigDecimalValue
(
row
.
getCell
(
2
2
),
evaluator
));
at
.
setPeriodCrBeq
(
getCellBigDecimalValue
(
row
.
getCell
(
22
)
,
evaluator
));
at
.
setEndBalBeq
(
getCellBigDecimalValue
(
row
.
getCell
(
23
)
,
evaluator
));
ats
.
add
(
at
);
}
return
ats
;
...
...
@@ -2010,6 +2011,27 @@ public class DataImportService extends BaseService {
return
null
;
}
private
BigDecimal
getCellBigDecimalValue
(
Cell
cell
,
FormulaEvaluator
evaluator
)
{
if
(
null
==
cell
)
{
return
null
;
}
if
(
cell
.
getCellTypeEnum
().
equals
(
CellType
.
FORMULA
)){
CellValue
cellValue
=
evaluator
.
evaluate
(
cell
);
if
(
cellValue
.
getCellTypeEnum
().
equals
(
CellType
.
STRING
))
{
return
new
BigDecimal
(
cellValue
.
getStringValue
().
trim
());
}
else
if
(
cellValue
.
getCellTypeEnum
().
equals
(
CellType
.
NUMERIC
))
{
return
new
BigDecimal
(
cellValue
.
getNumberValue
());
}
return
null
;
}
if
(
cell
.
getCellTypeEnum
().
equals
(
CellType
.
STRING
))
{
return
new
BigDecimal
(
cell
.
getStringCellValue
().
trim
());
}
else
if
(
cell
.
getCellTypeEnum
().
equals
(
CellType
.
NUMERIC
))
{
return
new
BigDecimal
(
cell
.
getNumericCellValue
());
}
logger
.
warn
(
"获取单元格数据类型未匹配"
);
return
null
;
}
private
BigDecimal
getCellBigDecimalValue
(
Cell
cell
)
{
if
(
null
==
cell
)
{
return
null
;
...
...
atms-web/src/main/webapp/app/taxDocumentManage/tax-document-list/tax-document-list.html
View file @
a8a6a5e8
...
...
@@ -744,7 +744,7 @@
<span
class=
"required-tip"
>
*
</span>
{{'Company Name' | translate}}
</label>
<div
class=
"col-sm-11"
style=
"width:61.67%"
id=
"companyNameOptionsMap"
>
<div
class=
"col-sm-11"
style=
"width:61.67%
;height: 13px
"
id=
"companyNameOptionsMap"
>
<div
dx-select-box=
"editOrgOptions"
></div>
<!--<select ng-model="editFieldModel.companyName" class="form-control"-->
<!--title="{{editFieldModel.companyName}}" required-->
...
...
@@ -987,7 +987,7 @@
<span
class=
"required-tip"
>
*
</span>
{{'Company Name' | translate}}
</label>
<div
class=
"col-sm-11"
style=
"width:61.67%"
>
<div
class=
"col-sm-11"
style=
"width:61.67%
;height: 13px
"
>
<div
ng-class=
"{'upload-fail-mark':!editFieldItem.companyName}"
dx-select-box=
"editFieldItemOrgOptions"
></div>
<!--<select ng-model="editFieldItem.companyName" class="form-control"-->
<!--title="{{editFieldItem.companyName}}"-->
...
...
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