Commit 68247ee2 by 吕明尚

修改优惠券报错

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