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
ccc81120
Commit
ccc81120
authored
Oct 20, 2021
by
xugaojun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【10月迭代】:成员列表查询修改
parent
d63cc730
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
113 additions
and
37 deletions
+113
-37
StaffDTO.java
...src/main/java/com/gic/haoban/manage/api/dto/StaffDTO.java
+48
-13
StaffApiService.java
...va/com/gic/haoban/manage/api/service/StaffApiService.java
+4
-8
TabHaobanStaffClerkRelationMapper.java
...service/dao/mapper/TabHaobanStaffClerkRelationMapper.java
+10
-0
StaffClerkRelationService.java
...ban/manage/service/service/StaffClerkRelationService.java
+9
-0
StaffClerkRelationServiceImpl.java
...e/service/service/impl/StaffClerkRelationServiceImpl.java
+5
-0
StaffApiServiceImpl.java
.../manage/service/service/out/impl/StaffApiServiceImpl.java
+0
-0
TabHaobanStaffClerkRelationMapper.xml
...in/resources/mapper/TabHaobanStaffClerkRelationMapper.xml
+12
-0
StaffController.java
...com/gic/haoban/manage/web/controller/StaffController.java
+25
-16
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/dto/StaffDTO.java
View file @
ccc81120
...
@@ -5,29 +5,53 @@ import java.util.Date;
...
@@ -5,29 +5,53 @@ import java.util.Date;
import
java.util.List
;
import
java.util.List
;
public
class
StaffDTO
implements
Serializable
{
public
class
StaffDTO
implements
Serializable
{
/**
* 员工id
*/
private
String
staffId
;
private
String
staffId
;
/**
* 企业微信id
*/
private
String
wxEnterpriseId
;
private
String
wxEnterpriseId
;
/**
* 微信用户id
*/
private
String
wxUserId
;
private
String
wxUserId
;
/**
* 手机号
*/
private
String
phoneNumber
;
private
String
phoneNumber
;
/**
* 员工姓名
*/
private
String
staffName
;
private
String
staffName
;
/**
* 国家码
*/
private
String
nationCode
;
private
String
nationCode
;
/**
* 昵称
*/
private
String
nickName
;
private
String
nickName
;
/**
* 性别
*/
private
Integer
sex
;
private
Integer
sex
;
/**
* 职位
*/
private
String
postion
;
private
String
postion
;
/**
* 激活状态
*/
private
Integer
activeFlag
;
private
Integer
activeFlag
;
/**
* 对外职务
*/
private
String
extendPostion
;
private
String
extendPostion
;
/**
* 状态
*/
private
Integer
statusFlag
;
private
Integer
statusFlag
;
private
Date
createTime
;
private
Date
createTime
;
...
@@ -59,6 +83,11 @@ public class StaffDTO implements Serializable{
...
@@ -59,6 +83,11 @@ public class StaffDTO implements Serializable{
private
long
memberCount
;
private
long
memberCount
;
private
String
clerkId
;
private
String
clerkId
;
/**
* 关联状态 1 已关联 0 未关联
* 关联状态为 员工是否关联某门店导购
*/
private
Integer
relationFlag
;
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
...
@@ -281,5 +310,11 @@ public class StaffDTO implements Serializable{
...
@@ -281,5 +310,11 @@ public class StaffDTO implements Serializable{
this
.
memberCount
=
memberCount
;
this
.
memberCount
=
memberCount
;
}
}
public
Integer
getRelationFlag
()
{
return
relationFlag
;
}
public
void
setRelationFlag
(
Integer
relationFlag
)
{
this
.
relationFlag
=
relationFlag
;
}
}
}
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/StaffApiService.java
View file @
ccc81120
package
com
.
gic
.
haoban
.
manage
.
api
.
service
;
package
com
.
gic
.
haoban
.
manage
.
api
.
service
;
import
java.util.List
;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.Page
;
import
com.gic.haoban.base.api.common.BasePageInfo
;
import
com.gic.haoban.base.api.common.BasePageInfo
;
import
com.gic.haoban.base.api.common.ServiceResponse
;
import
com.gic.haoban.base.api.common.ServiceResponse
;
import
com.gic.haoban.manage.api.dto.GicClerkDTO
;
import
com.gic.haoban.manage.api.dto.*
;
import
com.gic.haoban.manage.api.dto.StaffClerkRelationDTO
;
import
com.gic.haoban.manage.api.dto.StaffDTO
;
import
java.util.List
;
import
com.gic.haoban.manage.api.dto.StaffDepartmentRelatedDTO
;
import
com.gic.haoban.manage.api.dto.UserLoginLogDTO
;
public
interface
StaffApiService
{
public
interface
StaffApiService
{
...
@@ -27,7 +23,7 @@ public interface StaffApiService {
...
@@ -27,7 +23,7 @@ public interface StaffApiService {
public
List
<
StaffDepartmentRelatedDTO
>
listStaffDepartmentByStaffId
(
String
staffId
);
public
List
<
StaffDepartmentRelatedDTO
>
listStaffDepartmentByStaffId
(
String
staffId
);
public
Page
<
StaffDTO
>
pageStaff
(
List
<
String
>
departmentId
,
Integer
activeFlag
,
String
keyword
,
BasePageInfo
pageInfo
);
public
Page
<
StaffDTO
>
pageStaff
(
List
<
String
>
departmentId
,
Integer
activeFlag
,
String
keyword
,
BasePageInfo
pageInfo
,
Integer
relationFlag
);
public
void
del
(
String
staffDepartmentStaffRelatedId
);
public
void
del
(
String
staffDepartmentStaffRelatedId
);
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/TabHaobanStaffClerkRelationMapper.java
View file @
ccc81120
...
@@ -134,4 +134,13 @@ public interface TabHaobanStaffClerkRelationMapper {
...
@@ -134,4 +134,13 @@ public interface TabHaobanStaffClerkRelationMapper {
* @date 2021-07-15 16:24:27
* @date 2021-07-15 16:24:27
*/
*/
List
<
StaffClerkRelationDTO
>
listAll
();
List
<
StaffClerkRelationDTO
>
listAll
();
/**
* 查询有关联的员工id列表
*
* @param staffIdList 员工id列表
* @author: YongEn
* @return {@link List<String>}
*/
List
<
String
>
listRelationsStaffId
(
@Param
(
"staffIdList"
)
Set
<
String
>
staffIdList
);
}
}
\ No newline at end of file
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/StaffClerkRelationService.java
View file @
ccc81120
...
@@ -131,4 +131,13 @@ public interface StaffClerkRelationService {
...
@@ -131,4 +131,13 @@ public interface StaffClerkRelationService {
* @date 2021-07-15 16:26:17
* @date 2021-07-15 16:26:17
*/
*/
List
<
StaffClerkRelationDTO
>
listAll
();
List
<
StaffClerkRelationDTO
>
listAll
();
/**
* 查询有关联的员工id列表
*
* @param staffIdList 员工id列表
* @author: YongEn
* @return {@link Set<String>}
*/
List
<
String
>
listRelationsStaffId
(
Set
<
String
>
staffIdList
);
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/StaffClerkRelationServiceImpl.java
View file @
ccc81120
...
@@ -291,4 +291,9 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
...
@@ -291,4 +291,9 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
public
List
<
StaffClerkRelationDTO
>
listAll
()
{
public
List
<
StaffClerkRelationDTO
>
listAll
()
{
return
mapper
.
listAll
();
return
mapper
.
listAll
();
}
}
@Override
public
List
<
String
>
listRelationsStaffId
(
Set
<
String
>
staffIdList
)
{
return
mapper
.
listRelationsStaffId
(
staffIdList
);
}
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/StaffApiServiceImpl.java
View file @
ccc81120
This source diff could not be displayed because it is too large. You can
view the blob
instead.
haoban-manage3-service/src/main/resources/mapper/TabHaobanStaffClerkRelationMapper.xml
View file @
ccc81120
...
@@ -452,4 +452,15 @@
...
@@ -452,4 +452,15 @@
WHERE a.status_flag = 1
WHERE a.status_flag = 1
GROUP BY a.staff_id
GROUP BY a.staff_id
</select>
</select>
<select
id=
"listRelationsStaffId"
resultType=
"java.lang.String"
>
select staff_id
from tab_haoban_staff_clerk_relation
where staff_id in
<foreach
collection=
"staffIdList"
item=
"item"
separator=
","
open=
"("
close=
")"
>
#{item}
</foreach>
and status_flag = 1 group by staff_id;
</select>
</mapper>
</mapper>
\ No newline at end of file
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/StaffController.java
View file @
ccc81120
...
@@ -13,10 +13,10 @@ import com.gic.enterprise.api.dto.StoreDTO;
...
@@ -13,10 +13,10 @@ import com.gic.enterprise.api.dto.StoreDTO;
import
com.gic.enterprise.api.service.EnterpriseService
;
import
com.gic.enterprise.api.service.EnterpriseService
;
import
com.gic.enterprise.api.service.StoreService
;
import
com.gic.enterprise.api.service.StoreService
;
import
com.gic.haoban.base.api.common.BasePageInfo
;
import
com.gic.haoban.base.api.common.BasePageInfo
;
import
com.gic.haoban.base.api.common.PageResult
;
import
com.gic.haoban.base.api.common.ServiceResponse
;
import
com.gic.haoban.base.api.common.ServiceResponse
;
import
com.gic.haoban.common.utils.EntityUtil
;
import
com.gic.haoban.common.utils.EntityUtil
;
import
com.gic.haoban.common.utils.HaobanResponse
;
import
com.gic.haoban.common.utils.HaobanResponse
;
import
com.gic.haoban.common.utils.PageUtil
;
import
com.gic.haoban.manage.api.dto.*
;
import
com.gic.haoban.manage.api.dto.*
;
import
com.gic.haoban.manage.api.enums.ChannelCodeEnum
;
import
com.gic.haoban.manage.api.enums.ChannelCodeEnum
;
import
com.gic.haoban.manage.api.service.*
;
import
com.gic.haoban.manage.api.service.*
;
...
@@ -27,6 +27,7 @@ import com.gic.haoban.manage.web.vo.ClerkInfoVo;
...
@@ -27,6 +27,7 @@ import com.gic.haoban.manage.web.vo.ClerkInfoVo;
import
com.gic.haoban.manage.web.vo.StaffExportVO
;
import
com.gic.haoban.manage.web.vo.StaffExportVO
;
import
com.gic.haoban.manage.web.vo.StaffVO
;
import
com.gic.haoban.manage.web.vo.StaffVO
;
import
com.gic.wechat.api.service.qywx.QywxUserApiService
;
import
com.gic.wechat.api.service.qywx.QywxUserApiService
;
import
com.google.common.collect.Lists
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
...
@@ -115,24 +116,32 @@ public class StaffController extends WebBaseController {
...
@@ -115,24 +116,32 @@ public class StaffController extends WebBaseController {
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
staff
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
staff
);
}
}
/**
* 分页查询员工列表
*
* @param departmentId 部门id
* @param activeFlag 激活状态 - 后期删除
* @param keyWord 关键字
* @param relationFlag 关联状态
* @param pageInfo 分页参数
* @return res
*/
@RequestMapping
(
"staff-list"
)
@RequestMapping
(
"staff-list"
)
public
HaobanResponse
staffList
(
String
departmentId
,
Integer
activeFlag
,
String
keyWord
,
BasePageInfo
pageInfo
)
{
public
HaobanResponse
staffList
(
String
departmentId
,
Integer
activeFlag
,
Integer
relationFlag
,
String
keyWord
,
BasePageInfo
pageInfo
)
{
LoginDTO
login
=
(
LoginDTO
)
AuthRequestUtil
.
getLoginUser
();
LoginDTO
login
=
(
LoginDTO
)
AuthRequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
// 部门
List
<
String
>
departmentIdSet
=
new
ArrayList
<>();
List
<
DepartmentDTO
>
sonDepartmentList
=
departmentApiService
.
listSonByDepartmentIds
(
Lists
.
newArrayList
(
departmentId
),
login
.
getWxEnterpriseId
());
departmentIdSet
.
add
(
departmentId
);
List
<
DepartmentDTO
>
sonDepartmentList
=
departmentApiService
.
listSonByDepartmentIds
(
departmentIdSet
,
wxEnterpriseId
);
List
<
String
>
departmentIds
=
sonDepartmentList
.
stream
().
map
(
DepartmentDTO:
:
getDepartmentId
).
collect
(
Collectors
.
toList
());
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
();
Page
<
StaffDTO
>
page
=
staffApiService
.
pageStaff
(
departmentIds
,
activeFlag
,
keyWord
,
pageInfo
,
relationFlag
);
logger
.
info
(
"pages={},totalPage={}"
,
page
.
getCurrentPage
(),
page
.
getTotalPage
());
logger
.
info
(
"pages={},totalPage={}"
,
page
.
getCurrentPage
(),
page
.
getTotalPage
());
PageResult
<
StaffDTO
>
pageVo
=
new
PageResult
<>();
pageVo
.
setList
(
list
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
PageUtil
.
getPageInfo
(
page
));
pageVo
.
setPageNum
(
page
.
getCurrentPage
());
pageVo
.
setPages
(
page
.
getPages
());
pageVo
.
setPageSize
(
page
.
getPageSize
());
pageVo
.
setTotal
(
page
.
getTotalCount
());
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
pageVo
);
}
}
@RequestMapping
(
"staff-del"
)
@RequestMapping
(
"staff-del"
)
...
@@ -475,7 +484,7 @@ public class StaffController extends WebBaseController {
...
@@ -475,7 +484,7 @@ public class StaffController extends WebBaseController {
List
<
DepartmentDTO
>
relationList
=
departmentApiService
.
listSonByDepartmentIds
(
departmentIdSet
,
wxEnterpriseId
);
List
<
DepartmentDTO
>
relationList
=
departmentApiService
.
listSonByDepartmentIds
(
departmentIdSet
,
wxEnterpriseId
);
Map
<
String
,
DepartmentDTO
>
departmentMap
=
relationList
.
stream
().
collect
(
Collectors
.
toMap
(
DepartmentDTO:
:
getDepartmentId
,
s
->
s
));
Map
<
String
,
DepartmentDTO
>
departmentMap
=
relationList
.
stream
().
collect
(
Collectors
.
toMap
(
DepartmentDTO:
:
getDepartmentId
,
s
->
s
));
List
<
String
>
departmentIds
=
relationList
.
stream
().
map
(
DepartmentDTO:
:
getDepartmentId
).
collect
(
Collectors
.
toList
());
List
<
String
>
departmentIds
=
relationList
.
stream
().
map
(
DepartmentDTO:
:
getDepartmentId
).
collect
(
Collectors
.
toList
());
Page
<
StaffDTO
>
page
=
staffApiService
.
pageStaff
(
departmentIds
,
activeFlag
,
keyWord
,
pageInfo
);
Page
<
StaffDTO
>
page
=
staffApiService
.
pageStaff
(
departmentIds
,
activeFlag
,
keyWord
,
pageInfo
,
null
);
List
<
StaffDTO
>
list
=
page
.
getResult
();
List
<
StaffDTO
>
list
=
page
.
getResult
();
List
<
StaffExportVO
>
voList
=
new
ArrayList
<>();
List
<
StaffExportVO
>
voList
=
new
ArrayList
<>();
for
(
StaffDTO
staffDTO
:
list
)
{
for
(
StaffDTO
staffDTO
:
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