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
bfeff411
Commit
bfeff411
authored
Jan 29, 2023
by
徐高华
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/获取用户敏感信息' into 'developer'
更新qrcode See merge request
!901
parents
b8a46522
18a2c40b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
48 deletions
+7
-48
WxStaffController.java
...m/gic/haoban/manage/web/controller/WxStaffController.java
+7
-48
No files found.
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/WxStaffController.java
View file @
bfeff411
...
...
@@ -43,7 +43,6 @@ import com.gic.haoban.manage.web.qo.CommonQO;
import
com.gic.haoban.manage.web.vo.*
;
import
com.gic.haoban.manage.web.vo.notify.CustomerFriendMemberVO
;
import
com.gic.redis.data.util.RedisUtil
;
import
com.gic.wechat.api.dto.qywx.fee.UserSensitiveInfoDTO
;
import
com.gic.wechat.api.service.qywx.QywxCorpApiService
;
import
com.gic.wechat.api.service.qywx.QywxUserApiService
;
import
org.apache.commons.collections.CollectionUtils
;
...
...
@@ -53,9 +52,7 @@ import org.slf4j.LoggerFactory;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.validation.Valid
;
import
java.io.IOException
;
import
java.util.*
;
import
java.util.stream.Collectors
;
...
...
@@ -107,8 +104,6 @@ public class WxStaffController extends WebBaseController {
private
HaobanRoleApiService
haobanRoleApiService
;
@Autowired
private
PowerService
powerService
;
@Autowired
private
QywxCorpApiService
qywxCorpApiService
;
//选择成员列表
@RequestMapping
(
"/staff-list"
)
...
...
@@ -1742,49 +1737,6 @@ public class WxStaffController extends WebBaseController {
}
/**
* 获取构造网页授权链接url
* @return
*/
@RequestMapping
(
"get-third-auth-url"
)
public
HaobanResponse
getAuthUrl
()
{
String
suiteId
=
config
.
getWxSuiteid
();
logger
.
info
(
"通讯录应用ID:{}"
,
suiteId
);
String
host
=
config
.
getHost
()
+
"third-callback"
;
//haoban-manage3-web 替换成 haoban-manage3-wx
String
redictUrl
=
host
.
replaceAll
(
"-web"
,
"-wx"
);
logger
.
info
(
"替换后的url:{}"
,
redictUrl
);
String
authorizationUrl
=
qywxCorpApiService
.
getAuthorizationUrl
(
suiteId
,
redictUrl
,
"snsapi_privateinfo"
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
authorizationUrl
);
}
/**
* 更新成员的qr_code
* @param code
*/
@RequestMapping
(
"third-callback"
)
public
void
getAuthUrl
(
String
code
,
String
state
,
HttpServletResponse
response
)
{
logger
.
info
(
"获取第三方应用用户敏感信息企微回调的code:{},state:{}"
,
code
,
state
);
String
suiteId
=
config
.
getWxSuiteid
();
ServiceResponse
<
UserSensitiveInfoDTO
>
dto
=
qywxUserApiService
.
getUserSensitiveInfoDTOByCode
(
code
,
suiteId
);
UserSensitiveInfoDTO
result
=
dto
.
getResult
();
//更新staff的qr_code
if
(
null
!=
result
){
logger
.
info
(
"成员的user_id:{},qr_code:{}"
,
result
.
getUserid
(),
result
.
getQr_code
());
staffApiService
.
updateQrCodeByUserId
(
result
.
getUserid
(),
result
.
getQr_code
());
}
//跳转好办小程序首页
String
host
=
config
.
getHost
();
//haoban-manage3-web 替换成 haoban-manage3-wx
String
redictUrl
=
host
.
replaceAll
(
"-web"
,
"-wx"
)+
"third_callback.html"
;
try
{
logger
.
info
(
"跳转的html地址{}"
,
redictUrl
);
response
.
sendRedirect
(
redictUrl
);
}
catch
(
IOException
e
)
{
throw
new
RuntimeException
(
e
);
}
}
/**
* 判断成员是否授权获取敏感信息
*/
@RequestMapping
(
"get-sensitive-status"
)
...
...
@@ -1792,4 +1744,11 @@ public class WxStaffController extends WebBaseController {
int
qrCodeByStaffId
=
staffApiService
.
getSensitiveStatus
(
staffId
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
qrCodeByStaffId
);
}
@RequestMapping
(
"update-qr-code"
)
public
HaobanResponse
updateQrCode
(
String
staffId
,
String
qrCode
){
this
.
staffApiService
.
updateQrCodeByStaffId
(
staffId
,
qrCode
)
;
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
}
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