|
|
|
@@ -162,6 +162,9 @@ public class WxMerchantServiceImpl implements WxMerchantService { |
|
|
|
|
|
|
|
@Override |
|
|
|
public PageInfo<WxMerchant> listAsPage(WxMerchant record, Integer pageIndex, Integer pageSize) { |
|
|
|
if(record.getIsAdmin() == null){ |
|
|
|
record.setAdminTypes(EnumMerchantAdmin.getOrdinaryTypes()); |
|
|
|
} |
|
|
|
return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxMerchantMapper.findList(record)); |
|
|
|
} |
|
|
|
|
|
|
|
@@ -288,6 +291,9 @@ public class WxMerchantServiceImpl implements WxMerchantService { |
|
|
|
|
|
|
|
@Override |
|
|
|
public List<Long> findIdList(WxMerchant record) { |
|
|
|
if(record == null){ |
|
|
|
record.setAdminTypes(EnumMerchantAdmin.getOrdinaryTypes()); |
|
|
|
} |
|
|
|
return wxMerchantMapper.findIdList(record); |
|
|
|
} |
|
|
|
|
|
|
|
@@ -307,6 +313,7 @@ public class WxMerchantServiceImpl implements WxMerchantService { |
|
|
|
wxMerchant.updateTenantInfo(tenantEntity); |
|
|
|
wxMerchant.setIsPrivate(EnumYesOrNo.NO.getCode()); |
|
|
|
wxMerchant.setStatus(EnumMerchantStatus.VALID.getCode()); |
|
|
|
wxMerchant.setAdminTypes(EnumMerchantAdmin.getOrdinaryTypes()); |
|
|
|
List<WxMerchant> wxMerchantList = wxMerchantMapper.findList(wxMerchant); |
|
|
|
List<WxMerchantSimpleVo> collect = wxMerchantList.stream().map(x -> { |
|
|
|
WxMerchantSimpleVo wxMerchantSimpleVo = new WxMerchantSimpleVo(); |
|
|
|
@@ -575,6 +582,9 @@ public class WxMerchantServiceImpl implements WxMerchantService { |
|
|
|
if(wxMerchant.getIsAdmin() == null) { |
|
|
|
wxMerchant.setIsAdmin(EnumMerchantAdmin.PUBLIC_COMMON.getCode()); |
|
|
|
} |
|
|
|
if(EnumMerchantAdmin.REGIONAL.getCode().equals(wxMerchant.getIsAdmin())){ |
|
|
|
wxMerchant.setIsPublic(EnumYesOrNo.NO.getCode()); |
|
|
|
} |
|
|
|
wxMerchant.setUpdateDate(date); |
|
|
|
wxMerchant.setCreateDate(date); |
|
|
|
if (StringUtils.isNotBlank(wxMerchant.getCoverPicture())) { |
|
|
|
@@ -1013,6 +1023,10 @@ public class WxMerchantServiceImpl implements WxMerchantService { |
|
|
|
@Override |
|
|
|
public void exportData(WxMerchant wxMerchant, HttpServletRequest request, HttpServletResponse response) { |
|
|
|
|
|
|
|
if(wxMerchant.getIsAdmin() == null){ |
|
|
|
wxMerchant.setAdminTypes(EnumMerchantAdmin.getOrdinaryTypes()); |
|
|
|
} |
|
|
|
|
|
|
|
List<WxMerchant> list = wxMerchantMapper.findList(wxMerchant); |
|
|
|
|
|
|
|
WxBusiness bq = new WxBusiness(); |
|
|
|
@@ -1145,6 +1159,10 @@ public class WxMerchantServiceImpl implements WxMerchantService { |
|
|
|
|
|
|
|
private void initQueryParam(WxMerchant record,boolean hasRentContractInfo,Map<Long,WxRentContract> merchantRentMap) { |
|
|
|
|
|
|
|
if(record.getIsAdmin() == null){ |
|
|
|
record.setAdminTypes(EnumMerchantAdmin.getOrdinaryTypes()); |
|
|
|
} |
|
|
|
|
|
|
|
if (hasRentContractInfo) { |
|
|
|
WxRentContract wxRentContractQ = new WxRentContract(); |
|
|
|
wxRentContractQ.updateTenantInfo(record); |
|
|
|
@@ -1522,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); |
|
|
|
@@ -1642,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); |
|
|
|
} |
|
|
|
@@ -2030,6 +2061,7 @@ public class WxMerchantServiceImpl implements WxMerchantService { |
|
|
|
wxMerchant.setTenantId(tenantEntity.getFinalTenantId()); |
|
|
|
wxMerchant.setStatus(EnumMerchantStatus.VALID.getCode()); |
|
|
|
wxMerchant.setBrand(brand); |
|
|
|
wxMerchant.setAdminTypes(EnumMerchantAdmin.getOrdinaryTypes()); |
|
|
|
List<WxMerchant> list = findList(wxMerchant); |
|
|
|
if(list.size() > 0){ |
|
|
|
return list.get(0); |
|
|
|
|