制作自定义交易组件用户前端售后,微信内取消售后操作

This commit is contained in:
大灰灰
2022-06-30 23:43:16 +08:00
parent dc408b8596
commit 9bf0a42289
7 changed files with 182 additions and 20 deletions

View File

@@ -75,6 +75,10 @@ namespace CoreCms.Net.WeChat.Service.Configuration
/// 自定义交易组件用户确认收货
/// </summary>
public const string OpenProductOrderConfirm = "open_product_order_confirm";
/// <summary>
/// 用户取消售后申请
/// </summary>
public const string AfterSaleUserCancel = "aftersale_user_cancel";
#endregion

View File

@@ -0,0 +1,65 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CoreCms.Net.WeChat.Service.Enums
{
public class AfterSalesEnum
{
/// <summary>
/// 售后类型
/// </summary>
public enum AfterSaleType
{
退 = 1,
退退 = 2,
}
/// <summary>
/// 售后描述说明
/// </summary>
public enum AfterSalesReasonType
{
= 1,
= 2,
= 3,
= 5,
= 6,
= 7,
= 8,
= 9,
72 = 10,
= 11,
= 12,
= 14,
= 15
}
/// <summary>
/// 售后状态
/// </summary>
public enum AfterSalesState
{
= 1,
退 = 2,
退 = 4,
退 = 5,
退 = 6,
= 7,
= 8,
退 = 11,
退 = 13,
退 = 21,
= 22,
退 = 23,
退 = 24,
退 = 25
}
}
}

View File

@@ -0,0 +1,74 @@
/***********************************************************************
* Project: CoreCms.Net *
* Web: https://CoreCms.Net *
* ProjectName: 核心内容管理系统 *
* Author: 大灰灰 *
* Email: JianWeie@163.com *
* CreateTime: 2020-08-13 23:57:23
* Description: 暂无
***********************************************************************/
using System;
using System.Threading;
using System.Threading.Tasks;
using CoreCms.Net.Configuration;
using CoreCms.Net.IServices;
using CoreCms.Net.Loging;
using CoreCms.Net.Model.Entities;
using CoreCms.Net.Utility.Helper;
using CoreCms.Net.WeChat.Service.HttpClients;
using CoreCms.Net.WeChat.Service.Models;
using MediatR;
using Newtonsoft.Json;
using SKIT.FlurlHttpClient.Wechat.Api;
using SKIT.FlurlHttpClient.Wechat.Api.Events;
namespace CoreCms.Net.WeChat.Service.Mediator
{
/// <summary>
/// 表示 TEXT 事件的数据
/// </summary>
public class AftersaleUserCancelEventCommand : IRequest<WeChatApiCallBack>
{
public AftersaleUserCancelEvent EventObj { get; set; }
}
/// <summary>
/// 用户取消售后申请
/// </summary>
public class AftersaleUserCancelEventCommandHandler : IRequestHandler<AftersaleUserCancelEventCommand, WeChatApiCallBack>
{
private readonly ICoreCmsBillAftersalesServices _aftersalesServices;
public AftersaleUserCancelEventCommandHandler(ICoreCmsBillAftersalesServices aftersalesServices)
{
_aftersalesServices = aftersalesServices;
}
public async Task<WeChatApiCallBack> Handle(AftersaleUserCancelEventCommand request, CancellationToken cancellationToken)
{
var jm = new WeChatApiCallBack() { Status = true };
if (request.EventObj != null)
{
try
{
await _aftersalesServices.UpdateAsync(p => new CoreCmsBillAftersales()
{
status = (int)GlobalEnumVars.BillAftersalesStatus.Cancel
},
p => p.aftersalesId == request.EventObj.AftersaleOrder.OutAftersaleOrderId);
}
catch (Exception e)
{
NLogUtil.WriteFileLog(NLog.LogLevel.Info, LogType.WxPost, "接收服务器推送", "用户取消售后申请", e);
}
}
return await Task.FromResult(jm);
}
}
}