Selaa lähdekoodia

退款总金额精度问题

plf 3 vuotta sitten
vanhempi
commit
f0f90e2268

+ 2 - 1
src/main/java/com/caimei/modules/order/service/CmRefundShopService.java

@@ -131,7 +131,8 @@ public class CmRefundShopService extends CrudService<CmRefundShopDao, CmRefundSh
                 } else {
                     so.setRefundsAmount(0d);
                 }
-                refundAmount += (so.getPayedShopAmount() - so.getRefundsAmount() - so.getShouldPayShopAmount());
+                BigDecimal payAmount = MathUtil.sub(so.getPayedShopAmount(), MathUtil.add(so.getRefundsAmount(), so.getShouldPayShopAmount()));
+                refundAmount = MathUtil.add(refundAmount, payAmount).doubleValue();
                 List<NewOrderProduct> orderProductList = newOrderProductDao.findByShopOrderID(so.getShopOrderID());
                 /*
                  1. 若发生退货,数量要减去已退货和已取消的数量