yichang
This commit is contained in:
@ -96,6 +96,7 @@ public class GroupBuyCouponServiceImpl implements GroupBuyCouponService {
|
|||||||
//生成第三方订单
|
//生成第三方订单
|
||||||
CarModelPackageDTO carModelPackageDTO = carInteg.getCarModelPackageByThireId(productIdMap.get("mtProductId"),null);
|
CarModelPackageDTO carModelPackageDTO = carInteg.getCarModelPackageByThireId(productIdMap.get("mtProductId"),null);
|
||||||
if (carModelPackageDTO == null){
|
if (carModelPackageDTO == null){
|
||||||
|
cancelVerifyCoupon(CouponTypeEnum.MT.getCode(),req.getStoreId().intValue(),req.getCouponCode(),productIdMap.get("mtOrderId"));
|
||||||
throw new BizException("无此对应团购套餐");
|
throw new BizException("无此对应团购套餐");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -167,6 +168,7 @@ public class GroupBuyCouponServiceImpl implements GroupBuyCouponService {
|
|||||||
//生成第三方订单
|
//生成第三方订单
|
||||||
CarModelPackageDTO carModelPackageDTO = carInteg.getCarModelPackageByThireId(null,productIdMap.get("dyProductId"));
|
CarModelPackageDTO carModelPackageDTO = carInteg.getCarModelPackageByThireId(null,productIdMap.get("dyProductId"));
|
||||||
if (carModelPackageDTO == null){
|
if (carModelPackageDTO == null){
|
||||||
|
cancelVerifyCoupon(CouponTypeEnum.DY.getCode(),req.getStoreId().intValue(),productIdMap.get("dyOrderId"),productIdMap.get("dyCertificateId"));
|
||||||
throw new BizException("无此对应团购套餐");
|
throw new BizException("无此对应团购套餐");
|
||||||
}
|
}
|
||||||
thirdRentCarOrder.setCarModelId(carModelPackageDTO.getCarModelId());
|
thirdRentCarOrder.setCarModelId(carModelPackageDTO.getCarModelId());
|
||||||
|
|||||||
@ -493,6 +493,7 @@ public class OrderServiceImpl implements OrderService {
|
|||||||
List<OrderMainPO> currentOrderList = orderMainRepo.list(currentOrderWrapper);
|
List<OrderMainPO> currentOrderList = orderMainRepo.list(currentOrderWrapper);
|
||||||
OrderMainPO waitPayOrder = currentOrderList.stream().filter(order -> order.getOrderStatus().equals(OrderStatusEnum.WAIT_PAY.getCode())).findFirst().orElse(null);
|
OrderMainPO waitPayOrder = currentOrderList.stream().filter(order -> order.getOrderStatus().equals(OrderStatusEnum.WAIT_PAY.getCode())).findFirst().orElse(null);
|
||||||
if(!currentOrderList.isEmpty() && waitPayOrder==null){
|
if(!currentOrderList.isEmpty() && waitPayOrder==null){
|
||||||
|
groupBuyCouponService.cancelVerifyCoupon(rentCarOrderReq.getOrderSource(),rentCarOrderReq.getStoreId().intValue(),rentCarOrderReq.getThirdOrderNo(),rentCarOrderReq.getCouponCode());
|
||||||
throw new BizException("您有未完成的订单,请先完成订单");
|
throw new BizException("您有未完成的订单,请先完成订单");
|
||||||
}
|
}
|
||||||
if(waitPayOrder!=null){
|
if(waitPayOrder!=null){
|
||||||
@ -510,12 +511,14 @@ public class OrderServiceImpl implements OrderService {
|
|||||||
.eq(CarPO::getStoreId, rentCarOrderReq.getStoreId());
|
.eq(CarPO::getStoreId, rentCarOrderReq.getStoreId());
|
||||||
List<CarPO> carPOList = carRepo.list(carWrapper);
|
List<CarPO> carPOList = carRepo.list(carWrapper);
|
||||||
if(CollectionUtils.isEmpty(carPOList)){
|
if(CollectionUtils.isEmpty(carPOList)){
|
||||||
|
groupBuyCouponService.cancelVerifyCoupon(rentCarOrderReq.getOrderSource(),rentCarOrderReq.getStoreId().intValue(),rentCarOrderReq.getThirdOrderNo(),rentCarOrderReq.getCouponCode());
|
||||||
throw new BizException("门店没有该车型的车辆可租");
|
throw new BizException("门店没有该车型的车辆可租");
|
||||||
}
|
}
|
||||||
|
|
||||||
//获取门店信息
|
//获取门店信息
|
||||||
CompanyStoreDTO companyStoreDTO = storeInteg.getStoreById(Integer.valueOf(rentCarOrderReq.getStoreId().toString()));
|
CompanyStoreDTO companyStoreDTO = storeInteg.getStoreById(Integer.valueOf(rentCarOrderReq.getStoreId().toString()));
|
||||||
if(Objects.isNull(companyStoreDTO)){
|
if(Objects.isNull(companyStoreDTO)){
|
||||||
|
groupBuyCouponService.cancelVerifyCoupon(rentCarOrderReq.getOrderSource(),rentCarOrderReq.getStoreId().intValue(),rentCarOrderReq.getThirdOrderNo(),rentCarOrderReq.getCouponCode());
|
||||||
throw new BizException("运营商或门店已下架");
|
throw new BizException("运营商或门店已下架");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -627,12 +630,14 @@ public class OrderServiceImpl implements OrderService {
|
|||||||
return rentCarOrderResultDTO;
|
return rentCarOrderResultDTO;
|
||||||
|
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
|
groupBuyCouponService.cancelVerifyCoupon(rentCarOrderReq.getOrderSource(),rentCarOrderReq.getStoreId().intValue(),rentCarOrderReq.getThirdOrderNo(),rentCarOrderReq.getCouponCode());
|
||||||
log.warn("下单失败", e);
|
log.warn("下单失败", e);
|
||||||
throw e;
|
throw e;
|
||||||
} finally {
|
} finally {
|
||||||
redisUtil.deleteRedisLock(redisLockKey);
|
redisUtil.deleteRedisLock(redisLockKey);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
groupBuyCouponService.cancelVerifyCoupon(rentCarOrderReq.getOrderSource(),rentCarOrderReq.getStoreId().intValue(),rentCarOrderReq.getThirdOrderNo(),rentCarOrderReq.getCouponCode());
|
||||||
log.warn("下单失败,锁已被占用");
|
log.warn("下单失败,锁已被占用");
|
||||||
throw new InnerException("服务器正在处理,请稍后再试");
|
throw new InnerException("服务器正在处理,请稍后再试");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user