条件判定语句顺序调整

This commit is contained in:
Chopper
2021-06-29 10:25:45 +08:00
parent 6a9ba13fc0
commit 5a415ffc77
2 changed files with 4 additions and 5 deletions

View File

@@ -203,8 +203,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
public Order cancel(String orderSn, String reason) {
Order order = OperationalJudgment.judgment(this.getBySn(orderSn));
//如果订单促销类型不为空&&订单是拼团订单,并且订单未成团,则抛出异常
if (StringUtils.isNotEmpty(order.getOrderPromotionType())
&& order.getOrderPromotionType().equals(OrderPromotionTypeEnum.PINTUAN.name())
if (OrderPromotionTypeEnum.PINTUAN.name().equals(order.getOrderPromotionType())
&& !order.getOrderStatus().equals(OrderStatusEnum.UNDELIVERED.name())) {
throw new ServiceException(ResultCode.ORDER_CAN_NOT_CANCEL);
}
@@ -286,7 +285,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
Order order = this.getBySn(orderSn);
//判断是否为拼团订单,进行特殊处理
//判断订单类型进行不同的订单确认操作
if (order.getOrderPromotionType() != null && order.getOrderPromotionType().equals(OrderPromotionTypeEnum.PINTUAN.name())) {
if (OrderPromotionTypeEnum.PINTUAN.name().equals(order.getOrderPromotionType())) {
this.checkPintuanOrder(order.getPromotionId(), order.getParentOrderSn());
} else {
//判断订单类型