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
246a0fdf
Commit
246a0fdf
authored
Sep 26, 2022
by
墨竹
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:登录调整
parent
579371d1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
21 deletions
+33
-21
WxEnterpriseInfoController.java
...ban/manage/web/controller/WxEnterpriseInfoController.java
+23
-21
WellDoneLoginInfoVO.java
...ava/com/gic/haoban/manage/web/vo/WellDoneLoginInfoVO.java
+10
-0
No files found.
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/WxEnterpriseInfoController.java
View file @
246a0fdf
...
...
@@ -149,7 +149,7 @@ public class WxEnterpriseInfoController extends WebBaseController {
loginUserDict
=
managerDictService
.
getSMSDict
(
"app_login_phone_num"
,
loginStaff
.
getWxOpenUseId
());
}
logger
.
info
(
"伪登录:{}userId:{},loginUser={}"
,
loginStaff
.
getPhoneNumber
(),
loginStaff
.
getWxOpenUseId
(),
JSONObject
.
toJSONString
(
loginUserDict
));
if
(
null
!=
loginUserDict
&&
StringUtils
.
isNotEmpty
(
loginUserDict
.
getDictName
())
&&
loginUserDict
.
getDictName
().
split
(
":"
).
length
==
2
)
{
if
(
null
!=
loginUserDict
&&
StringUtils
.
isNotEmpty
(
loginUserDict
.
getDictName
())
&&
loginUserDict
.
getDictName
().
split
(
":"
).
length
==
2
)
{
String
dictValue
=
loginUserDict
.
getDictValue
();
List
<
StaffDTO
>
staffDTOS
=
new
ArrayList
<>();
StaffDTO
dto
=
staffApiService
.
selectByUserIdAndEnterpriseId
(
dictValue
,
loginUserDict
.
getDictName
().
split
(
":"
)[
1
]);
...
...
@@ -179,7 +179,7 @@ public class WxEnterpriseInfoController extends WebBaseController {
}
String
wxEnterpriseId
=
loginStaff
.
getWxEnterpriseId
();
WxEnterpriseQwDTO
qwDTO
=
this
.
wxEnterpriseApiService
.
getQwInfo
(
wxEnterpriseId
)
;
WxEnterpriseQwDTO
qwDTO
=
this
.
wxEnterpriseApiService
.
getQwInfo
(
wxEnterpriseId
);
String
accesstoken
=
qywxCorpApiService
.
getCorpAccessToken
(
qwDTO
.
getThirdCorpid
(),
config
.
getWxSuiteid
());
WellDoneLoginInfoVO
wellDoneLoginInfoVo
=
new
WellDoneLoginInfoVO
();
wellDoneLoginInfoVo
.
setAccessToken
(
accesstoken
);
...
...
@@ -191,6 +191,8 @@ public class WxEnterpriseInfoController extends WebBaseController {
wellDoneLoginInfoVo
.
setWxUserId
(
loginStaff
.
getWxUserId
());
StaffPrivacyUseLogDTO
staffPrivacyUseLogDTO
=
staffApiService
.
getStaffPrivacyByStaffId
(
staffId
);
wellDoneLoginInfoVo
.
setPrivacyUseFlag
(
staffPrivacyUseLogDTO
==
null
?
0
:
1
);
List
<
StaffClerkRelationDTO
>
staffClerkRelationDTOS
=
staffClerkRelationApiService
.
listManageBindByStaffId
(
staffId
);
wellDoneLoginInfoVo
.
setManageFlag
(
CollectionUtils
.
isEmpty
(
staffClerkRelationDTOS
)
?
0
:
1
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
wellDoneLoginInfoVo
);
}
...
...
@@ -327,11 +329,11 @@ public class WxEnterpriseInfoController extends WebBaseController {
public
HaobanResponse
getInfoByMemberCode
(
GetUserByMemberCodeQo
qo
)
{
logger
.
info
(
"会员小程序={}"
,
JSON
.
toJSONString
(
qo
));
String
gicEnterpriseId
=
qo
.
getGicEnterpriseId
();
if
(
StringUtils
.
isNotEmpty
(
gicEnterpriseId
))
{
if
(
this
.
wxEnterpriseApiService
.
haobanIsStop
(
gicEnterpriseId
))
{
HaobanResponse
response
=
new
HaobanResponse
()
;
if
(
StringUtils
.
isNotEmpty
(
gicEnterpriseId
))
{
if
(
this
.
wxEnterpriseApiService
.
haobanIsStop
(
gicEnterpriseId
))
{
HaobanResponse
response
=
new
HaobanResponse
();
response
.
setErrorCode
(-
888
);
String
msg
=
this
.
wxEnterpriseApiService
.
getEndDate
(
gicEnterpriseId
)
;
String
msg
=
this
.
wxEnterpriseApiService
.
getEndDate
(
gicEnterpriseId
);
response
.
setMessage
(
msg
);
response
.
setDetailError
(
msg
);
return
response
;
...
...
@@ -340,7 +342,7 @@ public class WxEnterpriseInfoController extends WebBaseController {
WxEnterpriseDTO
enterpriseDTO
=
null
;
if
(
StringUtils
.
isNotBlank
(
qo
.
getCorpId
()))
{
enterpriseDTO
=
wxEnterpriseApiService
.
getEnterpriseBycorpId
(
qo
.
getCorpId
());
}
else
{
List
<
WxEnterpriseDTO
>
wxEnterpriseDTOS
=
wxEnterpriseRelatedApiService
.
listWxEnterpriseByEid
(
gicEnterpriseId
);
if
(
CollectionUtils
.
isNotEmpty
(
wxEnterpriseDTOS
))
{
...
...
@@ -352,17 +354,17 @@ public class WxEnterpriseInfoController extends WebBaseController {
return
resultResponse
(
HaoBanErrCode
.
ERR_500001
);
}
String
wxEnterpriseId
=
enterpriseDTO
.
getWxEnterpriseId
();
logger
.
info
(
"查询到的企微ID={}-{}"
,
wxEnterpriseId
,
enterpriseDTO
.
getCorpName
());
WxEnterpriseQwDTO
qwDTO
=
this
.
wxEnterpriseApiService
.
getQwInfo
(
wxEnterpriseId
)
;
logger
.
info
(
"查询到的企微ID={}-{}"
,
wxEnterpriseId
,
enterpriseDTO
.
getCorpName
());
WxEnterpriseQwDTO
qwDTO
=
this
.
wxEnterpriseApiService
.
getQwInfo
(
wxEnterpriseId
);
MemberLoginQo
user
=
new
MemberLoginQo
();
if
(
StringUtils
.
isBlank
(
qo
.
getUserId
()))
{
user
=
getUserByCode
(
wxEnterpriseId
,
qwDTO
.
getMemberCorpid
()
,
qo
.
getCode
(),
qo
.
getGicEnterpriseId
());
user
=
getUserByCode
(
wxEnterpriseId
,
qwDTO
.
getMemberCorpid
()
,
qo
.
getCode
(),
qo
.
getGicEnterpriseId
());
if
(
user
==
null
)
{
logger
.
info
(
"登录失败,从微信获取用户信息失败"
);
return
resultResponse
(
HaoBanErrCode
.
ERR_6
);
}
if
(
null
==
qo
.
getCorpId
()
&&
!
user
.
getCorpId
().
equals
(
enterpriseDTO
.
getWxCorpid
())
&&
!
user
.
getCorpId
().
equals
(
enterpriseDTO
.
getOpenCorpid
()))
{
logger
.
info
(
"corpid不一致,{},{},{}"
,
user
.
getCorpId
(),
enterpriseDTO
.
getWxCorpid
(),
enterpriseDTO
.
getOpenCorpid
());
logger
.
info
(
"corpid不一致,{},{},{}"
,
user
.
getCorpId
(),
enterpriseDTO
.
getWxCorpid
(),
enterpriseDTO
.
getOpenCorpid
());
return
resultResponse
(
HaoBanErrCode
.
ERR_500003
,
user
.
getCorpId
());
}
enterpriseDTO
=
wxEnterpriseApiService
.
getEnterpriseBycorpId
(
user
.
getCorpId
());
...
...
@@ -425,7 +427,7 @@ public class WxEnterpriseInfoController extends WebBaseController {
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
user
);
}
private
MemberLoginQo
getUserByCode
(
String
wxEnterpriseId
,
String
corpid
,
String
code
,
String
enterpriseId
)
{
private
MemberLoginQo
getUserByCode
(
String
wxEnterpriseId
,
String
corpid
,
String
code
,
String
enterpriseId
)
{
SecretSettingDTO
secretSetting
=
wxEnterpriseApiService
.
getSecretSetting
(
wxEnterpriseId
,
SecretTypeEnum
.
MEMBER_WAPP
.
getVal
(),
enterpriseId
);
if
(
null
==
secretSetting
||
StringUtils
.
isBlank
(
secretSetting
.
getSecretVal
()))
{
logger
.
info
(
"MEMBER_WAPPsecret没有配置{},{}"
,
wxEnterpriseId
,
enterpriseId
);
...
...
@@ -536,10 +538,10 @@ public class WxEnterpriseInfoController extends WebBaseController {
}
@RequestMapping
(
value
=
"get-staff-by-id"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"get-staff-by-id"
,
method
=
RequestMethod
.
GET
)
public
RestResponse
<
AppStaffVo
>
getStaffInfoById
(
String
staffId
)
{
if
(
StringUtils
.
isBlank
(
staffId
))
{
return
RestResponse
.
failure
(
Convert
.
toStr
(
HaoBanErrCode
.
ERR_2
.
getCode
()),
HaoBanErrCode
.
ERR_2
.
getMsg
());
return
RestResponse
.
failure
(
Convert
.
toStr
(
HaoBanErrCode
.
ERR_2
.
getCode
()),
HaoBanErrCode
.
ERR_2
.
getMsg
());
}
StaffDTO
staffDTO
=
staffApiService
.
selectById
(
staffId
);
AppStaffVo
appStaffVo
=
EntityUtil
.
changeEntityByOrika
(
AppStaffVo
.
class
,
staffDTO
);
...
...
@@ -562,7 +564,7 @@ public class WxEnterpriseInfoController extends WebBaseController {
@IgnoreLogin
@HttpLimit
@RequestMapping
(
"get-send-message-info"
)
public
HaobanResponse
getMessageMember
(
String
externalUserid
,
String
staffId
,
String
wxEnterpriseId
,
String
gicEnterpriseId
)
{
public
HaobanResponse
getMessageMember
(
String
externalUserid
,
String
staffId
,
String
wxEnterpriseId
,
String
gicEnterpriseId
)
{
logger
.
info
(
"会员工具传入参数:externalUserid:{},wxUserId:{},wxEnterpriseId:{},gicEnterpriseId:{}"
,
externalUserid
,
staffId
,
wxEnterpriseId
,
gicEnterpriseId
);
if
(
StringUtils
.
isAnyBlank
(
externalUserid
,
staffId
,
wxEnterpriseId
))
{
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
...
...
@@ -577,7 +579,7 @@ public class WxEnterpriseInfoController extends WebBaseController {
logger
.
info
(
"查询到该员工,wxUserId:{}"
,
staffId
);
return
resultResponse
(
HaoBanErrCode
.
ERR_400017
);
}
if
(!
staffDTO
.
getWxEnterpriseId
().
equals
(
wxEnterpriseId
))
{
if
(!
staffDTO
.
getWxEnterpriseId
().
equals
(
wxEnterpriseId
))
{
logger
.
info
(
"查询到该员工,异常"
);
return
resultResponse
(
HaoBanErrCode
.
ERR_400017
);
}
...
...
@@ -587,12 +589,12 @@ public class WxEnterpriseInfoController extends WebBaseController {
return
resultResponse
(
HaoBanErrCode
.
ERR_400021
);
}
//获取自建客户详情
WxEnterpriseQwDTO
qwInfo
=
this
.
wxEnterpriseApiService
.
getQwInfo
(
wxEnterpriseId
)
;
String
wxUserId
=
staffDTO
.
getWxUserId
()
;
if
(
qwInfo
.
needOpenUserIdDk
())
{
wxUserId
=
staffDTO
.
getWxOpenUseId
()
;
WxEnterpriseQwDTO
qwInfo
=
this
.
wxEnterpriseApiService
.
getQwInfo
(
wxEnterpriseId
);
String
wxUserId
=
staffDTO
.
getWxUserId
();
if
(
qwInfo
.
needOpenUserIdDk
())
{
wxUserId
=
staffDTO
.
getWxOpenUseId
();
}
ExternalUserDTO
externalUserDTO
=
memberUnionidRelatedApiService
.
getCorpSelfExternalUseridInfoForMember
(
wxEnterpriseId
,
wxUserId
,
externalUserid
,
gicEnterpriseId
);
ExternalUserDTO
externalUserDTO
=
memberUnionidRelatedApiService
.
getCorpSelfExternalUseridInfoForMember
(
wxEnterpriseId
,
wxUserId
,
externalUserid
,
gicEnterpriseId
);
if
(
externalUserDTO
==
null
)
{
logger
.
info
(
"请先添加好友,企业微信未查询到该好友,externalUserid:{}"
,
externalUserid
);
return
resultResponse
(
HaoBanErrCode
.
ERR_11126
);
...
...
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/vo/WellDoneLoginInfoVO.java
View file @
246a0fdf
...
...
@@ -22,6 +22,8 @@ public class WellDoneLoginInfoVO implements Serializable {
*/
private
String
wxOpenUseId
;
private
Integer
manageFlag
;
public
String
getWxUserId
()
{
return
wxUserId
;
}
...
...
@@ -85,4 +87,12 @@ public class WellDoneLoginInfoVO implements Serializable {
public
void
setWxOpenUseId
(
String
wxOpenUseId
)
{
this
.
wxOpenUseId
=
wxOpenUseId
;
}
public
Integer
getManageFlag
()
{
return
manageFlag
;
}
public
void
setManageFlag
(
Integer
manageFlag
)
{
this
.
manageFlag
=
manageFlag
;
}
}
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