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
489bfb20
Commit
489bfb20
authored
May 24, 2022
by
墨竹
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:通讯录修改
parent
51629c18
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
91 additions
and
59 deletions
+91
-59
DepartmentApiService.java
...m/gic/haoban/manage/api/service/DepartmentApiService.java
+11
-0
StaffApiService.java
...va/com/gic/haoban/manage/api/service/StaffApiService.java
+2
-1
StaffMapper.java
...com/gic/haoban/manage/service/dao/mapper/StaffMapper.java
+6
-2
StaffClerkRelationService.java
...ban/manage/service/service/StaffClerkRelationService.java
+1
-1
StaffDepartmentRelatedService.java
...manage/service/service/StaffDepartmentRelatedService.java
+7
-0
StaffService.java
...a/com/gic/haoban/manage/service/service/StaffService.java
+2
-2
ClerkMainStoreRelatedServiceImpl.java
...ervice/service/impl/ClerkMainStoreRelatedServiceImpl.java
+1
-1
StaffClerkRelationServiceImpl.java
...e/service/service/impl/StaffClerkRelationServiceImpl.java
+2
-2
StaffServiceImpl.java
.../haoban/manage/service/service/impl/StaffServiceImpl.java
+6
-3
DepartmentApiServiceImpl.java
...ge/service/service/out/impl/DepartmentApiServiceImpl.java
+17
-0
StaffApiServiceImpl.java
.../manage/service/service/out/impl/StaffApiServiceImpl.java
+12
-36
StaffClerkRelationApiServiceImpl.java
...ce/service/out/impl/StaffClerkRelationApiServiceImpl.java
+1
-1
StaffMapper.xml
...manage3-service/src/main/resources/mapper/StaffMapper.xml
+19
-6
StaffController.java
...com/gic/haoban/manage/web/controller/StaffController.java
+4
-4
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/DepartmentApiService.java
View file @
489bfb20
...
@@ -183,4 +183,15 @@ public interface DepartmentApiService {
...
@@ -183,4 +183,15 @@ public interface DepartmentApiService {
*/
*/
List
<
DepartmentShortDTO
>
listAllDepartment
(
String
wxEnterpriseId
);
List
<
DepartmentShortDTO
>
listAllDepartment
(
String
wxEnterpriseId
);
/**
* 获取子部门ids
*
* @param departmentId 部门id设置
* @param wxEnterpriseId wx企业标识
* @return {@link List }<{@link String }>
* @author mozhu
* @date 2022-05-24 17:45:57
*/
List
<
String
>
listSonDeptIdsByDepartmentId
(
String
departmentId
,
String
wxEnterpriseId
);
}
}
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/StaffApiService.java
View file @
489bfb20
...
@@ -23,7 +23,8 @@ public interface StaffApiService {
...
@@ -23,7 +23,8 @@ public interface StaffApiService {
List
<
StaffDepartmentRelatedDTO
>
listStaffDepartmentByStaffId
(
String
staffId
);
List
<
StaffDepartmentRelatedDTO
>
listStaffDepartmentByStaffId
(
String
staffId
);
Page
<
StaffDTO
>
pageStaff
(
List
<
String
>
departmentId
,
Integer
activeFlag
,
String
keyword
,
BasePageInfo
pageInfo
,
Integer
relationFlag
);
Page
<
StaffDTO
>
pageStaff
(
List
<
String
>
departmentId
,
Integer
activeFlag
,
String
keyword
,
BasePageInfo
pageInfo
,
Integer
relationFlag
,
String
wxEnterpriseId
);
@Deprecated
@Deprecated
void
del
(
String
staffDepartmentStaffRelatedId
);
void
del
(
String
staffDepartmentStaffRelatedId
);
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/StaffMapper.java
View file @
489bfb20
...
@@ -5,7 +5,6 @@ import com.github.pagehelper.Page;
...
@@ -5,7 +5,6 @@ import com.github.pagehelper.Page;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Set
;
public
interface
StaffMapper
{
public
interface
StaffMapper
{
int
deleteByPrimaryKey
(
String
staffId
);
int
deleteByPrimaryKey
(
String
staffId
);
...
@@ -24,7 +23,12 @@ public interface StaffMapper {
...
@@ -24,7 +23,12 @@ public interface StaffMapper {
List
<
TabHaobanStaff
>
listLikeName
(
@Param
(
"staffName"
)
String
staffName
,
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
);
List
<
TabHaobanStaff
>
listLikeName
(
@Param
(
"staffName"
)
String
staffName
,
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
);
Page
<
TabHaobanStaff
>
pageStaff
(
@Param
(
"staffIds"
)
Set
<
String
>
staffIds
,
@Param
(
"activeFlag"
)
Integer
activeFlag
,
@Param
(
"keyword"
)
String
keyword
);
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
);
/**
/**
* 选择用户id和企业标识
* 选择用户id和企业标识
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/StaffClerkRelationService.java
View file @
489bfb20
...
@@ -82,7 +82,7 @@ public interface StaffClerkRelationService {
...
@@ -82,7 +82,7 @@ public interface StaffClerkRelationService {
List
<
StaffClerkRelationDTO
>
listByClerkIds
(
List
<
String
>
clerkList
);
List
<
StaffClerkRelationDTO
>
listByClerkIds
(
List
<
String
>
clerkList
);
List
<
StaffClerkRelationDTO
>
lisByStaffId
(
String
wxEnterpriseId
,
String
staffId
);
List
<
StaffClerkRelationDTO
>
lis
t
ByStaffId
(
String
wxEnterpriseId
,
String
staffId
);
/**
/**
* 保存
* 保存
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/StaffDepartmentRelatedService.java
View file @
489bfb20
...
@@ -23,6 +23,13 @@ public interface StaffDepartmentRelatedService {
...
@@ -23,6 +23,13 @@ public interface StaffDepartmentRelatedService {
int
countByDepartmentId
(
String
departmentId
);
int
countByDepartmentId
(
String
departmentId
);
/**
* 效率很低
* @param departmentId
* @param keyword
* @return
*/
@Deprecated
List
<
TabHaobanStaffDepartmentRelated
>
listByDepartmentIdByKeyword
(
List
<
String
>
departmentId
,
String
keyword
);
List
<
TabHaobanStaffDepartmentRelated
>
listByDepartmentIdByKeyword
(
List
<
String
>
departmentId
,
String
keyword
);
List
<
TabHaobanStaffDepartmentRelated
>
listByWxUserId
(
String
wxUserId
);
List
<
TabHaobanStaffDepartmentRelated
>
listByWxUserId
(
String
wxUserId
);
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/StaffService.java
View file @
489bfb20
...
@@ -5,7 +5,6 @@ import com.gic.haoban.manage.service.entity.TabHaobanStaff;
...
@@ -5,7 +5,6 @@ import com.gic.haoban.manage.service.entity.TabHaobanStaff;
import
com.github.pagehelper.Page
;
import
com.github.pagehelper.Page
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Set
;
public
interface
StaffService
{
public
interface
StaffService
{
...
@@ -15,7 +14,8 @@ public interface StaffService {
...
@@ -15,7 +14,8 @@ public interface StaffService {
String
add
(
TabHaobanStaff
tab
);
String
add
(
TabHaobanStaff
tab
);
Page
<
TabHaobanStaff
>
pageStaff
(
Set
<
String
>
staffIds
,
Integer
activeFlag
,
String
keyword
);
Page
<
TabHaobanStaff
>
pageStaff
(
List
<
String
>
staffIds
,
Integer
activeFlag
,
String
keyword
,
List
<
String
>
departmentIds
,
String
wxEnterpriseId
,
Integer
relationFlag
);
void
updateByPrimaryKey
(
TabHaobanStaff
tab
);
void
updateByPrimaryKey
(
TabHaobanStaff
tab
);
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/ClerkMainStoreRelatedServiceImpl.java
View file @
489bfb20
...
@@ -99,7 +99,7 @@ public class ClerkMainStoreRelatedServiceImpl implements ClerkMainStoreRelatedSe
...
@@ -99,7 +99,7 @@ public class ClerkMainStoreRelatedServiceImpl implements ClerkMainStoreRelatedSe
* @return
* @return
*/
*/
private
TabHaobanClerkMainStoreRelated
setStaffMainStore
(
String
staffId
,
String
wxEnterpriseId
)
{
private
TabHaobanClerkMainStoreRelated
setStaffMainStore
(
String
staffId
,
String
wxEnterpriseId
)
{
List
<
StaffClerkRelationDTO
>
clerkRelationDTOS
=
staffClerkRelationService
.
lisByStaffId
(
wxEnterpriseId
,
staffId
);
List
<
StaffClerkRelationDTO
>
clerkRelationDTOS
=
staffClerkRelationService
.
lis
t
ByStaffId
(
wxEnterpriseId
,
staffId
);
if
(
CollectionUtils
.
isEmpty
(
clerkRelationDTOS
))
{
if
(
CollectionUtils
.
isEmpty
(
clerkRelationDTOS
))
{
return
null
;
return
null
;
}
}
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/StaffClerkRelationServiceImpl.java
View file @
489bfb20
...
@@ -138,7 +138,7 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
...
@@ -138,7 +138,7 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
}
}
String
staffId
=
staffClerkRelation
.
getStaffId
();
String
staffId
=
staffClerkRelation
.
getStaffId
();
String
wxEnterpriseId
=
staffClerkRelation
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
staffClerkRelation
.
getWxEnterpriseId
();
List
<
StaffClerkRelationDTO
>
list
=
this
.
lisByStaffId
(
wxEnterpriseId
,
staffId
);
List
<
StaffClerkRelationDTO
>
list
=
this
.
lis
t
ByStaffId
(
wxEnterpriseId
,
staffId
);
if
(
list
!=
null
&&
list
.
size
()
==
1
)
{
if
(
list
!=
null
&&
list
.
size
()
==
1
)
{
clerkMainStoreRelatedService
.
setMainStore
(
staffId
,
staffClerkRelation
.
getStoreId
(),
wxEnterpriseId
);
clerkMainStoreRelatedService
.
setMainStore
(
staffId
,
staffClerkRelation
.
getStoreId
(),
wxEnterpriseId
);
}
}
...
@@ -240,7 +240,7 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
...
@@ -240,7 +240,7 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
}
}
@Override
@Override
public
List
<
StaffClerkRelationDTO
>
lisByStaffId
(
String
wxEnterpriseId
,
String
staffId
)
{
public
List
<
StaffClerkRelationDTO
>
lis
t
ByStaffId
(
String
wxEnterpriseId
,
String
staffId
)
{
return
EntityUtil
.
changeEntityListByJSON
(
StaffClerkRelationDTO
.
class
,
mapper
.
lisByStaffId
(
wxEnterpriseId
,
staffId
));
return
EntityUtil
.
changeEntityListByJSON
(
StaffClerkRelationDTO
.
class
,
mapper
.
lisByStaffId
(
wxEnterpriseId
,
staffId
));
}
}
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/StaffServiceImpl.java
View file @
489bfb20
...
@@ -16,7 +16,10 @@ import org.apache.logging.log4j.Logger;
...
@@ -16,7 +16,10 @@ import org.apache.logging.log4j.Logger;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.util.*
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
@Service
@Service
...
@@ -61,8 +64,8 @@ public class StaffServiceImpl implements StaffService {
...
@@ -61,8 +64,8 @@ public class StaffServiceImpl implements StaffService {
}
}
@Override
@Override
public
Page
<
TabHaobanStaff
>
pageStaff
(
Set
<
String
>
staffIds
,
Integer
activeFlag
,
String
keyword
)
{
public
Page
<
TabHaobanStaff
>
pageStaff
(
List
<
String
>
staffIds
,
Integer
activeFlag
,
String
keyword
,
List
<
String
>
departmentIds
,
String
wxEnterpriseId
,
Integer
relationFlag
)
{
return
mapper
.
pageStaff
(
staffIds
,
activeFlag
,
keyword
);
return
mapper
.
pageStaff
(
staffIds
,
activeFlag
,
keyword
,
departmentIds
,
wxEnterpriseId
,
relationFlag
);
}
}
@Override
@Override
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/DepartmentApiServiceImpl.java
View file @
489bfb20
...
@@ -532,4 +532,21 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
...
@@ -532,4 +532,21 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
List
<
DepartmentShortDTO
>
list
=
departmentService
.
listAllDepartment
(
wxEnterpriseId
);
List
<
DepartmentShortDTO
>
list
=
departmentService
.
listAllDepartment
(
wxEnterpriseId
);
return
list
;
return
list
;
}
}
@Override
public
List
<
String
>
listSonDeptIdsByDepartmentId
(
String
departmentId
,
String
wxEnterpriseId
)
{
List
<
String
>
list
=
new
ArrayList
<>();
String
chainId
=
""
;
TabHaobanDepartment
department
=
departmentService
.
selectById
(
departmentId
);
if
(
department
!=
null
)
{
chainId
=
department
.
getChainId
()
+
Constant
.
ID_SEPARATOR
+
departmentId
;
}
list
.
add
(
departmentId
);
if
(
StringUtils
.
isNotBlank
(
chainId
))
{
List
<
TabHaobanDepartment
>
tabList
=
departmentService
.
listByChainId
(
chainId
,
wxEnterpriseId
);
List
<
String
>
departmentIds
=
tabList
.
stream
().
map
(
TabHaobanDepartment:
:
getDepartmentId
).
collect
(
Collectors
.
toList
());
list
.
addAll
(
departmentIds
);
}
return
list
;
}
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/StaffApiServiceImpl.java
View file @
489bfb20
...
@@ -46,7 +46,6 @@ import org.springframework.stereotype.Service;
...
@@ -46,7 +46,6 @@ import org.springframework.stereotype.Service;
import
java.util.*
;
import
java.util.*
;
import
java.util.concurrent.TimeUnit
;
import
java.util.concurrent.TimeUnit
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
@Service
@Service
...
@@ -198,46 +197,23 @@ public class StaffApiServiceImpl implements StaffApiService {
...
@@ -198,46 +197,23 @@ public class StaffApiServiceImpl implements StaffApiService {
}
}
@Override
@Override
public
Page
<
StaffDTO
>
pageStaff
(
List
<
String
>
departmentIds
,
Integer
activeFlag
,
String
keyword
,
BasePageInfo
pageInfo
,
Integer
relationFlag
)
{
public
Page
<
StaffDTO
>
pageStaff
(
List
<
String
>
departmentIds
,
Integer
activeFlag
,
String
keyword
,
BasePageInfo
pageInfo
,
Integer
relationFlag
,
String
wxEnterpriseId
)
{
// 部门 员工列表
List
<
String
>
staffIds
=
new
ArrayList
<>();
List
<
TabHaobanStaffDepartmentRelated
>
list
=
staffDepartmentRelatedService
.
listByDepartmentIdByKeyword
(
departmentIds
,
keyword
);
if
(
relationFlag
!=
null
)
{
List
<
TabHaobanStaffClerkRelation
>
relationList
=
staffClerkRelationService
.
listByWxEnterpriseId
(
wxEnterpriseId
);
if
(
CollectionUtils
.
isEmpty
(
list
))
{
staffIds
=
relationList
.
stream
().
map
(
TabHaobanStaffClerkRelation:
:
getStaffId
).
collect
(
Collectors
.
toList
());
return
new
Page
<>();
}
}
// 当前部门的所有员工id列表
Set
<
String
>
staffIdSet
=
list
.
stream
().
map
(
TabHaobanStaffDepartmentRelated:
:
getStaffId
).
collect
(
Collectors
.
toSet
());
// 查询当前部门所有已关联导购的员工id列表
List
<
String
>
relationsStaffIdList
=
staffClerkRelationService
.
listRelationsStaffId
(
staffIdSet
);
Set
<
String
>
relationStaffSet
=
new
HashSet
<>(
relationsStaffIdList
);
logger
.
info
(
"已关联的员工id列表:{}"
,
JSON
.
toJSONString
(
relationStaffSet
));
Set
<
String
>
queryStaffSet
=
filterByRelationFlag
(
staffIdSet
,
relationStaffSet
,
relationFlag
);
if
(
CollectionUtils
.
isEmpty
(
queryStaffSet
))
{
return
new
Page
<>();
}
// 分页
PageHelper
.
startPage
(
pageInfo
.
getPageNum
(),
pageInfo
.
getPageSize
());
PageHelper
.
startPage
(
pageInfo
.
getPageNum
(),
pageInfo
.
getPageSize
());
Page
<
StaffDTO
>
page
=
PageUtil
.
changePageHelperToCurrentPage
(
staffService
.
pageStaff
(
queryStaffSet
,
activeFlag
,
""
),
StaffDTO
.
class
);
Page
<
StaffDTO
>
page
=
PageUtil
.
changePageHelperToCurrentPage
(
staffService
.
pageStaff
(
staffIds
,
activeFlag
,
keyword
,
departmentIds
,
wxEnterpriseId
,
relationFlag
),
StaffDTO
.
class
);
List
<
StaffDTO
>
staffDTOList
=
page
.
getResult
();
if
(
CollectionUtils
.
isEmpty
(
page
.
getResult
()
))
{
if
(
CollectionUtils
.
isEmpty
(
staffDTOList
))
{
return
new
Page
<>();
return
new
Page
<>();
}
}
staffDTOList
.
forEach
(
one
->
{
Map
<
String
,
TabHaobanStaffDepartmentRelated
>
map
=
list
.
stream
()
//one.setDepartmentIds(Objects.isNull(related) ? null : related.getDepartmentId());
.
collect
(
Collectors
.
toMap
(
TabHaobanStaffDepartmentRelated:
:
getStaffId
,
Function
.
identity
(),
(
s1
,
s2
)
->
s2
));
page
.
getResult
().
forEach
(
one
->
{
TabHaobanStaffDepartmentRelated
related
=
map
.
get
(
one
.
getStaffId
());
one
.
setDepartmentIds
(
Objects
.
isNull
(
related
)
?
null
:
related
.
getDepartmentId
());
// 关联状态
// 关联状态
one
.
setRelationFlag
(
relationStaffSet
.
contains
(
one
.
getStaffId
())
?
1
:
0
);
List
<
StaffClerkRelationDTO
>
staffClerkRelationDTOS
=
staffClerkRelationService
.
listByStaffId
(
wxEnterpriseId
,
one
.
getStaffId
());
one
.
setRelationFlag
(
CollectionUtils
.
isNotEmpty
(
staffClerkRelationDTOS
)
?
1
:
0
);
});
});
return
page
;
return
page
;
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/StaffClerkRelationApiServiceImpl.java
View file @
489bfb20
...
@@ -405,7 +405,7 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
...
@@ -405,7 +405,7 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
}
}
String
staffId
=
staffClerkRelation
.
getStaffId
();
String
staffId
=
staffClerkRelation
.
getStaffId
();
String
wxEnterpriseId
=
staffClerkRelation
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
staffClerkRelation
.
getWxEnterpriseId
();
List
<
StaffClerkRelationDTO
>
list
=
staffClerkRelatinService
.
lisByStaffId
(
wxEnterpriseId
,
staffId
);
List
<
StaffClerkRelationDTO
>
list
=
staffClerkRelatinService
.
lis
t
ByStaffId
(
wxEnterpriseId
,
staffId
);
if
(
list
!=
null
&&
list
.
size
()
==
1
)
{
if
(
list
!=
null
&&
list
.
size
()
==
1
)
{
clerkMainStoreRelatedService
.
setMainStore
(
staffId
,
staffClerkRelation
.
getStoreId
(),
wxEnterpriseId
);
clerkMainStoreRelatedService
.
setMainStore
(
staffId
,
staffClerkRelation
.
getStoreId
(),
wxEnterpriseId
);
}
}
...
...
haoban-manage3-service/src/main/resources/mapper/StaffMapper.xml
View file @
489bfb20
...
@@ -275,20 +275,33 @@
...
@@ -275,20 +275,33 @@
<select
id=
"pageStaff"
resultMap=
"BaseResultMap"
>
<select
id=
"pageStaff"
resultMap=
"BaseResultMap"
>
select
select
<include
refid=
"Base_Column_List"
/>
<include
refid=
"Base_Column_List"
/>
from tab_haoban_staff
from tab_haoban_staff a
where status_flag = 1
left join tab_haoban_staff_department_related b on a.staff_id = b.staff_id
where a.status_flag = 1 and a.wx_enterprise_id = #{wxEnterpriseId}
<if
test=
"keyword != null and keyword != ''"
>
<if
test=
"keyword != null and keyword != ''"
>
and (
staff_name like CONCAT('%',#{keyword},'%') or
phone_number like CONCAT('%',#{keyword},'%'))
and (
a.staff_name like CONCAT('%',#{keyword},'%') or a.
phone_number like CONCAT('%',#{keyword},'%'))
</if>
</if>
<if
test=
"activeFlag != null"
>
<if
test=
"activeFlag != null"
>
and active_flag = #{activeFlag}
and a
.a
ctive_flag = #{activeFlag}
</if>
</if>
<if
test=
"staffIds != null and staffIds.size() > 0"
>
<if
test=
"staffIds != null and staffIds.size() > 0
and relationFlag != null and relationFlag == 1
"
>
and staff_id IN
and
a.
staff_id IN
<foreach
collection=
"staffIds"
item=
"id"
index=
"index"
open=
"("
close=
")"
separator=
","
>
<foreach
collection=
"staffIds"
item=
"id"
index=
"index"
open=
"("
close=
")"
separator=
","
>
#{id,jdbcType=VARCHAR}
#{id,jdbcType=VARCHAR}
</foreach>
</foreach>
</if>
</if>
<if
test=
"staffIds != null and staffIds.size() > 0 and relationFlag != null and relationFlag == 0 "
>
and a.staff_id not in
<foreach
collection=
"staffIds"
item=
"id"
index=
"index"
open=
"("
close=
")"
separator=
","
>
#{id,jdbcType=VARCHAR}
</foreach>
</if>
<if
test=
"departmentIds != null and departmentIds.size() > 0"
>
and b.department_id IN
<foreach
collection=
"departmentIds"
item=
"id"
index=
"index"
open=
"("
close=
")"
separator=
","
>
#{id,jdbcType=VARCHAR}
</foreach>
</if>
order by create_time desc
order by create_time desc
</select>
</select>
<select
id=
"listByIds"
resultMap=
"BaseResultMap"
>
<select
id=
"listByIds"
resultMap=
"BaseResultMap"
>
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/StaffController.java
View file @
489bfb20
...
@@ -135,11 +135,11 @@ public class StaffController extends WebBaseController {
...
@@ -135,11 +135,11 @@ public class StaffController extends WebBaseController {
String
keyWord
,
String
keyWord
,
BasePageInfo
pageInfo
)
{
BasePageInfo
pageInfo
)
{
WebLoginDTO
login
=
AuthWebRequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWebRequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
// 部门
// 部门
List
<
DepartmentDTO
>
sonDepartmentList
=
departmentApiService
.
listSonByDepartmentIds
(
Lists
.
newArrayList
(
departmentId
),
login
.
getWxEnterpriseId
());
List
<
String
>
departmentIds
=
departmentApiService
.
listSonDeptIdsByDepartmentId
(
departmentId
,
wxEnterpriseId
);
List
<
String
>
departmentIds
=
sonDepartmentList
.
stream
().
map
(
DepartmentDTO:
:
getDepartmentId
).
collect
(
Collectors
.
toList
());
//员工
//员工
Page
<
StaffDTO
>
page
=
staffApiService
.
pageStaff
(
departmentIds
,
activeFlag
,
keyWord
,
pageInfo
,
relationFlag
);
Page
<
StaffDTO
>
page
=
staffApiService
.
pageStaff
(
departmentIds
,
activeFlag
,
keyWord
,
pageInfo
,
relationFlag
,
wxEnterpriseId
);
logger
.
info
(
"pages={},totalPage={}"
,
page
.
getCurrentPage
(),
page
.
getTotalPage
());
logger
.
info
(
"pages={},totalPage={}"
,
page
.
getCurrentPage
(),
page
.
getTotalPage
());
...
@@ -492,7 +492,7 @@ public class StaffController extends WebBaseController {
...
@@ -492,7 +492,7 @@ public class StaffController extends WebBaseController {
int
pageNum
=
1
;
int
pageNum
=
1
;
while
(
true
)
{
while
(
true
)
{
pageInfo
.
setPageNum
(
pageNum
);
pageInfo
.
setPageNum
(
pageNum
);
Page
<
StaffDTO
>
page
=
staffApiService
.
pageStaff
(
departmentIds
,
activeFlag
,
keyWord
,
pageInfo
,
relationFlag
);
Page
<
StaffDTO
>
page
=
staffApiService
.
pageStaff
(
departmentIds
,
activeFlag
,
keyWord
,
pageInfo
,
relationFlag
,
wxEnterpriseId
);
List
<
StaffDTO
>
list
=
page
.
getResult
();
List
<
StaffDTO
>
list
=
page
.
getResult
();
if
(
CollectionUtils
.
isEmpty
(
list
))
{
if
(
CollectionUtils
.
isEmpty
(
list
))
{
break
;
break
;
...
...
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