From 240197f3e63391dabc053498680022a4917b5831 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A7=E7=81=B0=E7=81=B0?= Date: Fri, 19 Aug 2022 01:08:51 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BC=98=E5=8C=96=E3=80=91=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E5=A6=82=E6=9E=9C=E5=94=AE=E5=90=8E=E4=B8=BA0?= =?UTF-8?q?=E7=9A=84=E6=83=85=E5=86=B5=E4=B8=8B=EF=BC=8C=E7=A7=AF=E5=88=86?= =?UTF-8?q?=E7=AD=96=E7=95=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AfterSalesReviewForPointSubscribe.cs | 31 ++++++++++++++++--- .../wwwroot/views/shop/setting/index.html | 4 +-- 2 files changed, 28 insertions(+), 7 deletions(-) diff --git a/CoreCms.Net.RedisMQ/Subscribe/AfterSalesReviewForPointSubscribe.cs b/CoreCms.Net.RedisMQ/Subscribe/AfterSalesReviewForPointSubscribe.cs index a74034e6..cb2b2c24 100644 --- a/CoreCms.Net.RedisMQ/Subscribe/AfterSalesReviewForPointSubscribe.cs +++ b/CoreCms.Net.RedisMQ/Subscribe/AfterSalesReviewForPointSubscribe.cs @@ -100,16 +100,37 @@ namespace CoreCms.Net.RedisMQ.Subscribe if (pointExchangeModel == 1) { //可能存在就是根本不是全积分抵扣,而是订单实际在不够积分的情况下,抵扣了多少金额。那么统一就根据订单的比例来计算,更加精准,(这里的总金额是实际支付金额,去掉了优惠) - var practicalProportion = Math.Round(order.pointMoney / order.orderAmount, 4); + //如果订单实际支付金额是0的话,那就是全积分。 + var practicalProportion = order.orderAmount <= 0 ? 1 : Math.Round(order.pointMoney / order.orderAmount, 4); + + //未发货的商品库存调整,如果订单未发货或者部分发货,并且用户未收到商品的情况下,需要解冻冻结库存 + if ((order.shipStatus == (int)GlobalEnumVars.OrderShipStatus.No || + order.shipStatus == (int)GlobalEnumVars.OrderShipStatus.PartialYes) && + info.type == (int)GlobalEnumVars.BillAftersalesIsReceive.Refund && p.nums == 0) + { + point += aftersalesProduct.price * practicalProportion * pointDiscountedProportion; + } + else + { + //获取货品金额*积分使用比例*数量*积分折现比例=积分抵扣的金额应该可以兑换的积分。 + point += aftersalesProduct.price * practicalProportion * p.nums * pointDiscountedProportion; + } - //获取货品金额*积分使用比例*数量*积分折现比例=积分抵扣的金额应该可以兑换的积分。 - point += aftersalesProduct.price * practicalProportion * p.nums * pointDiscountedProportion; } //如果是单品模式 else if (pointExchangeModel == 2) { - //单品模式只能是全积分抵扣或者全金额支付。所以直接按照扣掉的金额还原积分即可。 - point += aftersalesProduct.pointsDeduction * p.nums * pointDiscountedProportion; + if ((order.shipStatus == (int)GlobalEnumVars.OrderShipStatus.No || + order.shipStatus == (int)GlobalEnumVars.OrderShipStatus.PartialYes) && + info.type == (int)GlobalEnumVars.BillAftersalesIsReceive.Refund && p.nums == 0) + { + point += aftersalesProduct.pointsDeduction * pointDiscountedProportion; + } + else + { + //单品模式只能是全积分抵扣或者全金额支付。所以直接按照扣掉的金额还原积分即可。 + point += aftersalesProduct.pointsDeduction * p.nums * pointDiscountedProportion; + } } } diff --git a/CoreCms.Net.Web.Admin/wwwroot/views/shop/setting/index.html b/CoreCms.Net.Web.Admin/wwwroot/views/shop/setting/index.html index 432884ab..8d839d1e 100644 --- a/CoreCms.Net.Web.Admin/wwwroot/views/shop/setting/index.html +++ b/CoreCms.Net.Web.Admin/wwwroot/views/shop/setting/index.html @@ -253,9 +253,9 @@
- +
-
前台下单时给商家发送短信通知
+
前台下单时给商家发送短信通知,多个手机号请使用小写逗号(,)隔开,最多8个号码,如:19145919666,19145919666