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
83809a27
Commit
83809a27
authored
Oct 12, 2022
by
墨竹
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:是否有店长权限接口
parent
09d2d96b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
31 deletions
+49
-31
StaffApiService.java
...va/com/gic/haoban/manage/api/service/StaffApiService.java
+7
-0
StaffApiServiceImpl.java
.../manage/service/service/out/impl/StaffApiServiceImpl.java
+42
-31
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/StaffApiService.java
View file @
83809a27
...
@@ -272,4 +272,11 @@ public interface StaffApiService {
...
@@ -272,4 +272,11 @@ public interface StaffApiService {
*/
*/
StoreRoleDTO
getCountHaoBanStoreIdsByClerkId
(
String
clerkId
,
String
wxEnterpriseId
);
StoreRoleDTO
getCountHaoBanStoreIdsByClerkId
(
String
clerkId
,
String
wxEnterpriseId
);
/**
* 是否店长权限 true 是
* @param clerkId
* @return
*/
boolean
isManager
(
String
clerkId
);
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/StaffApiServiceImpl.java
View file @
83809a27
...
@@ -138,8 +138,8 @@ public class StaffApiServiceImpl implements StaffApiService {
...
@@ -138,8 +138,8 @@ public class StaffApiServiceImpl implements StaffApiService {
if
(
CollectionUtils
.
isEmpty
(
staffDTOList
))
{
if
(
CollectionUtils
.
isEmpty
(
staffDTOList
))
{
return
new
Page
<>();
return
new
Page
<>();
}
}
Set
<
String
>
staffIdList
=
staffDTOList
.
stream
().
map
(
dto
->
dto
.
getStaffId
()).
collect
(
Collectors
.
toSet
())
;
Set
<
String
>
staffIdList
=
staffDTOList
.
stream
().
map
(
dto
->
dto
.
getStaffId
()).
collect
(
Collectors
.
toSet
())
;
List
<
String
>
relationIdList
=
this
.
staffClerkRelationService
.
listRelationsStaffId
(
staffIdList
)
;
List
<
String
>
relationIdList
=
this
.
staffClerkRelationService
.
listRelationsStaffId
(
staffIdList
);
staffDTOList
.
forEach
(
one
->
{
staffDTOList
.
forEach
(
one
->
{
one
.
setRelationFlag
(
relationIdList
.
contains
(
one
.
getStaffId
())
?
1
:
0
);
one
.
setRelationFlag
(
relationIdList
.
contains
(
one
.
getStaffId
())
?
1
:
0
);
});
});
...
@@ -163,14 +163,14 @@ public class StaffApiServiceImpl implements StaffApiService {
...
@@ -163,14 +163,14 @@ public class StaffApiServiceImpl implements StaffApiService {
@Override
@Override
public
ServiceResponse
getWxSaveNew
(
String
wxUserId
,
String
wxEnterpriseId
)
{
public
ServiceResponse
getWxSaveNew
(
String
wxUserId
,
String
wxEnterpriseId
)
{
ServiceResponse
res
=
new
ServiceResponse
();
ServiceResponse
res
=
new
ServiceResponse
();
WxEnterpriseQwDTO
qwDTO
=
this
.
wxEnterpriseService
.
getQwInfo
(
wxEnterpriseId
)
;
WxEnterpriseQwDTO
qwDTO
=
this
.
wxEnterpriseService
.
getQwInfo
(
wxEnterpriseId
);
if
(
null
==
qwDTO
)
{
if
(
null
==
qwDTO
)
{
logger
.
info
(
"企业不存在:{}:{}"
,
wxEnterpriseId
,
wxUserId
);
logger
.
info
(
"企业不存在:{}:{}"
,
wxEnterpriseId
,
wxUserId
);
res
.
setMessage
(
"企业不存在"
);
res
.
setMessage
(
"企业不存在"
);
res
.
setCode
(
2
);
res
.
setCode
(
2
);
return
res
;
return
res
;
}
}
String
dkCorpid
=
qwDTO
.
getDkCorpid
()
;
String
dkCorpid
=
qwDTO
.
getDkCorpid
();
SecretSettingDTO
secretSetting
=
secretSettingService
.
getSecretSetting
(
qwDTO
.
getWxEnterpriseId
(),
SecretTypeEnum
.
CUSTOMIZED_APP
.
getVal
());
SecretSettingDTO
secretSetting
=
secretSettingService
.
getSecretSetting
(
qwDTO
.
getWxEnterpriseId
(),
SecretTypeEnum
.
CUSTOMIZED_APP
.
getVal
());
if
(
null
==
secretSetting
||
secretSetting
.
getCheckFlag
()
==
0
)
{
if
(
null
==
secretSetting
||
secretSetting
.
getCheckFlag
()
==
0
)
{
logger
.
info
(
"没有配置secret:{}"
,
JSONObject
.
toJSONString
(
qwDTO
));
logger
.
info
(
"没有配置secret:{}"
,
JSONObject
.
toJSONString
(
qwDTO
));
...
@@ -179,18 +179,18 @@ public class StaffApiServiceImpl implements StaffApiService {
...
@@ -179,18 +179,18 @@ public class StaffApiServiceImpl implements StaffApiService {
return
res
;
return
res
;
}
}
UserDTO
user
=
null
;
UserDTO
user
=
null
;
if
(
qwDTO
.
getWxSecurityType
()==
4
)
{
if
(
qwDTO
.
getWxSecurityType
()
==
4
)
{
user
=
qywxUserApiService
.
getWorkWxUser
(
qwDTO
.
getThirdCorpid
(),
config
.
getWxSuiteid
(),
wxUserId
);
user
=
qywxUserApiService
.
getWorkWxUser
(
qwDTO
.
getThirdCorpid
(),
config
.
getWxSuiteid
(),
wxUserId
);
logger
.
info
(
"成员详情(第三方)={}"
,
JSON
.
toJSONString
(
user
))
;
logger
.
info
(
"成员详情(第三方)={}"
,
JSON
.
toJSONString
(
user
))
;
UserDTO
userSelf
=
qywxUserApiService
.
getSelfWorkWxUser
(
dkCorpid
,
secretSetting
.
getSecretVal
(),
user
.
getOpen_userid
());
UserDTO
userSelf
=
qywxUserApiService
.
getSelfWorkWxUser
(
dkCorpid
,
secretSetting
.
getSecretVal
(),
user
.
getOpen_userid
());
logger
.
info
(
"成员详情(代开)={}"
,
JSON
.
toJSONString
(
user
))
;
logger
.
info
(
"成员详情(代开)={}"
,
JSON
.
toJSONString
(
user
))
;
if
(
user
!=
null
&&
userSelf
!=
null
)
{
if
(
user
!=
null
&&
userSelf
!=
null
)
{
user
.
setName
(
userSelf
.
getName
());
user
.
setName
(
userSelf
.
getName
());
user
.
setPosition
(
userSelf
.
getPosition
());
user
.
setPosition
(
userSelf
.
getPosition
());
}
}
}
else
{
}
else
{
user
=
qywxUserApiService
.
getSelfWorkWxUser
(
dkCorpid
,
secretSetting
.
getSecretVal
(),
wxUserId
);
user
=
qywxUserApiService
.
getSelfWorkWxUser
(
dkCorpid
,
secretSetting
.
getSecretVal
(),
wxUserId
);
logger
.
info
(
"成员详情(代开)={}"
,
JSON
.
toJSONString
(
user
))
;
logger
.
info
(
"成员详情(代开)={}"
,
JSON
.
toJSONString
(
user
))
;
}
}
if
(
null
==
user
)
{
if
(
null
==
user
)
{
logger
.
info
(
"企业微信用户不存在:{}:{}"
,
wxEnterpriseId
,
wxUserId
);
logger
.
info
(
"企业微信用户不存在:{}:{}"
,
wxEnterpriseId
,
wxUserId
);
...
@@ -207,7 +207,7 @@ public class StaffApiServiceImpl implements StaffApiService {
...
@@ -207,7 +207,7 @@ public class StaffApiServiceImpl implements StaffApiService {
nationCode
=
arr
[
0
];
nationCode
=
arr
[
0
];
phoneNumber
=
arr
[
1
];
phoneNumber
=
arr
[
1
];
}
}
String
openUserid
=
getOpenUserid
(
wxUserId
,
dkCorpid
,
qwDTO
);
String
openUserid
=
getOpenUserid
(
wxUserId
,
dkCorpid
,
qwDTO
);
TabHaobanStaff
staff
=
staffService
.
selectByUserIdAndEnterpriseId
(
wxUserId
,
openUserid
,
wxEnterpriseId
);
TabHaobanStaff
staff
=
staffService
.
selectByUserIdAndEnterpriseId
(
wxUserId
,
openUserid
,
wxEnterpriseId
);
if
(
staff
!=
null
)
{
if
(
staff
!=
null
)
{
staffService
.
delOtherStaffByWxUserId
(
staff
.
getWxUserId
(),
staff
.
getStaffId
(),
wxEnterpriseId
);
staffService
.
delOtherStaffByWxUserId
(
staff
.
getWxUserId
(),
staff
.
getStaffId
(),
wxEnterpriseId
);
...
@@ -263,25 +263,25 @@ public class StaffApiServiceImpl implements StaffApiService {
...
@@ -263,25 +263,25 @@ public class StaffApiServiceImpl implements StaffApiService {
* @param corpid
* @param corpid
* @return
* @return
*/
*/
private
String
getOpenUserid
(
String
userId
,
String
corpid
,
WxEnterpriseQwDTO
qwDTO
)
{
private
String
getOpenUserid
(
String
userId
,
String
corpid
,
WxEnterpriseQwDTO
qwDTO
)
{
if
(
qwDTO
.
getWxSecurityType
()==
2
)
{
if
(
qwDTO
.
getWxSecurityType
()
==
2
)
{
return
userId
;
return
userId
;
}
}
List
<
QywxNewUseridDTO
>
list
=
null
;
List
<
QywxNewUseridDTO
>
list
=
null
;
if
(
qwDTO
.
getWxSecurityType
()==
4
)
{
if
(
qwDTO
.
getWxSecurityType
()
==
4
)
{
list
=
qywxUserApiService
.
useridToOpenuserid
(
qwDTO
.
getThirdCorpid
(),
config
.
getWxSuiteid
(),
Collections
.
singletonList
(
userId
));
list
=
qywxUserApiService
.
useridToOpenuserid
(
qwDTO
.
getThirdCorpid
(),
config
.
getWxSuiteid
(),
Collections
.
singletonList
(
userId
));
}
else
{
}
else
{
// 绝色这类商户在2个服务商,在2023516要切换调
// 绝色这类商户在2个服务商,在2023516要切换调
Object
o
=
RedisUtil
.
getCache
(
"bgrjswxEnterpriseId"
)
;
Object
o
=
RedisUtil
.
getCache
(
"bgrjswxEnterpriseId"
);
if
(
null
!=
o
&&
o
.
toString
().
contains
(
qwDTO
.
getWxEnterpriseId
()))
{
if
(
null
!=
o
&&
o
.
toString
().
contains
(
qwDTO
.
getWxEnterpriseId
()))
{
logger
.
info
(
"绝色同步通讯录"
);
logger
.
info
(
"绝色同步通讯录"
);
list
=
qywxUserApiService
.
useridToOpenuserid
(
qwDTO
.
getThirdCorpid
(),
config
.
getWxSuiteid
(),
Collections
.
singletonList
(
userId
));
list
=
qywxUserApiService
.
useridToOpenuserid
(
qwDTO
.
getThirdCorpid
(),
config
.
getWxSuiteid
(),
Collections
.
singletonList
(
userId
));
}
else
{
}
else
{
SecretSettingDTO
set
=
this
.
secretSettingService
.
getSecretSetting
(
qwDTO
.
getWxEnterpriseId
(),
SecretTypeEnum
.
CUSTOMIZED_APP
.
getVal
())
;
SecretSettingDTO
set
=
this
.
secretSettingService
.
getSecretSetting
(
qwDTO
.
getWxEnterpriseId
(),
SecretTypeEnum
.
CUSTOMIZED_APP
.
getVal
())
;
list
=
qywxUserApiService
.
getSelfUseridToOpenuserid
(
qwDTO
.
getDkCorpid
(),
set
.
getSecretVal
()
,
Collections
.
singletonList
(
userId
));
list
=
qywxUserApiService
.
getSelfUseridToOpenuserid
(
qwDTO
.
getDkCorpid
(),
set
.
getSecretVal
(),
Collections
.
singletonList
(
userId
));
}
}
}
}
logger
.
info
(
"明文userId转密文={},{}"
,
userId
,
JSON
.
toJSONString
(
list
));
logger
.
info
(
"明文userId转密文={},{}"
,
userId
,
JSON
.
toJSONString
(
list
));
if
(
CollectionUtils
.
isEmpty
(
list
))
{
if
(
CollectionUtils
.
isEmpty
(
list
))
{
return
""
;
return
""
;
}
}
...
@@ -428,7 +428,7 @@ public class StaffApiServiceImpl implements StaffApiService {
...
@@ -428,7 +428,7 @@ public class StaffApiServiceImpl implements StaffApiService {
user
.
setAlias
(
EmojiFilterUtil
.
removeAllEmoji
(
user
.
getAlias
()));
user
.
setAlias
(
EmojiFilterUtil
.
removeAllEmoji
(
user
.
getAlias
()));
tab
.
setNickName
((
user
.
getAlias
()));
tab
.
setNickName
((
user
.
getAlias
()));
}
}
if
(
StringUtils
.
isNotBlank
(
tab
.
getPhoneNumber
()))
{
if
(
StringUtils
.
isNotBlank
(
tab
.
getPhoneNumber
()))
{
tab
.
setNationCode
(
"86"
);
tab
.
setNationCode
(
"86"
);
}
}
tab
.
setSex
(
user
.
getGender
()
==
null
?
1
:
Integer
.
parseInt
(
user
.
getGender
()));
tab
.
setSex
(
user
.
getGender
()
==
null
?
1
:
Integer
.
parseInt
(
user
.
getGender
()));
...
@@ -496,7 +496,7 @@ public class StaffApiServiceImpl implements StaffApiService {
...
@@ -496,7 +496,7 @@ public class StaffApiServiceImpl implements StaffApiService {
}
else
{
}
else
{
//该员工部门没做改变(只更新手机号即可)
//该员工部门没做改变(只更新手机号即可)
TabHaobanStaffDepartmentRelated
related
=
map
.
get
(
addId
);
TabHaobanStaffDepartmentRelated
related
=
map
.
get
(
addId
);
if
(
StringUtils
.
isNotBlank
(
related
.
getPhoneNumber
()))
{
if
(
StringUtils
.
isNotBlank
(
related
.
getPhoneNumber
()))
{
if
(!
related
.
getPhoneNumber
().
equals
(
staff
.
getPhoneNumber
()))
{
if
(!
related
.
getPhoneNumber
().
equals
(
staff
.
getPhoneNumber
()))
{
related
.
setPhoneNumber
(
staff
.
getPhoneNumber
());
related
.
setPhoneNumber
(
staff
.
getPhoneNumber
());
related
.
setNationCode
(
staff
.
getNationCode
());
related
.
setNationCode
(
staff
.
getNationCode
());
...
@@ -645,15 +645,15 @@ public class StaffApiServiceImpl implements StaffApiService {
...
@@ -645,15 +645,15 @@ public class StaffApiServiceImpl implements StaffApiService {
resp
.
setResult
((
String
)
url
);
resp
.
setResult
((
String
)
url
);
return
resp
;
return
resp
;
}
}
WxEnterpriseQwDTO
qwDTO
=
this
.
wxEnterpriseService
.
getQwInfo
(
relationDTO
.
getWxEnterpriseId
())
;
WxEnterpriseQwDTO
qwDTO
=
this
.
wxEnterpriseService
.
getQwInfo
(
relationDTO
.
getWxEnterpriseId
());
SecretSettingDTO
secretSetting
=
secretSettingService
.
getSecretSetting
(
qwDTO
.
getWxEnterpriseId
(),
SecretTypeEnum
.
CUSTOMIZED_APP
.
getVal
());
SecretSettingDTO
secretSetting
=
secretSettingService
.
getSecretSetting
(
qwDTO
.
getWxEnterpriseId
(),
SecretTypeEnum
.
CUSTOMIZED_APP
.
getVal
());
if
(
null
==
secretSetting
||
secretSetting
.
getCheckFlag
()
==
0
)
{
if
(
null
==
secretSetting
||
secretSetting
.
getCheckFlag
()
==
0
)
{
logger
.
info
(
"没有配置secret:{}"
,
qwDTO
.
getWxEnterpriseId
());
logger
.
info
(
"没有配置secret:{}"
,
qwDTO
.
getWxEnterpriseId
());
return
null
;
return
null
;
}
}
String
wxUserId
=
relationDTO
.
getQwUserId
()
;
String
wxUserId
=
relationDTO
.
getQwUserId
();
if
(
qwDTO
.
needOpenUserIdDk
())
{
if
(
qwDTO
.
needOpenUserIdDk
())
{
wxUserId
=
relationDTO
.
getOpenUserId
()
;
wxUserId
=
relationDTO
.
getOpenUserId
();
}
}
UserDTO
user
=
qywxUserApiService
.
getSelfWorkWxUser
(
qwDTO
.
getDkCorpid
(),
secretSetting
.
getSecretVal
(),
wxUserId
);
UserDTO
user
=
qywxUserApiService
.
getSelfWorkWxUser
(
qwDTO
.
getDkCorpid
(),
secretSetting
.
getSecretVal
(),
wxUserId
);
if
(
user
!=
null
)
{
if
(
user
!=
null
)
{
...
@@ -798,7 +798,7 @@ public class StaffApiServiceImpl implements StaffApiService {
...
@@ -798,7 +798,7 @@ public class StaffApiServiceImpl implements StaffApiService {
logger
.
info
(
"没有配置secret:wxEnterpriseId:{}"
,
wxEnterpriseId
);
logger
.
info
(
"没有配置secret:wxEnterpriseId:{}"
,
wxEnterpriseId
);
return
null
;
return
null
;
}
}
WxEnterpriseQwDTO
qwDTO
=
this
.
wxEnterpriseService
.
getQwInfo
(
wxEnterpriseId
)
;
WxEnterpriseQwDTO
qwDTO
=
this
.
wxEnterpriseService
.
getQwInfo
(
wxEnterpriseId
);
if
(
qwDTO
==
null
)
{
if
(
qwDTO
==
null
)
{
logger
.
info
(
"企业不存在:wxEnterpriseId:{}"
,
wxEnterpriseId
);
logger
.
info
(
"企业不存在:wxEnterpriseId:{}"
,
wxEnterpriseId
);
return
null
;
return
null
;
...
@@ -824,8 +824,8 @@ public class StaffApiServiceImpl implements StaffApiService {
...
@@ -824,8 +824,8 @@ public class StaffApiServiceImpl implements StaffApiService {
//获取微信信息
//获取微信信息
String
wxUserId
=
staff
.
getWxUserId
();
String
wxUserId
=
staff
.
getWxUserId
();
if
(
qwDTO
.
needOpenUserIdDk
())
{
if
(
qwDTO
.
needOpenUserIdDk
())
{
wxUserId
=
staff
.
getWxOpenUseId
()
;
wxUserId
=
staff
.
getWxOpenUseId
();
}
}
UserDTO
user
=
qywxUserApiService
.
getSelfWorkWxUser
(
qwDTO
.
getDkCorpid
(),
secretSetting
.
getSecretVal
(),
wxUserId
);
UserDTO
user
=
qywxUserApiService
.
getSelfWorkWxUser
(
qwDTO
.
getDkCorpid
(),
secretSetting
.
getSecretVal
(),
wxUserId
);
if
(
null
==
user
)
{
if
(
null
==
user
)
{
...
@@ -980,7 +980,6 @@ public class StaffApiServiceImpl implements StaffApiService {
...
@@ -980,7 +980,6 @@ public class StaffApiServiceImpl implements StaffApiService {
/**
/**
* 获取门店筛选器门店ids
* 获取门店筛选器门店ids
*/
*/
private
List
<
String
>
getStoreWidgetIdStoreIds
(
String
storeWidgetId
,
String
enterpriseId
)
{
private
List
<
String
>
getStoreWidgetIdStoreIds
(
String
storeWidgetId
,
String
enterpriseId
)
{
// 门店id列表
// 门店id列表
...
@@ -991,4 +990,16 @@ public class StaffApiServiceImpl implements StaffApiService {
...
@@ -991,4 +990,16 @@ public class StaffApiServiceImpl implements StaffApiService {
logger
.
info
(
"门店筛选器查询结果数量:{}"
,
storeIdList
.
size
());
logger
.
info
(
"门店筛选器查询结果数量:{}"
,
storeIdList
.
size
());
return
storeIdList
;
return
storeIdList
;
}
}
@Override
public
boolean
isManager
(
String
clerkId
)
{
ClerkDTO
clerkDTO
=
clerkService
.
getClerkByClerkId
(
clerkId
);
if
(
clerkDTO
!=
null
)
{
Integer
clerkType
=
clerkDTO
.
getClerkType
();
if
(
clerkType
==
1
||
clerkType
==
2
)
{
return
true
;
}
}
return
false
;
}
}
}
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