Commit 68247ee2 by 吕明尚

修改优惠券报错

parent ba956a4a
...@@ -81,7 +81,7 @@ public class QPController { ...@@ -81,7 +81,7 @@ public class QPController {
//查询当前优惠券适用门店 //查询当前优惠券适用门店
@GetMapping("/queryshop") @GetMapping("/queryshop")
public R<List<SStoreVo>> queryshop(SStoreDto dto) { public R<List<SStoreVo>> queryshop(SStoreDto dto) throws Exception {
if (StringUtils.isEmpty(dto.getCode())) { if (StringUtils.isEmpty(dto.getCode())) {
throw new RuntimeException("券码缺失"); throw new RuntimeException("券码缺失");
} }
......
...@@ -34,7 +34,7 @@ public interface QPService { ...@@ -34,7 +34,7 @@ public interface QPService {
List<CustomerKeyShopScopeResponseEntity> scope(); List<CustomerKeyShopScopeResponseEntity> scope();
List<SStoreVo> queryshop(SStoreDto dto); List<SStoreVo> queryshop(SStoreDto dto) throws Exception;
List<SStoreVo> getsStores(List<SStore> sStoreList, SCoupon sCoupon, SStoreDto dto); List<SStoreVo> getsStores(List<SStore> sStoreList, SCoupon sCoupon, SStoreDto dto);
} }
...@@ -30,5 +30,5 @@ public interface TiktokService { ...@@ -30,5 +30,5 @@ public interface TiktokService {
List<TiktokPoi> poiList(); List<TiktokPoi> poiList();
List<SStoreVo> queryshop(SStoreDto dto); List<SStoreVo> queryshop(SStoreDto dto) throws Exception;
} }
...@@ -423,10 +423,10 @@ public class QPServiceImpl implements QPService { ...@@ -423,10 +423,10 @@ public class QPServiceImpl implements QPService {
} }
@Override @Override
public List<SStoreVo> queryshop(SStoreDto dto) { public List<SStoreVo> queryshop(SStoreDto dto) throws Exception {
String code = dto.getCode(); String code = dto.getCode();
if (StringUtils.isEmpty(dto.getLatitude()) || StringUtils.isEmpty(dto.getLongitude())) { if (StringUtils.isEmpty(dto.getLatitude()) || StringUtils.isEmpty(dto.getLongitude())) {
throw new RuntimeException("经纬度不能为空"); throw new Exception("经纬度不能为空");
} }
LambdaQueryWrapper<SStore> sStoreLambdaQueryWrapper = new LambdaQueryWrapper<>(SStore.class); LambdaQueryWrapper<SStore> sStoreLambdaQueryWrapper = new LambdaQueryWrapper<>(SStore.class);
sStoreLambdaQueryWrapper.eq(SStore::getStoreType, StoreType.HOTEL.getCode()); sStoreLambdaQueryWrapper.eq(SStore::getStoreType, StoreType.HOTEL.getCode());
...@@ -442,7 +442,7 @@ public class QPServiceImpl implements QPService { ...@@ -442,7 +442,7 @@ public class QPServiceImpl implements QPService {
queryWrapper.eq(SConsumerCoupon::getIsDelete, YesNoEnum.no.getIndex()); queryWrapper.eq(SConsumerCoupon::getIsDelete, YesNoEnum.no.getIndex());
SConsumerCoupon unUsedCoupon = isConsumerCouponService.getOne(queryWrapper); SConsumerCoupon unUsedCoupon = isConsumerCouponService.getOne(queryWrapper);
if (ObjectUtils.isNotEmpty(unUsedCoupon)) { if (ObjectUtils.isNotEmpty(unUsedCoupon)) {
throw new RuntimeException("该券码已被使用"); throw new Exception("该券码已被使用");
} }
sStoreList = storeService.list(new LambdaQueryWrapper<>(SStore.class).isNotNull(SStore::getOpenShopUuid)); sStoreList = storeService.list(new LambdaQueryWrapper<>(SStore.class).isNotNull(SStore::getOpenShopUuid));
SCoupon sCoupon = isCouponService.getOne(new LambdaQueryWrapper<>(SCoupon.class). SCoupon sCoupon = isCouponService.getOne(new LambdaQueryWrapper<>(SCoupon.class).
...@@ -456,7 +456,7 @@ public class QPServiceImpl implements QPService { ...@@ -456,7 +456,7 @@ public class QPServiceImpl implements QPService {
List<SCoupon> coupons = isCouponService.queryShopDeal(); List<SCoupon> coupons = isCouponService.queryShopDeal();
SCoupon scoupon = coupons.stream().filter(o -> o.getDealgroupId().equals(prepare.getDealgroup_id())).findFirst().get(); SCoupon scoupon = coupons.stream().filter(o -> o.getDealgroupId().equals(prepare.getDealgroup_id())).findFirst().get();
if (ObjectUtils.isEmpty(scoupon)) { if (ObjectUtils.isEmpty(scoupon)) {
throw new RuntimeException("当前优惠券异常,请联系客服"); throw new Exception("当前优惠券异常,请联系客服");
} }
isCouponService.save(scoupon); isCouponService.save(scoupon);
//过滤不存在sCoupon.getstoreIds()的门店 //过滤不存在sCoupon.getstoreIds()的门店
......
...@@ -470,10 +470,10 @@ public class TiktokServiceImpl implements TiktokService { ...@@ -470,10 +470,10 @@ public class TiktokServiceImpl implements TiktokService {
} }
@Override @Override
public List<SStoreVo> queryshop(SStoreDto dto) { public List<SStoreVo> queryshop(SStoreDto dto) throws Exception {
String code = dto.getCode(); String code = dto.getCode();
if (StringUtils.isEmpty(dto.getLatitude()) || StringUtils.isEmpty(dto.getLongitude())) { if (StringUtils.isEmpty(dto.getLatitude()) || StringUtils.isEmpty(dto.getLongitude())) {
throw new RuntimeException("经纬度不能为空"); throw new Exception("经纬度不能为空");
} }
LambdaQueryWrapper<SStore> sStoreLambdaQueryWrapper = new LambdaQueryWrapper<>(SStore.class); LambdaQueryWrapper<SStore> sStoreLambdaQueryWrapper = new LambdaQueryWrapper<>(SStore.class);
sStoreLambdaQueryWrapper.eq(SStore::getStoreType, StoreType.HOTEL.getCode()); sStoreLambdaQueryWrapper.eq(SStore::getStoreType, StoreType.HOTEL.getCode());
...@@ -490,7 +490,7 @@ public class TiktokServiceImpl implements TiktokService { ...@@ -490,7 +490,7 @@ public class TiktokServiceImpl implements TiktokService {
JSONObject prepare = prepare(tiktokCouponDto); JSONObject prepare = prepare(tiktokCouponDto);
JSONArray certificates = prepare.getJSONArray("certificates"); JSONArray certificates = prepare.getJSONArray("certificates");
if (CollectionUtils.isEmpty(certificates)) { if (CollectionUtils.isEmpty(certificates)) {
throw new RuntimeException("该券码已被使用"); throw new Exception("该券码已被使用");
} }
Object o = certificates.get(0); Object o = certificates.get(0);
JSONObject entries = new JSONObject(o); JSONObject entries = new JSONObject(o);
...@@ -506,13 +506,13 @@ public class TiktokServiceImpl implements TiktokService { ...@@ -506,13 +506,13 @@ public class TiktokServiceImpl implements TiktokService {
List<SCoupon> coupons = isCouponService.querySkuPoiList(); List<SCoupon> coupons = isCouponService.querySkuPoiList();
SCoupon scoupon = coupons.stream().filter(s -> s.getTiktokSkuId().equals(sku.getStr("sku_id"))).findFirst().get(); SCoupon scoupon = coupons.stream().filter(s -> s.getTiktokSkuId().equals(sku.getStr("sku_id"))).findFirst().get();
if (ObjectUtils.isEmpty(scoupon)) { if (ObjectUtils.isEmpty(scoupon)) {
throw new RuntimeException("当前优惠券异常,请联系客服"); throw new Exception("当前优惠券异常,请联系客服");
} }
isCouponService.save(scoupon); isCouponService.save(scoupon);
return qpService.getsStores(sStoreList, scoupon, dto); return qpService.getsStores(sStoreList, scoupon, dto);
} }
} catch (RuntimeException e) { } catch (RuntimeException e) {
throw new RuntimeException(e); throw new Exception(e);
} }
} }
return Collections.emptyList(); return Collections.emptyList();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment