Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-manage3.0
Overview
Overview
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
haoban3.0
haoban-manage3.0
Commits
f17a1030
Commit
f17a1030
authored
Dec 18, 2020
by
qwmqiuwenmin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
d221d517
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
63 additions
and
1 deletions
+63
-1
StaffController.java
...com/gic/haoban/manage/web/controller/StaffController.java
+63
-1
No files found.
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/StaffController.java
View file @
f17a1030
...
...
@@ -7,6 +7,8 @@ import com.gic.api.base.commons.Page;
import
com.gic.clerk.api.dto.ClerkDTO
;
import
com.gic.clerk.api.service.ClerkNewService
;
import
com.gic.clerk.api.service.ClerkService
;
import
com.gic.commons.util.DateUtil
;
import
com.gic.commons.util.ExcelUtils
;
import
com.gic.enterprise.api.dto.*
;
import
com.gic.enterprise.api.service.*
;
import
com.gic.enterprise.api.service.EnterpriseService
;
...
...
@@ -37,10 +39,14 @@ import org.springframework.web.bind.annotation.RequestParam;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
@RestController
public
class
StaffController
extends
WebBaseController
{
...
...
@@ -431,5 +437,61 @@ public class StaffController extends WebBaseController{
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
page
);
}
/**
*
* @Description 会员导出
* @return 返回值类型: <pre>
* @author 作者: qwm
* @date 时间: 2020年12月18日 上午11:11:35 <pre>
*/
@RequestMapping
(
"staff-export"
)
public
HaobanResponse
staffExport
(
String
departmentId
,
Integer
activeFlag
,
String
keyWord
,
HttpServletResponse
response
,
HttpServletRequest
request
){
BasePageInfo
pageInfo
=
new
BasePageInfo
();
int
pageSize
=
1000
;
int
pageNum
=
1
;
pageInfo
.
setPageNum
(
pageNum
);
pageInfo
.
setPageSize
(
pageSize
);
LoginVO
login
=
(
LoginVO
)
AuthRequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
List
<
String
>
departmentIdSet
=
new
ArrayList
<>();
departmentIdSet
.
add
(
departmentId
);
List
<
DepartmentDTO
>
sonDepartmentList
=
departmentApiService
.
listSonByDepartmentIds
(
departmentIdSet
,
wxEnterpriseId
);
// Map<String,DepartmentDTO> departmentMap = sonDepartmentList.stream().collect(Collectors.toMap(DepartmentDTO::getDepartmentId, s -> s));
List
<
String
>
departmentIds
=
sonDepartmentList
.
stream
().
map
(
DepartmentDTO:
:
getDepartmentId
).
collect
(
Collectors
.
toList
());
Page
<
StaffDTO
>
page
=
staffApiService
.
pageStaff
(
departmentIds
,
activeFlag
,
keyWord
,
pageInfo
);
List
<
StaffDTO
>
list
=
page
.
getResult
();
// List<StaffVO> voList = new ArrayList<>();
// for (StaffDTO staffDTO : list) {
// StaffVO vo = new StaffVO();
// vo.setPhoneNumber(staffDTO.getPhoneNumber());
// vo.setStaffName(staffDTO.getStaffName());
// vo.setPosition(staffDTO.getExtendPostion());
// vo.setDepartmentName(departmentMap.get(staffDTO.getde));
// }
if
(
page
.
getPages
()
<
page
.
getTotalPage
()){
pageNum
++
;
pageInfo
.
setPageNum
(
pageNum
);
page
=
staffApiService
.
pageStaff
(
departmentIds
,
activeFlag
,
keyWord
,
pageInfo
);
}
List
<
StaffDTO
>
sonList
=
page
.
getResult
();
if
(
CollectionUtils
.
isNotEmpty
(
sonList
)){
list
.
addAll
(
sonList
);
}
String
fileName
=
"会员导出"
+
DateUtil
.
dateToStr
(
new
Date
(),
DateUtil
.
FORMAT_DATETIME_14
);
List
<
String
>
fileList
=
new
ArrayList
<>();
List
<
String
>
titleList
=
new
ArrayList
<>();
titleList
.
add
(
"成员名称"
);
titleList
.
add
(
"手机号"
);
titleList
.
add
(
"成员职位"
);
fileList
.
add
(
"staffName"
);
fileList
.
add
(
"phoneNumber"
);
fileList
.
add
(
"extendPostion"
);
try
{
ExcelUtils
.
csv
(
response
,
request
,
fileName
,
list
,
fileList
,
titleList
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
logger
.
info
(
"导出失败"
);
}
return
null
;
}
}
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