From a29d611b6944ef05f43d4a157e93fc0a62dc8dc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=B9=E7=A3=8A?= <45566618@qq.com> Date: Fri, 12 Jul 2024 18:43:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E9=87=91=E5=88=B8=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/OrdersServiceImpl.java | 18 ++++++++---------- .../impl/UserPackageOrderServiceImpl.java | 3 ++- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/main/java/com/sqx/modules/artificer/service/impl/OrdersServiceImpl.java b/src/main/java/com/sqx/modules/artificer/service/impl/OrdersServiceImpl.java index 60dea5b..59faabf 100644 --- a/src/main/java/com/sqx/modules/artificer/service/impl/OrdersServiceImpl.java +++ b/src/main/java/com/sqx/modules/artificer/service/impl/OrdersServiceImpl.java @@ -665,18 +665,14 @@ public class OrdersServiceImpl extends ServiceImpl implements return Result.error("优惠券不满足使用条件!"); } } - couponMinMoney = couponMinMoney.add(couponUser.getMoney()); + couponMinMoney = couponMinMoney.add(couponUser.getMinMoney()); CouponUserList.add(couponUser); - BigDecimal money= couponUser.getMoney(); + BigDecimal money = couponUser.getMoney(); couponMoney = couponMoney.add(money); couponNameSb.append(couponUser.getCouponName()); couponNameSb.append(","); } } - - if(couponMoney.compareTo(couponMinMoney) < 0){ - return Result.error("当前应付总金额不满足优惠券使用的最小额度,请重新选择优惠券!"); - } orders.setCouponName(couponNameSb.toString()); orders.setCouponMoney(couponMoney); }else{ @@ -761,7 +757,7 @@ public class OrdersServiceImpl extends ServiceImpl implements orders.setEntryName(massageTypeName); //判断金额是否满足代金券金额最少消费额度 - if(price.compareTo(couponMinMoney) < 0){ + if(orders.getMassagePrice().compareTo(couponMinMoney) < 0){ return Result.error("当前应付总金额不满足优惠券使用的最小额度,请重新选择优惠券!"); } @@ -1732,7 +1728,7 @@ public class OrdersServiceImpl extends ServiceImpl implements return Result.error("优惠券不满足使用条件!"); } } - couponMinMoney = couponMinMoney.add(couponUser.getMoney()); + couponMinMoney = couponMinMoney.add(couponUser.getMinMoney()); CouponUserList.add(couponUser); BigDecimal money = couponUser.getMoney(); couponMoney = couponMoney.add(money); @@ -1785,7 +1781,10 @@ public class OrdersServiceImpl extends ServiceImpl implements BigDecimal artificerPrice = new BigDecimal("0.00"); for (OrdersMassage ordersMassage : ordersMassageList) { + orders.setDuration(massageType.getDuration()); + orders.setMassageNum(ordersMassage.getNum()); price = massageType.getPrice().multiply(BigDecimal.valueOf(ordersMassage.getNum())); + orders.setMassagePrice(price); BigDecimal massagePrice = price.multiply(orders.getTechnicianRate()).divide(new BigDecimal(100)).add(price);//技师等级加成金额 massagePrice = massagePrice.multiply(orders.getVipRate()).divide(new BigDecimal(100));//会员优惠后金额 massageTypeName = massageType.getTitle(); @@ -1797,12 +1796,11 @@ public class OrdersServiceImpl extends ServiceImpl implements orders.setMassageTypeId(massageType.getMassageTypeId()); } //保存现价 - orders.setMassagePrice(price); orders.setPrice(price); orders.setEntryName(massageTypeName); //判断金额是否满足代金券金额最少消费额度 - if (payMoney.compareTo(couponMinMoney) < 0) { + if (orders.getMassagePrice().compareTo(couponMinMoney) < 0) { return Result.error("当前应付总金额不满足优惠券使用的最小额度,请重新选择优惠券!"); } diff --git a/src/main/java/com/sqx/modules/bl/order/service/impl/UserPackageOrderServiceImpl.java b/src/main/java/com/sqx/modules/bl/order/service/impl/UserPackageOrderServiceImpl.java index 6d6be08..560e63a 100644 --- a/src/main/java/com/sqx/modules/bl/order/service/impl/UserPackageOrderServiceImpl.java +++ b/src/main/java/com/sqx/modules/bl/order/service/impl/UserPackageOrderServiceImpl.java @@ -190,7 +190,7 @@ public class UserPackageOrderServiceImpl extends ServiceImpl