Commit 5834916f by 程裕兵

feat: unbind

parent 8d2ee4e2
...@@ -346,19 +346,24 @@ public class StudioMerchantServiceImpl implements StudioMerchantService { ...@@ -346,19 +346,24 @@ public class StudioMerchantServiceImpl implements StudioMerchantService {
// 所有子通道全部开通成功 // 所有子通道全部开通成功
PartyToMerchant old = getRelation(apply.getStudioId()); PartyToMerchant old = getRelation(apply.getStudioId());
// 1. 绑定场馆 // 1. 如果当前场馆绑定的是自己的商户号(old),则需要将绑定了该商户号的所有其他场馆进行解绑
this.bind(apply.getStudioId(), event.getMerchantId(), false);
if (null != old && !old.getMerchantId().equals(event.getMerchantId())) { if (null != old && !old.getMerchantId().equals(event.getMerchantId())) {
// 1.1 场馆商户发生了变更,解绑掉绑定了老商户号的所有场馆 StudioMerchantApply oldApply = studioMerchantApplyRpService.getLatestOneSuccessByMerchantId(
old.getMerchantId());
if (!oldApply.getStudioId().equals(apply.getStudioId())) {
// 1.1 如果当前场馆绑定的是自己的商户号(old),则需要将绑定了该商户号的所有其他场馆进行解绑
this.unbindAll(old.getMerchantId()); this.unbindAll(old.getMerchantId());
// 1.2 场馆商户发生了变更,解绑掉绑定了老商户号的品牌 // 1.2 场馆商户发生了变更,解绑掉绑定了老商户号的品牌
brandMerchantService.unbind(apply.getBrandId(), old.getMerchantId()); brandMerchantService.unbind(apply.getBrandId(), old.getMerchantId());
} }
}
// 2. 绑定品牌 // 2. 绑定场馆
this.bind(apply.getStudioId(), event.getMerchantId(), false);
// 3. 绑定品牌
brandMerchantService.bind(apply.getBrandId(), event.getMerchantId()); brandMerchantService.bind(apply.getBrandId(), event.getMerchantId());
// 3. 其他操作 // 4. 其他操作
executor.execute(() -> this.doAfterMerchantSuccess(event, executor.execute(() -> this.doAfterMerchantSuccess(event,
Optional.ofNullable(old).map(PartyToMerchant::getMerchantId).orElse(null))); Optional.ofNullable(old).map(PartyToMerchant::getMerchantId).orElse(null)));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment