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
d057309f
Commit
d057309f
authored
Apr 10, 2019
by
chase
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug
parent
4a272701
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
14 deletions
+22
-14
ReportServiceImpl.java
.../pwc/taxtech/atms/vat/service/impl/ReportServiceImpl.java
+22
-14
No files found.
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/ReportServiceImpl.java
View file @
d057309f
...
@@ -479,12 +479,14 @@ public class ReportServiceImpl extends BaseService {
...
@@ -479,12 +479,14 @@ public class ReportServiceImpl extends BaseService {
for
(
int
r
=
sheet
.
getFirstRowNum
();
r
<=
sheet
.
getLastRowNum
();
r
++)
{
for
(
int
r
=
sheet
.
getFirstRowNum
();
r
<=
sheet
.
getLastRowNum
();
r
++)
{
Row
row
=
sheet
.
getRow
(
r
);
Row
row
=
sheet
.
getRow
(
r
);
for
(
int
c
=
row
.
getFirstCellNum
();
c
<=
row
.
getLastCellNum
();
c
++)
{
for
(
int
c
=
row
.
getFirstCellNum
();
c
<=
row
.
getLastCellNum
();
c
++)
{
Cell
cell
=
row
.
getCell
(
c
);
Cell
cell
=
row
.
getCell
(
c
);
if
(
cell
==
null
)
{
if
(
cell
==
null
)
{
continue
;
//todo cell == null 如何处理
continue
;
//todo cell == null 如何处理
}
}
if
(
r
<=
addRowIndex
+
1
)
{
if
(
r
<=
addRowIndex
+
1
)
{
if
(
r
==
addRowIndex
+
1
&&
c
>
TaxesCalculateReportEnum
.
Column
.
Column_14
.
getIndex
()){
assembleOriginalTemplateData
(
template
,
projectId
,
period
,
r
,
c
,
addRowIndex
,
cellTemplateList
,
cellTemplateConfigList
);
}
else
{
String
cellId
=
projectId
+
template
.
getId
()
+
period
+
r
+
c
;
String
cellId
=
projectId
+
template
.
getId
()
+
period
+
r
+
c
;
if
((
r
-
1
)
>=
0
&&
(
r
-
1
)
<
configIds
.
size
())
{
if
((
r
-
1
)
>=
0
&&
(
r
-
1
)
<
configIds
.
size
())
{
cellId
+=
configIds
.
get
(
configIds
.
size
()
-
r
);
cellId
+=
configIds
.
get
(
configIds
.
size
()
-
r
);
...
@@ -546,7 +548,26 @@ public class ReportServiceImpl extends BaseService {
...
@@ -546,7 +548,26 @@ public class ReportServiceImpl extends BaseService {
if
(
r
>
0
&&
r
<=
addRowIndex
&&
hasHandDatas
.
contains
(
c
))
{
if
(
r
>
0
&&
r
<=
addRowIndex
&&
hasHandDatas
.
contains
(
c
))
{
addManualConfig
(
cellTemplate
,
cell
,
now
,
cellTemplateConfigList
);
addManualConfig
(
cellTemplate
,
cell
,
now
,
cellTemplateConfigList
);
}
}
}
}
else
{
}
else
{
assembleOriginalTemplateData
(
template
,
projectId
,
period
,
r
,
c
,
addRowIndex
,
cellTemplateList
,
cellTemplateConfigList
);
}
}
}
List
<
List
<
PeriodCellTemplate
>>
tmpList
=
CommonUtils
.
subListWithLen
(
cellTemplateList
,
CommonUtils
.
BATCH_NUM
);
// tmpList.forEach(list -> cellTemplateMapper.batchInsert2(list));
tmpList
.
forEach
(
list
->
periodCellTemplateMapper
.
batchInsert
(
list
));
//todo 批量插入优化
List
<
List
<
PeriodCellTemplateConfig
>>
tmpConfigList
=
CommonUtils
.
subListWithLen
(
cellTemplateConfigList
,
CommonUtils
.
BATCH_NUM
);
tmpConfigList
.
forEach
(
list
->
periodCellTemplateConfigMapper
.
batchInsert
(
list
));
}
catch
(
Exception
e
)
{
logger
.
error
(
"importTemplateExcelFile error."
,
e
);
throw
new
ServiceException
(
ErrorMessage
.
SystemError
);
}
}
public
void
assembleOriginalTemplateData
(
Template
template
,
String
projectId
,
Integer
period
,
Integer
r
,
Integer
c
,
Integer
addRowIndex
,
List
<
PeriodCellTemplate
>
cellTemplateList
,
List
<
PeriodCellTemplateConfig
>
cellTemplateConfigList
)
{
//查询原来行cell是否有CellTemplate
//查询原来行cell是否有CellTemplate
CellTemplateExample
cellTemplateExample
=
new
CellTemplateExample
();
CellTemplateExample
cellTemplateExample
=
new
CellTemplateExample
();
cellTemplateExample
.
createCriteria
().
andReportTemplateIdEqualTo
(
template
.
getId
()).
andRowIndexEqualTo
(
r
-
addRowIndex
).
andColumnIndexEqualTo
(
c
);
cellTemplateExample
.
createCriteria
().
andReportTemplateIdEqualTo
(
template
.
getId
()).
andRowIndexEqualTo
(
r
-
addRowIndex
).
andColumnIndexEqualTo
(
c
);
...
@@ -614,19 +635,6 @@ public class ReportServiceImpl extends BaseService {
...
@@ -614,19 +635,6 @@ public class ReportServiceImpl extends BaseService {
}
}
}
}
}
}
}
}
List
<
List
<
PeriodCellTemplate
>>
tmpList
=
CommonUtils
.
subListWithLen
(
cellTemplateList
,
CommonUtils
.
BATCH_NUM
);
// tmpList.forEach(list -> cellTemplateMapper.batchInsert2(list));
tmpList
.
forEach
(
list
->
periodCellTemplateMapper
.
batchInsert
(
list
));
//todo 批量插入优化
List
<
List
<
PeriodCellTemplateConfig
>>
tmpConfigList
=
CommonUtils
.
subListWithLen
(
cellTemplateConfigList
,
CommonUtils
.
BATCH_NUM
);
tmpConfigList
.
forEach
(
list
->
periodCellTemplateConfigMapper
.
batchInsert
(
list
));
}
catch
(
Exception
e
)
{
logger
.
error
(
"importTemplateExcelFile error."
,
e
);
throw
new
ServiceException
(
ErrorMessage
.
SystemError
);
}
}
private
void
addManualConfig
(
PeriodCellTemplate
cellTemplate
,
Cell
cell
,
Date
now
,
List
<
PeriodCellTemplateConfig
>
list
)
{
private
void
addManualConfig
(
PeriodCellTemplate
cellTemplate
,
Cell
cell
,
Date
now
,
List
<
PeriodCellTemplateConfig
>
list
)
{
PeriodCellTemplateConfig
configManual
=
new
PeriodCellTemplateConfig
();
PeriodCellTemplateConfig
configManual
=
new
PeriodCellTemplateConfig
();
configManual
.
setId
(
distributedIdService
.
nextId
());
configManual
.
setId
(
distributedIdService
.
nextId
());
...
...
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