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
050420e6
Commit
050420e6
authored
Jan 16, 2023
by
hongguangwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MVP1.4导出-最后优化
parent
ad06fedd
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
14 deletions
+14
-14
TStatisticsCurrentReportController.java
...salary/controller/TStatisticsCurrentReportController.java
+4
-4
TStatisticsCurrentReportService.java
.../yifu/salary/service/TStatisticsCurrentReportService.java
+1
-1
TStatisticsCurrentReportServiceImpl.java
...ary/service/impl/TStatisticsCurrentReportServiceImpl.java
+6
-6
TStatisticsCurrentReportMapper.xml
.../main/resources/mapper/TStatisticsCurrentReportMapper.xml
+3
-3
No files found.
yifu-salary/yifu-salary-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/controller/TStatisticsCurrentReportController.java
View file @
050420e6
...
...
@@ -84,12 +84,12 @@ public class TStatisticsCurrentReportController {
@Operation
(
description
=
"导出统计-本期申报 hasPermission('salary_tstatisticscurrentreport-export')"
)
@PostMapping
(
"/export"
)
@PreAuthorize
(
"@pms.hasPermission('salary_tstatisticscurrentreport-export')"
)
public
void
export
(
HttpServletResponse
response
,
@RequestBody
TStatisticsCurrentReportSearchVo
searchVo
)
{
if
(
Common
.
isEmpty
(
searchVo
.
getDeclareMonth
()))
{
public
void
export
(
HttpServletResponse
response
,
@RequestBody
TStatisticsCurrentReportSearchVo
tStatisticsCurrentReport
)
{
if
(
Common
.
isEmpty
(
tStatisticsCurrentReport
.
getDeclareMonth
()))
{
String
nowMonth
=
DateUtil
.
addMonth
(
0
);
//本月
searchVo
.
setDeclareMonth
(
nowMonth
);
tStatisticsCurrentReport
.
setDeclareMonth
(
nowMonth
);
}
tStatisticsCurrentReportService
.
listExport
(
response
,
searchVo
);
tStatisticsCurrentReportService
.
listExport
(
response
,
tStatisticsCurrentReport
);
}
/**
...
...
yifu-salary/yifu-salary-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/service/TStatisticsCurrentReportService.java
View file @
050420e6
...
...
@@ -46,7 +46,7 @@ public interface TStatisticsCurrentReportService extends IService<TStatisticsCur
* @Date: 2022/8/19 17:04
* @return: void
**/
void
listExport
(
HttpServletResponse
response
,
TStatisticsCurrentReportSearchVo
searchVo
);
void
listExport
(
HttpServletResponse
response
,
TStatisticsCurrentReportSearchVo
tStatisticsCurrentReport
);
/**
* @param yearMonth
...
...
yifu-salary/yifu-salary-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/service/impl/TStatisticsCurrentReportServiceImpl.java
View file @
050420e6
...
...
@@ -72,11 +72,11 @@ public class TStatisticsCurrentReportServiceImpl extends ServiceImpl<TStatistics
* @return
*/
@Override
public
void
listExport
(
HttpServletResponse
response
,
TStatisticsCurrentReportSearchVo
searchVo
)
{
public
void
listExport
(
HttpServletResponse
response
,
TStatisticsCurrentReportSearchVo
tStatisticsCurrentReport
)
{
String
fileName
=
"本期申报批量导出"
+
DateUtil
.
getThisTime
()
+
CommonConstants
.
XLSX
;
//获取要导出的列表
List
<
TStatisticsCurrentReport
>
list
=
new
ArrayList
<>();
long
count
=
noPageCountDiy
(
searchVo
);
long
count
=
noPageCountDiy
(
tStatisticsCurrentReport
);
ServletOutputStream
out
=
null
;
try
{
out
=
response
.
getOutputStream
();
...
...
@@ -84,15 +84,15 @@ public class TStatisticsCurrentReportServiceImpl extends ServiceImpl<TStatistics
response
.
setCharacterEncoding
(
"utf-8"
);
response
.
setHeader
(
CommonConstants
.
CONTENT_DISPOSITION
,
CommonConstants
.
ATTACHMENT_FILENAME
+
URLEncoder
.
encode
(
fileName
,
"UTF-8"
));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
ExcelWriter
excelWriter
=
EasyExcelFactory
.
write
(
out
,
TStatisticsCurrentReport
.
class
).
includeColumnFiledNames
(
searchVo
.
getExportFields
()).
build
();
ExcelWriter
excelWriter
=
EasyExcelFactory
.
write
(
out
,
TStatisticsCurrentReport
.
class
).
includeColumnFiledNames
(
tStatisticsCurrentReport
.
getExportFields
()).
build
();
int
index
=
0
;
WriteSheet
writeSheet
;
if
(
count
>
CommonConstants
.
ZERO_INT
)
{
for
(
int
i
=
0
;
i
<=
count
;
i
=
i
+
CommonConstants
.
EXCEL_EXPORT_LIMIT_3
)
{
// 获取实际记录
searchVo
.
setLimitStart
(
i
);
searchVo
.
setLimitEnd
(
CommonConstants
.
EXCEL_EXPORT_LIMIT_3
);
list
=
noPageDiy
(
searchVo
);
tStatisticsCurrentReport
.
setLimitStart
(
i
);
tStatisticsCurrentReport
.
setLimitEnd
(
CommonConstants
.
EXCEL_EXPORT_LIMIT_3
);
list
=
noPageDiy
(
tStatisticsCurrentReport
);
if
(
Common
.
isNotNull
(
list
))
{
writeSheet
=
EasyExcelFactory
.
writerSheet
(
"本期申报"
+
index
).
build
();
excelWriter
.
write
(
list
,
writeSheet
);
...
...
yifu-salary/yifu-salary-biz/src/main/resources/mapper/TStatisticsCurrentReportMapper.xml
View file @
050420e6
...
...
@@ -319,9 +319,9 @@
<include
refid=
"tStatisticsCurrentReport_where"
/>
</where>
order by a.DECLARE_MONTH desc
<if
test=
"
searchVo
!= null"
>
<if
test=
"
searchVo
.limitStart != null"
>
limit #{
searchVo.limitStart},#{searchVo
.limitEnd}
<if
test=
"
tStatisticsCurrentReport
!= null"
>
<if
test=
"
tStatisticsCurrentReport
.limitStart != null"
>
limit #{
tStatisticsCurrentReport.limitStart},#{tStatisticsCurrentReport
.limitEnd}
</if>
</if>
</select>
...
...
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