修改工单流程页面,订单列表增加工单按钮

This commit is contained in:
chfei committed 2026-10-18 20:35:47 +08:00
1 parent f9dcae4610
commit 10bb0803d9
44 files changed
+5920 -1291

No files matched your search

+15 -10
View File
@@ -10,6 +10,7 @@ using System.Runtime.Serialization.Json;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using WxOrder.Framework.Commons;
namespace OrderSupportTicket.Services;
@@ -18,7 +19,7 @@ namespace OrderSupportTicket.Services;
/// </summary>
public sealed class TicketApiService : ITicketApiService
{
internal const string ServerUrl = "https://ai.e57.cn";
internal static string ServerUrl = "https://ai.e57.cn";
private const string ApiRoot = "/api/open/v2/customer-work-orders";
private static readonly Regex AppIdRegex =
new Regex(@"^wx[0-9a-f]{16}$", RegexOptions.Compiled | RegexOptions.CultureInvariant);
@@ -28,7 +29,13 @@ public sealed class TicketApiService : ITicketApiService
new Regex(@"^[\p{L}\p{N}_.@-]{2,120}$", RegexOptions.Compiled);
private static readonly Regex OperationIdRegex =
new Regex(@"^[A-Za-z0-9_.:-]{1,128}$", RegexOptions.Compiled | RegexOptions.CultureInvariant);
static TicketApiService()
{
if (EnvironmentHelper.IsTest)
{
ServerUrl = "http://localhost:5188";
}
}
/// <summary>
/// 获取工单列表
/// </summary>
@@ -64,7 +71,7 @@ public sealed class TicketApiService : ITicketApiService
return await PostAsync<WorkOrderListResponse>(
ApiRoot + "/list",
request).ConfigureAwait(false);
request);
}
/// <summary>
/// 获取工单消息
@@ -100,8 +107,7 @@ public sealed class TicketApiService : ITicketApiService
var path = ApiRoot
+ "/messages";
return await PostAsync<WorkOrderMessagesResponse>(path, request)
.ConfigureAwait(false);
return await PostAsync<WorkOrderMessagesResponse>(path, request);
}
/// <summary>
/// 创建工单
@@ -170,8 +176,7 @@ public sealed class TicketApiService : ITicketApiService
+ "/orders/"
+ Uri.EscapeDataString(workOrder.WechatOrderId)
+ "/messages";
return await PostAsync<SendMessageResponse>(path, request)
.ConfigureAwait(false);
return await PostAsync<SendMessageResponse>(path, request);
}
public async Task MarkReadAsync(
@@ -196,7 +201,7 @@ public sealed class TicketApiService : ITicketApiService
+ "/orders/"
+ Uri.EscapeDataString(wechatOrderId)
+ "/read";
var html = await PostBodyAsync(path, request).ConfigureAwait(false);
var html = await PostBodyAsync(path, request);
EnsureSuccessBody(html);
}
@@ -245,7 +250,7 @@ public sealed class TicketApiService : ITicketApiService
string path,
object request)
{
var html = await PostBodyAsync(path, request).ConfigureAwait(false);
var html = await PostBodyAsync(path, request);
return DeserializeResponse<T>(html);
}
@@ -256,7 +261,7 @@ public sealed class TicketApiService : ITicketApiService
var url = BuildUri(path);
// 请求 DTO 使用 DataMember 驼峰字段,先序列化后走 GetHtml 的字符串重载。
var json = Serialize(request);
var html = await GetHtml.PostJsonAsync(url, json).ConfigureAwait(false);
var html = await GetHtml.PostJsonAsync(url, json);
if (string.IsNullOrWhiteSpace(html))
throw RequestFailed("工单接口未返回数据。");
return html;