mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2025-12-06 17:23:26 +08:00
【新增】增加售后审核通过后,积分返还机制的队列实现,取消原有积分统一返还机制。
This commit is contained in:
@@ -144,6 +144,7 @@ namespace CoreCms.Net.Services
|
||||
#endregion
|
||||
|
||||
#region 统计用户的售后数量============================================
|
||||
|
||||
/// <summary>
|
||||
/// 统计用户的售后数量
|
||||
/// </summary>
|
||||
@@ -376,10 +377,19 @@ namespace CoreCms.Net.Services
|
||||
{
|
||||
if (type == (int)GlobalEnumVars.BillAftersalesIsReceive.Refund)
|
||||
{
|
||||
var n = orderItem.nums - orderItem.sendNums - (orderItem.reshipNums - orderItem.reshipedNums);
|
||||
if (n < nums)
|
||||
//售后中未退换的数量(申请售后退还的,已经收到退还的,差额就是客户还需要退还的)
|
||||
var reshipNum = orderItem.reshipNums - orderItem.reshipedNums;
|
||||
|
||||
//如果未发货,但申请售后大于0
|
||||
if (orderItem.sendNums == 0 && nums > 0)
|
||||
{
|
||||
jm.msg = orderItem.name + orderItem.addon + ",未发货商品,最多能退" + n + "个";
|
||||
jm.msg = orderItem.name + orderItem.addon + ",未发货商品,退货数量只能为0个";
|
||||
return jm;
|
||||
}
|
||||
//如果当前售后数量+未寄送的售后数量 > 已经发货数量
|
||||
if (reshipNum + nums > orderItem.sendNums)
|
||||
{
|
||||
jm.msg = orderItem.name + orderItem.addon + ",售后申请超过数量,最多能退" + (orderItem.sendNums - reshipNum - nums) + "个";
|
||||
return jm;
|
||||
}
|
||||
}
|
||||
@@ -625,17 +635,16 @@ namespace CoreCms.Net.Services
|
||||
orderInfo.payStatus = (int)GlobalEnumVars.OrderPayStatus.Refunded;
|
||||
orderInfo.status = (int)GlobalEnumVars.OrderStatus.Complete;
|
||||
|
||||
//返还积分
|
||||
if (orderInfo.point > 0)
|
||||
{
|
||||
await _userPointLogServices.SetPoint(orderInfo.userId, orderInfo.point, (int)GlobalEnumVars.UserPointSourceTypes.PointRefundReturn, "售后退款:" + orderInfo.orderId + "返还积分");
|
||||
}
|
||||
//返还积分(此模式会导致多次售后刷积分情况)
|
||||
//if (orderInfo.point > 0)
|
||||
//{
|
||||
// await _userPointLogServices.SetPoint(orderInfo.userId, orderInfo.point, (int)GlobalEnumVars.UserPointSourceTypes.PointRefundReturn, "售后退款:" + orderInfo.orderId + "返还积分");
|
||||
//}
|
||||
//返还优惠券
|
||||
if (!string.IsNullOrEmpty(orderInfo.coupon))
|
||||
{
|
||||
await couponServices.CancelReturnCoupon(orderInfo.coupon);
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -731,6 +740,8 @@ namespace CoreCms.Net.Services
|
||||
{
|
||||
//售后审核通过后处理
|
||||
await _redisOperationRepository.ListLeftPushAsync(RedisMessageQueueKey.AfterSalesReview, aftersalesId);
|
||||
//售后审核通过后积分退还机制
|
||||
await _redisOperationRepository.ListLeftPushAsync(RedisMessageQueueKey.AfterSalesReviewForPoint, aftersalesId);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user