Files
qhmes/yy-admin-master/YY.Admin.Core/Core/Services/IRawMaterialEntryService.cs

36 lines
1.7 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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);
/// <summary>按业务打印绑定准备模板 JSON 与 printData与后端 prepareNativePrint 一致,免密 anon。</summary>
Task<(string templateJson, string printDataJson, string? errorMessage)> PrepareNativePrintAsync(string id, CancellationToken ct = default);
/// <summary>
/// 同步读取本地缓存的「全量入场记录」快照(深拷贝),不会触发远端拉取。
/// 主要用于「磅单已入场重量」等跨表实时聚合,且需要保持与后端相同口径的场景。
/// </summary>
IReadOnlyList<MesXslRawMaterialEntry> GetCachedSnapshot();
}