From ed8686a5fe4f8e3db54c4e4702139e708a804e02 Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Wed, 22 May 2024 16:54:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/hfkj/service/order/impl/BsOrderServiceImpl.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/service/src/main/java/com/hfkj/service/order/impl/BsOrderServiceImpl.java b/service/src/main/java/com/hfkj/service/order/impl/BsOrderServiceImpl.java index 2cbba4d..57e7a5f 100644 --- a/service/src/main/java/com/hfkj/service/order/impl/BsOrderServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/order/impl/BsOrderServiceImpl.java @@ -287,7 +287,7 @@ public class BsOrderServiceImpl implements BsOrderService { } else if (3 == discount.getType()) { deduction.setCouponDiscountActualPrice( order.getTotalPrice() - .multiply(discount.getPrice().divide(new BigDecimal("100"))) + .multiply(discount.getPercentage().divide(new BigDecimal("100"))) .setScale(2, BigDecimal.ROUND_DOWN) ); } else { @@ -298,12 +298,10 @@ public class BsOrderServiceImpl implements BsOrderService { .add(new BigDecimal(deduction.getIntegralDiscountPrice().toString()).divide(new BigDecimal("100")))); orderDeductionService.editData(deduction); } catch (Exception e) { - throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "积分交易异常"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "优惠券使用异常"); } finally { redisTemplate.delete(key); } - - return deduction; }