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
3852f241
Commit
3852f241
authored
Feb 22, 2022
by
fudahua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:先查看user是否存在再看手机号是否存在
parent
f58de234
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
49 additions
and
5 deletions
+49
-5
StaffApiService.java
...va/com/gic/haoban/manage/api/service/StaffApiService.java
+8
-0
StaffServiceImpl.java
.../haoban/manage/service/service/impl/StaffServiceImpl.java
+8
-3
StaffApiServiceImpl.java
.../manage/service/service/out/impl/StaffApiServiceImpl.java
+30
-0
WxEnterpriseInfoController.java
...ban/manage/web/controller/WxEnterpriseInfoController.java
+3
-2
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/StaffApiService.java
View file @
3852f241
...
@@ -56,6 +56,14 @@ public interface StaffApiService {
...
@@ -56,6 +56,14 @@ public interface StaffApiService {
*/
*/
StaffDTO
selectByUserIdAndEnterpriseId
(
String
userId
,
String
wxEnterpriseId
);
StaffDTO
selectByUserIdAndEnterpriseId
(
String
userId
,
String
wxEnterpriseId
);
/**
* 没手机号的时候需要重新刷
* @param userId
* @param wxEnterpriseId
* @return
*/
StaffDTO
getByUserIdAndReflushWhenNoPhone
(
String
userId
,
String
wxEnterpriseId
);
StaffDepartmentRelatedDTO
getDepartmentIdAndStaffId
(
String
departmentId
,
String
staffId
);
StaffDepartmentRelatedDTO
getDepartmentIdAndStaffId
(
String
departmentId
,
String
staffId
);
int
countByDepartmentId
(
String
departmentId
);
int
countByDepartmentId
(
String
departmentId
);
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/StaffServiceImpl.java
View file @
3852f241
...
@@ -84,16 +84,21 @@ public class StaffServiceImpl implements StaffService {
...
@@ -84,16 +84,21 @@ public class StaffServiceImpl implements StaffService {
List
<
String
>
userIds
=
new
ArrayList
<>();
List
<
String
>
userIds
=
new
ArrayList
<>();
userIds
.
add
(
userId
);
userIds
.
add
(
userId
);
List
<
TabHaobanStaff
>
staffs
=
mapper
.
listByUserIdsAndWxEnterpriseId
(
userIds
,
wxEnterpriseId
);
List
<
TabHaobanStaff
>
staffs
=
mapper
.
listByUserIdsAndWxEnterpriseId
(
userIds
,
wxEnterpriseId
);
//需要去除多余的
if
(
CollectionUtils
.
isEmpty
(
staffs
))
{
if
(
CollectionUtils
.
isNotEmpty
(
staffs
)&&
staffs
.
size
()>
1
)
{
return
this
.
selectByPhoneNumberAndEnterpriseId
(
phoneNumber
,
wxEnterpriseId
);
}
if
(
staffs
.
size
()==
1
)
{
return
staffs
.
get
(
0
);
//需要去除多余的
}
else
if
(
staffs
.
size
()>
1
)
{
Map
<
String
,
TabHaobanStaff
>
staffMap
=
staffs
.
stream
().
collect
(
Collectors
.
toMap
(
dto
->
dto
.
getStaffId
(),
dto
->
dto
,(
o
,
n
)->
n
));
Map
<
String
,
TabHaobanStaff
>
staffMap
=
staffs
.
stream
().
collect
(
Collectors
.
toMap
(
dto
->
dto
.
getStaffId
(),
dto
->
dto
,(
o
,
n
)->
n
));
List
<
String
>
relationStaffIds
=
staffClerkRelationService
.
listRelationsStaffId
(
staffMap
.
keySet
());
List
<
String
>
relationStaffIds
=
staffClerkRelationService
.
listRelationsStaffId
(
staffMap
.
keySet
());
if
(
CollectionUtils
.
isNotEmpty
(
relationStaffIds
))
{
if
(
CollectionUtils
.
isNotEmpty
(
relationStaffIds
))
{
return
staffMap
.
get
(
relationStaffIds
.
get
(
0
));
return
staffMap
.
get
(
relationStaffIds
.
get
(
0
));
}
}
}
}
return
null
;
return
this
.
selectByPhoneNumberAndEnterpriseId
(
phoneNumber
,
wxEnterpriseId
);
}
}
@Override
@Override
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/StaffApiServiceImpl.java
View file @
3852f241
...
@@ -893,6 +893,36 @@ public class StaffApiServiceImpl implements StaffApiService {
...
@@ -893,6 +893,36 @@ public class StaffApiServiceImpl implements StaffApiService {
}
}
@Override
@Override
public
StaffDTO
getByUserIdAndReflushWhenNoPhone
(
String
userId
,
String
wxEnterpriseId
)
{
StaffDTO
staffDTO
=
EntityUtil
.
changeEntityByJSON
(
StaffDTO
.
class
,
staffService
.
selectByUserIdAndEnterpriseId
(
userId
,
wxEnterpriseId
));
if
(
staffDTO
==
null
)
{
return
null
;
}
if
(
StringUtils
.
isBlank
(
staffDTO
.
getPhoneNumber
()))
{
this
.
wxGetAdd
(
userId
,
wxEnterpriseId
);
return
EntityUtil
.
changeEntityByJSON
(
StaffDTO
.
class
,
staffService
.
selectByUserIdAndEnterpriseId
(
userId
,
wxEnterpriseId
));
}
//todo 历史数据 相同的id需要删除 后续这个逻辑可以删除
//存在多条
List
<
String
>
userIds
=
new
ArrayList
<>();
userIds
.
add
(
userId
);
List
<
TabHaobanStaff
>
staffs
=
staffMapper
.
listByUserIdsAndWxEnterpriseId
(
userIds
,
wxEnterpriseId
);
//需要去除多余的
if
(
CollectionUtils
.
isNotEmpty
(
staffs
)&&
staffs
.
size
()>
1
)
{
Map
<
String
,
TabHaobanStaff
>
staffMap
=
staffs
.
stream
().
collect
(
Collectors
.
toMap
(
dto
->
dto
.
getStaffId
(),
dto
->
dto
,(
o
,
n
)->
n
));
List
<
String
>
relationStaffIds
=
staffClerkRelationService
.
listRelationsStaffId
(
staffMap
.
keySet
());
if
(
CollectionUtils
.
isNotEmpty
(
relationStaffIds
))
{
TabHaobanStaff
staff
=
staffMap
.
get
(
relationStaffIds
.
get
(
0
));
staffService
.
delOtherStaffByWxUserId
(
staff
.
getWxUserId
(),
staff
.
getStaffId
(),
wxEnterpriseId
);
}
staffDTO
=
EntityUtil
.
changeEntityByJSON
(
StaffDTO
.
class
,
staffService
.
selectByUserIdAndEnterpriseId
(
userId
,
wxEnterpriseId
));
}
return
staffDTO
;
}
@Override
public
StaffDepartmentRelatedDTO
getDepartmentIdAndStaffId
(
String
departmentId
,
String
staffId
)
{
public
StaffDepartmentRelatedDTO
getDepartmentIdAndStaffId
(
String
departmentId
,
String
staffId
)
{
TabHaobanStaffDepartmentRelated
tab
=
staffDepartmentRelatedService
.
getDepartmentIdAndStaffId
(
departmentId
,
staffId
);
TabHaobanStaffDepartmentRelated
tab
=
staffDepartmentRelatedService
.
getDepartmentIdAndStaffId
(
departmentId
,
staffId
);
return
EntityUtil
.
changeEntityByJSON
(
StaffDepartmentRelatedDTO
.
class
,
tab
);
return
EntityUtil
.
changeEntityByJSON
(
StaffDepartmentRelatedDTO
.
class
,
tab
);
...
...
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/WxEnterpriseInfoController.java
View file @
3852f241
...
@@ -110,9 +110,10 @@ public class WxEnterpriseInfoController extends WebBaseController {
...
@@ -110,9 +110,10 @@ public class WxEnterpriseInfoController extends WebBaseController {
WxEnterpriseDTO
enterprise
=
wxEnterpriseApiService
.
getEnterpriseBycorpId
(
corpId
);
WxEnterpriseDTO
enterprise
=
wxEnterpriseApiService
.
getEnterpriseBycorpId
(
corpId
);
StaffDTO
loginStaff
=
null
;
StaffDTO
loginStaff
=
null
;
if
(
enterprise
!=
null
)
{
if
(
enterprise
!=
null
)
{
loginStaff
=
staffApiService
.
selectByUserIdAndEnterpriseId
(
userId
,
enterprise
.
getWxEnterpriseId
());
loginStaff
=
staffApiService
.
getByUserIdAndReflushWhenNoPhone
(
userId
,
enterprise
.
getWxEnterpriseId
());
}
}
if
(
loginStaff
==
null
)
{
//手机号不存在
if
(
loginStaff
==
null
||
StringUtils
.
isBlank
(
loginStaff
.
getPhoneNumber
()))
{
if
(
enterprise
!=
null
)
{
if
(
enterprise
!=
null
)
{
staffApiService
.
wxGetAdd
(
userId
,
enterprise
.
getWxEnterpriseId
());
staffApiService
.
wxGetAdd
(
userId
,
enterprise
.
getWxEnterpriseId
());
loginStaff
=
staffApiService
.
selectByUserIdAndEnterpriseId
(
userId
,
enterprise
.
getWxEnterpriseId
());
loginStaff
=
staffApiService
.
selectByUserIdAndEnterpriseId
(
userId
,
enterprise
.
getWxEnterpriseId
());
...
...
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