|
|
|
@@ -579,18 +579,23 @@ public class TtMerchantPoiServiceImpl implements TtMerchantPoiService { |
|
|
|
if(!EnumCouponType.getSpuSyncType().contains(coupon.getType())){ |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"卷类型不支持同步poi"); |
|
|
|
} |
|
|
|
List<Long> couponMerchantIds = wxCouponMerchantMapper.findMerchantIdListByProduct(coupon.getId(), tenantInfo.getTenantId()); |
|
|
|
if(couponMerchantIds == null || couponMerchantIds.size() == 0 ){ |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"未查询到门店"); |
|
|
|
} |
|
|
|
|
|
|
|
TtMerchantPoi poi = new TtMerchantPoi(); |
|
|
|
poi.updateTenantInfo(tenantInfo); |
|
|
|
poi.setIds(merchantIds); |
|
|
|
poi.setIds(couponMerchantIds); |
|
|
|
poi.setMatchStatus(EnumSupplierMathStatus.match_success.getCode()); |
|
|
|
poi.setSyncStatus(EnumSupplierSyncStatus.sync_success.getCode()); |
|
|
|
List<TtMerchantPoi> poiList = ttMerchantPoiMapper.findList(poi); |
|
|
|
if(merchantIds.size() != poiList.size()){ |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"未查询到poi或poi不匹配"); |
|
|
|
if(poiList == null || poiList.isEmpty()){ |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"未查询到可用poi"); |
|
|
|
} |
|
|
|
List<Long> collect = poiList.stream().map(p -> p.getId()).collect(Collectors.toList()); |
|
|
|
|
|
|
|
String spuId = spuSync(coupon,couponChannel,merchantIds); |
|
|
|
String spuId = spuSync(coupon,couponChannel,collect); |
|
|
|
if(StringUtils.isBlank(spuId)){ |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"同步失败"); |
|
|
|
} |
|
|
|
|