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
05cdfaf2
Commit
05cdfaf2
authored
May 17, 2023
by
jinxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
通讯录列表查询接口优化
parent
195a3597
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
539 additions
and
50 deletions
+539
-50
StaffListDTO.java
...main/java/com/gic/haoban/manage/api/dto/StaffListDTO.java
+159
-0
StaffApiService.java
...va/com/gic/haoban/manage/api/service/StaffApiService.java
+1
-3
StaffMapper.java
...com/gic/haoban/manage/service/dao/mapper/StaffMapper.java
+2
-7
TabHaobanStaffClerkRelationMapper.java
...service/dao/mapper/TabHaobanStaffClerkRelationMapper.java
+3
-0
StaffListBO.java
...va/com/gic/haoban/manage/service/pojo/bo/StaffListBO.java
+171
-0
StaffClerkRelationService.java
...ban/manage/service/service/StaffClerkRelationService.java
+7
-0
StaffService.java
...a/com/gic/haoban/manage/service/service/StaffService.java
+2
-3
StaffClerkRelationServiceImpl.java
...e/service/service/impl/StaffClerkRelationServiceImpl.java
+5
-0
StaffServiceImpl.java
.../haoban/manage/service/service/impl/StaffServiceImpl.java
+8
-3
StaffApiServiceImpl.java
.../manage/service/service/out/impl/StaffApiServiceImpl.java
+21
-7
StaffMapper.xml
...manage3-service/src/main/resources/mapper/StaffMapper.xml
+2
-2
TabHaobanStaffClerkRelationMapper.xml
...in/resources/mapper/TabHaobanStaffClerkRelationMapper.xml
+9
-0
StaffController.java
...com/gic/haoban/manage/web/controller/StaffController.java
+16
-25
StaffListQO.java
...c/main/java/com/gic/haoban/manage/web/qo/StaffListQO.java
+133
-0
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/dto/StaffListDTO.java
0 → 100644
View file @
05cdfaf2
package
com
.
gic
.
haoban
.
manage
.
api
.
dto
;
import
com.gic.haoban.base.api.common.BasePageInfo
;
import
java.io.Serializable
;
import
java.util.List
;
/**
* @description: 列表查询VO
* @Author: wenhua
* @Date: 2023/5/17 10:45
*/
public
class
StaffListDTO
implements
Serializable
{
/**
* 部门id
*/
private
String
departmentId
;
/**
* 激活状态 - 后期删除
*/
private
Integer
activeFlag
;
/**
* 关联状态
*/
private
Integer
relationFlag
;
/**
* 关键字
*/
private
String
keyWord
;
/**
* 许可状态 0 未激活,1 正常有效,2 即将过期,3 已过期,可多传,按‘,’隔开
*/
private
String
permitState
;
/**
* 其他占用许可页面标志,传1返回该页面数据
*/
private
Integer
occupy
;
/**
* 排序字段 不传默认create_time
*/
private
String
sortField
=
"create_time"
;
/**
* 排序类型 不传默认desc
*/
private
String
sortType
=
"desc"
;
/**
* 所属商户id
*/
private
String
enterpriseIdParam
;
/**
* 分页参数
*/
private
BasePageInfo
pageInfo
;
/**
* 企业微信id
*/
private
String
WxEnterpriseId
;
/**
* 部门id数组
*/
private
List
<
String
>
departmentIds
;
public
List
<
String
>
getDepartmentIds
()
{
return
departmentIds
;
}
public
void
setDepartmentIds
(
List
<
String
>
departmentIds
)
{
this
.
departmentIds
=
departmentIds
;
}
public
String
getWxEnterpriseId
()
{
return
WxEnterpriseId
;
}
public
void
setWxEnterpriseId
(
String
wxEnterpriseId
)
{
WxEnterpriseId
=
wxEnterpriseId
;
}
public
String
getDepartmentId
()
{
return
departmentId
;
}
public
void
setDepartmentId
(
String
departmentId
)
{
this
.
departmentId
=
departmentId
;
}
public
Integer
getActiveFlag
()
{
return
activeFlag
;
}
public
void
setActiveFlag
(
Integer
activeFlag
)
{
this
.
activeFlag
=
activeFlag
;
}
public
Integer
getRelationFlag
()
{
return
relationFlag
;
}
public
void
setRelationFlag
(
Integer
relationFlag
)
{
this
.
relationFlag
=
relationFlag
;
}
public
String
getKeyWord
()
{
return
keyWord
;
}
public
void
setKeyWord
(
String
keyWord
)
{
this
.
keyWord
=
keyWord
;
}
public
String
getPermitState
()
{
return
permitState
;
}
public
void
setPermitState
(
String
permitState
)
{
this
.
permitState
=
permitState
;
}
public
Integer
getOccupy
()
{
return
occupy
;
}
public
void
setOccupy
(
Integer
occupy
)
{
this
.
occupy
=
occupy
;
}
public
String
getSortField
()
{
return
sortField
;
}
public
void
setSortField
(
String
sortField
)
{
this
.
sortField
=
sortField
;
}
public
String
getSortType
()
{
return
sortType
;
}
public
void
setSortType
(
String
sortType
)
{
this
.
sortType
=
sortType
;
}
public
String
getEnterpriseIdParam
()
{
return
enterpriseIdParam
;
}
public
void
setEnterpriseIdParam
(
String
enterpriseIdParam
)
{
this
.
enterpriseIdParam
=
enterpriseIdParam
;
}
public
BasePageInfo
getPageInfo
()
{
return
pageInfo
;
}
public
void
setPageInfo
(
BasePageInfo
pageInfo
)
{
this
.
pageInfo
=
pageInfo
;
}
}
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/StaffApiService.java
View file @
05cdfaf2
...
...
@@ -19,9 +19,7 @@ public interface StaffApiService {
List
<
StaffDepartmentRelatedDTO
>
listStaffDepartmentByStaffId
(
String
staffId
);
Page
<
StaffDTO
>
pageStaff
(
List
<
String
>
departmentId
,
Integer
activeFlag
,
String
keyword
,
BasePageInfo
pageInfo
,
Integer
relationFlag
,
String
wxEnterpriseId
,
String
permitState
,
Integer
occupy
);
Page
<
StaffDTO
>
pageStaff
(
StaffListDTO
staffListDTO
);
/**
* 保存微信成员
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/StaffMapper.java
View file @
05cdfaf2
...
...
@@ -2,6 +2,7 @@ package com.gic.haoban.manage.service.dao.mapper;
import
com.gic.haoban.manage.api.dto.StaffDTO
;
import
com.gic.haoban.manage.service.entity.TabHaobanStaff
;
import
com.gic.haoban.manage.service.pojo.bo.StaffListBO
;
import
com.github.pagehelper.Page
;
import
org.apache.ibatis.annotations.Param
;
...
...
@@ -37,13 +38,7 @@ public interface StaffMapper {
List
<
TabHaobanStaff
>
listLikeName
(
@Param
(
"staffName"
)
String
staffName
,
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
);
Page
<
TabHaobanStaff
>
pageStaff
(
@Param
(
"staffIds"
)
List
<
String
>
staffIds
,
@Param
(
"activeFlag"
)
Integer
activeFlag
,
@Param
(
"keyword"
)
String
keyword
,
@Param
(
"departmentIds"
)
List
<
String
>
departmentIds
,
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
,
@Param
(
"relationFlag"
)
Integer
relationFlag
,
@Param
(
"permitState"
)
String
permitState
,
@Param
(
"occupy"
)
Integer
occupy
);
Page
<
TabHaobanStaff
>
pageStaff
(
StaffListBO
staffListBO
);
List
<
TabHaobanStaff
>
listByPhoneNumber
(
@Param
(
"phoneNumber"
)
String
phoneNumber
);
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/TabHaobanStaffClerkRelationMapper.java
View file @
05cdfaf2
...
...
@@ -129,4 +129,6 @@ public interface TabHaobanStaffClerkRelationMapper {
* @return
*/
List
<
StaffClerkRelationDTO
>
listByWxEnterpriseIdAndStaffId
(
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
,
@Param
(
"staffIdList"
)
Set
<
String
>
staffIdList
);
List
<
String
>
listAllStaffIdByEnterpriseId
(
@Param
(
"enterpriseId"
)
String
enterpriseId
,
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
);
}
\ No newline at end of file
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/pojo/bo/StaffListBO.java
0 → 100644
View file @
05cdfaf2
package
com
.
gic
.
haoban
.
manage
.
service
.
pojo
.
bo
;
import
com.gic.haoban.base.api.common.BasePageInfo
;
import
java.io.Serializable
;
import
java.util.List
;
/**
* @description: 列表查询VO
* @Author: wenhua
* @Date: 2023/5/17 10:45
*/
public
class
StaffListBO
implements
Serializable
{
/**
* 部门id
*/
private
String
departmentId
;
/**
* 激活状态 - 后期删除
*/
private
Integer
activeFlag
;
/**
* 关联状态
*/
private
Integer
relationFlag
;
/**
* 关键字
*/
private
String
keyWord
;
/**
* 许可状态 0 未激活,1 正常有效,2 即将过期,3 已过期,可多传,按‘,’隔开
*/
private
String
permitState
;
/**
* 其他占用许可页面标志,传1返回该页面数据
*/
private
Integer
occupy
;
/**
* 排序字段 不传默认create_time
*/
private
String
sortField
=
"create_time"
;
/**
* 排序类型 不传默认desc
*/
private
String
sortType
=
"desc"
;
/**
* 所属商户id
*/
private
String
enterpriseIdParam
;
/**
* 分页参数
*/
private
BasePageInfo
pageInfo
;
/**
* 企业微信id
*/
private
String
WxEnterpriseId
;
/**
* 部门id数组
*/
private
List
<
String
>
departmentIds
;
/**
* 关联成员id数组
*/
private
List
<
String
>
staffIds
;
public
List
<
String
>
getStaffIds
()
{
return
staffIds
;
}
public
void
setStaffIds
(
List
<
String
>
staffIds
)
{
this
.
staffIds
=
staffIds
;
}
public
List
<
String
>
getDepartmentIds
()
{
return
departmentIds
;
}
public
void
setDepartmentIds
(
List
<
String
>
departmentIds
)
{
this
.
departmentIds
=
departmentIds
;
}
public
String
getWxEnterpriseId
()
{
return
WxEnterpriseId
;
}
public
void
setWxEnterpriseId
(
String
wxEnterpriseId
)
{
WxEnterpriseId
=
wxEnterpriseId
;
}
public
String
getDepartmentId
()
{
return
departmentId
;
}
public
void
setDepartmentId
(
String
departmentId
)
{
this
.
departmentId
=
departmentId
;
}
public
Integer
getActiveFlag
()
{
return
activeFlag
;
}
public
void
setActiveFlag
(
Integer
activeFlag
)
{
this
.
activeFlag
=
activeFlag
;
}
public
Integer
getRelationFlag
()
{
return
relationFlag
;
}
public
void
setRelationFlag
(
Integer
relationFlag
)
{
this
.
relationFlag
=
relationFlag
;
}
public
String
getKeyWord
()
{
return
keyWord
;
}
public
void
setKeyWord
(
String
keyWord
)
{
this
.
keyWord
=
keyWord
;
}
public
String
getPermitState
()
{
return
permitState
;
}
public
void
setPermitState
(
String
permitState
)
{
this
.
permitState
=
permitState
;
}
public
Integer
getOccupy
()
{
return
occupy
;
}
public
void
setOccupy
(
Integer
occupy
)
{
this
.
occupy
=
occupy
;
}
public
String
getSortField
()
{
return
sortField
;
}
public
void
setSortField
(
String
sortField
)
{
this
.
sortField
=
sortField
;
}
public
String
getSortType
()
{
return
sortType
;
}
public
void
setSortType
(
String
sortType
)
{
this
.
sortType
=
sortType
;
}
public
String
getEnterpriseIdParam
()
{
return
enterpriseIdParam
;
}
public
void
setEnterpriseIdParam
(
String
enterpriseIdParam
)
{
this
.
enterpriseIdParam
=
enterpriseIdParam
;
}
public
BasePageInfo
getPageInfo
()
{
return
pageInfo
;
}
public
void
setPageInfo
(
BasePageInfo
pageInfo
)
{
this
.
pageInfo
=
pageInfo
;
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/StaffClerkRelationService.java
View file @
05cdfaf2
...
...
@@ -185,4 +185,11 @@ public interface StaffClerkRelationService {
* @return
*/
List
<
StaffClerkRelationDTO
>
listByWxEnterpriseIdAndStaffId
(
String
wxEnterpriseId
,
Set
<
String
>
staffIdList
);
/**
* 获取企业下所有关联成员id
* @param enterpriseId
* @return
*/
List
<
String
>
listAllStaffIdByEnterpriseId
(
String
enterpriseId
,
String
wxEnterpriseId
);
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/StaffService.java
View file @
05cdfaf2
...
...
@@ -7,6 +7,7 @@ import java.util.List;
import
com.gic.haoban.base.api.common.BasePageInfo
;
import
com.gic.haoban.manage.api.dto.StaffDTO
;
import
com.gic.haoban.manage.service.entity.TabHaobanStaff
;
import
com.gic.haoban.manage.service.pojo.bo.StaffListBO
;
import
com.github.pagehelper.Page
;
public
interface
StaffService
{
...
...
@@ -17,9 +18,7 @@ public interface StaffService {
String
add
(
TabHaobanStaff
tab
);
Page
<
TabHaobanStaff
>
pageStaff
(
List
<
String
>
staffIds
,
Integer
activeFlag
,
String
keyword
,
List
<
String
>
departmentIds
,
String
wxEnterpriseId
,
Integer
relationFlag
,
String
permitState
,
Integer
occupy
);
Page
<
TabHaobanStaff
>
pageStaff
(
StaffListBO
staffListBO
);
void
updateByPrimaryKey
(
TabHaobanStaff
tab
);
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/StaffClerkRelationServiceImpl.java
View file @
05cdfaf2
...
...
@@ -561,4 +561,9 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
public
List
<
StaffClerkRelationDTO
>
listByWxEnterpriseIdAndStaffId
(
String
wxEnterpriseId
,
Set
<
String
>
staffIdList
)
{
return
this
.
mapper
.
listByWxEnterpriseIdAndStaffId
(
wxEnterpriseId
,
staffIdList
);
}
@Override
public
List
<
String
>
listAllStaffIdByEnterpriseId
(
String
enterpriseId
,
String
wxEnterpriseId
)
{
return
this
.
mapper
.
listAllStaffIdByEnterpriseId
(
enterpriseId
,
wxEnterpriseId
);
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/StaffServiceImpl.java
View file @
05cdfaf2
...
...
@@ -4,6 +4,7 @@ import java.util.Collections;
import
java.util.Date
;
import
java.util.List
;
import
com.gic.haoban.manage.service.pojo.bo.StaffListBO
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.logging.log4j.LogManager
;
...
...
@@ -86,9 +87,13 @@ public class StaffServiceImpl implements StaffService {
}
@Override
public
Page
<
TabHaobanStaff
>
pageStaff
(
List
<
String
>
staffIds
,
Integer
activeFlag
,
String
keyword
,
List
<
String
>
departmentIds
,
String
wxEnterpriseId
,
Integer
relationFlag
,
String
permitState
,
Integer
occupy
)
{
return
mapper
.
pageStaff
(
staffIds
,
activeFlag
,
keyword
,
departmentIds
,
wxEnterpriseId
,
relationFlag
,
permitState
,
occupy
);
public
Page
<
TabHaobanStaff
>
pageStaff
(
StaffListBO
staffListBO
)
{
if
(
null
==
staffListBO
){
return
new
Page
<>();
}
String
sortField
=
"a."
+
staffListBO
.
getSortField
();
staffListBO
.
setSortField
(
sortField
);
return
mapper
.
pageStaff
(
staffListBO
);
}
@Override
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/StaffApiServiceImpl.java
View file @
05cdfaf2
...
...
@@ -34,6 +34,7 @@ import com.gic.haoban.manage.service.config.Config;
import
com.gic.haoban.manage.service.dao.mapper.StaffDepartmentRelatedMapper
;
import
com.gic.haoban.manage.service.dao.mapper.StaffMapper
;
import
com.gic.haoban.manage.service.entity.*
;
import
com.gic.haoban.manage.service.pojo.bo.StaffListBO
;
import
com.gic.haoban.manage.service.service.*
;
import
com.gic.haoban.manage.service.service.chat.GroupChatService
;
import
com.gic.haoban.manage.service.util.EmojiFilterUtil
;
...
...
@@ -139,17 +140,30 @@ public class StaffApiServiceImpl implements StaffApiService {
}
@Override
public
Page
<
StaffDTO
>
pageStaff
(
List
<
String
>
departmentIds
,
Integer
activeFlag
,
String
keyword
,
BasePageInfo
pageInfo
,
Integer
relationFlag
,
String
wxEnterpriseId
,
String
permitState
,
Integer
occupy
)
{
public
Page
<
StaffDTO
>
pageStaff
(
StaffListDTO
staffListDTO
)
{
if
(
null
==
staffListDTO
){
return
new
Page
<>();
}
Integer
relationFlag
=
staffListDTO
.
getRelationFlag
();
String
wxEnterpriseId
=
staffListDTO
.
getWxEnterpriseId
();
BasePageInfo
pageInfo
=
staffListDTO
.
getPageInfo
();
String
enterpriseIdParam
=
staffListDTO
.
getEnterpriseIdParam
();
List
<
String
>
staffIds
=
new
ArrayList
<>();
if
(
relationFlag
!=
null
)
{
staffIds
=
staffClerkRelationService
.
listByWxEnterpriseId
(
wxEnterpriseId
);
if
(
CollectionUtils
.
isEmpty
(
staffIds
)
&&
relationFlag
==
1
){
return
new
Page
<>();
//查询所属品牌成员id
if
(
null
!=
enterpriseIdParam
){
staffIds
=
staffClerkRelationService
.
listAllStaffIdByEnterpriseId
(
enterpriseIdParam
,
wxEnterpriseId
);
}
else
{
if
(
relationFlag
!=
null
)
{
staffIds
=
staffClerkRelationService
.
listByWxEnterpriseId
(
wxEnterpriseId
);
if
(
CollectionUtils
.
isEmpty
(
staffIds
)
&&
relationFlag
==
1
){
return
new
Page
<>();
}
}
}
StaffListBO
staffListBO
=
EntityUtil
.
changeEntityByJSON
(
StaffListBO
.
class
,
staffListDTO
);
staffListBO
.
setStaffIds
(
staffIds
);
PageHelper
.
startPage
(
pageInfo
.
getPageNum
(),
pageInfo
.
getPageSize
());
Page
<
StaffDTO
>
page
=
PageUtil
.
changePageHelperToCurrentPage
(
staffService
.
pageStaff
(
staff
Ids
,
activeFlag
,
keyword
,
departmentIds
,
wxEnterpriseId
,
relationFlag
,
permitState
,
occupy
),
StaffDTO
.
class
);
Page
<
StaffDTO
>
page
=
PageUtil
.
changePageHelperToCurrentPage
(
staffService
.
pageStaff
(
staff
ListBO
),
StaffDTO
.
class
);
List
<
StaffDTO
>
staffDTOList
=
page
.
getResult
();
if
(
CollectionUtils
.
isEmpty
(
staffDTOList
))
{
return
new
Page
<>();
...
...
haoban-manage3-service/src/main/resources/mapper/StaffMapper.xml
View file @
05cdfaf2
...
...
@@ -288,7 +288,7 @@
and status_flag = 1
</select>
<select
id=
"pageStaff"
resultMap=
"BaseResultMap"
>
<select
id=
"pageStaff"
parameterType=
"com.gic.haoban.manage.service.pojo.bo.StaffListBO"
resultMap=
"BaseResultMap"
>
select
a.*
<if
test=
"departmentIds != null and departmentIds.size() > 0"
>
...
...
@@ -356,7 +356,7 @@
<if
test=
"departmentIds != null and departmentIds.size() > 0"
>
group by a.staff_id
</if>
order by
a.create_time desc
order by
${sortField} ${sortType}
</select>
<select
id=
"listByIds"
resultMap=
"BaseResultMap"
>
select
...
...
haoban-manage3-service/src/main/resources/mapper/TabHaobanStaffClerkRelationMapper.xml
View file @
05cdfaf2
...
...
@@ -467,4 +467,12 @@
</foreach>
</select>
<select
id=
"listAllStaffIdByEnterpriseId"
resultType=
"java.lang.String"
>
select a.staff_id
from tab_haoban_staff_clerk_relation a left join tab_haoban_staff b on b.staff_id = a.staff_id
where a.enterprise_id = #{enterpriseId} and a.status_flag=1 and b.status_flag = 1 and a.wx_enterprise_id = #{wxEnterpriseId}
GROUP BY
a.staff_id
</select>
</mapper>
\ No newline at end of file
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/StaffController.java
View file @
05cdfaf2
...
...
@@ -11,6 +11,7 @@ import com.gic.haoban.manage.api.dto.*;
import
com.gic.haoban.manage.api.dto.qdto.TransferActiveCodeQDTO
;
import
com.gic.haoban.manage.api.service.*
;
import
com.gic.haoban.manage.web.log.LogRecordUserServiceImpl
;
import
com.gic.haoban.manage.web.qo.StaffListQO
;
import
com.gic.haoban.manage.web.qo.TransferActiveCodeQO
;
import
com.gic.haoban.manage.web.vo.*
;
import
com.gic.log.record.anno.GicLogRecord
;
...
...
@@ -116,40 +117,24 @@ public class StaffController extends WebBaseController {
/**
* 分页查询员工列表
*
* @param departmentId 部门id
* @param activeFlag 激活状态 - 后期删除
* @param keyWord 关键字
* @param relationFlag 关联状态
* @param permitState 许可状态 0 未激活,1 正常有效,2 即将过期,3 已过期,可多传,按‘,’隔开
* @param occupy 其他占用许可页面标志,传1返回该页面数据
* @param sortField 排序字段 不传默认create_time
* @param sortType 排序类型 不传默认desc
* @param pageInfo 分页参数
* @return res
*/
@RequestMapping
(
"staff-list"
)
public
HaobanResponse
staffList
(
String
departmentId
,
Integer
activeFlag
,
Integer
relationFlag
,
String
keyWord
,
String
permitState
,
Integer
occupy
,
@RequestParam
(
defaultValue
=
"create_time"
)
String
sortField
,
@RequestParam
(
defaultValue
=
"desc"
)
String
sortType
,
BasePageInfo
pageInfo
)
{
public
HaobanResponse
staffList
(
@RequestBody
StaffListQO
qo
)
{
WebLoginDTO
login
=
AuthWebRequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
List
<
String
>
departmentIds
=
new
ArrayList
<>();
DepartmentDTO
departmentDTO
=
departmentApiService
.
selectById
(
departmentId
);
DepartmentDTO
departmentDTO
=
departmentApiService
.
selectById
(
qo
.
getDepartmentId
()
);
if
(
departmentDTO
!=
null
)
{
String
parentDepartmentId
=
departmentDTO
.
getParentDepartmentId
();
if
(!
"0"
.
equals
(
parentDepartmentId
))
{
departmentIds
=
departmentApiService
.
listSonDeptIdsByDepartmentId
(
departmentId
,
wxEnterpriseId
);
departmentIds
=
departmentApiService
.
listSonDeptIdsByDepartmentId
(
qo
.
getDepartmentId
()
,
wxEnterpriseId
);
}
}
//员工
Page
<
StaffDTO
>
page
=
staffApiService
.
pageStaff
(
departmentIds
,
activeFlag
,
keyWord
,
pageInfo
,
relationFlag
,
wxEnterpriseId
,
permitState
,
occupy
);
StaffListDTO
dto
=
EntityUtil
.
changeEntityByJSON
(
StaffListDTO
.
class
,
qo
);
dto
.
setWxEnterpriseId
(
wxEnterpriseId
);
dto
.
setDepartmentIds
(
departmentIds
);
Page
<
StaffDTO
>
page
=
staffApiService
.
pageStaff
(
dto
);
logger
.
info
(
"pages={},totalPage={}"
,
page
.
getCurrentPage
(),
page
.
getTotalPage
());
if
(
CollectionUtils
.
isNotEmpty
(
page
.
getResult
()))
{
...
...
@@ -476,9 +461,11 @@ public class StaffController extends WebBaseController {
* @Description 会员导出
*/
@RequestMapping
(
"staff-export"
)
public
HaobanResponse
staffExport
(
HttpServletRequest
request
,
HttpServletResponse
response
,
String
departmentId
,
Integer
activeFlag
,
Integer
relationFlag
,
String
keyWord
,
String
permitState
,
BasePageInfo
pageInf
o
)
{
public
HaobanResponse
staffExport
(
HttpServletRequest
request
,
HttpServletResponse
response
,
@RequestBody
StaffListQO
q
o
)
{
WebLoginDTO
login
=
AuthWebRequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
String
departmentId
=
qo
.
getDepartmentId
();
BasePageInfo
pageInfo
=
qo
.
getPageInfo
();
if
(
StringUtils
.
isBlank
(
departmentId
)){
DepartmentDTO
dto
=
this
.
departmentApiService
.
getRootByEnterpriseId
(
wxEnterpriseId
)
;
departmentId
=
dto
.
getDepartmentId
()
;
...
...
@@ -490,11 +477,15 @@ public class StaffController extends WebBaseController {
List
<
String
>
departmentIds
;
departmentIds
=
relationList
.
stream
().
map
(
DepartmentDTO:
:
getDepartmentId
).
collect
(
Collectors
.
toList
());
List
<
StaffDTO
>
staffAllList
=
Lists
.
newArrayListWithCapacity
(
5000
);
StaffListDTO
dto
=
EntityUtil
.
changeEntityByJSON
(
StaffListDTO
.
class
,
qo
);
dto
.
setWxEnterpriseId
(
wxEnterpriseId
);
dto
.
setDepartmentIds
(
departmentIds
);
pageInfo
.
setPageSize
(
Integer
.
MAX_VALUE
);
int
pageNum
=
1
;
while
(
true
)
{
pageInfo
.
setPageNum
(
pageNum
);
Page
<
StaffDTO
>
page
=
staffApiService
.
pageStaff
(
departmentIds
,
activeFlag
,
keyWord
,
pageInfo
,
relationFlag
,
wxEnterpriseId
,
permitState
,
null
);
dto
.
setPageInfo
(
pageInfo
);
Page
<
StaffDTO
>
page
=
staffApiService
.
pageStaff
(
dto
);
List
<
StaffDTO
>
list
=
page
.
getResult
();
if
(
CollectionUtils
.
isEmpty
(
list
))
{
break
;
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/qo/StaffListQO.java
0 → 100644
View file @
05cdfaf2
package
com
.
gic
.
haoban
.
manage
.
web
.
qo
;
import
com.gic.haoban.base.api.common.BasePageInfo
;
import
java.io.Serializable
;
/**
* @description: 列表查询VO
* @Author: wenhua
* @Date: 2023/5/17 10:45
*/
public
class
StaffListQO
implements
Serializable
{
/**
* 部门id
*/
private
String
departmentId
;
/**
* 激活状态 - 后期删除
*/
private
Integer
activeFlag
;
/**
* 关联状态
*/
private
Integer
relationFlag
;
/**
* 关键字
*/
private
String
keyWord
;
/**
* 许可状态 0 未激活,1 正常有效,2 即将过期,3 已过期,可多传,按‘,’隔开
*/
private
String
permitState
;
/**
* 其他占用许可页面标志,传1返回该页面数据
*/
private
Integer
occupy
;
/**
* 排序字段 不传默认create_time
*/
private
String
sortField
=
"create_time"
;
/**
* 排序类型 不传默认desc
*/
private
String
sortType
=
"desc"
;
/**
* 所属商户id
*/
private
String
enterpriseIdParam
;
/**
* 分页参数
*/
private
BasePageInfo
pageInfo
;
public
String
getDepartmentId
()
{
return
departmentId
;
}
public
void
setDepartmentId
(
String
departmentId
)
{
this
.
departmentId
=
departmentId
;
}
public
Integer
getActiveFlag
()
{
return
activeFlag
;
}
public
void
setActiveFlag
(
Integer
activeFlag
)
{
this
.
activeFlag
=
activeFlag
;
}
public
Integer
getRelationFlag
()
{
return
relationFlag
;
}
public
void
setRelationFlag
(
Integer
relationFlag
)
{
this
.
relationFlag
=
relationFlag
;
}
public
String
getKeyWord
()
{
return
keyWord
;
}
public
void
setKeyWord
(
String
keyWord
)
{
this
.
keyWord
=
keyWord
;
}
public
String
getPermitState
()
{
return
permitState
;
}
public
void
setPermitState
(
String
permitState
)
{
this
.
permitState
=
permitState
;
}
public
Integer
getOccupy
()
{
return
occupy
;
}
public
void
setOccupy
(
Integer
occupy
)
{
this
.
occupy
=
occupy
;
}
public
String
getSortField
()
{
return
sortField
;
}
public
void
setSortField
(
String
sortField
)
{
this
.
sortField
=
sortField
;
}
public
String
getSortType
()
{
return
sortType
;
}
public
void
setSortType
(
String
sortType
)
{
this
.
sortType
=
sortType
;
}
public
String
getEnterpriseIdParam
()
{
return
enterpriseIdParam
;
}
public
void
setEnterpriseIdParam
(
String
enterpriseIdParam
)
{
this
.
enterpriseIdParam
=
enterpriseIdParam
;
}
public
BasePageInfo
getPageInfo
()
{
return
pageInfo
;
}
public
void
setPageInfo
(
BasePageInfo
pageInfo
)
{
this
.
pageInfo
=
pageInfo
;
}
}
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