Commit b0c7d084 by 吕明尚

支付成功增加验劵

parent 97d8f520
...@@ -55,7 +55,7 @@ public class QPServiceImpl implements QPService { ...@@ -55,7 +55,7 @@ public class QPServiceImpl implements QPService {
@Override @Override
public TuangouReceiptPrepareResponseEntityVo consumeByUser(String code, String openShopUuid) { public TuangouReceiptPrepareResponseEntityVo consumeByUser(String code, String openShopUuid) {
//验券准备 //验券准备
TuangouReceiptPrepareResponseEntity prepare = prepare(code, ""); TuangouReceiptPrepareResponseEntity prepare = prepare(code, openShopUuid);
SCoupon sCoupon = isCouponService.selectSCouponByName(prepare.getDeal_title()); SCoupon sCoupon = isCouponService.selectSCouponByName(prepare.getDeal_title());
if (sCoupon == null) { if (sCoupon == null) {
throw new RuntimeException("未找到对应的优惠券"); throw new RuntimeException("未找到对应的优惠券");
...@@ -63,10 +63,13 @@ public class QPServiceImpl implements QPService { ...@@ -63,10 +63,13 @@ public class QPServiceImpl implements QPService {
TuangouReceiptPrepareResponseEntityVo response = new TuangouReceiptPrepareResponseEntityVo(); TuangouReceiptPrepareResponseEntityVo response = new TuangouReceiptPrepareResponseEntityVo();
//查询领取记录表 //查询领取记录表
LambdaQueryWrapper<SConsumerCoupon> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<SConsumerCoupon> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(SConsumerCoupon::getCouponId, prepare.getDeal_title()); queryWrapper.eq(SConsumerCoupon::getDealId, prepare.getDeal_id());
SConsumerCoupon one = isConsumerCouponService.getOne(queryWrapper); SConsumerCoupon one = isConsumerCouponService.getOne(queryWrapper);
if (ObjectUtils.isEmpty(one)) {
throw new RuntimeException("该券码已被使用");
}
SConsumer user = FrontTokenComponent.getWxSConsumerEntry(); SConsumer user = FrontTokenComponent.getWxSConsumerEntry();
if (ObjectUtils.isNotEmpty(one)) { if (ObjectUtils.isNotEmpty(sCoupon)) {
SConsumerCoupon sConsumerCoupon = new SConsumerCoupon(); SConsumerCoupon sConsumerCoupon = new SConsumerCoupon();
sConsumerCoupon.setDealId(prepare.getDeal_id()); sConsumerCoupon.setDealId(prepare.getDeal_id());
sConsumerCoupon.setName(prepare.getDeal_title()); sConsumerCoupon.setName(prepare.getDeal_title());
......
...@@ -203,6 +203,8 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper,SOrder> implemen ...@@ -203,6 +203,8 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper,SOrder> implemen
consumerCoupon.setId(tuangouReceiptPrepareResponseEntityVo.getConsumerCouponId()); consumerCoupon.setId(tuangouReceiptPrepareResponseEntityVo.getConsumerCouponId());
consumerCoupon.setUseStatus(UserStatusEnum.USED.getCode()); consumerCoupon.setUseStatus(UserStatusEnum.USED.getCode());
consumerCouponService.updateById(consumerCoupon); consumerCouponService.updateById(consumerCoupon);
//验劵
qpService.consume(request.getCode(), 1, sStore.getOpenShopUuid());
} else { } else {
consumerCouponService.deleteSConsumerCouponById(tuangouReceiptPrepareResponseEntityVo.getConsumerCouponId()); consumerCouponService.deleteSConsumerCouponById(tuangouReceiptPrepareResponseEntityVo.getConsumerCouponId());
} }
......
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