fwq
2024-09-04 4992e4ad87c81d3497f0a9e8949a479960a9e24e
其-BUG-除0问题
1个文件已修改
10 ■■■■ 已修改文件
phi_platform_common/src/main/java/com/hx/phip/tool/refund/CardRefundTool.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_common/src/main/java/com/hx/phip/tool/refund/CardRefundTool.java
@@ -758,10 +758,14 @@
                refundCardEquity.setOccupyRefundTotal(cardEquityRealRefund.getOccupyEqRefundTotal());
                refundCardEquity.setOccupyRefundIntegral(cardEquityRealRefund.getOccupyEqRefundIntegral());
                logger.info("卡项OCC退款OCC抵扣积分{},OCC总积分{}",refundCard.getOccupyRefundIntegralDeduction(),refundCard.getOccupyRefundIntegral());
                // 卡项OCC抵扣积分占比OCC总积分
                proportion = refundCard.getOccupyRefundIntegralDeduction().divide(refundCard.getOccupyRefundIntegral(),20,RoundingMode.HALF_UP);
                logger.info("卡项OCC退款OCC抵扣积分{},OCC总积分{},占比:{}",refundCard.getOccupyRefundIntegralDeduction()
                        ,refundCard.getOccupyRefundIntegral(),proportion);
                if (refundCard.getOccupyRefundIntegral() != null && refundCard.getOccupyRefundIntegral().compareTo(BigDecimal.ZERO) != 0){
                    proportion = refundCard.getOccupyRefundIntegralDeduction().divide(refundCard.getOccupyRefundIntegral(),20,RoundingMode.HALF_UP);
                }else {
                    proportion = BigDecimal.ZERO;
                }
                logger.info("卡项OCC退款OCC抵扣积分占比OCC总积分:{}",proportion);
                refundCardEquity.setOccupyRefundIntegralDeduction(cardEquityRealRefund.getOccupyRefundIntegral().multiply(proportion));
                refundCardEquity.setOccupyRefundIntegralCash(cardEquityRealRefund.getOccupyIntegralDeduction().multiply(refundCard.getCashRate()));