2026-05-11 14:32:44 +08:00
|
|
|
|
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);
|
2026-05-12 14:06:07 +08:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 按拆码明细 ID 列表批量删除原材料卡片。
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="splitDetailIds">拆码明细行的 GUID 集合(自动 distinct,空跳过)</param>
|
|
|
|
|
|
/// <param name="dryRun">为 true 时仅返回匹配数量、不真正删除(用于「重新拆码」弹窗预提示)</param>
|
|
|
|
|
|
/// <returns>匹配/删除的卡片数量;失败返回 -1</returns>
|
|
|
|
|
|
Task<int> DeleteBySplitDetailIdsAsync(IEnumerable<string> splitDetailIds, bool dryRun = false, CancellationToken ct = default);
|
2026-05-13 15:49:51 +08:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 按业务打印绑定生成模板 JSON + 映射后 printData,供桌面端打印预览使用。
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns>(templateJson, printDataJson, errorMessage) 元组;errorMessage 非 null 时表示失败</returns>
|
|
|
|
|
|
Task<(string templateJson, string printDataJson, string? errorMessage)> PrepareNativePrintAsync(string id, CancellationToken ct = default);
|
2026-05-11 14:32:44 +08:00
|
|
|
|
}
|