新增业务打印绑定功能,整合打印模板与业务数据的映射配置,优化打印数据生成逻辑。新增免密接口,支持桌面端打印模板的查询与列表展示,提升用户体验和系统的实时数据同步能力。同时,重构相关控制器以增强系统的可维护性和扩展性。

This commit is contained in:
geht
2026-05-14 10:43:51 +08:00
parent 642cecb04d
commit 8bcc34aee0
649 changed files with 18804 additions and 70 deletions

View File

@@ -0,0 +1,11 @@
using Prism.Events;
namespace YY.Admin.Core.Events;
public class PrintBizTemplateBindChangedPayload
{
public string Action { get; set; } = string.Empty;
public string? BindId { get; set; }
}
public class PrintBizTemplateBindChangedEvent : PubSubEvent<PrintBizTemplateBindChangedPayload> { }

View File

@@ -0,0 +1,12 @@
using YY.Admin.Core.Entity;
namespace YY.Admin.Core.Services;
/// <summary>业务打印绑定:免密拉取 + 本地缓存(只读)</summary>
public interface IPrintBizTemplateBindService
{
IReadOnlyList<PrintBizTemplateBind> GetCached();
Task<IReadOnlyList<PrintBizTemplateBind>> ListAsync(CancellationToken ct = default);
Task<IReadOnlyList<PrintBizTemplateBind>> RefreshCacheAsync(CancellationToken ct = default);
Task<PrintBizTemplateBind?> GetByIdAsync(string id, CancellationToken ct = default);
}

View File

@@ -24,6 +24,9 @@ public interface IRawMaterialEntryService
/// <summary>调用后端接口生成条码/批次号格式QH+物料编码+yyMMdd+序号)</summary>
Task<string?> GenerateBarcodeAsync(string materialCode, CancellationToken ct = default);
/// <summary>按业务打印绑定准备模板 JSON 与 printData与后端 prepareNativePrint 一致,免密 anon。</summary>
Task<(string templateJson, string printDataJson, string? errorMessage)> PrepareNativePrintAsync(string id, CancellationToken ct = default);
/// <summary>
/// 同步读取本地缓存的「全量入场记录」快照(深拷贝),不会触发远端拉取。
/// 主要用于「磅单已入场重量」等跨表实时聚合,且需要保持与后端相同口径的场景。