新增原料入场记录功能,包含免密接口和数据同步,更新相关控制器、实体和服务,支持条码/批次号生成及管理,优化用户体验和系统实时数据处理能力。

This commit is contained in:
geht
2026-05-09 15:55:11 +08:00
parent 64e978a618
commit 16bb22a113
38 changed files with 2398 additions and 10 deletions

View File

@@ -0,0 +1,13 @@
using Prism.Events;
namespace YY.Admin.Core.Events;
public class RawMaterialEntryChangedPayload
{
public string? Action { get; set; }
public string? EntryId { get; set; }
}
public class RawMaterialEntryChangedEvent : PubSubEvent<RawMaterialEntryChangedPayload>
{
}

View File

@@ -0,0 +1,26 @@
using YY.Admin.Core.Entity;
namespace YY.Admin.Core.Services;
public record RawMaterialEntryPageResult(List<MesXslRawMaterialEntry> Records, long Total, int PageNo, int PageSize);
public interface IRawMaterialEntryService
{
Task<RawMaterialEntryPageResult> PageAsync(
int pageNo, int pageSize,
string? barcode = null,
string? batchNo = null,
string? billNo = null,
string? materialName = null,
string? supplierName = null,
CancellationToken ct = default);
Task<MesXslRawMaterialEntry?> GetByIdAsync(string id, CancellationToken ct = default);
Task<bool> AddAsync(MesXslRawMaterialEntry entry, CancellationToken ct = default);
Task<bool> EditAsync(MesXslRawMaterialEntry entry, CancellationToken ct = default);
Task<bool> DeleteAsync(string id, CancellationToken ct = default);
Task<bool> DeleteBatchAsync(string ids, CancellationToken ct = default);
/// <summary>调用后端接口生成条码/批次号格式QH+物料编码+yyMMdd+序号)</summary>
Task<string?> GenerateBarcodeAsync(string materialCode, CancellationToken ct = default);
}

View File

@@ -0,0 +1,89 @@
namespace YY.Admin.Core.Entity;
public class MesXslRawMaterialEntry
{
public string? Id { get; set; }
public string? Barcode { get; set; }
public string? BatchNo { get; set; }
public DateTime? EntryTime { get; set; }
public string? WeightRecordId { get; set; }
public string? BillNo { get; set; }
public string? MaterialId { get; set; }
public string? MaterialCode { get; set; }
public string? MaterialName { get; set; }
public string? SupplyCustomer { get; set; }
public string? SupplierId { get; set; }
public string? SupplierName { get; set; }
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; }
/// <summary>检测结果0未检 1合格 2不合格</summary>
public string? TestResult { get; set; }
/// <summary>检测状态0送样 1已批准</summary>
public string? TestStatus { get; set; }
/// <summary>打印标记1已打印 0未打印</summary>
public string? PrintFlag { get; set; }
/// <summary>入库结存1是 0否</summary>
public string? StockBalance { get; set; }
public string? WarehouseLocation { get; set; }
public string? UnloadOperator { get; set; }
/// <summary>是否特采1是 0否</summary>
public string? IsSpecialAdoption { get; set; }
public string? SpecialAdoptionOperator { get; set; }
public DateTime? SpecialAdoptionTime { get; set; }
public string? SpecialAdoptionReason { get; set; }
public string? Status { get; set; }
public string? Remark { 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 TestResultText => TestResult switch
{
"0" => "未检",
"1" => "合格",
"2" => "不合格",
_ => TestResult ?? ""
};
public string TestStatusText => TestStatus switch
{
"0" => "送样",
"1" => "已批准",
_ => TestStatus ?? ""
};
public string PrintFlagText => PrintFlag switch
{
"1" => "已打印",
"0" => "未打印",
_ => PrintFlag ?? ""
};
public string StockBalanceText => StockBalance switch
{
"1" => "是",
"0" => "否",
_ => StockBalance ?? ""
};
public string IsSpecialAdoptionText => IsSpecialAdoption switch
{
"1" => "是",
"0" => "否",
_ => IsSpecialAdoption ?? ""
};
}

View File

@@ -38,6 +38,8 @@ public class SysMenuSeedData : ISqlSugarEntitySeedData<SysMenu>
new SysMenu{ Id=1300150010501, Pid=1300150000101, Title="地磅称重操作", Path="/xslmes/weightRecordOperation", Name="weightRecordOperation", Component="WeightRecordOperationView", Icon="&#xe7de;", Type=MenuTypeEnum.Menu, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), OrderNo=104 },
// 密炼物料信息
new SysMenu{ Id=1300150010601, Pid=1300150000101, Title="密炼物料信息", Path="/xslmes/mesMixerMaterial", Name="mesMixerMaterial", Component="MixerMaterialListView", Icon="&#xe7ce;", Type=MenuTypeEnum.Menu, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), OrderNo=105 },
// 原料入场记录
new SysMenu{ Id=1300150010701, Pid=1300150000101, Title="原料入场记录", Path="/xslmes/mesXslRawMaterialEntry", Name="mesXslRawMaterialEntry", Component="RawMaterialEntryListView", Icon="&#xe7ce;", Type=MenuTypeEnum.Menu, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), OrderNo=106 },
#endregion

View File

@@ -27,6 +27,7 @@ public class SysTenantMenuSeedData : ISqlSugarEntitySeedData<SysTenantMenu>
new SysTenantMenu(){ TenantId=1300000000001,MenuId=1300150010401},
new SysTenantMenu(){ TenantId=1300000000001,MenuId=1300150010501},
new SysTenantMenu(){ TenantId=1300000000001,MenuId=1300150010601},
new SysTenantMenu(){ TenantId=1300000000001,MenuId=1300150010701},
new SysTenantMenu(){ TenantId=1300000000001,MenuId=1300200012101},
new SysTenantMenu(){ TenantId=1300000000001,MenuId=1300200012111},
new SysTenantMenu(){ TenantId=1300000000001,MenuId=1300200012121},