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
f3f3d784
Commit
f3f3d784
authored
Feb 21, 2022
by
墨竹
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:好办登陆接口修改
parent
8c6dcbf4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
43 additions
and
30 deletions
+43
-30
StaffApiService.java
...va/com/gic/haoban/manage/api/service/StaffApiService.java
+5
-0
StaffApiServiceImpl.java
.../manage/service/service/out/impl/StaffApiServiceImpl.java
+4
-4
WxEnterpriseInfoController.java
...ban/manage/web/controller/WxEnterpriseInfoController.java
+33
-25
HaoBanErrCode.java
...java/com/gic/haoban/manage/web/errCode/HaoBanErrCode.java
+1
-1
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/StaffApiService.java
View file @
f3f3d784
...
@@ -36,6 +36,11 @@ public interface StaffApiService {
...
@@ -36,6 +36,11 @@ public interface StaffApiService {
*/
*/
ServiceResponse
getWxSaveNew
(
String
userId
,
String
wxEnterpriseId
);
ServiceResponse
getWxSaveNew
(
String
userId
,
String
wxEnterpriseId
);
/**
* 新增成员
* @param userId
* @param wxEnterpriseId
*/
void
wxGetAdd
(
String
userId
,
String
wxEnterpriseId
);
void
wxGetAdd
(
String
userId
,
String
wxEnterpriseId
);
void
staffEdit
(
StaffDTO
staffDTO
,
String
departmentIds
);
void
staffEdit
(
StaffDTO
staffDTO
,
String
departmentIds
);
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/StaffApiServiceImpl.java
View file @
f3f3d784
...
@@ -389,9 +389,9 @@ public class StaffApiServiceImpl implements StaffApiService {
...
@@ -389,9 +389,9 @@ 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
.
selectBy
PhoneNumberAndEnterpriseId
(
phoneNumber
.
trim
()
,
wxEnterpriseId
);
TabHaobanStaff
staff
=
staffService
.
selectBy
UserIdAndEnterpriseId
(
userId
,
wxEnterpriseId
);
if
(
staff
!=
null
){
if
(
staff
!=
null
)
{
staffService
.
delOtherStaffByWxUserId
(
staff
.
getWxUserId
(),
staff
.
getStaffId
(),
wxEnterpriseId
);
staffService
.
delOtherStaffByWxUserId
(
staff
.
getWxUserId
(),
staff
.
getStaffId
(),
wxEnterpriseId
);
}
}
staff
=
(
staff
==
null
?
new
TabHaobanStaff
()
:
staff
);
staff
=
(
staff
==
null
?
new
TabHaobanStaff
()
:
staff
);
staff
.
setWxUserId
(
userId
);
staff
.
setWxUserId
(
userId
);
...
@@ -1522,7 +1522,7 @@ public class StaffApiServiceImpl implements StaffApiService {
...
@@ -1522,7 +1522,7 @@ public class StaffApiServiceImpl implements StaffApiService {
return
staffQrCodeDTO
;
return
staffQrCodeDTO
;
}
}
String
qr_code
=
user
.
getQr_code
();
String
qr_code
=
user
.
getQr_code
();
staffMapper
.
updateQrCodeByStaffId
(
staffId
,
qr_code
);
staffMapper
.
updateQrCodeByStaffId
(
staffId
,
qr_code
);
staffQrCodeDTO
.
setQrCode
(
qr_code
);
staffQrCodeDTO
.
setQrCode
(
qr_code
);
return
staffQrCodeDTO
;
return
staffQrCodeDTO
;
}
}
...
...
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/WxEnterpriseInfoController.java
View file @
f3f3d784
...
@@ -121,27 +121,31 @@ public class WxEnterpriseInfoController extends WebBaseController {
...
@@ -121,27 +121,31 @@ public class WxEnterpriseInfoController extends WebBaseController {
if
(
loginStaff
==
null
)
{
if
(
loginStaff
==
null
)
{
return
resultResponse
(
HaoBanErrCode
.
ERR_600001
);
return
resultResponse
(
HaoBanErrCode
.
ERR_600001
);
}
}
if
(
StringUtils
.
isNotBlank
(
loginStaff
.
getPhoneNumber
()))
{
DictDTO
loginUserId
=
managerDictService
.
getSMSDict
(
"app_login_phone_num"
,
loginStaff
.
getPhoneNumber
());
String
phoneNumber
=
loginStaff
.
getPhoneNumber
();
logger
.
info
(
"伪登录:{},userId:{}"
,
loginStaff
.
getPhoneNumber
(),
JSONObject
.
toJSONString
(
loginUserId
));
if
(
StringUtils
.
isBlank
(
phoneNumber
))
{
if
(
null
!=
loginUserId
)
{
return
resultResponse
(
HaoBanErrCode
.
ERR_600002
);
String
val
=
loginUserId
.
getDictValue
();
}
List
<
StaffDTO
>
staffDTOS
=
new
ArrayList
<>();
List
<
StaffDTO
>
phoneDtos
=
staffApiService
.
listByPhoneNumber
(
val
);
DictDTO
dictDTO
=
managerDictService
.
getSMSDict
(
"app_login_phone_num"
,
phoneNumber
);
List
<
StaffDTO
>
userDtos
=
staffApiService
.
listByWxUserId
(
val
);
logger
.
info
(
"伪登录:{},userId:{}"
,
phoneNumber
,
JSONObject
.
toJSONString
(
dictDTO
));
if
(
CollectionUtils
.
isNotEmpty
(
phoneDtos
))
{
if
(
null
!=
dictDTO
)
{
staffDTOS
.
addAll
(
phoneDtos
);
String
val
=
dictDTO
.
getDictValue
();
}
List
<
StaffDTO
>
staffDTOS
=
new
ArrayList
<>();
if
(
CollectionUtils
.
isNotEmpty
(
userDtos
))
{
List
<
StaffDTO
>
phoneDtos
=
staffApiService
.
listByPhoneNumber
(
val
);
staffDTOS
.
addAll
(
userDtos
);
List
<
StaffDTO
>
userDtos
=
staffApiService
.
listByWxUserId
(
val
);
}
if
(
CollectionUtils
.
isNotEmpty
(
phoneDtos
))
{
if
(
CollectionUtils
.
isNotEmpty
(
staffDTOS
))
{
staffDTOS
.
addAll
(
phoneDtos
);
if
(
staffDTOS
.
size
()
>
1
)
{
}
String
dictName
=
loginUserId
.
getDictName
();
if
(
CollectionUtils
.
isNotEmpty
(
userDtos
))
{
loginStaff
=
staffDTOS
.
stream
().
filter
(
staffDTO
->
dictName
.
indexOf
(
staffDTO
.
getWxEnterpriseId
())
>
0
).
findFirst
().
orElse
(
loginStaff
);
staffDTOS
.
addAll
(
userDtos
);
}
else
{
}
loginStaff
=
staffDTOS
.
get
(
0
);
if
(
CollectionUtils
.
isNotEmpty
(
staffDTOS
))
{
}
if
(
staffDTOS
.
size
()
>
1
)
{
String
dictName
=
dictDTO
.
getDictName
();
loginStaff
=
staffDTOS
.
stream
().
filter
(
staffDTO
->
dictName
.
indexOf
(
staffDTO
.
getWxEnterpriseId
())
>
0
).
findFirst
().
orElse
(
loginStaff
);
}
else
{
loginStaff
=
staffDTOS
.
get
(
0
);
}
}
}
}
}
}
...
@@ -151,7 +155,6 @@ public class WxEnterpriseInfoController extends WebBaseController {
...
@@ -151,7 +155,6 @@ public class WxEnterpriseInfoController extends WebBaseController {
staffApiService
.
activeStaff
(
staffId
);
staffApiService
.
activeStaff
(
staffId
);
}
}
String
wxEnterpriseId
=
loginStaff
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
loginStaff
.
getWxEnterpriseId
();
WxEnterpriseDTO
wxEnterpriseDTO
=
wxEnterpriseApiService
.
getOne
(
wxEnterpriseId
);
WxEnterpriseDTO
wxEnterpriseDTO
=
wxEnterpriseApiService
.
getOne
(
wxEnterpriseId
);
String
accesstoken
=
qywxCorpApiService
.
getCorpAccessToken
(
wxEnterpriseDTO
.
getCorpid
(),
config
.
getWxSuiteid
());
String
accesstoken
=
qywxCorpApiService
.
getCorpAccessToken
(
wxEnterpriseDTO
.
getCorpid
(),
config
.
getWxSuiteid
());
...
@@ -160,7 +163,7 @@ public class WxEnterpriseInfoController extends WebBaseController {
...
@@ -160,7 +163,7 @@ public class WxEnterpriseInfoController extends WebBaseController {
wellDoneLoginInfoVo
.
setStaffId
(
staffId
);
wellDoneLoginInfoVo
.
setStaffId
(
staffId
);
wellDoneLoginInfoVo
.
setWxEnterpriseId
(
wxEnterpriseId
);
wellDoneLoginInfoVo
.
setWxEnterpriseId
(
wxEnterpriseId
);
wellDoneLoginInfoVo
.
setStaffName
(
loginStaff
.
getStaffName
());
wellDoneLoginInfoVo
.
setStaffName
(
loginStaff
.
getStaffName
());
wellDoneLoginInfoVo
.
setPhoneNumber
(
loginStaff
.
getPhoneNumber
()
);
wellDoneLoginInfoVo
.
setPhoneNumber
(
phoneNumber
);
wellDoneLoginInfoVo
.
setNationcode
(
loginStaff
.
getNationCode
());
wellDoneLoginInfoVo
.
setNationcode
(
loginStaff
.
getNationCode
());
wellDoneLoginInfoVo
.
setWxUserId
(
loginStaff
.
getWxUserId
());
wellDoneLoginInfoVo
.
setWxUserId
(
loginStaff
.
getWxUserId
());
wellDoneLoginInfoVo
.
setPrivacyUseFlag
(
1
);
wellDoneLoginInfoVo
.
setPrivacyUseFlag
(
1
);
...
@@ -187,6 +190,11 @@ public class WxEnterpriseInfoController extends WebBaseController {
...
@@ -187,6 +190,11 @@ public class WxEnterpriseInfoController extends WebBaseController {
if
(
staffDTO
==
null
)
{
if
(
staffDTO
==
null
)
{
return
RestResponse
.
failure
(
String
.
valueOf
(
HaoBanErrCode
.
ERR_6
.
getCode
()),
HaoBanErrCode
.
ERR_6
.
getMsg
());
return
RestResponse
.
failure
(
String
.
valueOf
(
HaoBanErrCode
.
ERR_6
.
getCode
()),
HaoBanErrCode
.
ERR_6
.
getMsg
());
}
}
String
phoneNumber
=
staffDTO
.
getPhoneNumber
();
if
(
StringUtils
.
isBlank
(
phoneNumber
))
{
return
RestResponse
.
failure
(
String
.
valueOf
(
HaoBanErrCode
.
ERR_600002
.
getCode
()),
HaoBanErrCode
.
ERR_600002
.
getMsg
());
}
//登录和刷新token兼容
//登录和刷新token兼容
String
headerToken
=
AuthRequestWellDoneUtil
.
getHeaderToken
();
String
headerToken
=
AuthRequestWellDoneUtil
.
getHeaderToken
();
if
(
StringUtils
.
isNotBlank
(
headerToken
))
{
if
(
StringUtils
.
isNotBlank
(
headerToken
))
{
...
@@ -200,14 +208,14 @@ public class WxEnterpriseInfoController extends WebBaseController {
...
@@ -200,14 +208,14 @@ public class WxEnterpriseInfoController extends WebBaseController {
Map
<
String
,
String
>
map
=
new
HashMap
<>();
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"staffId"
,
staffId
);
map
.
put
(
"staffId"
,
staffId
);
map
.
put
(
"wxEnterpriseId"
,
staffDTO
.
getWxEnterpriseId
());
map
.
put
(
"wxEnterpriseId"
,
staffDTO
.
getWxEnterpriseId
());
map
.
put
(
"phoneNumber"
,
staffDTO
.
getPhoneNumber
()
);
map
.
put
(
"phoneNumber"
,
phoneNumber
);
String
token
=
JwtUtil
.
genToken
(
map
);
String
token
=
JwtUtil
.
genToken
(
map
);
AuthRequestWellDoneUtil
.
setAppLoginUser
(
staffId
,
token
);
AuthRequestWellDoneUtil
.
setAppLoginUser
(
staffId
,
token
);
StaffLoginDTO
staffLoginDTO
=
new
StaffLoginDTO
();
StaffLoginDTO
staffLoginDTO
=
new
StaffLoginDTO
();
BeanUtils
.
copyProperties
(
staffLoginQO
,
staffLoginDTO
);
BeanUtils
.
copyProperties
(
staffLoginQO
,
staffLoginDTO
);
staffLoginDTO
.
setStaffIp
(
IPAddressUtil
.
getIpAddress
(
request
));
staffLoginDTO
.
setStaffIp
(
IPAddressUtil
.
getIpAddress
(
request
));
staffDTO
.
setWxEnterpriseId
(
staffDTO
.
getWxEnterpriseId
());
staffDTO
.
setWxEnterpriseId
(
staffDTO
.
getWxEnterpriseId
());
staffDTO
.
setPhoneNumber
(
staffDTO
.
getPhoneNumber
()
);
staffDTO
.
setPhoneNumber
(
phoneNumber
);
staffDTO
.
setWxUserId
(
staffDTO
.
getWxUserId
());
staffDTO
.
setWxUserId
(
staffDTO
.
getWxUserId
());
wxEnterpriseApiService
.
wellDoneLogin
(
staffLoginDTO
);
wxEnterpriseApiService
.
wellDoneLogin
(
staffLoginDTO
);
return
RestResponse
.
successResult
(
token
);
return
RestResponse
.
successResult
(
token
);
...
...
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/errCode/HaoBanErrCode.java
View file @
f3f3d784
...
@@ -190,7 +190,7 @@ public enum HaoBanErrCode {
...
@@ -190,7 +190,7 @@ public enum HaoBanErrCode {
ERR_500001
(
500001
,
"该企业没关联好办"
),
ERR_500001
(
500001
,
"该企业没关联好办"
),
ERR_500003
(
500003
,
"企业corpid不对应,需要重新登录传code"
),
ERR_500003
(
500003
,
"企业corpid不对应,需要重新登录传code"
),
ERR_600001
(
600001
,
"成员不存在,请联系管理员后台授权通讯录权限"
),
ERR_600001
(
600001
,
"成员不存在,请联系管理员后台授权通讯录权限"
),
ERR_600002
(
600002
,
"
无手机号
"
),
ERR_600002
(
600002
,
"
成员无手机号,请联系管理员后台授权通讯录权限
"
),
ERR_600003
(
600003
,
"未获取成员openid"
),
ERR_600003
(
600003
,
"未获取成员openid"
),
ERR_10004
(
10004
,
"成员名称不能为空"
),
ERR_10004
(
10004
,
"成员名称不能为空"
),
...
...
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