|
|
|
@@ -366,7 +366,7 @@ public class WxCouponServiceImpl implements WxCouponService { |
|
|
|
return null; |
|
|
|
} |
|
|
|
|
|
|
|
List<WxMerchantVo> merchantList = getMerchantVoList(wxCouponCVo, wxCouponCVo.getId(), wxCouponCVo.getType()); |
|
|
|
List<WxMerchantVo> merchantList = getMerchantVoList(wxCouponCVo, mallTenantEntity, wxCouponCVo.getId(), wxCouponCVo.getType()); |
|
|
|
|
|
|
|
wxCouponCVo.setMerchantVoList(merchantList); |
|
|
|
if(EnumCouponType.COUPON_GIFT.getCode().equals(wxCouponCVo.getType())){ |
|
|
|
@@ -382,21 +382,26 @@ public class WxCouponServiceImpl implements WxCouponService { |
|
|
|
return wxCouponCVo; |
|
|
|
} |
|
|
|
|
|
|
|
private List<WxMerchantVo> getMerchantVoList(TenantEntity couponTenant,Long couponId,Integer couponType){ |
|
|
|
if (EnumCouponType.isParentCoupon(couponType)){ |
|
|
|
WxCouponMall couponMall = new WxCouponMall(); |
|
|
|
couponMall.updateTenantInfo(couponTenant); |
|
|
|
couponMall.setProductId(couponId); |
|
|
|
couponMall.setStatus(EnumCouponMallStatus.FINISED.getCode()); |
|
|
|
List<WxCouponMall> couponMallList = wxCouponMallMapper.findList(couponMall); |
|
|
|
List<WxMerchantVo> merchantVoList = new ArrayList<>(); |
|
|
|
if (null != couponMallList && couponMallList.size()> 0 ) { |
|
|
|
for (WxCouponMall cm:couponMallList) { |
|
|
|
WxMall mall = wxMallMapper.getByTenantId(cm.getMallTenantId()); |
|
|
|
merchantVoList.addAll(getCouponMerchantList(couponId, mall)); |
|
|
|
private List<WxMerchantVo> getMerchantVoList(TenantEntity couponTenant,TenantEntity mallTenant,Long couponId,Integer couponType){ |
|
|
|
if (EnumCouponType.isParentCoupon(couponType) && couponTenant.getTenantId().equals(mallTenant)){ |
|
|
|
//集团查券 查询所有门店 |
|
|
|
if(couponTenant.getTenantId().equals(mallTenant.getTenantId())){ |
|
|
|
WxCouponMall couponMall = new WxCouponMall(); |
|
|
|
couponMall.updateTenantInfo(couponTenant); |
|
|
|
couponMall.setProductId(couponId); |
|
|
|
List<WxCouponMall> couponMallList = wxCouponMallMapper.findList(couponMall); |
|
|
|
List<WxMerchantVo> merchantVoList = new ArrayList<>(); |
|
|
|
if (null != couponMallList && couponMallList.size()> 0 ) { |
|
|
|
for (WxCouponMall cm:couponMallList) { |
|
|
|
WxMall mall = wxMallMapper.getByTenantId(cm.getMallTenantId()); |
|
|
|
merchantVoList.addAll(getCouponMerchantList(couponId, mall)); |
|
|
|
} |
|
|
|
} |
|
|
|
return merchantVoList; |
|
|
|
//子广场查券 只查询自己广场的门店 |
|
|
|
}else{ |
|
|
|
return getCouponMerchantList(couponId,mallTenant); |
|
|
|
} |
|
|
|
return merchantVoList; |
|
|
|
}else{ |
|
|
|
return getCouponMerchantList(couponId,couponTenant); |
|
|
|
} |
|
|
|
|