| @@ -3,6 +3,7 @@ package com.iformall.service; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.domain.dto.WxMerchantDto; | import com.iformall.domain.dto.WxMerchantDto; | ||||
| import com.iformall.domain.po.WxCoupon; | |||||
| import com.iformall.domain.po.WxMerchantCorp; | import com.iformall.domain.po.WxMerchantCorp; | ||||
| import com.iformall.domain.po.base.TenantEntity; | import com.iformall.domain.po.base.TenantEntity; | ||||
| import com.iformall.domain.po.WxMerchant; | import com.iformall.domain.po.WxMerchant; | ||||
| @@ -200,4 +201,8 @@ public interface WxMerchantService { | |||||
| List<WxMerchantVo> findMerchantListByProduct(TenantEntity tenantEntity,Long productId,boolean hasShop); | List<WxMerchantVo> findMerchantListByProduct(TenantEntity tenantEntity,Long productId,boolean hasShop); | ||||
| WxMerchantCorp getMerchantCorp(TenantEntity tenantInfo, Long id); | WxMerchantCorp getMerchantCorp(TenantEntity tenantInfo, Long id); | ||||
| WxMerchant findAdmin(TenantEntity tenantEntity); | |||||
| WxMerchant findBrandAdmin(TenantEntity tenantEntity, Long brandId); | |||||
| } | } | ||||
| @@ -812,10 +812,10 @@ public class WxCouponServiceImpl implements WxCouponService { | |||||
| //平台券,集团商管商户 | //平台券,集团商管商户 | ||||
| if (EnumCouponType.COUPON_DOUYIN_PLAT.getCode() == coupon.getType()) { | if (EnumCouponType.COUPON_DOUYIN_PLAT.getCode() == coupon.getType()) { | ||||
| //TODO 查询集团商管商户 | //TODO 查询集团商管商户 | ||||
| makeMerchant = wxMerchantService.findAdmin(coupon); | |||||
| //品牌券,查询集团品牌商户 | //品牌券,查询集团品牌商户 | ||||
| }else if (EnumCouponType.COUPON_DOUYIN_BRAND.getCode() == coupon.getType()) { | }else if (EnumCouponType.COUPON_DOUYIN_BRAND.getCode() == coupon.getType()) { | ||||
| makeMerchant = wxMerchantService.findBrandAdmin(coupon,coupon.getBrand()); | |||||
| //商场券 | //商场券 | ||||
| }else { | }else { | ||||
| if(coupon.getMerchantType() == EnumCouponMerchantType.ONE_MERCHANT.getCode()){ | if(coupon.getMerchantType() == EnumCouponMerchantType.ONE_MERCHANT.getCode()){ | ||||
| @@ -1889,4 +1889,26 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||||
| } | } | ||||
| return null; | return null; | ||||
| } | } | ||||
| @Override | |||||
| public WxMerchant findAdmin(TenantEntity tenantEntity) { | |||||
| List<WxMerchant> adminList = findAdminList(tenantEntity); | |||||
| if(adminList.size() > 0){ | |||||
| return adminList.get(0); | |||||
| } | |||||
| return null; | |||||
| } | |||||
| @Override | |||||
| public WxMerchant findBrandAdmin(TenantEntity tenantEntity, Long brand) { | |||||
| WxMerchant wxMerchant = new WxMerchant(); | |||||
| wxMerchant.setTenantId(tenantEntity.getFinalTenantId()); | |||||
| wxMerchant.setStatus(EnumMerchantStatus.VALID.getCode()); | |||||
| wxMerchant.setBrand(brand); | |||||
| List<WxMerchant> list = findList(wxMerchant); | |||||
| if(list.size() > 0){ | |||||
| return list.get(0); | |||||
| } | |||||
| return null; | |||||
| } | |||||
| } | } | ||||