fix: 数值枚举从 1 起编并统一 OrderTaskStatus 常量
Reserve 0 as None for byte enums and align customer group labels with dict codes; add OrderTaskStatusCodes for import task status strings. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
32753e7606
commit
365f9d8a94
@ -66,11 +66,11 @@ public static class DataPermConstants
|
|||||||
|
|
||||||
public static readonly IReadOnlyList<(int Value, string Label)> CustomerGroupOptions =
|
public static readonly IReadOnlyList<(int Value, string Label)> CustomerGroupOptions =
|
||||||
[
|
[
|
||||||
(0, "默认"),
|
(1, "普通客户"),
|
||||||
(1, "VIP"),
|
(2, "VIP1"),
|
||||||
(2, "重点"),
|
(3, "VIP2"),
|
||||||
(3, "普通"),
|
(4, "VIP3"),
|
||||||
(4, "试用"),
|
(5, "VIP4"),
|
||||||
(5, "停用")
|
(6, "VIP5")
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@ -384,7 +384,7 @@ public partial class OrderService
|
|||||||
Quantity = parsedRows.Count,
|
Quantity = parsedRows.Count,
|
||||||
SuccessCount = 0,
|
SuccessCount = 0,
|
||||||
FailCount = 0,
|
FailCount = 0,
|
||||||
Status = "processing",
|
Status = OrderTaskStatusCodes.Processing,
|
||||||
TemplateId = template.Id,
|
TemplateId = template.Id,
|
||||||
CustomerId = effectiveCustomer.Id
|
CustomerId = effectiveCustomer.Id
|
||||||
});
|
});
|
||||||
@ -456,7 +456,7 @@ public partial class OrderService
|
|||||||
Quantity = 0,
|
Quantity = 0,
|
||||||
SuccessCount = 0,
|
SuccessCount = 0,
|
||||||
FailCount = 0,
|
FailCount = 0,
|
||||||
Status = "processing",
|
Status = OrderTaskStatusCodes.Processing,
|
||||||
TemplateId = template.Id,
|
TemplateId = template.Id,
|
||||||
CustomerId = effectiveCustomer.Id
|
CustomerId = effectiveCustomer.Id
|
||||||
});
|
});
|
||||||
@ -500,7 +500,7 @@ public partial class OrderService
|
|||||||
task.Quantity = quantity;
|
task.Quantity = quantity;
|
||||||
task.SuccessCount = successCount;
|
task.SuccessCount = successCount;
|
||||||
task.FailCount = failCount;
|
task.FailCount = failCount;
|
||||||
task.Status = "completed";
|
task.Status = OrderTaskStatusCodes.Completed;
|
||||||
await OrderTaskRepository.UpdateAsync(task);
|
await OrderTaskRepository.UpdateAsync(task);
|
||||||
return new OrderUploadOutput { TaskId = task.Id };
|
return new OrderUploadOutput { TaskId = task.Id };
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,11 +1,15 @@
|
|||||||
namespace Oms.Domain.CustomersAggregate.Enums;
|
namespace Oms.Domain.CustomersAggregate.Enums;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 客户组。0=None 未设置;业务值从 1 起。
|
||||||
|
/// </summary>
|
||||||
public enum CustomerGroup : byte
|
public enum CustomerGroup : byte
|
||||||
{
|
{
|
||||||
Normal = 0,
|
None = 0,
|
||||||
Vip1 = 1,
|
Normal = 1,
|
||||||
Vip2 = 2,
|
Vip1 = 2,
|
||||||
Vip3 = 3,
|
Vip2 = 3,
|
||||||
Vip4 = 4,
|
Vip3 = 4,
|
||||||
Vip5 = 5
|
Vip4 = 5,
|
||||||
|
Vip5 = 6
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,8 +1,12 @@
|
|||||||
namespace Oms.Domain.CustomersAggregate.Enums;
|
namespace Oms.Domain.CustomersAggregate.Enums;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 客户状态。0=None 未设置;业务值从 1 起。
|
||||||
|
/// </summary>
|
||||||
public enum CustomerStatus : byte
|
public enum CustomerStatus : byte
|
||||||
{
|
{
|
||||||
Disabled = 0,
|
None = 0,
|
||||||
Normal = 1,
|
Disabled = 1,
|
||||||
Frozen = 2
|
Normal = 2,
|
||||||
|
Frozen = 3
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,26 @@
|
|||||||
|
namespace Oms.Domain.OrdersAggregate.Consts;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 订单导入/批量任务状态(t_order_task.Status,字符串落库;与字典 order_task_status 对齐)。
|
||||||
|
/// </summary>
|
||||||
|
public static class OrderTaskStatusCodes
|
||||||
|
{
|
||||||
|
public const string Pending = "pending";
|
||||||
|
public const string Processing = "processing";
|
||||||
|
public const string Completed = "completed";
|
||||||
|
|
||||||
|
public static readonly HashSet<string> All = new(StringComparer.OrdinalIgnoreCase)
|
||||||
|
{
|
||||||
|
Pending,
|
||||||
|
Processing,
|
||||||
|
Completed
|
||||||
|
};
|
||||||
|
|
||||||
|
public static string GetDisplayName(string? code) => code?.Trim().ToLowerInvariant() switch
|
||||||
|
{
|
||||||
|
Pending => "待处理",
|
||||||
|
Processing => "处理中",
|
||||||
|
Completed => "已完成",
|
||||||
|
_ => code ?? string.Empty
|
||||||
|
};
|
||||||
|
}
|
||||||
@ -1,7 +1,11 @@
|
|||||||
namespace Oms.Domain.RechargeAggregate.Enums;
|
namespace Oms.Domain.RechargeAggregate.Enums;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 支付方式。0=None 未设置;业务值从 1 起。
|
||||||
|
/// </summary>
|
||||||
public enum PayType : byte
|
public enum PayType : byte
|
||||||
{
|
{
|
||||||
|
None = 0,
|
||||||
Wechat = 1,
|
Wechat = 1,
|
||||||
Alipay = 2
|
Alipay = 2
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,8 +1,12 @@
|
|||||||
namespace Oms.Domain.RechargeAggregate.Enums;
|
namespace Oms.Domain.RechargeAggregate.Enums;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 充值审核状态。0=None 未设置;业务值从 1 起。
|
||||||
|
/// </summary>
|
||||||
public enum RechargeStatus : byte
|
public enum RechargeStatus : byte
|
||||||
{
|
{
|
||||||
Pending = 0,
|
None = 0,
|
||||||
Approved = 1,
|
Pending = 1,
|
||||||
Rejected = 2
|
Approved = 2,
|
||||||
|
Rejected = 3
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,7 +1,11 @@
|
|||||||
namespace Oms.Domain.Shared.Enums;
|
namespace Oms.Domain.Shared.Enums;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 启用状态。0=None 未设置;业务值从 1 起。
|
||||||
|
/// </summary>
|
||||||
public enum EnableStatus : byte
|
public enum EnableStatus : byte
|
||||||
{
|
{
|
||||||
Disabled = 0,
|
None = 0,
|
||||||
Enabled = 1
|
Disabled = 1,
|
||||||
|
Enabled = 2
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user