From 0c733d9627f5d304f7213e74f5f86c93dff8a5cb Mon Sep 17 00:00:00 2001 From: fwq <582742538@qq.com> Date: 星期二, 09 五月 2023 19:19:32 +0800 Subject: [PATCH] 叠加金额计算优化 --- phis-feign/src/main/java/com/hz/phis/dt/coupon/CouponCheckMoneyDt.java | 25 +++++++++++++++++++++++++ 1 files changed, 25 insertions(+), 0 deletions(-) diff --git a/phis-feign/src/main/java/com/hz/phis/dt/coupon/CouponCheckMoneyDt.java b/phis-feign/src/main/java/com/hz/phis/dt/coupon/CouponCheckMoneyDt.java new file mode 100644 index 0000000..bee990a --- /dev/null +++ b/phis-feign/src/main/java/com/hz/phis/dt/coupon/CouponCheckMoneyDt.java @@ -0,0 +1,25 @@ +package com.hz.phis.dt.coupon; + + +import lombok.Data; + +import java.math.BigDecimal; +import java.math.RoundingMode; + +/** + * 浼樻儬鍒告楠岄噾棰濊繑鍥炲疄浣� + */ +@Data +public class CouponCheckMoneyDt { + /**閲戦*/ + BigDecimal goodsMoney = BigDecimal.ZERO; + + /**閲戦鍙犲姞*/ + public void goodsMoneyAdd(BigDecimal money) { + if (money == null){ + money = BigDecimal.ZERO; + } + this.goodsMoney = this.goodsMoney.add(money).setScale(2, RoundingMode.HALF_UP); + } + +} -- Gitblit v1.8.0