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
ca3f71b1
Commit
ca3f71b1
authored
Oct 30, 2023
by
songyinghui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feature: 好办授权接口
parent
b7ff4b9c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
67 additions
and
3 deletions
+67
-3
ContentAccountController.java
...nage/web/controller/content/ContentAccountController.java
+57
-3
ClerkStoreAdaptor.java
...age/web/controller/content/adaptor/ClerkStoreAdaptor.java
+8
-0
dubbo-haoban-manage-wx.xml
...ge3-wx/src/main/webapp/WEB-INF/dubbo-haoban-manage-wx.xml
+2
-0
No files found.
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/content/ContentAccountController.java
View file @
ca3f71b1
package
com
.
gic
.
haoban
.
manage
.
web
.
controller
.
content
;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.clerk.api.dto.ClerkDTO
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.commons.webapi.reponse.RestResponse
;
import
com.gic.content.api.dto.account.AccountAuthorizeDTO
;
import
com.gic.content.api.dto.account.AccountAuthorizeResultDTO
;
import
com.gic.content.api.dto.account.ContentAccountInfoDTO
;
import
com.gic.content.api.enums.ContentAccountQrCodeSourceType
;
import
com.gic.content.api.qdto.account.AccountGenerateQrCodeQDTO
;
import
com.gic.content.api.qdto.account.AccountScanQrCodeResultQDTO
;
import
com.gic.content.api.qdto.account.ContentAccountQDTO
;
import
com.gic.content.api.service.ContentAccountApiService
;
import
com.gic.haoban.manage.web.controller.content.adaptor.ClerkStoreAdaptor
;
import
com.gic.haoban.manage.web.qo.content.account.AccountGenerateQrCodeQo
;
import
com.gic.haoban.manage.web.qo.content.account.AccountInfoQo
;
import
com.gic.haoban.manage.web.qo.content.account.AccountScanResultQo
;
import
com.gic.haoban.manage.web.vo.content.account.AccountAuthorizeResultVo
;
import
com.gic.haoban.manage.web.vo.content.account.AccountAuthorizeVo
;
import
com.gic.haoban.manage.web.vo.content.account.ContentAccountInfoVo
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
* 好办-视频号-授权
...
...
@@ -25,6 +41,10 @@ import java.util.List;
@RequestMapping
(
path
=
"/content/account"
)
public
class
ContentAccountController
{
@Autowired
private
ContentAccountApiService
contentAccountApiService
;
@Autowired
private
ClerkStoreAdaptor
clerkStoreAdaptor
;
/**
* 查询导购当前账号视频号列表
...
...
@@ -33,7 +53,27 @@ public class ContentAccountController {
*/
@RequestMapping
(
path
=
"/list"
)
private
RestResponse
<
List
<
ContentAccountInfoVo
>>
queryAccountList
(
AccountInfoQo
accountInfoQo
)
{
return
RestResponse
.
successResult
();
ClerkDTO
clerkDTO
=
clerkStoreAdaptor
.
queryClerkInfo
(
accountInfoQo
.
getEnterpriseId
(),
accountInfoQo
.
getClerkId
());
if
(
clerkDTO
==
null
)
{
return
RestResponse
.
successResult
(
Collections
.
emptyList
());
}
ContentAccountQDTO
contentAccountQDTO
=
new
ContentAccountQDTO
();
contentAccountQDTO
.
setEnterpriseId
(
accountInfoQo
.
getEnterpriseId
());
contentAccountQDTO
.
setQueryForClerk
(
Boolean
.
TRUE
);
contentAccountQDTO
.
setUserCodes
(
Collections
.
singletonList
(
clerkDTO
.
getClerkCode
()));
contentAccountQDTO
.
setStoreIds
(
Collections
.
singletonList
(
clerkDTO
.
getStoreId
()));
ServiceResponse
<
Page
<
ContentAccountInfoDTO
>>
serviceResponse
=
contentAccountApiService
.
queryAccountList
(
contentAccountQDTO
);
if
(!
serviceResponse
.
isSuccess
())
{
return
RestResponse
.
successResult
();
}
List
<
ContentAccountInfoVo
>
contentAccountInfoVos
=
serviceResponse
.
getResult
()
.
getResult
()
.
stream
()
.
map
(
item
->
EntityUtil
.
changeEntityByJSON
(
ContentAccountInfoVo
.
class
,
item
))
.
collect
(
Collectors
.
toList
());
return
RestResponse
.
successResult
(
contentAccountInfoVos
);
}
...
...
@@ -45,7 +85,15 @@ public class ContentAccountController {
@ResponseBody
@RequestMapping
(
value
=
"/generate/qrcode"
)
public
RestResponse
<
AccountAuthorizeVo
>
generateQrCode
(
AccountGenerateQrCodeQo
accountGenerateQrCodeQo
)
{
return
RestResponse
.
successResult
();
AccountGenerateQrCodeQDTO
accountGenerateQrCodeQDTO
=
new
AccountGenerateQrCodeQDTO
();
accountGenerateQrCodeQDTO
.
setEnterpriseId
(
accountGenerateQrCodeQo
.
getEnterpriseId
());
accountGenerateQrCodeQDTO
.
setSourceType
(
ContentAccountQrCodeSourceType
.
HAOBAN
.
getCode
());
ServiceResponse
<
AccountAuthorizeDTO
>
serviceResponse
=
contentAccountApiService
.
generateQrCode
(
accountGenerateQrCodeQDTO
);
if
(!
serviceResponse
.
isSuccess
())
{
return
RestResponse
.
failure
(
"500"
,
"生成二维码异常"
);
}
return
RestResponse
.
successResult
(
EntityUtil
.
changeEntityByJSON
(
AccountAuthorizeVo
.
class
,
serviceResponse
.
getResult
()));
}
/**
...
...
@@ -56,6 +104,12 @@ public class ContentAccountController {
@ResponseBody
@RequestMapping
(
value
=
"/loop/query/scan/qrcode/result"
)
public
RestResponse
<
AccountAuthorizeResultVo
>
queryScanQrCodeResult
(
AccountScanResultQo
accountScanResultQo
)
{
return
RestResponse
.
successResult
();
AccountScanQrCodeResultQDTO
accountScanQrCodeResultQDTO
=
EntityUtil
.
changeEntityByJSON
(
AccountScanQrCodeResultQDTO
.
class
,
accountScanResultQo
);
ServiceResponse
<
AccountAuthorizeResultDTO
>
serviceResponse
=
contentAccountApiService
.
queryScanQrcodeResult
(
accountScanQrCodeResultQDTO
);
if
(!
serviceResponse
.
isSuccess
())
{
return
RestResponse
.
failure
(
"500"
,
"获取结果异常"
);
}
return
RestResponse
.
successResult
(
EntityUtil
.
changeEntityByJSON
(
AccountAuthorizeResultVo
.
class
,
serviceResponse
.
getResult
()));
}
}
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/content/adaptor/ClerkStoreAdaptor.java
View file @
ca3f71b1
package
com
.
gic
.
haoban
.
manage
.
web
.
controller
.
content
.
adaptor
;
import
com.gic.clerk.api.dto.ClerkDTO
;
import
com.gic.clerk.api.service.ClerkService
;
import
com.gic.haoban.manage.api.dto.StaffClerkRelationDTO
;
import
com.gic.haoban.manage.api.dto.StaffDTO
;
import
com.gic.haoban.manage.api.dto.role.StoreRoleDTO
;
...
...
@@ -28,6 +30,8 @@ public class ClerkStoreAdaptor {
private
StaffApiService
staffApiService
;
@Autowired
private
StaffClerkRelationApiService
staffClerkRelationApiService
;
@Autowired
private
ClerkService
clerkService
;
/**
* 查询区经角色下管辖的门店权限
...
...
@@ -73,4 +77,8 @@ public class ClerkStoreAdaptor {
return
null
;
}
public
ClerkDTO
queryClerkInfo
(
String
enterpriseId
,
String
clerkId
)
{
return
clerkService
.
getClerkByClerkId
(
clerkId
);
}
}
haoban-manage3-wx/src/main/webapp/WEB-INF/dubbo-haoban-manage-wx.xml
View file @
ca3f71b1
...
...
@@ -155,5 +155,7 @@
id=
"contentMaterialCommentApiService"
timeout=
"10000"
retries=
"0"
check=
"false"
/>
<dubbo:reference
id=
"cmeFileApiService"
interface=
"com.gic.content.api.service.CmeFileApiService"
timeout=
"10000"
retries=
"0"
check=
"false"
/>
<dubbo:reference
interface=
"com.gic.content.api.service.ContentAccountApiService"
id=
"contentAccountApiService"
timeout=
"10000"
retries=
"0"
check=
"false"
/>
</beans>
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