diff --git a/src/main/java/com/example/demo/serviceImpl/cash/CashRefundServiceImpl.java b/src/main/java/com/example/demo/serviceImpl/cash/CashRefundServiceImpl.java index 506096b..660229e 100644 --- a/src/main/java/com/example/demo/serviceImpl/cash/CashRefundServiceImpl.java +++ b/src/main/java/com/example/demo/serviceImpl/cash/CashRefundServiceImpl.java @@ -140,9 +140,13 @@ public class CashRefundServiceImpl implements RefundService { item.setFree(free); item.setActivity(cashCollection.getActivity()); item.setPaymentCurrency(cashCollection.getPaymentCurrency()); - item.setPaymentAmount(cashCollection.getPaymentAmount().divide(new BigDecimal(100), 2, RoundingMode.HALF_UP)); + if(cashCollection.getPaymentCurrency() != null){ + item.setPaymentAmount(cashCollection.getPaymentAmount().divide(new BigDecimal(100), 2, RoundingMode.HALF_UP));} + else item.setPaymentAmount(cashCollection.getPaymentAmount()); item.setReceivedCurrency(cashCollection.getReceivedCurrency()); - item.setReceivedAmount(cashCollection.getReceivedAmount().divide(new BigDecimal(100), 2, RoundingMode.HALF_UP)); + if (cashCollection.getReceivedCurrency() != null){ + item.setReceivedAmount(cashCollection.getReceivedAmount().divide(new BigDecimal(100), 2, RoundingMode.HALF_UP));} + else item.setReceivedAmount(cashCollection.getReceivedAmount()); item.setPayType(cashCollection.getPayType()); item.setPayTime(cashCollection.getPayTime()); item.setPayBankCode(cashCollection.getBankCode());