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
f58de234
Commit
f58de234
authored
Feb 22, 2022
by
fudahua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:先查看user是否存在再看手机号是否存在
parent
813fac7b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
4 deletions
+40
-4
StaffService.java
...a/com/gic/haoban/manage/service/service/StaffService.java
+11
-0
StaffServiceImpl.java
.../haoban/manage/service/service/impl/StaffServiceImpl.java
+28
-3
StaffApiServiceImpl.java
.../manage/service/service/out/impl/StaffApiServiceImpl.java
+1
-1
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/StaffService.java
View file @
f58de234
...
@@ -44,6 +44,17 @@ public interface StaffService {
...
@@ -44,6 +44,17 @@ public interface StaffService {
*/
*/
TabHaobanStaff
selectByPhoneNumberAndEnterpriseId
(
String
phoneNumber
,
String
wxEnterpriseId
);
TabHaobanStaff
selectByPhoneNumberAndEnterpriseId
(
String
phoneNumber
,
String
wxEnterpriseId
);
/**
* 选择userId跟手机号查询数据 userid优先级高
*
* @param phoneNumber 电话号码
* @param wxEnterpriseId wx企业标识
* @return {@link TabHaobanStaff }
* @author mozhu
* @date 2022-01-12 17:19:28
*/
TabHaobanStaff
selectByPhoneNumberOrUserIdAndEnterpriseId
(
String
phoneNumber
,
String
userId
,
String
wxEnterpriseId
);
List
<
StaffDTO
>
listByUserIdsAndWxEnterpriseId
(
List
<
String
>
userIds
,
String
wxEnterpriseId
);
List
<
StaffDTO
>
listByUserIdsAndWxEnterpriseId
(
List
<
String
>
userIds
,
String
wxEnterpriseId
);
/**
/**
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/StaffServiceImpl.java
View file @
f58de234
...
@@ -6,17 +6,18 @@ import com.gic.haoban.manage.api.dto.StaffDTO;
...
@@ -6,17 +6,18 @@ import com.gic.haoban.manage.api.dto.StaffDTO;
import
com.gic.haoban.manage.service.dao.mapper.StaffMapper
;
import
com.gic.haoban.manage.service.dao.mapper.StaffMapper
;
import
com.gic.haoban.manage.service.entity.TabHaobanStaff
;
import
com.gic.haoban.manage.service.entity.TabHaobanStaff
;
import
com.gic.haoban.manage.service.service.MemberUnionRelatedService
;
import
com.gic.haoban.manage.service.service.MemberUnionRelatedService
;
import
com.gic.haoban.manage.service.service.StaffClerkRelationService
;
import
com.gic.haoban.manage.service.service.StaffService
;
import
com.gic.haoban.manage.service.service.StaffService
;
import
com.github.pagehelper.Page
;
import
com.github.pagehelper.Page
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
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.Date
;
import
java.util.*
;
import
java.util.List
;
import
java.util.stream.Collectors
;
import
java.util.Set
;
@Service
@Service
public
class
StaffServiceImpl
implements
StaffService
{
public
class
StaffServiceImpl
implements
StaffService
{
...
@@ -27,6 +28,9 @@ public class StaffServiceImpl implements StaffService {
...
@@ -27,6 +28,9 @@ public class StaffServiceImpl implements StaffService {
@Autowired
@Autowired
private
MemberUnionRelatedService
memberUnionRelatedService
;
private
MemberUnionRelatedService
memberUnionRelatedService
;
@Autowired
private
StaffClerkRelationService
staffClerkRelationService
;
@Override
@Override
public
TabHaobanStaff
selectById
(
String
id
)
{
public
TabHaobanStaff
selectById
(
String
id
)
{
return
mapper
.
selectByPrimaryKey
(
id
);
return
mapper
.
selectByPrimaryKey
(
id
);
...
@@ -72,6 +76,27 @@ public class StaffServiceImpl implements StaffService {
...
@@ -72,6 +76,27 @@ public class StaffServiceImpl implements StaffService {
}
}
@Override
@Override
public
TabHaobanStaff
selectByPhoneNumberOrUserIdAndEnterpriseId
(
String
phoneNumber
,
String
userId
,
String
wxEnterpriseId
)
{
if
(
StringUtils
.
isBlank
(
userId
))
{
return
null
;
}
//存在多条
List
<
String
>
userIds
=
new
ArrayList
<>();
userIds
.
add
(
userId
);
List
<
TabHaobanStaff
>
staffs
=
mapper
.
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
))
{
return
staffMap
.
get
(
relationStaffIds
.
get
(
0
));
}
}
return
this
.
selectByPhoneNumberAndEnterpriseId
(
phoneNumber
,
wxEnterpriseId
);
}
@Override
public
void
updateByPrimaryKey
(
TabHaobanStaff
tab
)
{
public
void
updateByPrimaryKey
(
TabHaobanStaff
tab
)
{
tab
.
setUpdateTime
(
new
Date
());
tab
.
setUpdateTime
(
new
Date
());
mapper
.
updateByPrimaryKeySelective
(
tab
);
mapper
.
updateByPrimaryKeySelective
(
tab
);
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/StaffApiServiceImpl.java
View file @
f58de234
...
@@ -389,7 +389,7 @@ public class StaffApiServiceImpl implements StaffApiService {
...
@@ -389,7 +389,7 @@ public class StaffApiServiceImpl implements StaffApiService {
String
[]
arr
=
getNationCodeAndPhoneNumber
(
mobile
);
String
[]
arr
=
getNationCodeAndPhoneNumber
(
mobile
);
String
nationCode
=
arr
[
0
];
String
nationCode
=
arr
[
0
];
String
phoneNumber
=
arr
[
1
];
String
phoneNumber
=
arr
[
1
];
TabHaobanStaff
staff
=
staffService
.
selectByPhoneNumber
AndEnterpriseId
(
phoneNumber
,
wxEnterpriseId
);
TabHaobanStaff
staff
=
staffService
.
selectByPhoneNumber
OrUserIdAndEnterpriseId
(
phoneNumber
,
userId
,
wxEnterpriseId
);
if
(
staff
!=
null
)
{
if
(
staff
!=
null
)
{
staffService
.
delOtherStaffByWxUserId
(
staff
.
getWxUserId
(),
staff
.
getStaffId
(),
wxEnterpriseId
);
staffService
.
delOtherStaffByWxUserId
(
staff
.
getWxUserId
(),
staff
.
getStaffId
(),
wxEnterpriseId
);
}
}
...
...
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