增强原材料卡片管理功能,新增免密接口和数据处理逻辑,支持原材料卡片的增删改查操作。更新前端视图以支持多行拆码明细拼接,优化用户体验和系统实时数据同步能力。
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
using Prism.Events;
|
||||
|
||||
namespace YY.Admin.Core.Events;
|
||||
|
||||
public class RawMaterialCardChangedPayload
|
||||
{
|
||||
public string Action { get; set; } = string.Empty;
|
||||
public string? CardId { get; set; }
|
||||
}
|
||||
|
||||
public class RawMaterialCardChangedEvent : PubSubEvent<RawMaterialCardChangedPayload>
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using YY.Admin.Core.Entity;
|
||||
|
||||
namespace YY.Admin.Core.Services;
|
||||
|
||||
public record RawMaterialCardPageResult(List<MesXslRawMaterialCard> Records, long Total, int Current, int Size);
|
||||
|
||||
public interface IRawMaterialCardService
|
||||
{
|
||||
Task<RawMaterialCardPageResult> PageAsync(int pageNo, int pageSize,
|
||||
string? barcode = null, string? batchNo = null, string? materialName = null,
|
||||
string? supplierName = null, string? status = null, CancellationToken ct = default);
|
||||
Task<MesXslRawMaterialCard?> GetByIdAsync(string id, CancellationToken ct = default);
|
||||
Task<bool> AddAsync(MesXslRawMaterialCard card, CancellationToken ct = default);
|
||||
Task<bool> EditAsync(MesXslRawMaterialCard card, CancellationToken ct = default);
|
||||
Task<bool> DeleteAsync(string id, CancellationToken ct = default);
|
||||
Task<bool> DeleteBatchAsync(string ids, CancellationToken ct = default);
|
||||
Task<bool> UpdatePriorityAsync(string id, string priorityPickup, CancellationToken ct = default);
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
namespace YY.Admin.Core.Entity;
|
||||
|
||||
public class MesXslRawMaterialCard
|
||||
{
|
||||
public string? Id { get; set; }
|
||||
public string? Barcode { get; set; }
|
||||
public string? BatchNo { get; set; }
|
||||
public DateTime? EntryDate { get; set; }
|
||||
public string? MaterialId { get; set; }
|
||||
public string? MaterialName { get; set; }
|
||||
public string? MaterialDesc { get; set; }
|
||||
public string? SupplierId { get; set; }
|
||||
public string? SupplierName { get; set; }
|
||||
public string? ManufacturerMaterialName { get; set; }
|
||||
public string? ShelfLife { get; set; }
|
||||
public decimal? TotalWeight { get; set; }
|
||||
public decimal? RemainingWeight { get; set; }
|
||||
public int? RemainingQuantity { get; set; }
|
||||
|
||||
/// <summary>状态:1正常 0异常(字典 xslmes_card_status)</summary>
|
||||
public string? Status { get; set; }
|
||||
|
||||
/// <summary>检测结果:0未检 1合格 2不合格(字典 xslmes_test_result)</summary>
|
||||
public string? TestResult { get; set; }
|
||||
|
||||
public string? WarehouseArea { get; set; }
|
||||
public string? UnloadOperator { get; set; }
|
||||
|
||||
/// <summary>优先出库:1是 0否</summary>
|
||||
public string? PriorityPickup { get; set; }
|
||||
|
||||
public string? CreateBy { get; set; }
|
||||
public DateTime? CreateTime { get; set; }
|
||||
public string? UpdateBy { get; set; }
|
||||
public DateTime? UpdateTime { get; set; }
|
||||
public int? TenantId { get; set; }
|
||||
|
||||
public string StatusText => Status switch
|
||||
{
|
||||
"1" => "正常",
|
||||
"0" => "异常",
|
||||
_ => Status ?? ""
|
||||
};
|
||||
|
||||
public string TestResultText => TestResult switch
|
||||
{
|
||||
"0" => "未检",
|
||||
"1" => "合格",
|
||||
"2" => "不合格",
|
||||
_ => TestResult ?? ""
|
||||
};
|
||||
|
||||
public bool PriorityPickupBool => PriorityPickup == "1";
|
||||
public string PriorityPickupText => PriorityPickup == "1" ? "是" : "否";
|
||||
|
||||
public string EntryDateText => EntryDate.HasValue ? EntryDate.Value.ToString("yyyy-MM-dd") : "";
|
||||
}
|
||||
@@ -17,9 +17,12 @@ public class MesXslRawMaterialEntry
|
||||
public string? ManufacturerMaterialName { get; set; }
|
||||
public string? ShelfLife { get; set; }
|
||||
public double? TotalWeight { get; set; }
|
||||
public int? TotalPortions { get; set; }
|
||||
public double? PortionWeight { get; set; }
|
||||
public int? PortionPackages { get; set; }
|
||||
|
||||
// 总份数 / 每份总重 / 每份包数:与后端同步升级为字符串,
|
||||
// 用于持久化「拆码明细」多行拼接(如 20/1/、100/200/)。
|
||||
public string? TotalPortions { get; set; }
|
||||
public string? PortionWeight { get; set; }
|
||||
public string? PortionPackages { get; set; }
|
||||
|
||||
/// <summary>检测结果:0未检 1合格 2不合格</summary>
|
||||
public string? TestResult { get; set; }
|
||||
|
||||
@@ -42,6 +42,8 @@ public class SysMenuSeedData : ISqlSugarEntitySeedData<SysMenu>
|
||||
new SysMenu{ Id=1300150010701, Pid=1300150000101, Title="原料入场记录", Path="/xslmes/mesXslRawMaterialEntry", Name="mesXslRawMaterialEntry", Component="RawMaterialEntryListView", Icon="", Type=MenuTypeEnum.Menu, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), OrderNo=106 },
|
||||
// 新增原料入场记录(独立页面)
|
||||
new SysMenu{ Id=1300150010801, Pid=1300150000101, Title="新增原料入场记录", Path="/xslmes/rawMaterialEntryOperation", Name="rawMaterialEntryOperation", Component="RawMaterialEntryOperationView", Icon="", Type=MenuTypeEnum.Menu, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), OrderNo=107 },
|
||||
// 原材料卡片
|
||||
new SysMenu{ Id=1300150010901, Pid=1300150000101, Title="原材料卡片", Path="/xslmes/mesXslRawMaterialCard", Name="mesXslRawMaterialCard", Component="RawMaterialCardListView", Icon="", Type=MenuTypeEnum.Menu, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), OrderNo=108 },
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -215,6 +215,7 @@ public class SysTenantMenuSeedData : ISqlSugarEntitySeedData<SysTenantMenu>
|
||||
new SysTenantMenu(){ TenantId=1300000000001,MenuId= 1300300040501 },
|
||||
new SysTenantMenu(){ TenantId=1300000000001,MenuId = 1300200010201},
|
||||
new SysTenantMenu() { TenantId = 1300000000001,MenuId = 1300600040101},
|
||||
new SysTenantMenu(){ TenantId=1300000000001, MenuId=1300150010901 },
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user