Commit 551c23dc by 程裕兵

feat:unbind all

parent 4572400a
...@@ -90,4 +90,11 @@ public class PartyToMerchantRpService extends ...@@ -90,4 +90,11 @@ public class PartyToMerchantRpService extends
wrapper.eq(PartyToMerchant.PARTY_TYPE, partyType.getCode()); wrapper.eq(PartyToMerchant.PARTY_TYPE, partyType.getCode());
return this.baseMapper.selectList(wrapper); return this.baseMapper.selectList(wrapper);
} }
public void deleteByMerchantId(Long merchantId, PartyTypeEnum partyType) {
QueryWrapper<PartyToMerchant> wrapper = new QueryWrapper<>();
wrapper.eq(PartyToMerchant.MERCHANT_ID, merchantId);
wrapper.eq(PartyToMerchant.PARTY_TYPE, partyType.getCode());
this.baseMapper.delete(wrapper);
}
} }
...@@ -43,11 +43,11 @@ public interface StudioMerchantService { ...@@ -43,11 +43,11 @@ public interface StudioMerchantService {
void unbind(Long studioId, Long merchantId); void unbind(Long studioId, Long merchantId);
/** /**
* 解绑所有 * 解绑绑定了指定商户的所有场馆
* *
* @param studioId 场馆ID * @param merchantId 商户ID
*/ */
void unbindAll(Long studioId); void unbindAll(Long merchantId);
/** /**
* 进件申请回调 * 进件申请回调
......
...@@ -151,8 +151,8 @@ public class StudioMerchantServiceImpl implements StudioMerchantService { ...@@ -151,8 +151,8 @@ public class StudioMerchantServiceImpl implements StudioMerchantService {
} }
@Override @Override
public void unbindAll(Long studioId) { public void unbindAll(Long merchantId) {
partyToMerchantRpService.deleteByParty(studioId, PartyTypeEnum.STUDIO); partyToMerchantRpService.deleteByMerchantId(merchantId, PartyTypeEnum.STUDIO);
} }
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class) @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
...@@ -288,6 +288,10 @@ public class StudioMerchantServiceImpl implements StudioMerchantService { ...@@ -288,6 +288,10 @@ public class StudioMerchantServiceImpl implements StudioMerchantService {
// 1. 绑定场馆 // 1. 绑定场馆
this.bind(apply.getStudioId(), event.getMerchantId(), false); this.bind(apply.getStudioId(), event.getMerchantId(), false);
// 1.1 解绑掉绑定了老商户号的所有场馆
if (null != old) {
this.unbindAll(old.getMerchantId());
}
// 2. 绑定品牌 // 2. 绑定品牌
brandMerchantService.bind(apply.getBrandId(), event.getMerchantId()); brandMerchantService.bind(apply.getBrandId(), event.getMerchantId());
......
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