| @@ -966,31 +966,32 @@ public class WxCouponServiceImpl implements WxCouponService { | |||||
| @Override | @Override | ||||
| public Map<Long, String> getCouponMerchant(List<Long> couponIds, TenantEntity tenantEntity) { | public Map<Long, String> getCouponMerchant(List<Long> couponIds, TenantEntity tenantEntity) { | ||||
| Map<Long,String> couponMerchantMap = new HashMap<Long,String>(); | Map<Long,String> couponMerchantMap = new HashMap<Long,String>(); | ||||
| List<Long> merchantIds = wxCouponMerchantMapper.findMerchantByProductIds(tenantEntity.getTenantId(),couponIds); | |||||
| WxMerchant merchantQ = new WxMerchant(); | |||||
| merchantQ.updateTenantInfo(tenantEntity); | |||||
| merchantQ.setIds(merchantIds); | |||||
| List<WxMerchant> merchantList = wxMerchantMapper.findIdNameList(merchantQ); | |||||
| Map<Long,String> merchantNameMap = new HashMap<Long,String>(); | |||||
| if (null != merchantList) { | |||||
| for (int i = 0 ; i < merchantList.size() ; i ++) { | |||||
| WxMerchant m = merchantList.get(i); | |||||
| merchantNameMap.put(m.getId(), m.getName()); | |||||
| if(null != couponIds && couponIds.size() > 0){ | |||||
| List<Long> merchantIds = wxCouponMerchantMapper.findMerchantByProductIds(tenantEntity.getTenantId(),couponIds); | |||||
| WxMerchant merchantQ = new WxMerchant(); | |||||
| merchantQ.updateTenantInfo(tenantEntity); | |||||
| merchantQ.setIds(merchantIds); | |||||
| List<WxMerchant> merchantList = wxMerchantMapper.findIdNameList(merchantQ); | |||||
| Map<Long,String> merchantNameMap = new HashMap<Long,String>(); | |||||
| if (null != merchantList) { | |||||
| for (int i = 0 ; i < merchantList.size() ; i ++) { | |||||
| WxMerchant m = merchantList.get(i); | |||||
| merchantNameMap.put(m.getId(), m.getName()); | |||||
| } | |||||
| } | } | ||||
| } | |||||
| List<WxMerchantProductVo> merchantProductVos = wxCouponMerchantMapper.findMerchantProduct(tenantEntity.getTenantId(), merchantIds); | |||||
| List<WxMerchantProductVo> merchantProductVos = wxCouponMerchantMapper.findMerchantProduct(tenantEntity.getTenantId(), merchantIds); | |||||
| // Map<Long,String> couponMerchantMap = new HashMap<Long,String>(); | // Map<Long,String> couponMerchantMap = new HashMap<Long,String>(); | ||||
| if (null != merchantProductVos) { | |||||
| for (int i = 0 ; i < merchantProductVos.size(); i ++) { | |||||
| WxMerchantProductVo mp = merchantProductVos.get(i); | |||||
| if(couponIds.contains(mp.getProductId())){ | |||||
| if (mp.getMc() > 1) { | |||||
| couponMerchantMap.put(mp.getProductId(), "多商户通用"); | |||||
| }else { | |||||
| couponMerchantMap.put(mp.getProductId(), merchantNameMap.get(mp.getMerchantId())); | |||||
| if (null != merchantProductVos) { | |||||
| for (int i = 0 ; i < merchantProductVos.size(); i ++) { | |||||
| WxMerchantProductVo mp = merchantProductVos.get(i); | |||||
| if(couponIds.contains(mp.getProductId())){ | |||||
| if (mp.getMc() > 1) { | |||||
| couponMerchantMap.put(mp.getProductId(), "多商户通用"); | |||||
| }else { | |||||
| couponMerchantMap.put(mp.getProductId(), merchantNameMap.get(mp.getMerchantId())); | |||||
| } | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||