zoujiajian há 2 anos atrás
pai
commit
5ee50bbd39

+ 3 - 0
netflix-service/src/main/java/com/cyksj/service/mange/impl/CmsOrderDonServiceImpl.java

@@ -922,6 +922,9 @@ public class CmsOrderDonServiceImpl extends ServiceImpl<OrderDonMapper,OrderDon>
         //默认补差价余额
         String refundType = Optional.ofNullable(orderRefundReq.getRefundType()).orElse("balance");
         if ("money".equals(refundType)) {
+            if (orderDon.getMoney().compareTo(BigDecimal.ZERO) == 0) {
+                throw BusinessRuntimeException.getInstance("该订单为0元订单,无法补差价至用户账户");
+            }
             BigDecimal refundMoney = orderRefundReq.getRefundMoney();
             if (refundMoney == null || refundMoney.compareTo(BigDecimal.ZERO) <= 0) {
                 throw BusinessRuntimeException.getInstance("请输入正确的差价金额");