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
7ee3c6dc
Commit
7ee3c6dc
authored
Aug 15, 2024
by
徐高华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
企微托管导购授权
parent
2fc03500
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
0 deletions
+55
-0
QywxOpenController.java
...haoban/manage/web/controller/open/QywxOpenController.java
+55
-0
No files found.
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/open/QywxOpenController.java
View file @
7ee3c6dc
...
...
@@ -19,6 +19,7 @@ import com.gic.enterprise.api.dto.WechatWorkServiceSetting;
import
com.gic.enterprise.api.service.EnterpriseService
;
import
com.gic.enterprise.api.service.EnterpriseUseForbidService
;
import
com.gic.haoban.base.api.common.pojo.dto.WebLoginDTO
;
import
com.gic.haoban.common.anno.IgnoreLogin
;
import
com.gic.haoban.common.utils.AuthWebRequestUtil
;
import
com.gic.haoban.common.utils.EntityUtil
;
import
com.gic.haoban.manage.api.dto.*
;
...
...
@@ -217,6 +218,7 @@ public class QywxOpenController {
* @return
*/
@RequestMapping
(
"get-open-staff"
)
@IgnoreLogin
public
RestResponse
<
OpenStaffDTO
>
getOpenStaff
(
Long
openStaffId
)
{
ServiceResponse
<
OpenStaffDTO
>
resp
=
this
.
openStaffApiService
.
getById
(
openStaffId
);
if
(!
resp
.
isSuccess
())
{
...
...
@@ -237,6 +239,7 @@ public class QywxOpenController {
* @return
*/
@RequestMapping
(
"check-code"
)
@IgnoreLogin
public
RestResponse
<
Void
>
checkCode
(
Long
openStaffId
,
String
code
)
{
ServiceResponse
<
Void
>
resp
=
this
.
openStaffApiService
.
checkCode
(
openStaffId
,
code
);
if
(!
resp
.
isSuccess
())
{
...
...
@@ -343,4 +346,56 @@ public class QywxOpenController {
return
vo
;
}
/**
* 导购授权
* @param wxEnterpriseId
* @param enterpriseId
* @param clerkCode
* @return
*/
@IgnoreLogin
@RequestMapping
(
"open-qrcode-for-clerk"
)
public
RestResponse
<
OpenStaffDTO
>
cancelOpenStaff
(
String
wxEnterpriseId
,
String
enterpriseId
,
String
clerkCode
)
{
if
(
org
.
apache
.
commons
.
lang3
.
StringUtils
.
isAnyBlank
(
wxEnterpriseId
,
enterpriseId
,
clerkCode
))
{
return
RestResponse
.
failure
(
"9999"
,
"参数为空"
)
;
}
ClerkDTO
clerk
=
this
.
clerkService
.
getClerkByClerkCode
(
enterpriseId
,
clerkCode
)
;
if
(
null
==
clerk
)
{
return
RestResponse
.
failure
(
"9999"
,
"该账号在当前企业下不存在"
)
;
}
String
clerkId
=
clerk
.
getClerkId
()
;
StaffClerkRelationDTO
staffClerkRelationDTO
=
this
.
staffClerkRelationApiService
.
getByClerkId
(
clerkId
)
;
if
(
null
==
staffClerkRelationDTO
)
{
return
RestResponse
.
failure
(
"9999"
,
"该账号未绑定好办小程序"
)
;
}
String
staffId
=
staffClerkRelationDTO
.
getStaffId
()
;
ServiceResponse
<
OpenStaffDTO
>
staffResp
=
this
.
openStaffApiService
.
getByStaffId
(
staffId
)
;
if
(!
staffResp
.
isSuccess
()
||
null
==
staffResp
.
getResult
())
{
return
RestResponse
.
failure
(
"9999"
,
"此成员未添加到授权列表"
)
;
}
OpenStaffDTO
openStaff
=
staffResp
.
getResult
()
;
if
(
openStaff
.
getStatusFlag
()==
1
)
{
return
RestResponse
.
failure
(
"9999"
,
"成员正托管中"
)
;
}
String
checkMsg
=
this
.
check
(
wxEnterpriseId
,
enterpriseId
,
true
);
if
(
null
!=
checkMsg
)
{
return
RestResponse
.
failure
(
"9999"
,
checkMsg
);
}
OpenStaffInitQDTO
initQDTO
=
new
OpenStaffInitQDTO
();
initQDTO
.
setWxEnterpriseId
(
wxEnterpriseId
);
initQDTO
.
setEnterpriseId
(
enterpriseId
);
initQDTO
.
setStaffId
(
staffId
);
initQDTO
.
setLoginAgainFlag
(
0
);
ServiceResponse
<
OpenStaffDTO
>
initResp
=
this
.
openStaffApiService
.
init
(
initQDTO
);
if
(!
initResp
.
isSuccess
())
{
return
RestResponse
.
failure
(
"9999"
,
initResp
.
getMessage
());
}
OpenStaffDTO
openStaffDTO
=
initResp
.
getResult
();
openStaffDTO
.
setStaffName
(
staffClerkRelationDTO
.
getStaffName
());
StaffDTO
staff
=
this
.
staffApiService
.
selectById
(
openStaffDTO
.
getStaffId
());
openStaffDTO
.
setStaffHeadImg
(
staff
.
getHeadImg
());
return
RestResponse
.
successResult
(
openStaffDTO
);
}
}
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