完善基础数据
This commit is contained in:
@@ -0,0 +1,70 @@
|
||||
using FreeSql.DataAnnotations;
|
||||
using F9WebAiTest.Domain.Enums.SYS.Departments;
|
||||
using F9WebAiTest.Domain.Enums.SYS.WuziMulus;
|
||||
using F9WebAiTest.Domain.Events.SYS.WuziMulus;
|
||||
|
||||
namespace F9WebAiTest.Domain.Entities.SYS.WuziMulus;
|
||||
|
||||
/// <summary>
|
||||
/// 物资分组:物资目录的分类树(如 01 干茧、04 副产品、0401 副产品-副产车间…),编号按父级编号 + 2 位序号自动生成。
|
||||
/// </summary>
|
||||
[Table(Name = "sys_wuzi_group")]
|
||||
public class WuziGroup : AggregateRoot
|
||||
{
|
||||
/// <summary>业务类型(原料/中间品/生丝/副产品/五金)</summary>
|
||||
[Column(Name = "businesstype")]
|
||||
public WuziBusiness_Type_Enum BusinessType { get; private set; }
|
||||
|
||||
/// <summary>归属部门职责类型</summary>
|
||||
[Column(Name = "departmenttype")]
|
||||
public Department_DutyType_Enum DepartmentType { get; private set; }
|
||||
|
||||
/// <summary>编号(如 01、0101)</summary>
|
||||
[Column(Name = "code")]
|
||||
public string Code { get; private set; }
|
||||
|
||||
/// <summary>名称</summary>
|
||||
[Column(Name = "name")]
|
||||
public string Name { get; private set; }
|
||||
|
||||
/// <summary>父级 Id(0 = 一级分类)</summary>
|
||||
[Column(Name = "parentid")]
|
||||
public long ParentId { get; private set; }
|
||||
|
||||
/// <summary>顺序号</summary>
|
||||
[Column(Name = "sortorder")]
|
||||
public int SortOrder { get; private set; }
|
||||
|
||||
/// <summary>描述</summary>
|
||||
[Column(Name = "description")]
|
||||
public string Description { get; private set; }
|
||||
|
||||
public WuziGroup() { }
|
||||
|
||||
public WuziGroup(long id, WuziBusiness_Type_Enum businessType, Department_DutyType_Enum departmentType,
|
||||
string code, string name, long parentId, int sortOrder, string description)
|
||||
{
|
||||
Id = id;
|
||||
BusinessType = businessType;
|
||||
DepartmentType = departmentType;
|
||||
Code = code;
|
||||
Name = name;
|
||||
ParentId = parentId;
|
||||
SortOrder = sortOrder;
|
||||
Description = description;
|
||||
AddDomainEvent(new WuziGroup_ChangedDomainEvent(Id));
|
||||
}
|
||||
|
||||
public void Update(WuziBusiness_Type_Enum businessType, Department_DutyType_Enum departmentType,
|
||||
string name, int sortOrder, string description)
|
||||
{
|
||||
BusinessType = businessType;
|
||||
DepartmentType = departmentType;
|
||||
Name = name;
|
||||
SortOrder = sortOrder;
|
||||
Description = description;
|
||||
AddDomainEvent(new WuziGroup_ChangedDomainEvent(Id));
|
||||
}
|
||||
|
||||
public void Deleted() => AddDomainEvent(new WuziGroup_ChangedDomainEvent(Id));
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
using FreeSql.DataAnnotations;
|
||||
using F9WebAiTest.Domain.Events.SYS.WuziMulus;
|
||||
|
||||
namespace F9WebAiTest.Domain.Entities.SYS.WuziMulus;
|
||||
|
||||
/// <summary>
|
||||
/// 物资目录:具体物资(如 0101 优茧、0102 普茧),编号按所属分组编号 + 2 位序号自动生成。
|
||||
/// </summary>
|
||||
[Table(Name = "sys_wuzi_mulu")]
|
||||
public class WuziMulu : AggregateRoot
|
||||
{
|
||||
/// <summary>所属物资分组 Id</summary>
|
||||
[Column(Name = "groupid")]
|
||||
public long GroupId { get; private set; }
|
||||
|
||||
/// <summary>名称</summary>
|
||||
[Column(Name = "name")]
|
||||
public string Name { get; private set; }
|
||||
|
||||
/// <summary>编号(如 0101)</summary>
|
||||
[Column(Name = "code")]
|
||||
public string Code { get; private set; }
|
||||
|
||||
/// <summary>单位</summary>
|
||||
[Column(Name = "unit")]
|
||||
public string Unit { get; private set; }
|
||||
|
||||
/// <summary>规格</summary>
|
||||
[Column(Name = "guige")]
|
||||
public string Guige { get; private set; }
|
||||
|
||||
/// <summary>型号</summary>
|
||||
[Column(Name = "xinghao")]
|
||||
public string Xinghao { get; private set; }
|
||||
|
||||
/// <summary>拼音码</summary>
|
||||
[Column(Name = "pinyinname")]
|
||||
public string PinyinName { get; private set; }
|
||||
|
||||
/// <summary>库存预警数量</summary>
|
||||
[Column(Name = "kucunyujing")]
|
||||
public decimal Kucunyujing { get; private set; }
|
||||
|
||||
/// <summary>顺序号</summary>
|
||||
[Column(Name = "sortorder")]
|
||||
public int SortOrder { get; private set; }
|
||||
|
||||
/// <summary>是否启用预警</summary>
|
||||
[Column(Name = "is_yujing")]
|
||||
public bool IsYujing { get; private set; }
|
||||
|
||||
/// <summary>销售税率</summary>
|
||||
[Column(Name = "salerate")]
|
||||
public decimal SaleRate { get; private set; }
|
||||
|
||||
public WuziMulu() { }
|
||||
|
||||
public WuziMulu(long id, long groupId, string name, string code, string unit, string guige, string xinghao,
|
||||
string pinyinName, decimal kucunyujing, int sortOrder, bool isYujing, decimal saleRate)
|
||||
{
|
||||
Id = id;
|
||||
GroupId = groupId;
|
||||
Name = name;
|
||||
Code = code;
|
||||
Unit = unit;
|
||||
Guige = guige;
|
||||
Xinghao = xinghao;
|
||||
PinyinName = pinyinName;
|
||||
Kucunyujing = kucunyujing;
|
||||
SortOrder = sortOrder;
|
||||
IsYujing = isYujing;
|
||||
SaleRate = saleRate;
|
||||
AddDomainEvent(new WuziMulu_ChangedDomainEvent(Id));
|
||||
}
|
||||
|
||||
public void Update(long groupId, string name, string unit, string guige, string xinghao, string pinyinName,
|
||||
decimal kucunyujing, int sortOrder, bool isYujing, decimal saleRate)
|
||||
{
|
||||
GroupId = groupId;
|
||||
Name = name;
|
||||
Unit = unit;
|
||||
Guige = guige;
|
||||
Xinghao = xinghao;
|
||||
PinyinName = pinyinName;
|
||||
Kucunyujing = kucunyujing;
|
||||
SortOrder = sortOrder;
|
||||
IsYujing = isYujing;
|
||||
SaleRate = saleRate;
|
||||
AddDomainEvent(new WuziMulu_ChangedDomainEvent(Id));
|
||||
}
|
||||
|
||||
public void Deleted() => AddDomainEvent(new WuziMulu_ChangedDomainEvent(Id));
|
||||
}
|
||||
Reference in New Issue
Block a user