diff --git a/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application.Contracts/Dtos/Label/LabelBatchCreateInputVo.cs b/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application.Contracts/Dtos/Label/LabelBatchCreateInputVo.cs
new file mode 100644
index 0000000..c3e2333
--- /dev/null
+++ b/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application.Contracts/Dtos/Label/LabelBatchCreateInputVo.cs
@@ -0,0 +1,18 @@
+namespace FoodLabeling.Application.Contracts.Dtos.Label;
+
+///
+/// 标签批量导入入参(同一模板多行)
+///
+public class LabelBatchCreateInputVo
+{
+ /// 模板编码(所有行共用)
+ public string TemplateCode { get; set; } = string.Empty;
+
+ /// 导入行列表
+ public List Items { get; set; } = new();
+
+ ///
+ /// 是否将各行模板数据合并写入 fl_label_template_product_default(与 Web 端 Bulk Add 行为一致)
+ ///
+ public bool SaveTemplateProductDefaults { get; set; } = true;
+}
diff --git a/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application.Contracts/Dtos/Label/LabelBatchCreateItemInputVo.cs b/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application.Contracts/Dtos/Label/LabelBatchCreateItemInputVo.cs
new file mode 100644
index 0000000..00df67d
--- /dev/null
+++ b/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application.Contracts/Dtos/Label/LabelBatchCreateItemInputVo.cs
@@ -0,0 +1,50 @@
+namespace FoodLabeling.Application.Contracts.Dtos.Label;
+
+///
+/// 批量导入单行:标签基本字段 + 模板数据字段
+///
+public class LabelBatchCreateItemInputVo
+{
+ public string? LabelCode { get; set; }
+
+ public string LabelName { get; set; } = string.Empty;
+
+ public string? PartnerId { get; set; }
+
+ public List? PartnerIds { get; set; }
+
+ public string? AppliedRegionType { get; set; }
+
+ public List? RegionIds { get; set; }
+
+ public List? GroupIds { get; set; }
+
+ public List? LocationIds { get; set; }
+
+ public string? LocationId { get; set; }
+
+ public string LabelCategoryId { get; set; } = string.Empty;
+
+ public string? LabelTypeId { get; set; }
+
+ public List ProductIds { get; set; } = new();
+
+ /// 标签级模板数据(落库 fl_label.LabelInfoJson);通常批量导入走模板 ProductDefaults
+ public object? LabelInfoJson { get; set; }
+
+ public bool State { get; set; } = true;
+
+ ///
+ /// 已组装的模板默认值(elementId → 值)。若传入则优先使用,不再从下方结构化字段推导。
+ ///
+ public Dictionary? TemplateDefaultValues { get; set; }
+
+ /// 模板文本类录入(elementId → 文本)
+ public Dictionary? TemplateDataValues { get; set; }
+
+ /// 模板日期/时间/时长录入(elementId → 单位+数值)
+ public Dictionary? TemplateDateOffsets { get; set; }
+
+ /// 营养成分手动录入(nutritionElementId → 子字段键值)
+ public Dictionary>? NutritionByElementId { get; set; }
+}
diff --git a/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application.Contracts/Dtos/Label/LabelBatchCreateResultDto.cs b/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application.Contracts/Dtos/Label/LabelBatchCreateResultDto.cs
new file mode 100644
index 0000000..a92f894
--- /dev/null
+++ b/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application.Contracts/Dtos/Label/LabelBatchCreateResultDto.cs
@@ -0,0 +1,33 @@
+namespace FoodLabeling.Application.Contracts.Dtos.Label;
+
+///
+/// 标签批量导入结果
+///
+public class LabelBatchCreateResultDto
+{
+ public int SuccessCount { get; set; }
+
+ public int FailCount { get; set; }
+
+ public List Errors { get; set; } = new();
+
+ public List SuccessItems { get; set; } = new();
+}
+
+public class LabelBatchCreateErrorDto
+{
+ public int RowNumber { get; set; }
+
+ public string? LabelName { get; set; }
+
+ public string Message { get; set; } = string.Empty;
+}
+
+public class LabelBatchCreateSuccessItemDto
+{
+ public int RowNumber { get; set; }
+
+ public string LabelCode { get; set; } = string.Empty;
+
+ public string LabelName { get; set; } = string.Empty;
+}
diff --git a/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application.Contracts/Dtos/Label/LabelBatchDateOffsetInputVo.cs b/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application.Contracts/Dtos/Label/LabelBatchDateOffsetInputVo.cs
new file mode 100644
index 0000000..339bad0
--- /dev/null
+++ b/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application.Contracts/Dtos/Label/LabelBatchDateOffsetInputVo.cs
@@ -0,0 +1,13 @@
+namespace FoodLabeling.Application.Contracts.Dtos.Label;
+
+///
+/// 批量导入行:模板日期/时间/时长偏移录入(单位 + 数值)
+///
+public class LabelBatchDateOffsetInputVo
+{
+ /// 偏移单位,如 Days、Hours
+ public string Unit { get; set; } = "Days";
+
+ /// 偏移数值
+ public string Value { get; set; } = string.Empty;
+}
diff --git a/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application.Contracts/Dtos/Product/ProductCreateInputVo.cs b/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application.Contracts/Dtos/Product/ProductCreateInputVo.cs
index 623f4cb..5f849e5 100644
--- a/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application.Contracts/Dtos/Product/ProductCreateInputVo.cs
+++ b/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application.Contracts/Dtos/Product/ProductCreateInputVo.cs
@@ -30,6 +30,11 @@ public class ProductCreateInputVo
public bool State { get; set; } = true;
///
+ /// 适用门店:ALL / SPECIFIED(ALL 时动态包含后续新增门店,不写快照)
+ ///
+ public string? AvailabilityType { get; set; }
+
+ ///
/// 适用 Company(fl_partner.Id,UI 称 Company);展开该公司下全部门店后与 Region/门店合并写入 fl_location_product
///
public string? PartnerId { get; set; }
diff --git a/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application.Contracts/Dtos/Product/ProductGetListOutputDto.cs b/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application.Contracts/Dtos/Product/ProductGetListOutputDto.cs
index 8f75e0e..2d01648 100644
--- a/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application.Contracts/Dtos/Product/ProductGetListOutputDto.cs
+++ b/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application.Contracts/Dtos/Product/ProductGetListOutputDto.cs
@@ -24,6 +24,9 @@ public class ProductGetListOutputDto
public bool State { get; set; }
+ /// 适用门店:ALL / SPECIFIED
+ public string AvailabilityType { get; set; } = "SPECIFIED";
+
///
/// 该产品关联的标签数量(fl_label_product + fl_label)
///
diff --git a/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application.Contracts/Dtos/Product/ProductGetOutputDto.cs b/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application.Contracts/Dtos/Product/ProductGetOutputDto.cs
index 2d36fb4..a5da767 100644
--- a/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application.Contracts/Dtos/Product/ProductGetOutputDto.cs
+++ b/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application.Contracts/Dtos/Product/ProductGetOutputDto.cs
@@ -26,6 +26,9 @@ public class ProductGetOutputDto
public bool State { get; set; }
+ /// 适用门店:ALL / SPECIFIED
+ public string AvailabilityType { get; set; } = "SPECIFIED";
+
/// 适用 Company Id(fl_partner.Id,由关联门店反推;多公司时取第一个)
public string? PartnerId { get; set; }
diff --git a/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application.Contracts/IServices/ILabelAppService.cs b/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application.Contracts/IServices/ILabelAppService.cs
index a7870cf..7506e37 100644
--- a/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application.Contracts/IServices/ILabelAppService.cs
+++ b/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application.Contracts/IServices/ILabelAppService.cs
@@ -26,6 +26,11 @@ public interface ILabelAppService : IApplicationService
Task CreateAsync(LabelCreateInputVo input);
///
+ /// 批量导入标签(同一模板多行)。每行含标签基本字段与模板数据字段;可选合并写入模板 ProductDefaults。
+ ///
+ Task BatchCreateAsync(LabelBatchCreateInputVo input);
+
+ ///
/// 编辑标签(id=LabelCode)。适用 Region / 门店字段同 。
///
Task UpdateAsync(string id, LabelUpdateInputVo input);
diff --git a/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application/Helpers/AllScopeBindingHelper.cs b/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application/Helpers/AllScopeBindingHelper.cs
new file mode 100644
index 0000000..2f0df3d
--- /dev/null
+++ b/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application/Helpers/AllScopeBindingHelper.cs
@@ -0,0 +1,228 @@
+using FoodLabeling.Application.Services.DbModels;
+using SqlSugar;
+
+namespace FoodLabeling.Application.Helpers;
+
+///
+/// 「适用全部 Region/Location/Company」:保存为 ALL(不写关联快照),查询时动态包含后续新增的 Region/Location。
+///
+public static class AllScopeBindingHelper
+{
+ public const string ScopeAll = "ALL";
+ public const string ScopeSpecified = "SPECIFIED";
+
+ public const string AllRegionsDisplay = "All Regions";
+ public const string AllLocationsDisplay = "All Locations";
+ public const string AllCompaniesDisplay = "All Companies";
+
+ /// 选中 Id 是否覆盖当前上下文中全部可选项(用于将「全选」规范为 ALL)。
+ public static bool IsFullIdSelection(IReadOnlyList selected, IReadOnlyList universe)
+ {
+ if (universe.Count == 0)
+ {
+ return selected.Count == 0;
+ }
+
+ if (selected.Count != universe.Count)
+ {
+ return false;
+ }
+
+ var set = new HashSet(universe, StringComparer.Ordinal);
+ return selected.All(id => set.Contains(id));
+ }
+
+ /// 解析维度类型:显式 ALL、空数组 ALL、或 Id 列表全选时视为 ALL。
+ public static string ResolveDimensionType(
+ string? declaredType,
+ IReadOnlyList ids,
+ bool hasArrayInPayload,
+ bool isFullSelection)
+ {
+ if (isFullSelection || (ids.Count == 0 && IsDeclaredAll(declaredType)))
+ {
+ return ScopeAll;
+ }
+
+ if (ids.Count > 0)
+ {
+ return ScopeSpecified;
+ }
+
+ if (hasArrayInPayload && IsDeclaredAll(declaredType))
+ {
+ return ScopeAll;
+ }
+
+ var normalized = (declaredType ?? ScopeAll).Trim().ToUpperInvariant();
+ return normalized == ScopeSpecified ? ScopeSpecified : ScopeAll;
+ }
+
+ public static bool IsDeclaredAll(string? type) =>
+ string.Equals((type ?? ScopeAll).Trim(), ScopeAll, StringComparison.OrdinalIgnoreCase);
+
+ /// 全部 Company(fl_partner.Id)。
+ public static async Task> ResolveAllPartnerIdsAsync(ISqlSugarClient db)
+ {
+ var rows = await db.Queryable()
+ .Where(x => !x.IsDeleted)
+ .Select(x => x.Id)
+ .ToListAsync();
+ return LocationScopeBindingHelper.NormalizeIds(rows);
+ }
+
+ /// 全部 Region;可按 Company 限定。
+ public static async Task> ResolveAllRegionIdsAsync(
+ ISqlSugarClient db,
+ IReadOnlyList? partnerIds)
+ {
+ var query = db.Queryable().Where(x => !x.IsDeleted);
+ var pids = LocationScopeBindingHelper.NormalizeIds(partnerIds);
+ if (pids.Count > 0)
+ {
+ query = query.Where(x => pids.Contains(x.PartnerId));
+ }
+
+ var rows = await query.Select(x => x.Id).ToListAsync();
+ return LocationScopeBindingHelper.NormalizeIds(rows);
+ }
+
+ /// 全部门店;可按 Company / Region 限定。
+ public static async Task> ResolveAllLocationIdsAsync(
+ ISqlSugarClient db,
+ IReadOnlyList? partnerIds,
+ IReadOnlyList? regionIds)
+ {
+ var merged = await LocationScopeBindingHelper.MergeToLocationIdsAsync(
+ db,
+ partnerIds,
+ regionIds,
+ null);
+ return LocationScopeBindingHelper.NormalizeIds(merged);
+ }
+
+ /// Company 维度是否应存为 ALL(含「勾选了全部 Company」)。
+ public static async Task<(string Type, List Ids)> NormalizePartnerScopeAsync(
+ ISqlSugarClient db,
+ string? declaredType,
+ IReadOnlyList? partnerIds,
+ IReadOnlyList? companyIds,
+ bool hasArrayInPayload)
+ {
+ var ids = LabelEntityPartnerScopeHelper.NormalizePartnerIds(partnerIds, companyIds);
+ var allPartners = await ResolveAllPartnerIdsAsync(db);
+ var isFull = ids.Count > 0 && IsFullIdSelection(ids, allPartners);
+ var type = ResolveDimensionType(declaredType, ids, hasArrayInPayload, isFull);
+ return (type, type == ScopeSpecified ? ids : new List());
+ }
+
+ /// Region 维度是否应存为 ALL。
+ public static async Task<(string Type, List Ids)> NormalizeRegionScopeAsync(
+ ISqlSugarClient db,
+ string? declaredType,
+ IReadOnlyList regionIds,
+ bool hasArrayInPayload,
+ IReadOnlyList? partnerIdsForContext)
+ {
+ var ids = LocationScopeBindingHelper.NormalizeIds(regionIds);
+ var allRegions = await ResolveAllRegionIdsAsync(db, partnerIdsForContext);
+ var isFull = ids.Count > 0 && IsFullIdSelection(ids, allRegions);
+ var type = ResolveDimensionType(declaredType, ids, hasArrayInPayload, isFull);
+ return (type, type == ScopeSpecified ? ids : new List());
+ }
+
+ /// Location 维度是否应存为 ALL。
+ public static async Task<(string Type, List Ids)> NormalizeLocationScopeAsync(
+ ISqlSugarClient db,
+ string? declaredType,
+ IReadOnlyList locationIds,
+ bool hasArrayInPayload,
+ IReadOnlyList? partnerIdsForContext,
+ IReadOnlyList? regionIdsForContext)
+ {
+ var ids = LocationScopeBindingHelper.NormalizeIds(locationIds);
+ var allLocations = await ResolveAllLocationIdsAsync(db, partnerIdsForContext, regionIdsForContext);
+ var isFull = ids.Count > 0 && IsFullIdSelection(ids, allLocations);
+ var type = ResolveDimensionType(declaredType, ids, hasArrayInPayload, isFull);
+ return (type, type == ScopeSpecified ? ids : new List());
+ }
+
+ ///
+ /// 标签类型/分类/多选项/产品分类:Region+Location 合并后是否应视为 ALL。
+ ///
+ public static async Task ShouldTreatMergedLocationScopeAsAllAsync(
+ ISqlSugarClient db,
+ string? declaredAvailabilityType,
+ IReadOnlyList? regionIds,
+ IReadOnlyList? locationIds,
+ bool hasScopeArrays,
+ IReadOnlyList? partnerIdsForContext)
+ {
+ if (IsDeclaredAll(declaredAvailabilityType)
+ && LocationScopeBindingHelper.NormalizeIds(regionIds).Count == 0
+ && LocationScopeBindingHelper.NormalizeIds(locationIds).Count == 0)
+ {
+ return true;
+ }
+
+ if (hasScopeArrays
+ && LocationScopeBindingHelper.NormalizeIds(regionIds).Count == 0
+ && LocationScopeBindingHelper.NormalizeIds(locationIds).Count == 0
+ && IsDeclaredAll(declaredAvailabilityType))
+ {
+ return true;
+ }
+
+ var merged = await LocationScopeBindingHelper.MergeToLocationIdsAsync(
+ db,
+ (IReadOnlyList?)null,
+ regionIds,
+ locationIds);
+ if (merged.Count == 0)
+ {
+ return false;
+ }
+
+ var allLocations = await ResolveAllLocationIdsAsync(db, partnerIdsForContext, null);
+ return IsFullIdSelection(merged, allLocations);
+ }
+
+ /// 产品门店范围是否应存为 ALL(不写 fl_location_product 快照)。
+ public static async Task ShouldTreatProductLocationScopeAsAllAsync(
+ ISqlSugarClient db,
+ string? declaredAvailabilityType,
+ string? partnerId,
+ IReadOnlyList? groupIds,
+ IReadOnlyList? locationIds,
+ bool hasScopePayload)
+ {
+ if (IsDeclaredAll(declaredAvailabilityType)
+ && string.IsNullOrWhiteSpace(partnerId)
+ && LocationScopeBindingHelper.NormalizeIds(groupIds).Count == 0
+ && LocationScopeBindingHelper.NormalizeIds(locationIds).Count == 0)
+ {
+ return true;
+ }
+
+ if (!hasScopePayload)
+ {
+ return false;
+ }
+
+ var partnerIds = string.IsNullOrWhiteSpace(partnerId)
+ ? null
+ : new List { partnerId.Trim() };
+ var merged = await LocationScopeBindingHelper.MergeToLocationIdsAsync(
+ db,
+ partnerId,
+ groupIds,
+ locationIds);
+ if (merged.Count == 0)
+ {
+ return false;
+ }
+
+ var allLocations = await ResolveAllLocationIdsAsync(db, partnerIds, null);
+ return IsFullIdSelection(merged, allLocations);
+ }
+}
diff --git a/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application/Helpers/LabelBatchTemplateDefaultsHelper.cs b/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application/Helpers/LabelBatchTemplateDefaultsHelper.cs
new file mode 100644
index 0000000..56b5ebb
--- /dev/null
+++ b/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application/Helpers/LabelBatchTemplateDefaultsHelper.cs
@@ -0,0 +1,426 @@
+using System.Globalization;
+using System.Text.Json;
+using FoodLabeling.Application.Contracts.Dtos.Label;
+using FoodLabeling.Application.Contracts.Dtos.LabelTemplate;
+using FoodLabeling.Application.Services.DbModels;
+using SqlSugar;
+using Volo.Abp;
+using Volo.Abp.Guids;
+
+namespace FoodLabeling.Application.Helpers;
+
+///
+/// 标签批量导入:模板 ProductDefaults 合并与默认值组装
+///
+public static class LabelBatchTemplateDefaultsHelper
+{
+ private static readonly HashSet DataEntryTypeAddWhitelist = new(StringComparer.OrdinalIgnoreCase)
+ {
+ "label_label name",
+ "label_text",
+ "label_qr code",
+ "label_barcode",
+ "label_price",
+ "label_duration date",
+ "label_duration time",
+ "label_duration",
+ "label_image",
+ "label_label type",
+ "label_how-to",
+ "label_expiration alert"
+ };
+
+ public static async Task> LoadTemplateElementsAsync(
+ ISqlSugarClient db,
+ string templateDbId)
+ {
+ var rows = await db.Queryable()
+ .Where(x => x.TemplateId == templateDbId)
+ .OrderBy(x => x.OrderNum * 1000000 + x.ZIndex)
+ .ToListAsync();
+
+ return rows.Select(e =>
+ {
+ object? cfg = null;
+ if (!string.IsNullOrWhiteSpace(e.ConfigJson))
+ {
+ try
+ {
+ cfg = JsonSerializer.Deserialize