|
|
@@ -979,13 +979,21 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
|
|
|
|
|
|
//是否有其他规格的续费订单 若有请先关闭
|
|
|
List<Long> userIdList = userBindRelationService.getRelationUserIdList(userId, user);
|
|
|
- Integer count = orderDonMapper.selectCount(Wrappers.lambdaQuery(OrderDon.class)
|
|
|
- .eq(OrderDon::getRelationId, payRequest.getRelationId())
|
|
|
- .eq(OrderDon::getYhsId, yhsId)
|
|
|
- .in(OrderDon::getUserId, userIdList)
|
|
|
- .eq(OrderDon::getStatus, OrderDon.Status.noPayment).eq(OrderDon::getOrderType, 2));
|
|
|
- if (count > 0) {
|
|
|
- throw BusinessRuntimeException.getInstance("您有该车票未支付的续费订单..");
|
|
|
+ if (payRequest.getCmt() == 2) {
|
|
|
+ //关闭其他待支付订单
|
|
|
+ orderDonMapper.update(null, Wrappers.lambdaUpdate(OrderDon.class)
|
|
|
+ .set(OrderDon::getStatus, OrderDon.Status.close)
|
|
|
+ .eq(OrderDon::getUserId, userId)
|
|
|
+ .eq(OrderDon::getStatus, OrderDon.Status.noPayment));
|
|
|
+ } else {
|
|
|
+ Integer count = orderDonMapper.selectCount(Wrappers.lambdaQuery(OrderDon.class)
|
|
|
+ .eq(OrderDon::getRelationId, payRequest.getRelationId())
|
|
|
+ .eq(OrderDon::getYhsId, yhsId)
|
|
|
+ .in(OrderDon::getUserId, userIdList)
|
|
|
+ .eq(OrderDon::getStatus, OrderDon.Status.noPayment).eq(OrderDon::getOrderType, 2));
|
|
|
+ if (count > 0) {
|
|
|
+ throw BusinessRuntimeException.getInstance("您有该车票未支付的续费订单..");
|
|
|
+ }
|
|
|
}
|
|
|
GoodsDonSku sku = adjustGoodsDonSku(yhsId, false, renewSkuId);
|
|
|
|