| @@ -204,7 +204,7 @@ public interface WxMerchantService { | |||||
| List<Long> getFloorBuildMerchantIds(TenantEntity tenantEntity,String floorRule,Long building,Long floor,String shopTypeForRule,Integer merchantShopDel,Integer shopDel ,String shopNumber) ; | List<Long> getFloorBuildMerchantIds(TenantEntity tenantEntity,String floorRule,Long building,Long floor,String shopTypeForRule,Integer merchantShopDel,Integer shopDel ,String shopNumber) ; | ||||
| List<WxMerchantVo> findMerchantListByProduct(TenantEntity tenantEntity,Long productId,boolean hasShop); | |||||
| List<WxMerchantVo> findMerchantListByProduct(TenantEntity tenantEntity,Long productId,boolean hasShop,boolean isValid); | |||||
| WxMerchantCorp getMerchantCorp(TenantEntity tenantInfo, Long id); | WxMerchantCorp getMerchantCorp(TenantEntity tenantInfo, Long id); | ||||
| @@ -802,7 +802,7 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService { | |||||
| cvo.setQrCode(cc.getQrCode()); | cvo.setQrCode(cc.getQrCode()); | ||||
| cvo.setTtQrCode(cc.getTtQrCode()); | cvo.setTtQrCode(cc.getTtQrCode()); | ||||
| if (hasMerchant) { | if (hasMerchant) { | ||||
| cvo.setMerchantVoList(wxMerchantService.findMerchantListByProduct(cc,cc.getCouponId(), true)); | |||||
| cvo.setMerchantVoList(wxMerchantService.findMerchantListByProduct(cc,cc.getCouponId(), true,false)); | |||||
| } | } | ||||
| return cvo; | return cvo; | ||||
| } catch (IllegalAccessException e) { | } catch (IllegalAccessException e) { | ||||
| @@ -2593,7 +2593,7 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { | |||||
| WxCardCVo cardCVo = findCardDetailOfCUser(Long.valueOf(couponOrderId),tenantinfo.getTenantId()); | WxCardCVo cardCVo = findCardDetailOfCUser(Long.valueOf(couponOrderId),tenantinfo.getTenantId()); | ||||
| cardCVo.setMerchantVoList(wxMerchantService.findMerchantListByProduct(tenantinfo,cardCVo.getCouponId(), false)); | |||||
| cardCVo.setMerchantVoList(wxMerchantService.findMerchantListByProduct(tenantinfo,cardCVo.getCouponId(), false, true)); | |||||
| Long couponId = cardCVo.getCouponId(); | Long couponId = cardCVo.getCouponId(); | ||||
| WxCouponChannel wxCouponChannel = new WxCouponChannel(); | WxCouponChannel wxCouponChannel = new WxCouponChannel(); | ||||
| @@ -2059,7 +2059,7 @@ public class WxCouponServiceImpl implements WxCouponService { | |||||
| TenantEntity mallTenantEntity = new TenantEntity(); | TenantEntity mallTenantEntity = new TenantEntity(); | ||||
| mallTenantEntity.setTenantId(wcm.getMallTenantId()); | mallTenantEntity.setTenantId(wcm.getMallTenantId()); | ||||
| mallTenantEntity.setParentTenantId(couponTenantEntity.getTenantId()); | mallTenantEntity.setParentTenantId(couponTenantEntity.getTenantId()); | ||||
| List<WxMerchantVo> merchantVoList = wxMerchantService.findMerchantListByProduct(mallTenantEntity,couponId,false); | |||||
| List<WxMerchantVo> merchantVoList = wxMerchantService.findMerchantListByProduct(mallTenantEntity,couponId,false,false); | |||||
| if (null != merchantVoList && merchantVoList.size() > 0 ) { | if (null != merchantVoList && merchantVoList.size() > 0 ) { | ||||
| if (merchantVoList.stream().anyMatch((cm->cm.getMerchantStatus().equals(EnumMerchantStatus.VALID.getCode())))){ | if (merchantVoList.stream().anyMatch((cm->cm.getMerchantStatus().equals(EnumMerchantStatus.VALID.getCode())))){ | ||||
| return true; | return true; | ||||
| @@ -2069,7 +2069,7 @@ public class WxCouponServiceImpl implements WxCouponService { | |||||
| return false; | return false; | ||||
| }else { | }else { | ||||
| List<WxMerchantVo> merchantVoList = wxMerchantService.findMerchantListByProduct(couponTenantEntity,couponId,false); | |||||
| List<WxMerchantVo> merchantVoList = wxMerchantService.findMerchantListByProduct(couponTenantEntity,couponId,false,false); | |||||
| if (null == merchantVoList || merchantVoList.size() <=0 ) { | if (null == merchantVoList || merchantVoList.size() <=0 ) { | ||||
| return false; | return false; | ||||
| } | } | ||||
| @@ -465,7 +465,7 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||||
| private boolean isCouponMerchantValid(Long couponId,TenantEntity tenantEntity) { | private boolean isCouponMerchantValid(Long couponId,TenantEntity tenantEntity) { | ||||
| List<WxMerchantVo> merchantVoList = findMerchantListByProduct(tenantEntity,couponId,false); | |||||
| List<WxMerchantVo> merchantVoList = findMerchantListByProduct(tenantEntity,couponId,false,false); | |||||
| if(merchantVoList == null){ | if(merchantVoList == null){ | ||||
| return false; | return false; | ||||
| } | } | ||||
| @@ -1990,7 +1990,7 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||||
| } | } | ||||
| @Override | @Override | ||||
| public List<WxMerchantVo> findMerchantListByProduct(TenantEntity tenantEntity,Long productId,boolean hasShop) { | |||||
| public List<WxMerchantVo> findMerchantListByProduct(TenantEntity tenantEntity,Long productId,boolean hasShop,boolean isValid) { | |||||
| List<Long> merchantIds = wxCouponMerchantMapper.findMerchantIdListByProduct(productId, tenantEntity.getTenantId()); | List<Long> merchantIds = wxCouponMerchantMapper.findMerchantIdListByProduct(productId, tenantEntity.getTenantId()); | ||||
| Map<Long,WxMerchant> merchantMap = new HashMap<Long,WxMerchant>(); | Map<Long,WxMerchant> merchantMap = new HashMap<Long,WxMerchant>(); | ||||
| Map<Long, List<WxShopVo>> merchantShopVoMap = null; | Map<Long, List<WxShopVo>> merchantShopVoMap = null; | ||||
| @@ -2043,7 +2043,12 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||||
| WxCouponMerchant cm = couponMerchantList.get(i); | WxCouponMerchant cm = couponMerchantList.get(i); | ||||
| if (null != cm && null != cm.getMerchantId()) { | if (null != cm && null != cm.getMerchantId()) { | ||||
| WxMerchant m = merchantMap.get(cm.getMerchantId()); | WxMerchant m = merchantMap.get(cm.getMerchantId()); | ||||
| if (null != m) { | |||||
| if (null != m ) { | |||||
| if (isValid) { | |||||
| if (m.getIsDel() == EnumYesOrNo.YES.getCode() || m.getStatus() == EnumMerchantStatus.NOT_VALID.getCode()) { | |||||
| continue; | |||||
| } | |||||
| } | |||||
| WxMerchantVo vo = new WxMerchantVo(); | WxMerchantVo vo = new WxMerchantVo(); | ||||
| vo.setParameter(cm.getParameter()); | vo.setParameter(cm.getParameter()); | ||||
| @@ -2674,7 +2674,7 @@ public class WxOrderServiceImpl implements WxOrderService { | |||||
| vo.initByCoupon(c,false); | vo.initByCoupon(c,false); | ||||
| } | } | ||||
| if (hasMerchant) { | if (hasMerchant) { | ||||
| vo.setMerchantVoList(wxMerchantService.findMerchantListByProduct(tenantEntity, o.getProductId(), false)); | |||||
| vo.setMerchantVoList(wxMerchantService.findMerchantListByProduct(tenantEntity, o.getProductId(), false,false)); | |||||
| } | } | ||||
| } | } | ||||
| retList.add(vo); | retList.add(vo); | ||||
| @@ -2758,7 +2758,7 @@ public class WxOrderServiceImpl implements WxOrderService { | |||||
| WxCouponOrder couponOrder = wxCouponOrderMapper.findDetailOfCUser(couponOrderList.get(0).getId(), tenantEntity.getTenantId()); | WxCouponOrder couponOrder = wxCouponOrderMapper.findDetailOfCUser(couponOrderList.get(0).getId(), tenantEntity.getTenantId()); | ||||
| vo.initByCouponOrder(couponOrder); | vo.initByCouponOrder(couponOrder); | ||||
| } | } | ||||
| vo.setMerchantVoList(wxMerchantService.findMerchantListByProduct(tenantEntity, order.getProductId(), false)); | |||||
| vo.setMerchantVoList(wxMerchantService.findMerchantListByProduct(tenantEntity, order.getProductId(), false,false)); | |||||
| voList.add(vo); | voList.add(vo); | ||||
| } | } | ||||
| return voList; | return voList; | ||||