Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fit-finance
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fitness-server
fit-finance
Commits
77618169
Commit
77618169
authored
Mar 06, 2024
by
程裕兵
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:rebind mini appid
parent
5e6c6271
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
8 deletions
+26
-8
service/src/main/java/com/jiejing/fitness/finance/service/merchant/impl/StudioMerchantServiceImpl.java
+22
-4
service/src/main/java/com/jiejing/fitness/finance/service/rpc/MerchantRpcService.java
+4
-4
No files found.
service/src/main/java/com/jiejing/fitness/finance/service/merchant/impl/StudioMerchantServiceImpl.java
View file @
77618169
...
@@ -34,9 +34,11 @@ import com.jiejing.paycenter.api.merchant.vo.AuthSubChannelVO;
...
@@ -34,9 +34,11 @@ import com.jiejing.paycenter.api.merchant.vo.AuthSubChannelVO;
import
com.jiejing.paycenter.api.merchant.vo.ConfigSubChannelVO
;
import
com.jiejing.paycenter.api.merchant.vo.ConfigSubChannelVO
;
import
com.jiejing.paycenter.api.merchant.vo.MerchantVO
;
import
com.jiejing.paycenter.api.merchant.vo.MerchantVO
;
import
com.jiejing.paycenter.api.merchant.vo.SubChannelAuthVO
;
import
com.jiejing.paycenter.api.merchant.vo.SubChannelAuthVO
;
import
com.jiejing.paycenter.api.merchant.vo.SubChannelConfigVO
;
import
com.jiejing.paycenter.common.enums.common.OpenStateEnums
;
import
com.jiejing.paycenter.common.enums.common.OpenStateEnums
;
import
com.jiejing.paycenter.common.enums.merchant.ResourceTypeEnums
;
import
com.jiejing.paycenter.common.enums.merchant.ResourceTypeEnums
;
import
com.jiejing.paycenter.common.enums.merchant.SubChannelAuthTypeEnums
;
import
com.jiejing.paycenter.common.enums.merchant.SubChannelAuthTypeEnums
;
import
com.jiejing.paycenter.common.enums.merchant.SubChannelConfigTypeEnums
;
import
com.jiejing.paycenter.common.enums.merchant.SubChannelEnums
;
import
com.jiejing.paycenter.common.enums.merchant.SubChannelEnums
;
import
com.jiejing.paycenter.common.event.MerchantEvent
;
import
com.jiejing.paycenter.common.event.MerchantEvent
;
import
com.jiejing.paycenter.common.model.ResourceInfo
;
import
com.jiejing.paycenter.common.model.ResourceInfo
;
...
@@ -190,8 +192,8 @@ public class StudioMerchantServiceImpl implements StudioMerchantService {
...
@@ -190,8 +192,8 @@ public class StudioMerchantServiceImpl implements StudioMerchantService {
if
(
null
==
relation
)
{
if
(
null
==
relation
)
{
throw
new
BizException
(
FinanceErrorEnums
.
MERCHANT_NOT_OPEN
);
throw
new
BizException
(
FinanceErrorEnums
.
MERCHANT_NOT_OPEN
);
}
}
ConfigSubChannelVO
vo
=
merchantRpcService
.
bindAppIdWxXcxOffline
(
channel
,
IdWorker
.
getIdStr
(),
ConfigSubChannelVO
vo
=
merchantRpcService
.
bindAppIdWxXcxOffline
(
channel
,
relation
.
getMerchantId
(),
relation
.
getMerchantId
(),
appId
);
appId
);
return
StudioMerchantBindXcxAppIdVO
.
builder
().
state
(
vo
.
getState
()).
failMessage
(
vo
.
getFailMessage
())
return
StudioMerchantBindXcxAppIdVO
.
builder
().
state
(
vo
.
getState
()).
failMessage
(
vo
.
getFailMessage
())
.
build
();
.
build
();
...
@@ -243,15 +245,31 @@ public class StudioMerchantServiceImpl implements StudioMerchantService {
...
@@ -243,15 +245,31 @@ public class StudioMerchantServiceImpl implements StudioMerchantService {
if
(
OpenStateEnums
.
SUCCESS
==
applyToModify
.
getOpenState
())
{
if
(
OpenStateEnums
.
SUCCESS
==
applyToModify
.
getOpenState
())
{
// 所有子通道全部开通成功
// 所有子通道全部开通成功
// 1. 绑定场馆
// 1. 配置场馆小程序appId
PartyToMerchant
relation
=
getRelation
(
apply
.
getStudioId
());
if
(
null
!=
relation
)
{
this
.
rebindMiniAppId
(
relation
.
getMerchantId
(),
event
.
getMerchantId
());
}
// 2. 绑定场馆
this
.
bind
(
apply
.
getStudioId
(),
event
.
getMerchantId
());
this
.
bind
(
apply
.
getStudioId
(),
event
.
getMerchantId
());
//
2
. 绑定品牌
//
3
. 绑定品牌
brandMerchantService
.
bind
(
apply
.
getBrandId
(),
event
.
getMerchantId
());
brandMerchantService
.
bind
(
apply
.
getBrandId
(),
event
.
getMerchantId
());
}
}
}
}
private
void
rebindMiniAppId
(
Long
oldMerchantId
,
Long
newMerchantId
)
{
MerchantVO
merchant
=
merchantRpcService
.
getByMerchantId
(
oldMerchantId
);
merchant
.
getSubChannelConfigs
().
stream
()
.
filter
(
e
->
SubChannelConfigTypeEnums
.
WX_XCX_OFFLINE
.
name
().
equals
(
e
.
getConfigType
()))
.
forEach
(
config
->
merchantRpcService
.
bindAppIdWxXcxOffline
(
merchant
.
getChannelNo
(),
newMerchantId
,
config
.
getAppId
()));
}
private
Map
<
ResourceTypeEnums
,
ResourceInfo
>
upload
(
ApplyStudioMerchantParams
params
)
{
private
Map
<
ResourceTypeEnums
,
ResourceInfo
>
upload
(
ApplyStudioMerchantParams
params
)
{
Map
<
ResourceTypeEnums
,
ResourceInfo
>
resourceMap
=
MerchantConvert
.
convertResourceMap
(
Map
<
ResourceTypeEnums
,
ResourceInfo
>
resourceMap
=
MerchantConvert
.
convertResourceMap
(
...
...
service/src/main/java/com/jiejing/fitness/finance/service/rpc/MerchantRpcService.java
View file @
77618169
...
@@ -56,10 +56,9 @@ public class MerchantRpcService {
...
@@ -56,10 +56,9 @@ public class MerchantRpcService {
return
result
.
getResult
();
return
result
.
getResult
();
}
}
public
ConfigSubChannelVO
bindAppIdWxXcxOffline
(
String
channelNo
,
String
applyNo
,
Long
merchantId
,
public
ConfigSubChannelVO
bindAppIdWxXcxOffline
(
String
channelNo
,
Long
merchantId
,
String
appId
)
{
String
appId
)
{
JsonResult
<
ConfigSubChannelVO
>
result
=
merchantApi
.
configSubChannel
(
ConfigSubChannelRequest
.
builder
()
JsonResult
<
ConfigSubChannelVO
>
result
=
merchantApi
.
configSubChannel
(
ConfigSubChannelRequest
.
builder
()
.
applyNo
(
applyNo
)
.
applyNo
(
IdWorker
.
getIdStr
()
)
.
appId
(
appId
)
.
appId
(
appId
)
.
merchantId
(
merchantId
)
.
merchantId
(
merchantId
)
.
channelNo
(
channelNo
)
.
channelNo
(
channelNo
)
...
@@ -67,7 +66,8 @@ public class MerchantRpcService {
...
@@ -67,7 +66,8 @@ public class MerchantRpcService {
.
configType
(
SubChannelConfigTypeEnums
.
WX_XCX_OFFLINE
)
.
configType
(
SubChannelConfigTypeEnums
.
WX_XCX_OFFLINE
)
.
build
());
.
build
());
if
(!
result
.
getSuccess
())
{
if
(!
result
.
getSuccess
())
{
return
ConfigSubChannelVO
.
builder
().
state
(
OpenStateEnums
.
FAIL
.
name
()).
failMessage
(
result
.
getMessage
()).
build
();
return
ConfigSubChannelVO
.
builder
().
state
(
OpenStateEnums
.
FAIL
.
name
()).
failMessage
(
result
.
getMessage
())
.
build
();
}
}
return
result
.
getResult
();
return
result
.
getResult
();
}
}
...
...
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