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
ddc46624
Commit
ddc46624
authored
Mar 11, 2022
by
墨竹
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:新增修好友openuserid
parent
c0737f61
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
0 deletions
+38
-0
TestController.java
.../com/gic/haoban/manage/web/controller/TestController.java
+38
-0
No files found.
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/TestController.java
View file @
ddc46624
...
...
@@ -28,6 +28,7 @@ import org.springframework.web.bind.annotation.RequestParam;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.TreeMap
;
import
java.util.concurrent.ExecutorService
;
...
...
@@ -75,6 +76,8 @@ public class TestController extends WebBaseController {
private
QywxUserApiService
qywxUserApiService
;
@Autowired
private
StaffApiService
staffApiService
;
@Autowired
private
WxApplicationApiService
wxApplicationApiService
;
@RequestMapping
(
"/send-message-test"
)
public
HaobanResponse
testSendMessage
(
QywxXcxSendMessageQo
qo
)
{
...
...
@@ -276,4 +279,39 @@ public class TestController extends WebBaseController {
}
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
/**
* 后台单个处理wx_user_id to wx_open_user_id
*
* @param corpid
* @param staffId
* @return
*/
@RequestMapping
(
"/useridToOpenuseridByStaffId"
)
public
HaobanResponse
useridToOpenuseridByStaffId
(
String
corpid
,
String
staffId
)
{
StaffDTO
staffDTO
=
staffApiService
.
selectById
(
staffId
);
if
(
staffDTO
==
null
)
{
return
resultResponse
(
HaoBanErrCode
.
ERR_8
);
}
String
wxUserId
=
staffDTO
.
getWxUserId
();
String
openUserid
=
getOpenUserid
(
wxUserId
,
corpid
);
staffApiService
.
updateOpenUserIdsByUserId
(
staffDTO
.
getWxEnterpriseId
(),
wxUserId
,
openUserid
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
/**
* 获取openuserid
*
* @param userId
* @param corpid
* @return
*/
private
String
getOpenUserid
(
String
userId
,
String
corpid
)
{
WxApplicationDTO
wxApplicationDTO
=
wxApplicationApiService
.
selectByCorpid
(
corpid
);
List
<
QywxNewUseridDTO
>
qywxNewUseridDTOS
=
qywxUserApiService
.
useridToOpenuserid
(
corpid
,
wxApplicationDTO
.
getSiteId
(),
Collections
.
singletonList
(
userId
));
if
(
CollectionUtils
.
isEmpty
(
qywxNewUseridDTOS
))
{
return
""
;
}
return
qywxNewUseridDTOS
.
get
(
0
).
getOpen_userid
();
}
}
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