Commit 551c23dc by 程裕兵

feat:unbind all

parent 4572400a
......@@ -90,4 +90,11 @@ public class PartyToMerchantRpService extends
wrapper.eq(PartyToMerchant.PARTY_TYPE, partyType.getCode());
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 {
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 {
}
@Override
public void unbindAll(Long studioId) {
partyToMerchantRpService.deleteByParty(studioId, PartyTypeEnum.STUDIO);
public void unbindAll(Long merchantId) {
partyToMerchantRpService.deleteByMerchantId(merchantId, PartyTypeEnum.STUDIO);
}
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
......@@ -288,6 +288,10 @@ public class StudioMerchantServiceImpl implements StudioMerchantService {
// 1. 绑定场馆
this.bind(apply.getStudioId(), event.getMerchantId(), false);
// 1.1 解绑掉绑定了老商户号的所有场馆
if (null != old) {
this.unbindAll(old.getMerchantId());
}
// 2. 绑定品牌
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