Zxd.Core/code/Zxd.Entity/Crm/ProductPackage.cs

88 lines
2.1 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Zxd.Entity.Crm
{
[Table("t_product_package")]
public class ProductPackage
{
[Key]
public int Pk { get; set; }
public string Id { get; set; }
public string? Name { get; set; }
public decimal Price { get; set; }
[Column("subproducts")]
public string? SubProducts { get; set; }
public string? Remark { get; set; }
[Column("subproductsinfo")]
public string? SubProductsInfo { get; set; }
public string? Extinfo { get; set; }
public string? Appextinfo { get; set; }
public string? Appext { get; set; }
[Column("webimgurl")]
public string? WebImgUrl { get; set; }
[Column("appimgurl")]
public string? AppImgUrl { get; set; }
public int? Active { get; set; }
public bool? Old { get; set; }
public int Groupid { get; set; }
public DateTime Ctime { get; set; }
[Column("update_time")]
public DateTime? UpdateTime { get; set; }
public int? BusinessType { get; set; }
[Column("effective_immediately")]
public bool? EffectiveImmediately { get; set; }
public virtual ProductGroup? ProductGroup { get; set; }
[NotMapped]
public List<string>? SubProductCodes
{
get
{
return string.IsNullOrEmpty(SubProducts) ? new List<string>()
: SubProducts.Split('|').ToList();
}
}
[NotMapped]
public List<SubProductJson>? SubProductsInfos
{
get
{
return string.IsNullOrEmpty(SubProductsInfo) ? new List<SubProductJson>()
: JsonSerializer.Deserialize<List<SubProductJson>>(SubProductsInfo);
}
}
}
public class SubProductJson
{
[JsonPropertyName("subproductid")]
public string? SubProductId { get; set; }
[JsonPropertyName("subprice")]
public string? SubPrice { get; set; }
}
}