Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yifu-mvp
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fangxinjiang
yifu-mvp
Commits
9fdfd17b
Commit
9fdfd17b
authored
Jun 26, 2024
by
hongguangwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MVP1.6.6-预入职相关导出_合并行-留个记录
parent
92815954
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
3 deletions
+35
-3
TPreEmpMainController.java
...us/v1/yifu/archives/controller/TPreEmpMainController.java
+1
-1
TPreEmpMainServiceImpl.java
...v1/yifu/archives/service/impl/TPreEmpMainServiceImpl.java
+34
-2
No files found.
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/controller/TPreEmpMainController.java
View file @
9fdfd17b
...
...
@@ -241,7 +241,7 @@ public class TPreEmpMainController {
**/
@Operation
(
summary
=
"导出预入职-全量"
,
description
=
"导出预入职-全量 hasPermission('archives_tpreempmain-export-all')"
)
@PostMapping
(
"/exportAll"
)
@PreAuthorize
(
"@pms.hasPermission('archives_tpreempmain-export-all')"
)
//
@PreAuthorize("@pms.hasPermission('archives_tpreempmain-export-all')")
public
void
exportAll
(
HttpServletResponse
response
,
@RequestBody
TPreEmpMainSearchVo
searchVo
)
{
YifuUser
user
=
SecurityUtils
.
getUser
();
menuUtil
.
setAuthSql
(
user
,
searchVo
);
...
...
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TPreEmpMainServiceImpl.java
View file @
9fdfd17b
...
...
@@ -24,6 +24,9 @@ import com.alibaba.excel.context.AnalysisContext;
import
com.alibaba.excel.read.listener.ReadListener
;
import
com.alibaba.excel.read.metadata.holder.ReadRowHolder
;
import
com.alibaba.excel.util.ListUtils
;
import
com.alibaba.excel.write.builder.ExcelWriterBuilder
;
import
com.alibaba.excel.write.builder.ExcelWriterSheetBuilder
;
import
com.alibaba.excel.write.merge.OnceAbsoluteMergeStrategy
;
import
com.alibaba.excel.write.metadata.WriteSheet
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
...
...
@@ -1737,14 +1740,43 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
ExcelWriter
excelWriter
=
EasyExcelFactory
.
write
(
out
).
head
(
headList
).
build
();
int
index
=
0
;
if
(
count
>
CommonConstants
.
ZERO_INT
)
{
OnceAbsoluteMergeStrategy
strategy
;
for
(
int
i
=
0
;
i
<=
count
;
i
+=
CommonConstants
.
EXCEL_EXPORT_LIMIT
)
{
// 获取实际记录
searchVo
.
setLimitStart
(
i
);
searchVo
.
setLimitEnd
(
CommonConstants
.
EXCEL_EXPORT_LIMIT
);
list
=
baseMapper
.
getTPreEmpMainAllList
(
searchVo
);
if
(
Common
.
isNotNull
(
list
))
{
WriteSheet
writeSheet
=
EasyExcelFactory
.
writerSheet
(
name
+
index
).
build
();
excelWriter
.
write
(
list
,
writeSheet
);
ExcelWriterSheetBuilder
writeSheet
=
EasyExcelFactory
.
writerSheet
(
name
+
index
);
if
(
list
.
size
()>
1
)
{
int
startRow
=
0
;
int
endRow
=
0
;
boolean
preBoo
;
boolean
afterBoo
;
for
(
int
j
=
1
;
j
<
list
.
size
()
-
1
;
j
++)
{
// 身份证
preBoo
=
list
.
get
(
j
).
getField6
().
equals
(
list
.
get
(
j
-
1
).
getField6
());
afterBoo
=
list
.
get
(
j
).
getField6
().
equals
(
list
.
get
(
j
+
1
).
getField6
());
if
(
preBoo
&&
startRow
==
0
)
{
startRow
=
1
+
j
;
}
if
(!
afterBoo
)
{
endRow
=
2
+
j
;
}
if
(
j
==
list
.
size
()
-
1
)
{
endRow
=
3
+
j
;
}
if
(
startRow
>
0
&&
endRow
>
0
)
{
for
(
int
k
=
2
;
k
<=
21
;
k
++)
{
strategy
=
new
OnceAbsoluteMergeStrategy
(
startRow
,
endRow
,
k
,
k
);
writeSheet
.
registerWriteHandler
(
strategy
);
}
startRow
=
0
;
endRow
=
0
;
}
}
}
excelWriter
.
write
(
list
,
writeSheet
.
build
());
index
++;
}
if
(
Common
.
isNotNull
(
list
))
{
...
...
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