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
45f47bd4
Commit
45f47bd4
authored
Mar 06, 2024
by
程裕兵
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:rebind mini appid
parent
77618169
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
13 deletions
+20
-13
service/src/main/java/com/jiejing/fitness/finance/service/merchant/impl/StudioMerchantServiceImpl.java
+20
-13
No files found.
service/src/main/java/com/jiejing/fitness/finance/service/merchant/impl/StudioMerchantServiceImpl.java
View file @
45f47bd4
...
@@ -48,6 +48,7 @@ import java.util.List;
...
@@ -48,6 +48,7 @@ import java.util.List;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.Objects
;
import
java.util.Objects
;
import
java.util.Optional
;
import
java.util.Optional
;
import
java.util.concurrent.Executor
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
...
@@ -90,6 +91,9 @@ public class StudioMerchantServiceImpl implements StudioMerchantService {
...
@@ -90,6 +91,9 @@ public class StudioMerchantServiceImpl implements StudioMerchantService {
@Resource
@Resource
private
BrandMerchantService
brandMerchantService
;
private
BrandMerchantService
brandMerchantService
;
@Resource
(
name
=
"financeThreadPool"
)
private
Executor
executor
;
@Async
(
value
=
"financeThreadPool"
)
@Async
(
value
=
"financeThreadPool"
)
@Override
@Override
public
void
apply
(
ApplyStudioMerchantParams
params
)
{
public
void
apply
(
ApplyStudioMerchantParams
params
)
{
...
@@ -238,27 +242,30 @@ public class StudioMerchantServiceImpl implements StudioMerchantService {
...
@@ -238,27 +242,30 @@ public class StudioMerchantServiceImpl implements StudioMerchantService {
private
void
doOpenMerchantSuccess
(
MerchantEvent
event
)
{
private
void
doOpenMerchantSuccess
(
MerchantEvent
event
)
{
StudioMerchantApply
apply
=
studioMerchantApplyRpService
.
getByIdForUpdate
(
StudioMerchantApply
apply
=
studioMerchantApplyRpService
.
getByIdForUpdate
(
Long
.
parseLong
(
event
.
getApplyNo
())).
orElseThrow
(()
->
new
BizException
(
FinanceErrorEnums
.
NOT_EXIST
));
Long
.
parseLong
(
event
.
getApplyNo
())).
orElseThrow
(()
->
new
BizException
(
FinanceErrorEnums
.
NOT_EXIST
));
StudioMerchantApply
toModify
=
MerchantConvert
.
convertApply
(
apply
,
event
,
StudioMerchantApply
applyToModify
=
MerchantConvert
.
convertApply
(
apply
,
event
,
getDefaultBrandSubChannelInfo
().
getSubChannels
());
getDefaultBrandSubChannelInfo
().
getSubChannels
());
studioMerchantApplyRpService
.
updateById
(
applyToModify
);
studioMerchantApplyRpService
.
updateById
(
toModify
);
if
(
OpenStateEnums
.
SUCCESS
!=
toModify
.
getOpenState
())
{
if
(
OpenStateEnums
.
SUCCESS
==
applyToModify
.
getOpenState
())
{
return
;
// 所有子通道全部开通成功
// 1. 配置场馆小程序appId
PartyToMerchant
relation
=
getRelation
(
apply
.
getStudioId
());
if
(
null
!=
relation
)
{
this
.
rebindMiniAppId
(
relation
.
getMerchantId
(),
event
.
getMerchantId
());
}
}
// 所有子通道全部开通成功
PartyToMerchant
old
=
getRelation
(
apply
.
getStudioId
());
// 2
. 绑定场馆
// 1
. 绑定场馆
this
.
bind
(
apply
.
getStudioId
(),
event
.
getMerchantId
());
this
.
bind
(
apply
.
getStudioId
(),
event
.
getMerchantId
());
// 3
. 绑定品牌
// 2
. 绑定品牌
brandMerchantService
.
bind
(
apply
.
getBrandId
(),
event
.
getMerchantId
());
brandMerchantService
.
bind
(
apply
.
getBrandId
(),
event
.
getMerchantId
());
// 3. 其他操作
executor
.
execute
(()
->
this
.
doAfterMerchantSuccess
(
event
,
Optional
.
ofNullable
(
old
).
map
(
PartyToMerchant:
:
getMerchantId
).
orElse
(
null
)));
}
}
private
void
doAfterMerchantSuccess
(
MerchantEvent
event
,
Long
oldMerchantId
)
{
// 1. 配置场馆小程序appId
this
.
rebindMiniAppId
(
oldMerchantId
,
event
.
getMerchantId
());
}
}
private
void
rebindMiniAppId
(
Long
oldMerchantId
,
Long
newMerchantId
)
{
private
void
rebindMiniAppId
(
Long
oldMerchantId
,
Long
newMerchantId
)
{
...
...
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