diff --git a/ssjygl-xsx-local/src/main/java/com/cowr/local/ssjygl/order/ordertemp/OrderTempSyncService.java b/ssjygl-xsx-local/src/main/java/com/cowr/local/ssjygl/order/ordertemp/OrderTempSyncService.java index e668cec..a32f925 100644 --- a/ssjygl-xsx-local/src/main/java/com/cowr/local/ssjygl/order/ordertemp/OrderTempSyncService.java +++ b/ssjygl-xsx-local/src/main/java/com/cowr/local/ssjygl/order/ordertemp/OrderTempSyncService.java @@ -14,6 +14,7 @@ import com.cowr.local.ssjygl.order.orderseq.OrderSeqService; import com.cowr.ssjygl.invoice.log.InvoiceLogService; import com.cowr.ssjygl.invoice.receive.InvoiceReceiveService; import com.cowr.ssjygl.order.ordercluster.OrderclusterService; +import com.cowr.ssjygl.prepay.refunddetail.RefundDetailService; import com.cowr.ssjygl.supermarket.product.SupermarketProductService; import com.cowr.local.ssjygl.synctask.SyncTaskService; import com.cowr.model.*; @@ -619,13 +620,15 @@ public class OrderTempSyncService { return Result.failed("不是预付费客户"); } + PrepayCustomer prepayCustomer = PrepayCustomerService.me.getPrepayCustomer(customer.getId()); if (prepayCustomer == null) { return Result.failed("没有找到客户预付费信息"); } - - if (prepayCustomer.getSurplus() == null || prepayCustomer.getSurplus().compareTo(min) == 0) { + //账户可用余额 + BigDecimal availableBalance = RefundDetailService.me.getAvailableBalance(prepayCustomer.getCustomerId(), prepayCustomer.getSurplus()); + if (availableBalance == null || availableBalance.compareTo(min) <= 0) { return Result.failed("客户余额不足"); }