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
57042132
Commit
57042132
authored
Jan 15, 2023
by
jinxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
获取敏感信息接口开发
parent
d0f39e56
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
79 additions
and
0 deletions
+79
-0
StaffApiService.java
...va/com/gic/haoban/manage/api/service/StaffApiService.java
+7
-0
StaffMapper.java
...com/gic/haoban/manage/service/dao/mapper/StaffMapper.java
+7
-0
StaffApiServiceImpl.java
.../manage/service/service/out/impl/StaffApiServiceImpl.java
+8
-0
StaffMapper.xml
...manage3-service/src/main/resources/mapper/StaffMapper.xml
+4
-0
ServiceTest.java
haoban-manage3-service/src/test/java/ServiceTest.java
+8
-0
WxStaffController.java
...m/gic/haoban/manage/web/controller/WxStaffController.java
+45
-0
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/StaffApiService.java
View file @
57042132
...
...
@@ -185,6 +185,13 @@ public interface StaffApiService {
int
updateOpenIdByStaffId
(
String
staffId
,
String
openId
);
/**
* 根据员工id获取二维码
* @param staffId
* @return
*/
int
getQrCodeByStaffId
(
String
staffId
);
/**
* 更新二维码通过员工id
*
* @param staffId 员工id
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/StaffMapper.java
View file @
57042132
...
...
@@ -69,6 +69,13 @@ public interface StaffMapper {
int
updateOpenIdByStaffId
(
@Param
(
"staffId"
)
String
staffId
,
@Param
(
"openId"
)
String
openId
);
/**
* 根据员工id获取二维码
* @param staffId
* @return
*/
String
getQrCodeByStaffId
(
@Param
(
"staffId"
)
String
staffId
);
/**
* 更新二维码通过员工id
*
* @param staffId 员工id
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/StaffApiServiceImpl.java
View file @
57042132
...
...
@@ -742,6 +742,14 @@ public class StaffApiServiceImpl implements StaffApiService {
}
@Override
public
int
getQrCodeByStaffId
(
String
staffId
)
{
String
qrCode
=
staffMapper
.
getQrCodeByStaffId
(
staffId
);
if
(
StringUtils
.
isNotBlank
(
qrCode
))
return
1
;
return
0
;
}
@Override
public
int
updateQrCodeByStaffId
(
String
staffId
,
String
qrCode
)
{
return
staffMapper
.
updateQrCodeByStaffId
(
staffId
,
qrCode
);
}
...
...
haoban-manage3-service/src/main/resources/mapper/StaffMapper.xml
View file @
57042132
...
...
@@ -435,6 +435,10 @@
and wx_user_id = #{wxUserId}
</update>
<select
id=
"getQrCodeByStaffId"
resultType=
"string"
>
select qr_code from tab_haoban_staff where staff_id = #{staffId} and status_flag = 1
</select>
<update
id=
"updateOpenIdByStaffId"
parameterType=
"com.gic.haoban.manage.service.entity.TabHaobanStaff"
>
update tab_haoban_staff
set wx_open_id = #{openId},
...
...
haoban-manage3-service/src/test/java/ServiceTest.java
View file @
57042132
...
...
@@ -45,6 +45,9 @@ public class ServiceTest {
@Autowired
private
Config
config
;
@Autowired
private
StaffApiService
staffApiService
;
@Test
public
void
test
()
{
...
...
@@ -69,4 +72,9 @@ public class ServiceTest {
String
autoActiveStatus
=
qywxUserApiService
.
getAutoActiveStatus
(
"wp59NLDQAAJL6DsM6YwOGqJlhCBykkeA"
,
config
.
getCorpid
());
System
.
out
.
println
(
autoActiveStatus
);
}
@Test
public
void
test5
(){
int
qrCodeByStaffId
=
staffApiService
.
getQrCodeByStaffId
(
"00af1fe7e75644a7accdcb84e126e50c"
);
System
.
out
.
println
(
"111111111111111111111111111111111"
+
qrCodeByStaffId
);
}
}
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/WxStaffController.java
View file @
57042132
...
...
@@ -15,6 +15,9 @@ import java.util.stream.Collectors;
import
javax.validation.Valid
;
import
com.gic.wechat.api.dto.qywx.fee.UserSensitiveInfoDTO
;
import
com.gic.wechat.api.service.qywx.QywxCorpApiService
;
import
com.gic.wechat.api.service.qywx.QywxSuiteApiService
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
...
...
@@ -155,6 +158,10 @@ public class WxStaffController extends WebBaseController {
private
HaobanRoleApiService
haobanRoleApiService
;
@Autowired
private
PowerService
powerService
;
@Autowired
private
QywxCorpApiService
qywxCorpApiService
;
@Autowired
private
QywxUserApiService
qywxUserApiService
;
//选择成员列表
@RequestMapping
(
"/staff-list"
)
...
...
@@ -1786,4 +1793,42 @@ public class WxStaffController extends WebBaseController {
retPage
.
setResult
(
resultList
);
return
RestResponse
.
successResult
(
retPage
);
}
/**
* 获取构造网页授权链接url
* @return
*/
@RequestMapping
(
"get-third-auth-url"
)
public
HaobanResponse
getAuthUrl
()
{
String
suiteId
=
config
.
getSuiteId
();
logger
.
info
(
"通讯录应用ID:{}"
,
suiteId
);
String
redictUrl
=
config
.
getHost
()
+
"third-callback"
;
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
)
{
logger
.
info
(
"获取第三方应用用户敏感信息企微回调的code:{}"
,
code
);
String
suiteId
=
config
.
getSuiteId
();
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
.
updateQrCodeByStaffId
(
result
.
getUserid
(),
result
.
getQr_code
());
}
}
/**
* 判断成员是否授权获取敏感信息
*/
@RequestMapping
(
"get-sensitive-status"
)
public
HaobanResponse
getSensitiveStatus
(
String
staffId
){
int
qrCodeByStaffId
=
staffApiService
.
getQrCodeByStaffId
(
staffId
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
qrCodeByStaffId
);
}
}
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