Commit ba956a4a by 吕明尚

修改异常报错

parent 09c78f5e
......@@ -67,7 +67,7 @@ public class TiktokController {
//用户验券接口
@GetMapping("/consumeByUser")
public AjaxResult consumeByUser(String code, String poiId) {
public AjaxResult consumeByUser(String code, String poiId) throws Exception {
return success(tiktokService.consumeByUser(code, poiId));
}
}
......@@ -51,7 +51,7 @@ public class QPController {
//用户验券接口
@GetMapping("/consumeByUser")
public R<String> consumeByUser(String code, String storeId) {
public R<String> consumeByUser(String code, String storeId) throws Exception {
if (code.length() == 10) {
return R.ok(qpService.consumeByUser(code, storeId, ConsumerCouponStatusEnum.CONTROLLER.getCode()));
} else if (code.startsWith("https://v.douyin.com/") | code.length() == 15 | code.length() == 12) {
......
......@@ -64,7 +64,7 @@ public class TiktokController {
//用户验券接口
@GetMapping("/consumeByUser")
public AjaxResult consumeByUser(String code, String storeId) {
public AjaxResult consumeByUser(String code, String storeId) throws Exception {
return success(tiktokService.consumeByUser(code, storeId));
}
}
......@@ -20,7 +20,7 @@ public interface QPService {
TuangouReceiptGetConsumedReponseEntity getconsumed(String code, String openShopUuid);
String consumeByUser(String code, String storeId, String status);
String consumeByUser(String code, String storeId, String status) throws Exception;
List<TuangouReceiptReverseConsumeResponseEntity> reverseconsumeByUser(Long id);
......
......@@ -26,7 +26,7 @@ public interface TiktokService {
JSONObject onlineGet(String productIds, String accountId);
String consumeByUser(String code, String storeId);
String consumeByUser(String code, String storeId) throws Exception;
List<TiktokPoi> poiList();
......
......@@ -94,15 +94,15 @@ public class QPServiceImpl implements QPService {
* 用户验卷接口
*/
@Override
public String consumeByUser(String code, String storeId, String status) {
public String consumeByUser(String code, String storeId, String status) throws Exception {
LambdaQueryWrapper<SStore> sStoreLambdaQueryWrapper = new LambdaQueryWrapper<>();
sStoreLambdaQueryWrapper.eq(SStore::getId, storeId);
SStore sStore = storeService.getOne(sStoreLambdaQueryWrapper);
if (ObjectUtils.isEmpty(sStore) || StoreStatusEnum.STOP.getIndex().equals(sStore.getStatus())) {
throw new RuntimeException("门店维护中,请联系客服");
throw new Exception("门店维护中,请联系客服");
}
if (StringUtils.isEmpty(sStore.getOpenShopUuid())) {
throw new RuntimeException("门店未授权,请联系客服");
throw new Exception("门店未授权,请联系客服");
}
//验券准备
TuangouReceiptPrepareResponseEntity prepare = prepare(code.trim(), sStore.getOpenShopUuid(), status);
......@@ -115,7 +115,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("该券码已被使用");
}
//根据优惠卷名称查询优惠劵配置 查询list,取第一个
SConsumerCoupon sConsumerCoupon = new SConsumerCoupon();
......@@ -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 RuntimeException("该券码已被使用");
}
sStoreList = storeService.list(new LambdaQueryWrapper<>(SStore.class).isNotNull(SStore::getOpenShopUuid));
SCoupon sCoupon = isCouponService.getOne(new LambdaQueryWrapper<>(SCoupon.class).
......
......@@ -330,15 +330,15 @@ public class TiktokServiceImpl implements TiktokService {
}
@Override
public String consumeByUser(String code, String storeId) {
public String consumeByUser(String code, String storeId) throws Exception {
LambdaQueryWrapper<SStore> sStoreLambdaQueryWrapper = new LambdaQueryWrapper<>();
sStoreLambdaQueryWrapper.eq(SStore::getId, storeId);
SStore sStore = storeService.getOne(sStoreLambdaQueryWrapper);
if (ObjectUtils.isEmpty(sStore) || StoreStatusEnum.STOP.getIndex().equals(sStore.getStatus())) {
throw new RuntimeException("门店维护中,请联系客服");
throw new Exception("门店维护中,请联系客服");
}
if (StringUtils.isEmpty(sStore.getTiktokPoiId())) {
throw new RuntimeException("门店未授权,请联系客服");
throw new Exception("门店未授权,请联系客服");
}
if (code.startsWith("https://v.douyin.com/") | code.length() == 15 | code.length() == 12) {
try {
......@@ -352,7 +352,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);
......
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