feat 移除订单编号字段并优化订单创建逻辑
- 移除了 `Order` 实体中的 `OrderSN` 字段及相关逻辑。 - 修改 `Order` 构造函数,简化参数,新增默认状态字段。 - 更新 `AddressInfo` 属性访问修饰符为 `private set`。 - 调整 `OrderAppService` 的订单创建逻辑,适配新构造函数。 - 更新数据库迁移路径,新增迁移文件 `20251017042956_V1.0.0`。 - 新增 `AppOrder`、`AppProduct`、`AppServiceCategory` 表。 - 在 `AbpUsers` 表中新增字段以支持用户扩展。 - 更新实体配置,统一命名约定,支持扩展映射。 - 添加 `AdminDataSeedContributor` 类,预留数据种子逻辑。
This commit is contained in:
		@ -7,16 +7,14 @@ namespace KonSoft.Admin.Entities;
 | 
			
		||||
 | 
			
		||||
public class Order : FullAuditedAggregateRoot<Guid>
 | 
			
		||||
{
 | 
			
		||||
    protected Order()
 | 
			
		||||
    private Order()
 | 
			
		||||
    {
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    public Order(Guid id, string orderSN, Guid customerId, Guid serviceCategoryId, DateTime serviceTime, decimal amount,
 | 
			
		||||
        AddressInfo address, string remark = null)
 | 
			
		||||
        : base(id)
 | 
			
		||||
    public Order(Guid customerId, Guid serviceCategoryId, DateTime serviceTime, decimal amount,
 | 
			
		||||
        AddressInfo address, string? remark = null)
 | 
			
		||||
    {
 | 
			
		||||
        OrderSN = orderSN;
 | 
			
		||||
        CustomerId = customerId;
 | 
			
		||||
        ServiceCategoryId = serviceCategoryId;
 | 
			
		||||
        ServiceTime = serviceTime;
 | 
			
		||||
@ -26,11 +24,6 @@ public class Order : FullAuditedAggregateRoot<Guid>
 | 
			
		||||
        Status = OrderStatus.PendingPayment;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /// <summary>
 | 
			
		||||
    ///     订单编号
 | 
			
		||||
    /// </summary>
 | 
			
		||||
    public string OrderSN { get; private set; }
 | 
			
		||||
 | 
			
		||||
    /// <summary>
 | 
			
		||||
    ///     用户ID
 | 
			
		||||
    /// </summary>
 | 
			
		||||
@ -41,26 +34,19 @@ public class Order : FullAuditedAggregateRoot<Guid>
 | 
			
		||||
    /// </summary>
 | 
			
		||||
    public Guid? WorkerId { get; private set; }
 | 
			
		||||
 | 
			
		||||
    ///// <summary>
 | 
			
		||||
    ///// 用户ID
 | 
			
		||||
    ///// </summary>
 | 
			
		||||
    //public virtual IdentityUser Customer { get; private set; }
 | 
			
		||||
    ///// <summary>
 | 
			
		||||
    ///// 家政人员ID
 | 
			
		||||
    ///// </summary>
 | 
			
		||||
    //public virtual IdentityUser? Worker { get; private set; }
 | 
			
		||||
    /// <summary>
 | 
			
		||||
    ///     服务项目ID
 | 
			
		||||
    /// </summary>
 | 
			
		||||
    public Guid ServiceCategoryId { get; private set; }
 | 
			
		||||
 | 
			
		||||
    public virtual ServiceCategory ServiceCategory { get; private set; }
 | 
			
		||||
 | 
			
		||||
    /// <summary>
 | 
			
		||||
    ///     服务预约时间
 | 
			
		||||
    /// </summary>
 | 
			
		||||
    public DateTime ServiceTime { get; private set; }
 | 
			
		||||
 | 
			
		||||
    /// <summary>
 | 
			
		||||
    /// 订单状态
 | 
			
		||||
    /// </summary>
 | 
			
		||||
    public OrderStatus Status { get; private set; }
 | 
			
		||||
 | 
			
		||||
    /// <summary>
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user