From f37338d40a920fb1ae53725a1dba17626c04c324 Mon Sep 17 00:00:00 2001 From: liangzongpeng <532365025@qq.com> Date: Wed, 20 Mar 2024 18:03:44 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Admin.NET.Application/Entity/Materials.cs | 87 ++++++++++++++++++- .../Service/SysUnit/SysUnitService.cs | 13 ++- 2 files changed, 97 insertions(+), 3 deletions(-) diff --git a/Admin.NET/Admin.NET.Application/Entity/Materials.cs b/Admin.NET/Admin.NET.Application/Entity/Materials.cs index 356b5a6..caba1fa 100644 --- a/Admin.NET/Admin.NET.Application/Entity/Materials.cs +++ b/Admin.NET/Admin.NET.Application/Entity/Materials.cs @@ -50,11 +50,96 @@ public class Materials : EntityTenant [Required] [SugarColumn(ColumnName = "IsEnable", ColumnDescription = "可用状态")] public bool IsEnable { get; set; } - + + /// + /// 品牌 + /// + [SugarColumn(ColumnName = "Brand", ColumnDescription = "品牌", Length = 32)] + public string? Brand { get; set; } + + /// + /// 保质期 + /// + [SugarColumn(ColumnName = "ShelfLife", ColumnDescription = "保质期", Length = 32)] + public int? ShelfLife { get; set; } + + /// + /// 保质期单位 + /// + [SugarColumn(ColumnName = "ShelfLifeUnit", ColumnDescription = "保质期单位", Length = 32)] + public string? ShelfLifeUnit { get; set; } + + /// + /// 统一零售价 + /// + [SugarColumn(ColumnName = "Price", ColumnDescription = "统一零售价")] + public decimal? Price { get; set; } + + /// + /// 条形码 + /// + [SugarColumn(ColumnName = "BarCode", ColumnDescription = "条形码", Length = 32)] + public string? BarCode { get; set; } + + /// + /// 单位组ID + /// + [SugarColumn(ColumnName = "UnitGroupId", ColumnDescription = "单位组ID")] + public long? UnitGroupId { get; set; } + + /// + /// 基本单位 + /// + [SugarColumn(ColumnName = "Unit", ColumnDescription = "基本单位", Length = 32)] + public string? Unit { get; set; } + + /// + /// 生产单位 + /// + [SugarColumn(ColumnName = "ProductUnit", ColumnDescription = "生产单位", Length = 32)] + public string? ProductUnit { get; set; } + + /// + /// 采购单位 + /// + [SugarColumn(ColumnName = "ProcureUnit", ColumnDescription = "采购单位", Length = 32)] + public string? ProcureUnit { get; set; } + + /// + /// 库存单位 + /// + [SugarColumn(ColumnName = "InventoryUnit", ColumnDescription = "库存单位", Length = 32)] + public string? InventoryUnit { get; set; } + + /// + /// 销售单位 + /// + [SugarColumn(ColumnName = "SaleUnit", ColumnDescription = "销售单位", Length = 32)] + public string? SaleUnit { get; set; } + + /// + /// 分销单位 + /// + [SugarColumn(ColumnName = "RetailStoreUnit", ColumnDescription = "分销单位", Length = 32)] + public string? RetailStoreUnit { get; set; } + + /// + /// 包装关系ID + /// + [SugarColumn(ColumnName = "PackagId", ColumnDescription = "包装关系ID")] + public long? PackagId { get; set; } + + /// + /// 推广ID + /// + [SugarColumn(ColumnName = "PromotionId", ColumnDescription = "推广ID")] + public long? PromotionId { get; set; } + /// /// 备注 /// [SugarColumn(ColumnName = "Remarks", ColumnDescription = "备注", Length = 32)] public string? Remarks { get; set; } + } diff --git a/Admin.NET/Admin.NET.Application/Service/SysUnit/SysUnitService.cs b/Admin.NET/Admin.NET.Application/Service/SysUnit/SysUnitService.cs index 029e2af..7e50efe 100644 --- a/Admin.NET/Admin.NET.Application/Service/SysUnit/SysUnitService.cs +++ b/Admin.NET/Admin.NET.Application/Service/SysUnit/SysUnitService.cs @@ -98,7 +98,6 @@ public class SysUnitService : IDynamicApiController, ITransient /// /// 获取单位列表 /// - /// /// [HttpGet] [ApiDescriptionSettings(Name = "List")] @@ -107,7 +106,17 @@ public class SysUnitService : IDynamicApiController, ITransient return await _rep.AsQueryable().Select().ToListAsync(); } - + /// + /// 获取单位列表 + /// + /// + /// + [HttpGet] + [ApiDescriptionSettings(Name = "List")] + public async Task> ListByGroupId(long unitGroupId) + { + return await _rep.AsQueryable().WhereIF(unitGroupId > 0, u => u.GroupUnitId == unitGroupId).Select().ToListAsync(); + }