|
|
|
@@ -1540,16 +1540,23 @@ public class WxMerchantServiceImpl implements WxMerchantService { |
|
|
|
return findCouponMerchantVoList(couponIds, mallTenantEntity, null, hasShop); |
|
|
|
} |
|
|
|
|
|
|
|
private Map<Long,List<WxMerchantVo>> findCouponMerchantVoList(List<Long> couponIds,TenantEntity mallTenantEntity,TtMerchantPoi poiQ,boolean hasShop) { |
|
|
|
private Map<Long,List<WxMerchantVo>> findCouponMerchantVoList(List<Long> couponIds,TenantEntity mallTenantEntity,List<Long> poiMerchantIds,boolean hasShop) { |
|
|
|
Map<Long,List<WxMerchantVo>> retMap = new HashMap<Long,List<WxMerchantVo>>(); |
|
|
|
if (null == couponIds || couponIds.size() <= 0) { |
|
|
|
return retMap; |
|
|
|
} |
|
|
|
List<Long> merchantIds = wxCouponMerchantMapper.findMerchantByProductIds(mallTenantEntity.getTenantId(), couponIds); |
|
|
|
if(null != merchantIds && merchantIds.size() > 0 ) { |
|
|
|
if (null == poiQ) { |
|
|
|
poiQ = new TtMerchantPoi(); |
|
|
|
List<Long> productMerchantIds = wxCouponMerchantMapper.findMerchantByProductIds(mallTenantEntity.getTenantId(), couponIds); |
|
|
|
if(null != productMerchantIds && productMerchantIds.size() > 0 ) { |
|
|
|
List<Long> merchantIds = null; |
|
|
|
if (null != poiMerchantIds && poiMerchantIds.size() > 0 ){ |
|
|
|
//取交集 |
|
|
|
merchantIds = (List<Long>) CollectionUtils.intersection(poiMerchantIds, productMerchantIds); |
|
|
|
} |
|
|
|
if (null == merchantIds) { |
|
|
|
return retMap; |
|
|
|
} |
|
|
|
|
|
|
|
TtMerchantPoi poiQ = new TtMerchantPoi(); |
|
|
|
poiQ.updateTenantInfo(mallTenantEntity); |
|
|
|
poiQ.setIds(merchantIds); |
|
|
|
List<TtMerchantPoi> poiList = ttMerchantPoiMapper.findList(poiQ); |
|
|
|
@@ -1660,9 +1667,15 @@ public class WxMerchantServiceImpl implements WxMerchantService { |
|
|
|
public List<WxMerchantVo> findMerchantVoList(Long couponId,String city,TenantEntity tenantEntity,boolean hasShop) { |
|
|
|
List<Long> couponIds = new ArrayList<Long>(); |
|
|
|
couponIds.add(couponId); |
|
|
|
TtMerchantPoi poiQ = new TtMerchantPoi(); |
|
|
|
poiQ.setCity(city); |
|
|
|
Map<Long,List<WxMerchantVo>> couponMerchantVoList = findCouponMerchantVoList(couponIds,tenantEntity,poiQ,hasShop); |
|
|
|
List<Long> poiMerchantIds = null; |
|
|
|
if (StringUtils.isNotBlank(city)) { |
|
|
|
TtMerchantPoi poiQ = new TtMerchantPoi(); |
|
|
|
poiQ.setCity(city); |
|
|
|
poiQ.updateTenantInfo(tenantEntity); |
|
|
|
poiMerchantIds = ttMerchantPoiMapper.findIdList(poiQ); |
|
|
|
} |
|
|
|
|
|
|
|
Map<Long,List<WxMerchantVo>> couponMerchantVoList = findCouponMerchantVoList(couponIds,tenantEntity,poiMerchantIds,hasShop); |
|
|
|
if (null != couponMerchantVoList) { |
|
|
|
return couponMerchantVoList.get(couponId); |
|
|
|
} |
|
|
|
|