|
|
@@ -192,10 +192,20 @@ public class CmsGroupRelationController {
|
|
|
orderDon = orderDonMapper.selectOne(Wrappers.lambdaQuery(OrderDon.class)
|
|
|
.eq(OrderDon::getUserId, relation.getUserId())
|
|
|
.eq(OrderDon::getRelationId, relationId)
|
|
|
- .notIn(OrderDon::getStatus, Constant.noOrderStatus)
|
|
|
+ .notIn(OrderDon::getStatus, Constant.noOrderAllStatus)
|
|
|
.orderByDesc(OrderDon::getId)
|
|
|
.last("limit 1"));
|
|
|
- if (orderDon == null) throw BusinessRuntimeException.getInstance("该代充订单不存在");
|
|
|
+ if (orderDon == null){
|
|
|
+ orderDon = orderDonMapper.selectOne(Wrappers.lambdaQuery(OrderDon.class)
|
|
|
+ .eq(OrderDon::getUserId, relation.getUserId())
|
|
|
+ .eq(OrderDon::getRelationId, relationId)
|
|
|
+ .notIn(OrderDon::getStatus, Constant.noOrderStatus)
|
|
|
+ .orderByDesc(OrderDon::getId)
|
|
|
+ .last("limit 1"));
|
|
|
+ if (orderDon == null) {
|
|
|
+ throw BusinessRuntimeException.getInstance("该代充订单不存在");
|
|
|
+ }
|
|
|
+ }
|
|
|
if (orderDon.getStatus() == OrderDon.Status.refund) {
|
|
|
throw BusinessRuntimeException.getInstance("该代充订单已退款");
|
|
|
}
|