From 90dc7e2f0d419d40a823cd26b01e352d0be4ffee Mon Sep 17 00:00:00 2001
From: 李曜臣
Date: Thu, 2 Apr 2026 16:31:17 +0800
Subject: [PATCH] 重新打印优化
---
美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application.Contracts/Dtos/UsAppLabeling/PrintLogItemDto.cs | 22 ++--------------------
美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application/Services/UsAppLabelingAppService.cs | 40 ++--------------------------------------
项目相关文档/标签模块接口对接说明.md | 11 ++---------
3 files changed, 6 insertions(+), 67 deletions(-)
diff --git a/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application.Contracts/Dtos/UsAppLabeling/PrintLogItemDto.cs b/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application.Contracts/Dtos/UsAppLabeling/PrintLogItemDto.cs
index 85a1cf3..f006a1f 100644
--- a/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application.Contracts/Dtos/UsAppLabeling/PrintLogItemDto.cs
+++ b/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application.Contracts/Dtos/UsAppLabeling/PrintLogItemDto.cs
@@ -32,13 +32,8 @@ public class PrintLogItemDto
/// 模板尺寸(来自 fl_label_template.Width/Height/Unit)
public string? LabelSizeText { get; set; }
- /// 本次任务落库的渲染模板 JSON(fl_label_print_task.RenderTemplateJson)
- public string? RenderTemplateJson { get; set; }
-
- ///
- /// 本次打印的内容快照(来自 fl_label_print_data,按 PrintTaskId 关联)
- ///
- public List PrintDataList { get; set; } = new();
+ /// 打印入参 JSON(直接来自 fl_label_print_task.PrintInputJson 列)
+ public string? PrintInputJson { get; set; }
/// 打印时间(PrintedAt ?? CreationTime)
public DateTime PrintedAt { get; set; }
@@ -49,16 +44,3 @@ public class PrintLogItemDto
/// 门店名称
public string LocationName { get; set; } = "无";
}
-
-///
-/// 打印内容快照项(fl_label_print_data)
-///
-public class PrintLogDataItemDto
-{
- public string ElementId { get; set; } = string.Empty;
-
- public string? RenderValue { get; set; }
-
- public object? RenderConfigJson { get; set; }
-}
-
diff --git a/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application/Services/UsAppLabelingAppService.cs b/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application/Services/UsAppLabelingAppService.cs
index bfbadbd..1a89a0d 100644
--- a/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application/Services/UsAppLabelingAppService.cs
+++ b/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application/Services/UsAppLabelingAppService.cs
@@ -775,48 +775,13 @@ public class UsAppLabelingAppService : ApplicationService, IUsAppLabelingAppServ
TemplateWidth = tpl.Width,
TemplateHeight = tpl.Height,
TemplateUnit = tpl.Unit,
- t.RenderTemplateJson,
+ t.PrintInputJson,
t.PrintedAt,
t.CreationTime
});
var pageRows = await query.ToPageListAsync(input.SkipCount, input.MaxResultCount, total);
- var taskIds = pageRows.Select(x => x.Id).Where(x => !string.IsNullOrWhiteSpace(x)).Distinct().ToList();
-
- var dataRows = taskIds.Count == 0
- ? new List()
- : await _dbContext.SqlSugarClient.Queryable()
- .Where(x => taskIds.Contains(x.PrintTaskId))
- .ToListAsync();
-
- var dataMap = dataRows
- .GroupBy(x => x.PrintTaskId)
- .ToDictionary(
- g => g.Key,
- g => g.Select(d =>
- {
- object? cfg = null;
- if (!string.IsNullOrWhiteSpace(d.RenderConfigJson))
- {
- try
- {
- cfg = JsonSerializer.Deserialize