Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
attendance-performance-platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
attendance-performance-platform
Commits
5eabcf7d
Commit
5eabcf7d
authored
2 months ago
by
廖旭伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
窗口绩效汇总导出修改
parent
9c5d95bd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
0 deletions
+39
-0
attendance-performance-manager/src/main/java/com/mortals/xhx/module/window/web/WindowPerformSummaryController.java
...xhx/module/window/web/WindowPerformSummaryController.java
+39
-0
No files found.
attendance-performance-manager/src/main/java/com/mortals/xhx/module/window/web/WindowPerformSummaryController.java
View file @
5eabcf7d
...
...
@@ -2,6 +2,10 @@ package com.mortals.xhx.module.window.web;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.model.Context
;
import
com.mortals.framework.model.PageInfo
;
import
com.mortals.framework.util.StringUtils
;
import
com.mortals.framework.utils.ReflectUtils
;
import
com.mortals.framework.utils.poi.ExcelUtil
;
import
com.mortals.framework.web.BaseCRUDJsonBodyMappingController
;
import
com.mortals.xhx.base.system.param.service.ParamService
;
import
com.mortals.xhx.module.window.model.WindowPerformSummaryEntity
;
...
...
@@ -9,9 +13,12 @@ import com.mortals.xhx.module.window.model.WindowPerformSummaryQuery;
import
com.mortals.xhx.module.window.service.WindowPerformSummaryService
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -65,4 +72,36 @@ public class WindowPerformSummaryController extends BaseCRUDJsonBodyMappingContr
}
}
@PostMapping
({
"exportExcel"
})
@Override
public
void
exportExcel
(
@RequestBody
WindowPerformSummaryEntity
query
)
{
Context
context
=
this
.
getContext
();
String
busiDesc
=
"导出"
+
this
.
getModuleDesc
();
ArrayList
properties
=
new
ArrayList
();
try
{
this
.
doExportBefore
(
context
,
query
,
properties
);
String
name
=
StringUtils
.
trim
(
this
.
moduleDesc
);
if
(
StringUtils
.
isEmpty
(
name
))
{
name
=
System
.
currentTimeMillis
()
+
""
;
}
String
fileName
=
name
+
".xlsx"
;
PageInfo
pageInfo
=
this
.
buildPageInfo
(
query
);
pageInfo
.
setPrePageResult
(-
1
);
this
.
buildPermisionSql
(
query
);
List
<
WindowPerformSummaryEntity
>
list
=
this
.
service
.
find
(
query
,
pageInfo
,
this
.
getContext
()).
getList
();
Class
<
WindowPerformSummaryEntity
>
tClass
=
ReflectUtils
.
getClassGenricType
(
this
.
getClass
(),
1
);
ExcelUtil
<
WindowPerformSummaryEntity
,
Long
>
util
=
new
ExcelUtil
(
tClass
);
this
.
doExportAfter
(
context
,
list
);
byte
[]
data
=
util
.
exportExcel
(
list
,
properties
,
name
);
this
.
doExportFileAfter
(
data
,
query
,
context
);
this
.
responseStream
(
this
.
response
,
data
,
fileName
);
this
.
recordSysLog
(
this
.
request
,
busiDesc
+
" 【成功】"
);
}
catch
(
Exception
var12
)
{
this
.
doException
(
this
.
request
,
"导出异常"
,
new
HashMap
(),
var12
);
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
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