From cf1d0fdbdbfe969500508ae9c0fa51cc37d06577 Mon Sep 17 00:00:00 2001 From: xuhy <3313886187@qq.com> Date: 星期二, 06 六月 2023 12:08:17 +0800 Subject: [PATCH] 代理商修改,分公司修改列表 --- management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TBranchOfficeServiceImpl.java | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TBranchOfficeServiceImpl.java b/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TBranchOfficeServiceImpl.java index 61bea73..8421a62 100644 --- a/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TBranchOfficeServiceImpl.java +++ b/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TBranchOfficeServiceImpl.java @@ -185,12 +185,14 @@ // 已发放优惠券 tBranchOfficeResp.setTotalCount(totalCount); - BigDecimal orderPriceCount = new BigDecimal("0"); + BigDecimal orderPriceCount = BigDecimal.ZERO; // 累计优惠券金额 for (TUserToCoupon tUserToCoupon : tUserToCoupons) { TCoupon tCoupon = tCouponMapper.selectById(tUserToCoupon.getCouponId()); - BigDecimal price = tCoupon.getCouponPreferentialAmount().multiply(new BigDecimal(tUserToCoupon.getCouponTotal())); - orderPriceCount = orderPriceCount.add(price); + if(Objects.nonNull(tCoupon)){ + BigDecimal price = tCoupon.getCouponPreferentialAmount().multiply(new BigDecimal(tUserToCoupon.getCouponTotal())); + orderPriceCount = orderPriceCount.add(price); + } } tBranchOfficeResp.setOrderPriceCount(orderPriceCount); -- Gitblit v1.7.1