Commit c2e3194d04edb97efb9d968026928107a181d95b

Authored by 李曜臣
1 parent ecb291fd

登陆优化;产品-门店绑定优化

Showing 18 changed files with 427 additions and 206 deletions
标签模块接口对接说明.md
... ... @@ -574,6 +574,10 @@ ADD UNIQUE KEY `uk_fl_ltpd_template_product_label_type` (`TemplateId`, `ProductI
574 574 入参:
575 575 - `id`:产品Id(`fl_product.Id`)
576 576  
  577 +返回(`ProductGetOutputDto`,与实现一致的主要字段):
  578 +- `id`、`productCode`、`productName`、`categoryId`、`categoryName`、`productImageUrl`、`state`
  579 +- **`locationIds`**:`string[]`,该产品在 **`fl_location_product`** 中绑定的门店 Id(去重);无关联时为空数组
  580 +
577 581 ### 6.3 新增产品
578 582  
579 583 方法:`POST /api/app/product`
... ... @@ -583,15 +587,30 @@ ADD UNIQUE KEY `uk_fl_ltpd_template_product_label_type` (`TemplateId`, `ProductI
583 587 {
584 588 "productCode": "PRD_TEST_001",
585 589 "productName": "Chicken",
586   - "categoryName": "Meat",
  590 + "categoryId": "a2696b9e-2277-11f1-b4c6-00163e0c7c4f",
587 591 "productImageUrl": "https://example.com/img.png",
588   - "state": true
  592 + "state": true,
  593 + "locationIds": [
  594 + "11111111-1111-1111-1111-111111111111",
  595 + "22222222-2222-2222-2222-222222222222"
  596 + ]
589 597 }
590 598 ```
591 599  
  600 +字段说明:
  601 +| 字段 | 类型 | 必填 | 说明 |
  602 +|------|------|------|------|
  603 +| `productCode` | string | 是 | 产品编码 |
  604 +| `productName` | string | 是 | 产品名称 |
  605 +| `categoryId` | string \| null | 否 | 产品分类 Id(`fl_product_category.id`) |
  606 +| `productImageUrl` | string \| null | 否 | 主图 URL |
  607 +| `state` | bool | 否 | 默认 `true` |
  608 +| **`locationIds`** | `string[]` \| **省略** | 否 | **可选。** 有该字段时:在同一事务内按列表批量写入 **`fl_location_product`**(**每个门店 Id 一行**,即「一产品一门店一条关联」)。**请求体中省略该字段**时:本接口不写门店关联,仍可通过 **§7 Product-Location** 维护。传空数组 `[]` 表示新建产品后不绑定任何门店。 |
  609 +
592 610 校验:
593   -- `productCode/productName` 不能为空
  611 +- `productCode` / `productName` 不能为空
594 612 - `productCode` 不能与未删除的数据重复
  613 +- 若传入 **`locationIds`** 且含非空项:每个 Id 须为合法 Guid,且对应门店存在于 **`Location`** 主数据且未删除;否则返回友好错误(如「门店Id格式不正确」「门店不存在」)
595 614  
596 615 ### 6.4 编辑产品
597 616  
... ... @@ -599,7 +618,13 @@ ADD UNIQUE KEY `uk_fl_ltpd_template_product_label_type` (`TemplateId`, `ProductI
599 618  
600 619 入参:
601 620 - Path:`id` 为当前产品Id(`fl_product.Id`)
602   -- Body:字段同新增(`ProductUpdateInputVo`)
  621 +- Body:字段同新增(`ProductUpdateInputVo`,继承 `ProductCreateInputVo`)
  622 +
  623 +**`locationIds` 行为(与新增不同,请注意):**
  624 +- **请求体中省略 `locationIds` 属性**:不修改 **`fl_location_product`**(仅更新 `fl_product` 主表字段;兼容原「先 PUT 产品再调 §7 同步门店」的调用方式)。
  625 +- **请求体中包含 `locationIds` 属性**(含空数组 `[]`):对该产品的门店关联做 **整表替换**——先删除本产品下全部 **`fl_location_product`** 行,再按列表逐条插入;`[]` 表示解除该产品与所有门店的关联。
  626 +
  627 +其它校验同 **§6.3**(含门店存在性校验,当 `locationIds` 含非空项时)。
603 628  
604 629 ### 6.5 删除(逻辑删除)
605 630  
... ... @@ -613,6 +638,7 @@ ADD UNIQUE KEY `uk_fl_ltpd_template_product_label_type` (`TemplateId`, `ProductI
613 638  
614 639 说明:
615 640 - 关联表:`fl_location_product`
  641 +- 也可在 **§6.3 / §6.4** 通过产品 Body 的 **`locationIds`** 一次性维护本产品在各门店的关联(与 §7 写入同一张表);二者可并存,按需选择调用方式。
616 642 - 关联按门店进行批量替换:
617 643 - `Create`:在门店下新增未存在的 product 关联
618 644 - `Update`:替换该门店下全部关联(先删后建)
... ...
美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application.Contracts/Dtos/Product/ProductCreateInputVo.cs
  1 +using System.Collections.Generic;
  2 +
1 3 namespace FoodLabeling.Application.Contracts.Dtos.Product;
2 4  
3 5 public class ProductCreateInputVo
... ... @@ -11,5 +13,11 @@ public class ProductCreateInputVo
11 13 public string? ProductImageUrl { get; set; }
12 14  
13 15 public bool State { get; set; } = true;
  16 +
  17 + /// <summary>
  18 + /// 可选。门店 Id 列表;每个 Id 在 fl_location_product 落一行(同一 fl_product 可对应多门店)。
  19 + /// 不传或空列表则不在本接口写入门店关联(仍可用 product-location 接口维护)。
  20 + /// </summary>
  21 + public List<string>? LocationIds { get; set; }
14 22 }
15 23  
... ...
美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application.Contracts/IServices/IProductAppService.cs
... ... @@ -23,11 +23,18 @@ public interface IProductAppService : IApplicationService
23 23 /// <summary>
24 24 /// 新增产品
25 25 /// </summary>
  26 + /// <remarks>
  27 + /// 若 <see cref="ProductCreateInputVo.LocationIds"/> 有值,将在同一事务内批量写入 fl_location_product(一门店一条)。
  28 + /// </remarks>
26 29 Task<ProductGetOutputDto> CreateAsync(ProductCreateInputVo input);
27 30  
28 31 /// <summary>
29 32 /// 编辑产品
30 33 /// </summary>
  34 + /// <remarks>
  35 + /// 当请求体包含 <see cref="ProductCreateInputVo.LocationIds"/> 属性时,按该列表整表替换本产品在各门店的关联;
  36 + /// 不传该属性则不改门店关联(兼容仅改名称/分类等调用)。
  37 + /// </remarks>
31 38 Task<ProductGetOutputDto> UpdateAsync(string id, ProductUpdateInputVo input);
32 39  
33 40 /// <summary>
... ...
美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application/Services/ProductAppService.cs
... ... @@ -3,6 +3,7 @@ using FoodLabeling.Application.Contracts.Dtos.Common;
3 3 using FoodLabeling.Application.Contracts.Dtos.Product;
4 4 using FoodLabeling.Application.Contracts.IServices;
5 5 using FoodLabeling.Application.Services.DbModels;
  6 +using FoodLabeling.Domain.Entities;
6 7 using SqlSugar;
7 8 using Volo.Abp;
8 9 using Volo.Abp.Application.Services;
... ... @@ -188,6 +189,13 @@ public class ProductAppService : ApplicationService, IProductAppService
188 189 };
189 190  
190 191 await _dbContext.SqlSugarClient.Insertable(entity).ExecuteCommandAsync();
  192 +
  193 + if (input.LocationIds is not null)
  194 + {
  195 + var locIds = await NormalizeAndValidateLocationIdsAsync(input.LocationIds);
  196 + await ReplaceProductLocationLinksAsync(entity.Id, locIds);
  197 + }
  198 +
191 199 return await GetAsync(entity.Id);
192 200 }
193 201  
... ... @@ -228,6 +236,13 @@ public class ProductAppService : ApplicationService, IProductAppService
228 236 entity.State = input.State;
229 237  
230 238 await _dbContext.SqlSugarClient.Updateable(entity).ExecuteCommandAsync();
  239 +
  240 + if (input.LocationIds is not null)
  241 + {
  242 + var locIds = await NormalizeAndValidateLocationIdsAsync(input.LocationIds);
  243 + await ReplaceProductLocationLinksAsync(productId, locIds);
  244 + }
  245 +
231 246 return await GetAsync(productId);
232 247 }
233 248  
... ... @@ -251,6 +266,66 @@ public class ProductAppService : ApplicationService, IProductAppService
251 266 await _dbContext.SqlSugarClient.Updateable(entity).ExecuteCommandAsync();
252 267 }
253 268  
  269 + /// <summary>
  270 + /// 去重、校验门店 Id 格式与存在性。
  271 + /// </summary>
  272 + private async Task<List<string>> NormalizeAndValidateLocationIdsAsync(IEnumerable<string> rawIds)
  273 + {
  274 + var distinct = rawIds
  275 + .Where(x => !string.IsNullOrWhiteSpace(x))
  276 + .Select(x => x.Trim())
  277 + .Distinct(StringComparer.Ordinal)
  278 + .ToList();
  279 +
  280 + if (distinct.Count == 0)
  281 + {
  282 + return new List<string>();
  283 + }
  284 +
  285 + foreach (var id in distinct)
  286 + {
  287 + if (!Guid.TryParse(id, out _))
  288 + {
  289 + throw new UserFriendlyException("门店Id格式不正确");
  290 + }
  291 + }
  292 +
  293 + var guidList = distinct.Select(Guid.Parse).ToList();
  294 + var existCount = await _dbContext.SqlSugarClient.Queryable<LocationAggregateRoot>()
  295 + .Where(x => !x.IsDeleted && guidList.Contains(x.Id))
  296 + .CountAsync();
  297 + if (existCount != distinct.Count)
  298 + {
  299 + throw new UserFriendlyException("门店不存在");
  300 + }
  301 +
  302 + return distinct;
  303 + }
  304 +
  305 + /// <summary>
  306 + /// 按产品维度替换 fl_location_product:先删本产品全部关联,再按列表插入(每门店一行)。
  307 + /// </summary>
  308 + private async Task ReplaceProductLocationLinksAsync(string productId, List<string> locationIds)
  309 + {
  310 + await _dbContext.SqlSugarClient.Deleteable<FlLocationProductDbEntity>()
  311 + .Where(x => x.ProductId == productId)
  312 + .ExecuteCommandAsync();
  313 +
  314 + if (locationIds.Count == 0)
  315 + {
  316 + return;
  317 + }
  318 +
  319 + var rows = locationIds.Select(lid => new FlLocationProductDbEntity
  320 + {
  321 + Id = _guidGenerator.Create().ToString(),
  322 + LocationId = lid,
  323 + ProductId = productId
  324 + }).ToList();
  325 +
  326 + await _dbContext.SqlSugarClient.Insertable(rows).ExecuteCommandAsync();
  327 + }
  328 +
254 329 private static PagedResultWithPageDto<T> BuildPagedResult<T>(int skipCount, int maxResultCount, int total, List<T> items)
255 330 {
256 331 var pageSize = maxResultCount <= 0 ? items.Count : maxResultCount;
... ...
美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application/Services/UsAppAuthAppService.cs
... ... @@ -413,16 +413,21 @@ public class UsAppAuthAppService : ApplicationService, IUsAppAuthAppService
413 413 }
414 414  
415 415 /// <summary>
416   - /// 按邮箱查找未删除且启用的用户(邮箱比较忽略大小写)
  416 + /// 按邮箱或用户名(邮箱形字符串写在 UserName 时)查找未删除且启用的用户;比较忽略大小写,Email 命中优先。
417 417 /// </summary>
418 418 private async Task<UserAggregateRoot?> FindActiveUserByEmailAsync(string email)
419 419 {
420 420 var normalized = email.Trim().ToLowerInvariant();
421 421 var users = await _userRepository._DbQueryable
422 422 .Where(u => !u.IsDeleted && u.State == true)
423   - .Where(u => u.Email != null && SqlFunc.ToLower(u.Email) == normalized)
  423 + .Where(u =>
  424 + (u.Email != null && SqlFunc.ToLower(u.Email) == normalized) ||
  425 + SqlFunc.ToLower(u.UserName) == normalized)
424 426 .ToListAsync();
425   - return users.FirstOrDefault();
  427 + return users.FirstOrDefault(u =>
  428 + u.Email != null &&
  429 + string.Equals(u.Email.Trim(), normalized, StringComparison.OrdinalIgnoreCase))
  430 + ?? users.FirstOrDefault();
426 431 }
427 432  
428 433 private string CreateAppAccessToken(UserAggregateRoot user)
... ...
美国版/Food Labeling Management Code/Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.Application.Contracts/IServices/IAccountService.cs
... ... @@ -14,12 +14,6 @@ namespace Yi.Framework.Rbac.Application.Contracts.IServices
14 14 Task<bool> RestPasswordAsync(Guid userId, RestPasswordDto input);
15 15  
16 16 /// <summary>
17   - /// 提供其他服务使用,根据用户id,直接返回token
18   - /// </summary>
19   - /// <returns></returns>
20   - Task<LoginOutputDto> PostLoginAsync(Guid userId);
21   -
22   - /// <summary>
23 17 /// 根据信息查询用户,可能为空,代表该用户不存在或禁用
24 18 /// </summary>
25 19 /// <param name="userName"></param>
... ...
美国版/Food Labeling Management Code/Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.Application/ObjectMapping/RbacMapsterRegister.cs 0 → 100644
  1 +using Mapster;
  2 +using Yi.Framework.Rbac.Application.Contracts.Dtos.Menu;
  3 +using Yi.Framework.Rbac.Domain.Entities;
  4 +using Yi.Framework.Rbac.Domain.Shared;
  5 +using Yi.Framework.Rbac.Domain.Shared.Dtos;
  6 +
  7 +namespace Yi.Framework.Rbac.Application.ObjectMapping;
  8 +
  9 +/// <summary>
  10 +/// <c>Menu.ParentId</c> 实体为字符串,对外 DTO 仍为 <see cref="Guid"/>。
  11 +/// </summary>
  12 +public class RbacMapsterRegister : IRegister
  13 +{
  14 + public void Register(TypeAdapterConfig config)
  15 + {
  16 + config.NewConfig<MenuAggregateRoot, MenuGetOutputDto>()
  17 + .Map(d => d.ParentId, s => MenuParentIdConverter.ToGuid(s.ParentId));
  18 +
  19 + config.NewConfig<MenuAggregateRoot, MenuGetListOutputDto>()
  20 + .Map(d => d.ParentId, s => MenuParentIdConverter.ToGuid(s.ParentId));
  21 +
  22 + // 登录组装用户信息时使用;库中 ParentId 可能为 "0",不能交给 Mapster 默认 string→Guid
  23 + config.NewConfig<MenuAggregateRoot, MenuDto>()
  24 + .Map(d => d.ParentId, s => MenuParentIdConverter.ToGuid(s.ParentId));
  25 + }
  26 +}
... ...
美国版/Food Labeling Management Code/Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.Application/Services/AccountService.cs
... ... @@ -115,11 +115,17 @@ namespace Yi.Framework.Rbac.Application.Services
115 115 ValidationImageCaptcha(input.Uuid,input.Code);
116 116  
117 117 var normalized = email.ToLowerInvariant();
  118 + // 平台登录框为「邮箱」:优先按 Email 匹配;若历史账号仅把邮箱形字符串写在 UserName、Email 为空,则按 UserName 匹配。
118 119 var candidates = await _userRepository._DbQueryable
119 120 .Where(u => !u.IsDeleted && u.State == true)
120   - .Where(u => u.Email != null && SqlFunc.ToLower(u.Email) == normalized)
  121 + .Where(u =>
  122 + (u.Email != null && SqlFunc.ToLower(u.Email) == normalized) ||
  123 + SqlFunc.ToLower(u.UserName) == normalized)
121 124 .ToListAsync();
122   - var user = candidates.FirstOrDefault();
  125 + var user = candidates.FirstOrDefault(u =>
  126 + u.Email != null &&
  127 + string.Equals(u.Email.Trim(), normalized, StringComparison.OrdinalIgnoreCase))
  128 + ?? candidates.FirstOrDefault();
123 129 if (user is null)
124 130 {
125 131 throw new UserFriendlyException("Sign-in failed: account not found.");
... ...
美国版/Food Labeling Management Code/Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.Domain.Shared/MenuParentIdConverter.cs 0 → 100644
  1 +namespace Yi.Framework.Rbac.Domain.Shared;
  2 +
  3 +/// <summary>
  4 +/// <c>Menu.ParentId</c> 在部分库中为 <c>varchar</c>(如根节点为 <c>0</c>),与 ORM 中 Guid 映射不一致时会导致 SqlSugar 绑定失败;统一用字符串落库并在需要时转为 <see cref="Guid"/>。
  5 +/// </summary>
  6 +public static class MenuParentIdConverter
  7 +{
  8 + public static bool IsRoot(string? raw) =>
  9 + string.IsNullOrWhiteSpace(raw) ||
  10 + raw.Trim() == "0" ||
  11 + string.Equals(raw.Trim(), Guid.Empty.ToString(), StringComparison.OrdinalIgnoreCase);
  12 +
  13 + public static Guid ToGuid(string? raw)
  14 + {
  15 + if (IsRoot(raw))
  16 + {
  17 + return Guid.Empty;
  18 + }
  19 +
  20 + var t = raw!.Trim();
  21 + return Guid.TryParse(t, out var g) ? g : Guid.Empty;
  22 + }
  23 +
  24 + /// <summary>写入数据库:根节点与历史库对齐为 <c>0</c>,否则为标准 GUID 字符串。</summary>
  25 + public static string FromGuid(Guid g) => g == Guid.Empty ? "0" : g.ToString("D");
  26 +}
... ...
美国版/Food Labeling Management Code/Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.Domain/Entities/MenuAggregateRoot.cs
1   -using System.Text.RegularExpressions;
  1 +using System.Text.RegularExpressions;
2 2 using System.Web;
3 3 using NUglify.Helpers;
4 4 using SqlSugar;
... ... @@ -7,6 +7,7 @@ using Volo.Abp.Auditing;
7 7 using Volo.Abp.Domain.Entities;
8 8 using Yi.Framework.Core.Data;
9 9 using Yi.Framework.Core.Helper;
  10 +using Yi.Framework.Rbac.Domain.Shared;
10 11 using Yi.Framework.Rbac.Domain.Shared.Dtos;
11 12 using Yi.Framework.Rbac.Domain.Shared.Enums;
12 13  
... ... @@ -25,13 +26,13 @@ namespace Yi.Framework.Rbac.Domain.Entities
25 26 public MenuAggregateRoot(Guid id)
26 27 {
27 28 Id = id;
28   - ParentId = Guid.Empty;
  29 + ParentId = MenuParentIdConverter.FromGuid(Guid.Empty);
29 30 }
30 31  
31 32 public MenuAggregateRoot(Guid id, Guid parentId)
32 33 {
33 34 Id = id;
34   - ParentId = parentId;
  35 + ParentId = MenuParentIdConverter.FromGuid(parentId);
35 36 }
36 37  
37 38 /// <summary>
... ... @@ -100,8 +101,9 @@ namespace Yi.Framework.Rbac.Domain.Entities
100 101 /// <summary>
101 102 ///
102 103 ///</summary>
  104 + /// <summary>父级菜单 Id;库中多为 varchar(如根为 <c>0</c> 或 GUID 文本)。</summary>
103 105 [SugarColumn(ColumnName = "ParentId")]
104   - public Guid ParentId { get; set; }
  106 + public string ParentId { get; set; } = "0";
105 107  
106 108 /// <summary>
107 109 /// 菜单图标
... ... @@ -183,7 +185,7 @@ namespace Yi.Framework.Rbac.Domain.Entities
183 185 r.OrderNum = m.OrderNum;
184 186 var routerName = m.Router?.Split("/").LastOrDefault();
185 187 r.Id = m.Id;
186   - r.ParentId = m.ParentId;
  188 + r.ParentId = MenuParentIdConverter.ToGuid(m.ParentId);
187 189  
188 190 //开头大写
189 191 r.Name = routerName?.First().ToString().ToUpper() + routerName?.Substring(1);
... ... @@ -197,7 +199,7 @@ namespace Yi.Framework.Rbac.Domain.Entities
197 199 r.AlwaysShow = true;
198 200  
199 201 //判断是否为最顶层的路由
200   - if (Guid.Empty == m.ParentId)
  202 + if (MenuParentIdConverter.IsRoot(m.ParentId))
201 203 {
202 204 r.Component = "Layout";
203 205 }
... ... @@ -250,7 +252,7 @@ namespace Yi.Framework.Rbac.Domain.Entities
250 252 var r = new Vue3RouterDto();
251 253 r.OrderNum = m.OrderNum;
252 254 r.Id = m.Id;
253   - r.ParentId = m.ParentId;
  255 + r.ParentId = MenuParentIdConverter.ToGuid(m.ParentId);
254 256 r.Hidden = !m.IsShow;
255 257  
256 258 // 检测是否为 URL 链接(http:// 或 https:// 开头)
... ... @@ -359,7 +361,7 @@ namespace Yi.Framework.Rbac.Domain.Entities
359 361 r.AlwaysShow = false;
360 362  
361 363 // 判断是否为最顶层的路由
362   - if (Guid.Empty == m.ParentId)
  364 + if (MenuParentIdConverter.IsRoot(m.ParentId))
363 365 {
364 366 r.Component = "Layout";
365 367 }
... ... @@ -385,7 +387,7 @@ namespace Yi.Framework.Rbac.Domain.Entities
385 387 r.AlwaysShow = true;
386 388  
387 389 // 判断是否为最顶层的路由
388   - if (Guid.Empty == m.ParentId)
  390 + if (MenuParentIdConverter.IsRoot(m.ParentId))
389 391 {
390 392 r.Component = "Layout";
391 393 }
... ... @@ -449,7 +451,7 @@ namespace Yi.Framework.Rbac.Domain.Entities
449 451 },
450 452 Children =null,
451 453 Id = m.Id,
452   - ParentId = m.ParentId
  454 + ParentId = MenuParentIdConverter.ToGuid(m.ParentId)
453 455 })
454 456 .ToList();
455 457  
... ... @@ -487,7 +489,7 @@ namespace Yi.Framework.Rbac.Domain.Entities
487 489 var treeDto = new MenuTreeDto
488 490 {
489 491 Id = m.Id,
490   - ParentId = m.ParentId,
  492 + ParentId = MenuParentIdConverter.ToGuid(m.ParentId),
491 493 OrderNum = m.OrderNum,
492 494 MenuName = m.MenuName,
493 495 MenuType = m.MenuType,
... ...
美国版/Food Labeling Management Code/Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.Domain/Managers/AccountManager.cs
1   -using System.IdentityModel.Tokens.Jwt;
  1 +using System.IdentityModel.Tokens.Jwt;
2 2 using System.Security.Claims;
3 3 using System.Text;
4 4 using Mapster;
... ... @@ -77,10 +77,8 @@ namespace Yi.Framework.Rbac.Domain.Managers
77 77 {
78 78 throw new UserFriendlyException(UserConst.No_Role);
79 79 }
80   - if (!userInfo.PermissionCodes.Any())
81   - {
82   - throw new UserFriendlyException(UserConst.No_Permission);
83   - }
  80 +
  81 + // 菜单表 PermissionCode 可未落库;当前以角色及角色-菜单绑定为准,不要求 PermissionCodes 非空
84 82  
85 83 if (getUserInfo is not null)
86 84 {
... ...
美国版/Food Labeling Management Code/Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.Domain/Managers/UserManager.cs
1   -using System.Text.RegularExpressions;
  1 +using System.Text.RegularExpressions;
2 2 using Mapster;
3 3 using Microsoft.Extensions.Caching.Distributed;
4 4 using Microsoft.Extensions.DependencyInjection;
... ... @@ -10,6 +10,7 @@ using Volo.Abp.EventBus.Local;
10 10 using Volo.Abp.Guids;
11 11 using Yi.Framework.Rbac.Domain.Entities;
12 12 using Yi.Framework.Rbac.Domain.Repositories;
  13 +using Yi.Framework.Rbac.Domain.Shared;
13 14 using Yi.Framework.Rbac.Domain.Shared.Caches;
14 15 using Yi.Framework.Rbac.Domain.Shared.Consts;
15 16 using Yi.Framework.Rbac.Domain.Shared.Dtos;
... ...
美国版/Food Labeling Management Code/Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.SqlSugarCore/DataSeeds/MenuPureDataSeed.cs
... ... @@ -87,7 +87,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
87 87 Router = "/system/user/index",
88 88 MenuIcon = "ri:admin-line",
89 89 OrderNum = 100,
90   - ParentId = system.Id,
  90 + ParentId = system.Id.ToString(),
91 91 RouterName = "SystemUser"
92 92 };
93 93 entities.Add(user);
... ... @@ -99,7 +99,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
99 99 PermissionCode = "system:user:query",
100 100 MenuType = MenuTypeEnum.Component,
101 101 OrderNum = 100,
102   - ParentId = user.Id,
  102 + ParentId = user.Id.ToString(),
103 103 IsDeleted = false
104 104 };
105 105 entities.Add(userQuery);
... ... @@ -111,7 +111,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
111 111 PermissionCode = "system:user:add",
112 112 MenuType = MenuTypeEnum.Component,
113 113 OrderNum = 100,
114   - ParentId = user.Id,
  114 + ParentId = user.Id.ToString(),
115 115 IsDeleted = false
116 116 };
117 117 entities.Add(userAdd);
... ... @@ -123,7 +123,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
123 123 PermissionCode = "system:user:edit",
124 124 MenuType = MenuTypeEnum.Component,
125 125 OrderNum = 100,
126   - ParentId = user.Id,
  126 + ParentId = user.Id.ToString(),
127 127 IsDeleted = false
128 128 };
129 129 entities.Add(userEdit);
... ... @@ -135,7 +135,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
135 135 PermissionCode = "system:user:remove",
136 136 MenuType = MenuTypeEnum.Component,
137 137 OrderNum = 100,
138   - ParentId = user.Id,
  138 + ParentId = user.Id.ToString(),
139 139 IsDeleted = false
140 140 };
141 141 entities.Add(userRemove);
... ... @@ -148,7 +148,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
148 148 PermissionCode = "system:user:resetPwd",
149 149 MenuType = MenuTypeEnum.Component,
150 150 OrderNum = 100,
151   - ParentId = user.Id,
  151 + ParentId = user.Id.ToString(),
152 152 IsDeleted = false
153 153 };
154 154 entities.Add(userResetPwd);
... ... @@ -164,7 +164,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
164 164 Router = "/system/role/index",
165 165 MenuIcon = "ri:admin-fill",
166 166 OrderNum = 99,
167   - ParentId = system.Id,
  167 + ParentId = system.Id.ToString(),
168 168 RouterName = "SystemRole"
169 169 };
170 170 entities.Add(role);
... ... @@ -176,7 +176,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
176 176 PermissionCode = "system:role:query",
177 177 MenuType = MenuTypeEnum.Component,
178 178 OrderNum = 100,
179   - ParentId = role.Id,
  179 + ParentId = role.Id.ToString(),
180 180 IsDeleted = false
181 181 };
182 182 entities.Add(roleQuery);
... ... @@ -188,7 +188,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
188 188 PermissionCode = "system:role:add",
189 189 MenuType = MenuTypeEnum.Component,
190 190 OrderNum = 100,
191   - ParentId = role.Id,
  191 + ParentId = role.Id.ToString(),
192 192 IsDeleted = false
193 193 };
194 194 entities.Add(roleAdd);
... ... @@ -200,7 +200,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
200 200 PermissionCode = "system:role:edit",
201 201 MenuType = MenuTypeEnum.Component,
202 202 OrderNum = 100,
203   - ParentId = role.Id,
  203 + ParentId = role.Id.ToString(),
204 204 IsDeleted = false
205 205 };
206 206 entities.Add(roleEdit);
... ... @@ -212,7 +212,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
212 212 PermissionCode = "system:role:remove",
213 213 MenuType = MenuTypeEnum.Component,
214 214 OrderNum = 100,
215   - ParentId = role.Id,
  215 + ParentId = role.Id.ToString(),
216 216 IsDeleted = false
217 217 };
218 218 entities.Add(roleRemove);
... ... @@ -228,7 +228,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
228 228 Router = "/system/menu/index",
229 229 MenuIcon = "ep:menu",
230 230 OrderNum = 98,
231   - ParentId = system.Id,
  231 + ParentId = system.Id.ToString(),
232 232 RouterName = "SystemMenu"
233 233 };
234 234 entities.Add(menu);
... ... @@ -240,7 +240,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
240 240 PermissionCode = "system:menu:query",
241 241 MenuType = MenuTypeEnum.Component,
242 242 OrderNum = 100,
243   - ParentId = menu.Id,
  243 + ParentId = menu.Id.ToString(),
244 244 IsDeleted = false
245 245 };
246 246 entities.Add(menuQuery);
... ... @@ -252,7 +252,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
252 252 PermissionCode = "system:menu:add",
253 253 MenuType = MenuTypeEnum.Component,
254 254 OrderNum = 100,
255   - ParentId = menu.Id,
  255 + ParentId = menu.Id.ToString(),
256 256 IsDeleted = false
257 257 };
258 258 entities.Add(menuAdd);
... ... @@ -264,7 +264,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
264 264 PermissionCode = "system:menu:edit",
265 265 MenuType = MenuTypeEnum.Component,
266 266 OrderNum = 100,
267   - ParentId = menu.Id,
  267 + ParentId = menu.Id.ToString(),
268 268 IsDeleted = false
269 269 };
270 270 entities.Add(menuEdit);
... ... @@ -276,7 +276,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
276 276 PermissionCode = "system:menu:remove",
277 277 MenuType = MenuTypeEnum.Component,
278 278 OrderNum = 100,
279   - ParentId = menu.Id,
  279 + ParentId = menu.Id.ToString(),
280 280 IsDeleted = false
281 281 };
282 282 entities.Add(menuRemove);
... ... @@ -291,7 +291,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
291 291 Router = "/system/dept/index",
292 292 MenuIcon = "ri:git-branch-line",
293 293 OrderNum = 97,
294   - ParentId = system.Id,
  294 + ParentId = system.Id.ToString(),
295 295 RouterName = "SystemDept"
296 296 };
297 297 entities.Add(dept);
... ... @@ -303,7 +303,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
303 303 PermissionCode = "system:dept:query",
304 304 MenuType = MenuTypeEnum.Component,
305 305 OrderNum = 100,
306   - ParentId = dept.Id,
  306 + ParentId = dept.Id.ToString(),
307 307 IsDeleted = false
308 308 };
309 309 entities.Add(deptQuery);
... ... @@ -315,7 +315,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
315 315 PermissionCode = "system:dept:add",
316 316 MenuType = MenuTypeEnum.Component,
317 317 OrderNum = 100,
318   - ParentId = dept.Id,
  318 + ParentId = dept.Id.ToString(),
319 319 IsDeleted = false
320 320 };
321 321 entities.Add(deptAdd);
... ... @@ -327,7 +327,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
327 327 PermissionCode = "system:dept:edit",
328 328 MenuType = MenuTypeEnum.Component,
329 329 OrderNum = 100,
330   - ParentId = dept.Id,
  330 + ParentId = dept.Id.ToString(),
331 331 IsDeleted = false
332 332 };
333 333 entities.Add(deptEdit);
... ... @@ -339,7 +339,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
339 339 PermissionCode = "system:dept:remove",
340 340 MenuType = MenuTypeEnum.Component,
341 341 OrderNum = 100,
342   - ParentId = dept.Id,
  342 + ParentId = dept.Id.ToString(),
343 343 IsDeleted = false
344 344 };
345 345 entities.Add(deptRemove);
... ... @@ -356,7 +356,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
356 356 Router = "/system/post/index",
357 357 MenuIcon = "ant-design:deployment-unit-outlined",
358 358 OrderNum = 96,
359   - ParentId = system.Id,
  359 + ParentId = system.Id.ToString(),
360 360 RouterName = "SystemPost"
361 361 };
362 362 entities.Add(post);
... ... @@ -368,7 +368,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
368 368 PermissionCode = "system:post:query",
369 369 MenuType = MenuTypeEnum.Component,
370 370 OrderNum = 100,
371   - ParentId = post.Id,
  371 + ParentId = post.Id.ToString(),
372 372 IsDeleted = false
373 373 };
374 374 entities.Add(postQuery);
... ... @@ -380,7 +380,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
380 380 PermissionCode = "system:post:add",
381 381 MenuType = MenuTypeEnum.Component,
382 382 OrderNum = 100,
383   - ParentId = post.Id,
  383 + ParentId = post.Id.ToString(),
384 384 IsDeleted = false
385 385 };
386 386 entities.Add(postAdd);
... ... @@ -392,7 +392,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
392 392 PermissionCode = "system:post:edit",
393 393 MenuType = MenuTypeEnum.Component,
394 394 OrderNum = 100,
395   - ParentId = post.Id,
  395 + ParentId = post.Id.ToString(),
396 396 IsDeleted = false
397 397 };
398 398 entities.Add(postEdit);
... ... @@ -404,7 +404,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
404 404 PermissionCode = "system:post:remove",
405 405 MenuType = MenuTypeEnum.Component,
406 406 OrderNum = 100,
407   - ParentId = post.Id,
  407 + ParentId = post.Id.ToString(),
408 408 IsDeleted = false
409 409 };
410 410 entities.Add(postRemove);
... ... @@ -420,7 +420,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
420 420 Router = "/monitor/operation-logs",
421 421 MenuIcon = "ri:history-fill",
422 422 OrderNum = 100,
423   - ParentId = monitoring.Id,
  423 + ParentId = monitoring.Id.ToString(),
424 424 RouterName = "OperationLog",
425 425 Component = "monitor/logs/operation/index"
426 426 };
... ... @@ -433,7 +433,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
433 433 PermissionCode = "monitor:operlog:query",
434 434 MenuType = MenuTypeEnum.Component,
435 435 OrderNum = 100,
436   - ParentId = operationLog.Id,
  436 + ParentId = operationLog.Id.ToString(),
437 437 IsDeleted = false
438 438 };
439 439 entities.Add(operationLogQuery);
... ... @@ -445,7 +445,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
445 445 PermissionCode = "monitor:operlog:remove",
446 446 MenuType = MenuTypeEnum.Component,
447 447 OrderNum = 100,
448   - ParentId = operationLog.Id,
  448 + ParentId = operationLog.Id.ToString(),
449 449 IsDeleted = false
450 450 };
451 451 entities.Add(operationLogRemove);
... ... @@ -465,7 +465,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
465 465 Component = "monitor/logs/login/index",
466 466 MenuIcon = "ri:window-line",
467 467 OrderNum = 100,
468   - ParentId = monitoring.Id,
  468 + ParentId = monitoring.Id.ToString(),
469 469 RouterName = "LoginLog",
470 470 };
471 471 entities.Add(loginLog);
... ... @@ -477,7 +477,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
477 477 PermissionCode = "monitor:logininfor:query",
478 478 MenuType = MenuTypeEnum.Component,
479 479 OrderNum = 100,
480   - ParentId = loginLog.Id,
  480 + ParentId = loginLog.Id.ToString(),
481 481 IsDeleted = false
482 482 };
483 483 entities.Add(loginLogQuery);
... ... @@ -489,7 +489,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
489 489 PermissionCode = "monitor:logininfor:remove",
490 490 MenuType = MenuTypeEnum.Component,
491 491 OrderNum = 100,
492   - ParentId = loginLog.Id,
  492 + ParentId = loginLog.Id.ToString(),
493 493 IsDeleted = false,
494 494  
495 495 };
... ... @@ -509,7 +509,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
509 509 Component = "/system/config/index",
510 510 MenuIcon = "ri:edit-box-line",
511 511 OrderNum = 94,
512   - ParentId = system.Id,
  512 + ParentId = system.Id.ToString(),
513 513 IsDeleted = false
514 514 };
515 515 entities.Add(config);
... ... @@ -521,7 +521,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
521 521 PermissionCode = "system:config:query",
522 522 MenuType = MenuTypeEnum.Component,
523 523 OrderNum = 100,
524   - ParentId = config.Id,
  524 + ParentId = config.Id.ToString(),
525 525 IsDeleted = false
526 526 };
527 527 entities.Add(configQuery);
... ... @@ -533,7 +533,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
533 533 PermissionCode = "system:config:add",
534 534 MenuType = MenuTypeEnum.Component,
535 535 OrderNum = 100,
536   - ParentId = config.Id,
  536 + ParentId = config.Id.ToString(),
537 537 IsDeleted = false
538 538 };
539 539 entities.Add(configAdd);
... ... @@ -545,7 +545,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
545 545 PermissionCode = "system:config:edit",
546 546 MenuType = MenuTypeEnum.Component,
547 547 OrderNum = 100,
548   - ParentId = config.Id,
  548 + ParentId = config.Id.ToString(),
549 549 IsDeleted = false
550 550 };
551 551 entities.Add(configEdit);
... ... @@ -557,7 +557,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
557 557 PermissionCode = "system:config:remove",
558 558 MenuType = MenuTypeEnum.Component,
559 559 OrderNum = 100,
560   - ParentId = config.Id,
  560 + ParentId = config.Id.ToString(),
561 561 IsDeleted = false
562 562 };
563 563 entities.Add(configRemove);
... ...
美国版/Food Labeling Management Code/Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.SqlSugarCore/DataSeeds/MenuRuoYiDataSeed.cs
... ... @@ -88,7 +88,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
88 88 Component = "code/field/index",
89 89 MenuIcon = "number",
90 90 OrderNum = 99,
91   - ParentId = code.Id,
  91 + ParentId = code.Id.ToString(),
92 92 IsDeleted = false
93 93 };
94 94 entities.Add(field);
... ... @@ -599,7 +599,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
599 599 Component = "system/tenant/index",
600 600 MenuIcon = "list",
601 601 OrderNum = 101,
602   - ParentId = system.Id,
  602 + ParentId = system.Id.ToString(),
603 603 IsDeleted = false
604 604 };
605 605 entities.Add(tenant);
... ... @@ -611,7 +611,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
611 611 PermissionCode = "system:tenant:query",
612 612 MenuType = MenuTypeEnum.Component,
613 613 OrderNum = 100,
614   - ParentId = tenant.Id,
  614 + ParentId = tenant.Id.ToString(),
615 615 IsDeleted = false
616 616 };
617 617 entities.Add(tenantQuery);
... ... @@ -623,7 +623,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
623 623 PermissionCode = "system:tenant:add",
624 624 MenuType = MenuTypeEnum.Component,
625 625 OrderNum = 100,
626   - ParentId = tenant.Id,
  626 + ParentId = tenant.Id.ToString(),
627 627 IsDeleted = false
628 628 };
629 629 entities.Add(tenantAdd);
... ... @@ -635,7 +635,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
635 635 PermissionCode = "system:tenant:edit",
636 636 MenuType = MenuTypeEnum.Component,
637 637 OrderNum = 100,
638   - ParentId = tenant.Id,
  638 + ParentId = tenant.Id.ToString(),
639 639 IsDeleted = false
640 640 };
641 641 entities.Add(tenantEdit);
... ... @@ -647,7 +647,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
647 647 PermissionCode = "system:tenant:remove",
648 648 MenuType = MenuTypeEnum.Component,
649 649 OrderNum = 100,
650   - ParentId = tenant.Id,
  650 + ParentId = tenant.Id.ToString(),
651 651 IsDeleted = false
652 652 };
653 653 entities.Add(tenantRemove);
... ... @@ -677,7 +677,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
677 677 Component = "system/user/index",
678 678 MenuIcon = "user",
679 679 OrderNum = 100,
680   - ParentId = system.Id,
  680 + ParentId = system.Id.ToString(),
681 681 IsDeleted = false
682 682 };
683 683 entities.Add(user);
... ... @@ -689,7 +689,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
689 689 PermissionCode = "system:user:query",
690 690 MenuType = MenuTypeEnum.Component,
691 691 OrderNum = 100,
692   - ParentId = user.Id,
  692 + ParentId = user.Id.ToString(),
693 693 IsDeleted = false
694 694 };
695 695 entities.Add(userQuery);
... ... @@ -701,7 +701,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
701 701 PermissionCode = "system:user:add",
702 702 MenuType = MenuTypeEnum.Component,
703 703 OrderNum = 100,
704   - ParentId = user.Id,
  704 + ParentId = user.Id.ToString(),
705 705 IsDeleted = false
706 706 };
707 707 entities.Add(userAdd);
... ... @@ -713,7 +713,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
713 713 PermissionCode = "system:user:edit",
714 714 MenuType = MenuTypeEnum.Component,
715 715 OrderNum = 100,
716   - ParentId = user.Id,
  716 + ParentId = user.Id.ToString(),
717 717 IsDeleted = false
718 718 };
719 719 entities.Add(userEdit);
... ... @@ -725,7 +725,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
725 725 PermissionCode = "system:user:remove",
726 726 MenuType = MenuTypeEnum.Component,
727 727 OrderNum = 100,
728   - ParentId = user.Id,
  728 + ParentId = user.Id.ToString(),
729 729 IsDeleted = false
730 730 };
731 731 entities.Add(userRemove);
... ... @@ -738,7 +738,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
738 738 PermissionCode = "system:user:resetPwd",
739 739 MenuType = MenuTypeEnum.Component,
740 740 OrderNum = 100,
741   - ParentId = user.Id,
  741 + ParentId = user.Id.ToString(),
742 742 IsDeleted = false
743 743 };
744 744 entities.Add(userResetPwd);
... ... @@ -758,7 +758,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
758 758 Component = "system/role/index",
759 759 MenuIcon = "peoples",
760 760 OrderNum = 99,
761   - ParentId = system.Id,
  761 + ParentId = system.Id.ToString(),
762 762 IsDeleted = false
763 763 };
764 764 entities.Add(role);
... ... @@ -770,7 +770,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
770 770 PermissionCode = "system:role:query",
771 771 MenuType = MenuTypeEnum.Component,
772 772 OrderNum = 100,
773   - ParentId = role.Id,
  773 + ParentId = role.Id.ToString(),
774 774 IsDeleted = false
775 775 };
776 776 entities.Add(roleQuery);
... ... @@ -782,7 +782,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
782 782 PermissionCode = "system:role:add",
783 783 MenuType = MenuTypeEnum.Component,
784 784 OrderNum = 100,
785   - ParentId = role.Id,
  785 + ParentId = role.Id.ToString(),
786 786 IsDeleted = false
787 787 };
788 788 entities.Add(roleAdd);
... ... @@ -794,7 +794,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
794 794 PermissionCode = "system:role:edit",
795 795 MenuType = MenuTypeEnum.Component,
796 796 OrderNum = 100,
797   - ParentId = role.Id,
  797 + ParentId = role.Id.ToString(),
798 798 IsDeleted = false
799 799 };
800 800 entities.Add(roleEdit);
... ... @@ -806,7 +806,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
806 806 PermissionCode = "system:role:remove",
807 807 MenuType = MenuTypeEnum.Component,
808 808 OrderNum = 100,
809   - ParentId = role.Id,
  809 + ParentId = role.Id.ToString(),
810 810 IsDeleted = false
811 811 };
812 812 entities.Add(roleRemove);
... ... @@ -826,7 +826,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
826 826 Component = "system/menu/index",
827 827 MenuIcon = "tree-table",
828 828 OrderNum = 98,
829   - ParentId = system.Id,
  829 + ParentId = system.Id.ToString(),
830 830 IsDeleted = false
831 831 };
832 832 entities.Add(menu);
... ... @@ -838,7 +838,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
838 838 PermissionCode = "system:menu:query",
839 839 MenuType = MenuTypeEnum.Component,
840 840 OrderNum = 100,
841   - ParentId = menu.Id,
  841 + ParentId = menu.Id.ToString(),
842 842 IsDeleted = false
843 843 };
844 844 entities.Add(menuQuery);
... ... @@ -850,7 +850,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
850 850 PermissionCode = "system:menu:add",
851 851 MenuType = MenuTypeEnum.Component,
852 852 OrderNum = 100,
853   - ParentId = menu.Id,
  853 + ParentId = menu.Id.ToString(),
854 854 IsDeleted = false
855 855 };
856 856 entities.Add(menuAdd);
... ... @@ -862,7 +862,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
862 862 PermissionCode = "system:menu:edit",
863 863 MenuType = MenuTypeEnum.Component,
864 864 OrderNum = 100,
865   - ParentId = menu.Id,
  865 + ParentId = menu.Id.ToString(),
866 866 IsDeleted = false
867 867 };
868 868 entities.Add(menuEdit);
... ... @@ -874,7 +874,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
874 874 PermissionCode = "system:menu:remove",
875 875 MenuType = MenuTypeEnum.Component,
876 876 OrderNum = 100,
877   - ParentId = menu.Id,
  877 + ParentId = menu.Id.ToString(),
878 878 IsDeleted = false
879 879 };
880 880 entities.Add(menuRemove);
... ... @@ -893,7 +893,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
893 893 Component = "system/dept/index",
894 894 MenuIcon = "tree",
895 895 OrderNum = 97,
896   - ParentId = system.Id,
  896 + ParentId = system.Id.ToString(),
897 897 IsDeleted = false
898 898 };
899 899 entities.Add(dept);
... ... @@ -905,7 +905,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
905 905 PermissionCode = "system:dept:query",
906 906 MenuType = MenuTypeEnum.Component,
907 907 OrderNum = 100,
908   - ParentId = dept.Id,
  908 + ParentId = dept.Id.ToString(),
909 909 IsDeleted = false
910 910 };
911 911 entities.Add(deptQuery);
... ... @@ -917,7 +917,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
917 917 PermissionCode = "system:dept:add",
918 918 MenuType = MenuTypeEnum.Component,
919 919 OrderNum = 100,
920   - ParentId = dept.Id,
  920 + ParentId = dept.Id.ToString(),
921 921 IsDeleted = false
922 922 };
923 923 entities.Add(deptAdd);
... ... @@ -929,7 +929,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
929 929 PermissionCode = "system:dept:edit",
930 930 MenuType = MenuTypeEnum.Component,
931 931 OrderNum = 100,
932   - ParentId = dept.Id,
  932 + ParentId = dept.Id.ToString(),
933 933 IsDeleted = false
934 934 };
935 935 entities.Add(deptEdit);
... ... @@ -941,7 +941,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
941 941 PermissionCode = "system:dept:remove",
942 942 MenuType = MenuTypeEnum.Component,
943 943 OrderNum = 100,
944   - ParentId = dept.Id,
  944 + ParentId = dept.Id.ToString(),
945 945 IsDeleted = false
946 946 };
947 947 entities.Add(deptRemove);
... ... @@ -962,7 +962,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
962 962 Component = "system/post/index",
963 963 MenuIcon = "post",
964 964 OrderNum = 96,
965   - ParentId = system.Id,
  965 + ParentId = system.Id.ToString(),
966 966 IsDeleted = false
967 967 };
968 968 entities.Add(post);
... ... @@ -974,7 +974,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
974 974 PermissionCode = "system:post:query",
975 975 MenuType = MenuTypeEnum.Component,
976 976 OrderNum = 100,
977   - ParentId = post.Id,
  977 + ParentId = post.Id.ToString(),
978 978 IsDeleted = false
979 979 };
980 980 entities.Add(postQuery);
... ... @@ -986,7 +986,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
986 986 PermissionCode = "system:post:add",
987 987 MenuType = MenuTypeEnum.Component,
988 988 OrderNum = 100,
989   - ParentId = post.Id,
  989 + ParentId = post.Id.ToString(),
990 990 IsDeleted = false
991 991 };
992 992 entities.Add(postAdd);
... ... @@ -998,7 +998,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
998 998 PermissionCode = "system:post:edit",
999 999 MenuType = MenuTypeEnum.Component,
1000 1000 OrderNum = 100,
1001   - ParentId = post.Id,
  1001 + ParentId = post.Id.ToString(),
1002 1002 IsDeleted = false
1003 1003 };
1004 1004 entities.Add(postEdit);
... ... @@ -1010,7 +1010,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
1010 1010 PermissionCode = "system:post:remove",
1011 1011 MenuType = MenuTypeEnum.Component,
1012 1012 OrderNum = 100,
1013   - ParentId = post.Id,
  1013 + ParentId = post.Id.ToString(),
1014 1014 IsDeleted = false
1015 1015 };
1016 1016 entities.Add(postRemove);
... ... @@ -1029,7 +1029,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
1029 1029 Component = "system/dict/index",
1030 1030 MenuIcon = "dict",
1031 1031 OrderNum = 95,
1032   - ParentId = system.Id,
  1032 + ParentId = system.Id.ToString(),
1033 1033 IsDeleted = false
1034 1034 };
1035 1035 entities.Add(dict);
... ... @@ -1041,7 +1041,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
1041 1041 PermissionCode = "system:dict:query",
1042 1042 MenuType = MenuTypeEnum.Component,
1043 1043 OrderNum = 100,
1044   - ParentId = dict.Id,
  1044 + ParentId = dict.Id.ToString(),
1045 1045 IsDeleted = false
1046 1046 };
1047 1047 entities.Add(dictQuery);
... ... @@ -1053,7 +1053,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
1053 1053 PermissionCode = "system:dict:add",
1054 1054 MenuType = MenuTypeEnum.Component,
1055 1055 OrderNum = 100,
1056   - ParentId = dict.Id,
  1056 + ParentId = dict.Id.ToString(),
1057 1057 IsDeleted = false
1058 1058 };
1059 1059 entities.Add(dictAdd);
... ... @@ -1065,7 +1065,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
1065 1065 PermissionCode = "system:dict:edit",
1066 1066 MenuType = MenuTypeEnum.Component,
1067 1067 OrderNum = 100,
1068   - ParentId = dict.Id,
  1068 + ParentId = dict.Id.ToString(),
1069 1069 IsDeleted = false
1070 1070 };
1071 1071 entities.Add(dictEdit);
... ... @@ -1077,7 +1077,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
1077 1077 PermissionCode = "system:dict:remove",
1078 1078 MenuType = MenuTypeEnum.Component,
1079 1079 OrderNum = 100,
1080   - ParentId = dict.Id,
  1080 + ParentId = dict.Id.ToString(),
1081 1081 IsDeleted = false
1082 1082 };
1083 1083 entities.Add(dictRemove);
... ... @@ -1097,7 +1097,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
1097 1097 Component = "system/config/index",
1098 1098 MenuIcon = "edit",
1099 1099 OrderNum = 94,
1100   - ParentId = system.Id,
  1100 + ParentId = system.Id.ToString(),
1101 1101 IsDeleted = false
1102 1102 };
1103 1103 entities.Add(config);
... ... @@ -1109,7 +1109,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
1109 1109 PermissionCode = "system:config:query",
1110 1110 MenuType = MenuTypeEnum.Component,
1111 1111 OrderNum = 100,
1112   - ParentId = config.Id,
  1112 + ParentId = config.Id.ToString(),
1113 1113 IsDeleted = false
1114 1114 };
1115 1115 entities.Add(configQuery);
... ... @@ -1121,7 +1121,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
1121 1121 PermissionCode = "system:config:add",
1122 1122 MenuType = MenuTypeEnum.Component,
1123 1123 OrderNum = 100,
1124   - ParentId = config.Id,
  1124 + ParentId = config.Id.ToString(),
1125 1125 IsDeleted = false
1126 1126 };
1127 1127 entities.Add(configAdd);
... ... @@ -1133,7 +1133,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
1133 1133 PermissionCode = "system:config:edit",
1134 1134 MenuType = MenuTypeEnum.Component,
1135 1135 OrderNum = 100,
1136   - ParentId = config.Id,
  1136 + ParentId = config.Id.ToString(),
1137 1137 IsDeleted = false
1138 1138 };
1139 1139 entities.Add(configEdit);
... ... @@ -1145,7 +1145,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
1145 1145 PermissionCode = "system:config:remove",
1146 1146 MenuType = MenuTypeEnum.Component,
1147 1147 OrderNum = 100,
1148   - ParentId = config.Id,
  1148 + ParentId = config.Id.ToString(),
1149 1149 IsDeleted = false
1150 1150 };
1151 1151 entities.Add(configRemove);
... ... @@ -1167,7 +1167,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
1167 1167 Component = "system/notice/index",
1168 1168 MenuIcon = "message",
1169 1169 OrderNum = 93,
1170   - ParentId = system.Id,
  1170 + ParentId = system.Id.ToString(),
1171 1171 IsDeleted = false
1172 1172 };
1173 1173 entities.Add(notice);
... ... @@ -1179,7 +1179,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
1179 1179 PermissionCode = "system:notice:query",
1180 1180 MenuType = MenuTypeEnum.Component,
1181 1181 OrderNum = 100,
1182   - ParentId = notice.Id,
  1182 + ParentId = notice.Id.ToString(),
1183 1183 IsDeleted = false
1184 1184 };
1185 1185 entities.Add(noticeQuery);
... ... @@ -1191,7 +1191,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
1191 1191 PermissionCode = "system:notice:add",
1192 1192 MenuType = MenuTypeEnum.Component,
1193 1193 OrderNum = 100,
1194   - ParentId = notice.Id,
  1194 + ParentId = notice.Id.ToString(),
1195 1195 IsDeleted = false
1196 1196 };
1197 1197 entities.Add(noticeAdd);
... ... @@ -1203,7 +1203,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
1203 1203 PermissionCode = "system:notice:edit",
1204 1204 MenuType = MenuTypeEnum.Component,
1205 1205 OrderNum = 100,
1206   - ParentId = notice.Id,
  1206 + ParentId = notice.Id.ToString(),
1207 1207 IsDeleted = false
1208 1208 };
1209 1209 entities.Add(noticeEdit);
... ... @@ -1215,7 +1215,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
1215 1215 PermissionCode = "system:notice:remove",
1216 1216 MenuType = MenuTypeEnum.Component,
1217 1217 OrderNum = 100,
1218   - ParentId = notice.Id,
  1218 + ParentId = notice.Id.ToString(),
1219 1219 IsDeleted = false
1220 1220 };
1221 1221 entities.Add(noticeRemove);
... ... @@ -1233,7 +1233,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
1233 1233 IsLink = false,
1234 1234 MenuIcon = "log",
1235 1235 OrderNum = 92,
1236   - ParentId = system.Id,
  1236 + ParentId = system.Id.ToString(),
1237 1237 IsDeleted = false
1238 1238 };
1239 1239 entities.Add(log);
... ... @@ -1252,7 +1252,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
1252 1252 Component = "monitor/operlog/index",
1253 1253 MenuIcon = "form",
1254 1254 OrderNum = 100,
1255   - ParentId = log.Id,
  1255 + ParentId = log.Id.ToString(),
1256 1256 IsDeleted = false
1257 1257 };
1258 1258 entities.Add(operationLog);
... ... @@ -1264,7 +1264,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
1264 1264 PermissionCode = "monitor:operlog:query",
1265 1265 MenuType = MenuTypeEnum.Component,
1266 1266 OrderNum = 100,
1267   - ParentId = operationLog.Id,
  1267 + ParentId = operationLog.Id.ToString(),
1268 1268 IsDeleted = false
1269 1269 };
1270 1270 entities.Add(operationLogQuery);
... ... @@ -1276,7 +1276,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
1276 1276 PermissionCode = "monitor:operlog:remove",
1277 1277 MenuType = MenuTypeEnum.Component,
1278 1278 OrderNum = 100,
1279   - ParentId = operationLog.Id,
  1279 + ParentId = operationLog.Id.ToString(),
1280 1280 IsDeleted = false
1281 1281 };
1282 1282 entities.Add(operationLogRemove);
... ... @@ -1296,7 +1296,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
1296 1296 Component = "monitor/logininfor/index",
1297 1297 MenuIcon = "logininfor",
1298 1298 OrderNum = 100,
1299   - ParentId = log.Id,
  1299 + ParentId = log.Id.ToString(),
1300 1300 IsDeleted = false
1301 1301 };
1302 1302 entities.Add(loginLog);
... ... @@ -1308,7 +1308,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
1308 1308 PermissionCode = "monitor:logininfor:query",
1309 1309 MenuType = MenuTypeEnum.Component,
1310 1310 OrderNum = 100,
1311   - ParentId = loginLog.Id,
  1311 + ParentId = loginLog.Id.ToString(),
1312 1312 IsDeleted = false
1313 1313 };
1314 1314 entities.Add(loginLogQuery);
... ... @@ -1320,7 +1320,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
1320 1320 PermissionCode = "monitor:logininfor:remove",
1321 1321 MenuType = MenuTypeEnum.Component,
1322 1322 OrderNum = 100,
1323   - ParentId = loginLog.Id,
  1323 + ParentId = loginLog.Id.ToString(),
1324 1324 IsDeleted = false
1325 1325 };
1326 1326 entities.Add(loginLogRemove);
... ...
美国版/Food Labeling Management Code/Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.SqlSugarCore/DataSeeds/MenuVben5DataSeed.cs
1   -using Volo.Abp.Data;
  1 +using Volo.Abp.Data;
2 2 using Volo.Abp.DependencyInjection;
3 3 using Volo.Abp.Guids;
4 4 using Yi.Framework.Rbac.Domain.Entities;
... ... @@ -88,7 +88,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
88 88 // Component = "code/field/index",
89 89 // MenuIcon = "tabler:file-code",
90 90 // OrderNum = 99,
91   - // ParentId = code.Id,
  91 + // ParentId = code.Id.ToString(),
92 92 // IsDeleted = false
93 93 // };
94 94 // entities.Add(field);
... ... @@ -251,7 +251,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
251 251 Component = "system/tenant/index",
252 252 MenuIcon = "tabler:users",
253 253 OrderNum = 101,
254   - ParentId = system.Id,
  254 + ParentId = system.Id.ToString(),
255 255 IsDeleted = false
256 256 };
257 257 entities.Add(tenant);
... ... @@ -263,7 +263,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
263 263 PermissionCode = "system:tenant:query",
264 264 MenuType = MenuTypeEnum.Component,
265 265 OrderNum = 100,
266   - ParentId = tenant.Id,
  266 + ParentId = tenant.Id.ToString(),
267 267 IsDeleted = false
268 268 };
269 269 entities.Add(tenantQuery);
... ... @@ -275,7 +275,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
275 275 PermissionCode = "system:tenant:add",
276 276 MenuType = MenuTypeEnum.Component,
277 277 OrderNum = 100,
278   - ParentId = tenant.Id,
  278 + ParentId = tenant.Id.ToString(),
279 279 IsDeleted = false
280 280 };
281 281 entities.Add(tenantAdd);
... ... @@ -287,7 +287,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
287 287 PermissionCode = "system:tenant:edit",
288 288 MenuType = MenuTypeEnum.Component,
289 289 OrderNum = 100,
290   - ParentId = tenant.Id,
  290 + ParentId = tenant.Id.ToString(),
291 291 IsDeleted = false
292 292 };
293 293 entities.Add(tenantEdit);
... ... @@ -299,7 +299,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
299 299 PermissionCode = "system:tenant:remove",
300 300 MenuType = MenuTypeEnum.Component,
301 301 OrderNum = 100,
302   - ParentId = tenant.Id,
  302 + ParentId = tenant.Id.ToString(),
303 303 IsDeleted = false
304 304 };
305 305 entities.Add(tenantRemove);
... ... @@ -318,7 +318,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
318 318 Component = "system/user/index",
319 319 MenuIcon = "tabler:user",
320 320 OrderNum = 100,
321   - ParentId = system.Id,
  321 + ParentId = system.Id.ToString(),
322 322 IsDeleted = false
323 323 };
324 324 entities.Add(user);
... ... @@ -330,7 +330,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
330 330 PermissionCode = "system:user:query",
331 331 MenuType = MenuTypeEnum.Component,
332 332 OrderNum = 100,
333   - ParentId = user.Id,
  333 + ParentId = user.Id.ToString(),
334 334 IsDeleted = false
335 335 };
336 336 entities.Add(userQuery);
... ... @@ -342,7 +342,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
342 342 PermissionCode = "system:user:add",
343 343 MenuType = MenuTypeEnum.Component,
344 344 OrderNum = 100,
345   - ParentId = user.Id,
  345 + ParentId = user.Id.ToString(),
346 346 IsDeleted = false
347 347 };
348 348 entities.Add(userAdd);
... ... @@ -354,7 +354,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
354 354 PermissionCode = "system:user:edit",
355 355 MenuType = MenuTypeEnum.Component,
356 356 OrderNum = 100,
357   - ParentId = user.Id,
  357 + ParentId = user.Id.ToString(),
358 358 IsDeleted = false
359 359 };
360 360 entities.Add(userEdit);
... ... @@ -366,7 +366,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
366 366 PermissionCode = "system:user:remove",
367 367 MenuType = MenuTypeEnum.Component,
368 368 OrderNum = 100,
369   - ParentId = user.Id,
  369 + ParentId = user.Id.ToString(),
370 370 IsDeleted = false
371 371 };
372 372 entities.Add(userRemove);
... ... @@ -379,7 +379,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
379 379 PermissionCode = "system:user:resetPwd",
380 380 MenuType = MenuTypeEnum.Component,
381 381 OrderNum = 100,
382   - ParentId = user.Id,
  382 + ParentId = user.Id.ToString(),
383 383 IsDeleted = false
384 384 };
385 385 entities.Add(userResetPwd);
... ... @@ -399,7 +399,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
399 399 Component = "system/role/index",
400 400 MenuIcon = "eos-icons:role-binding-outlined",
401 401 OrderNum = 99,
402   - ParentId = system.Id,
  402 + ParentId = system.Id.ToString(),
403 403 IsDeleted = false
404 404 };
405 405 entities.Add(role);
... ... @@ -411,7 +411,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
411 411 PermissionCode = "system:role:query",
412 412 MenuType = MenuTypeEnum.Component,
413 413 OrderNum = 100,
414   - ParentId = role.Id,
  414 + ParentId = role.Id.ToString(),
415 415 IsDeleted = false
416 416 };
417 417 entities.Add(roleQuery);
... ... @@ -423,7 +423,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
423 423 PermissionCode = "system:role:add",
424 424 MenuType = MenuTypeEnum.Component,
425 425 OrderNum = 100,
426   - ParentId = role.Id,
  426 + ParentId = role.Id.ToString(),
427 427 IsDeleted = false
428 428 };
429 429 entities.Add(roleAdd);
... ... @@ -435,7 +435,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
435 435 PermissionCode = "system:role:edit",
436 436 MenuType = MenuTypeEnum.Component,
437 437 OrderNum = 100,
438   - ParentId = role.Id,
  438 + ParentId = role.Id.ToString(),
439 439 IsDeleted = false
440 440 };
441 441 entities.Add(roleEdit);
... ... @@ -447,7 +447,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
447 447 PermissionCode = "system:role:remove",
448 448 MenuType = MenuTypeEnum.Component,
449 449 OrderNum = 100,
450   - ParentId = role.Id,
  450 + ParentId = role.Id.ToString(),
451 451 IsDeleted = false
452 452 };
453 453 entities.Add(roleRemove);
... ... @@ -466,7 +466,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
466 466 MenuIcon = "tabler:user-shield",
467 467 OrderNum = 15,
468 468 IsDeleted = false,
469   - ParentId = system.Id
  469 + ParentId = system.Id.ToString()
470 470 };
471 471 entities.Add(roleAuthUser);
472 472  
... ... @@ -485,7 +485,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
485 485 Component = "system/menu/index",
486 486 MenuIcon = "ic:sharp-menu",
487 487 OrderNum = 98,
488   - ParentId = system.Id,
  488 + ParentId = system.Id.ToString(),
489 489 IsDeleted = false
490 490 };
491 491 entities.Add(menu);
... ... @@ -497,7 +497,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
497 497 PermissionCode = "system:menu:query",
498 498 MenuType = MenuTypeEnum.Component,
499 499 OrderNum = 100,
500   - ParentId = menu.Id,
  500 + ParentId = menu.Id.ToString(),
501 501 IsDeleted = false
502 502 };
503 503 entities.Add(menuQuery);
... ... @@ -509,7 +509,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
509 509 PermissionCode = "system:menu:add",
510 510 MenuType = MenuTypeEnum.Component,
511 511 OrderNum = 100,
512   - ParentId = menu.Id,
  512 + ParentId = menu.Id.ToString(),
513 513 IsDeleted = false
514 514 };
515 515 entities.Add(menuAdd);
... ... @@ -521,7 +521,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
521 521 PermissionCode = "system:menu:edit",
522 522 MenuType = MenuTypeEnum.Component,
523 523 OrderNum = 100,
524   - ParentId = menu.Id,
  524 + ParentId = menu.Id.ToString(),
525 525 IsDeleted = false
526 526 };
527 527 entities.Add(menuEdit);
... ... @@ -533,7 +533,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
533 533 PermissionCode = "system:menu:remove",
534 534 MenuType = MenuTypeEnum.Component,
535 535 OrderNum = 100,
536   - ParentId = menu.Id,
  536 + ParentId = menu.Id.ToString(),
537 537 IsDeleted = false
538 538 };
539 539 entities.Add(menuRemove);
... ... @@ -552,7 +552,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
552 552 Component = "system/dept/index",
553 553 MenuIcon = "mingcute:department-line",
554 554 OrderNum = 97,
555   - ParentId = system.Id,
  555 + ParentId = system.Id.ToString(),
556 556 IsDeleted = false
557 557 };
558 558 entities.Add(dept);
... ... @@ -564,7 +564,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
564 564 PermissionCode = "system:dept:query",
565 565 MenuType = MenuTypeEnum.Component,
566 566 OrderNum = 100,
567   - ParentId = dept.Id,
  567 + ParentId = dept.Id.ToString(),
568 568 IsDeleted = false
569 569 };
570 570 entities.Add(deptQuery);
... ... @@ -576,7 +576,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
576 576 PermissionCode = "system:dept:add",
577 577 MenuType = MenuTypeEnum.Component,
578 578 OrderNum = 100,
579   - ParentId = dept.Id,
  579 + ParentId = dept.Id.ToString(),
580 580 IsDeleted = false
581 581 };
582 582 entities.Add(deptAdd);
... ... @@ -588,7 +588,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
588 588 PermissionCode = "system:dept:edit",
589 589 MenuType = MenuTypeEnum.Component,
590 590 OrderNum = 100,
591   - ParentId = dept.Id,
  591 + ParentId = dept.Id.ToString(),
592 592 IsDeleted = false
593 593 };
594 594 entities.Add(deptEdit);
... ... @@ -600,7 +600,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
600 600 PermissionCode = "system:dept:remove",
601 601 MenuType = MenuTypeEnum.Component,
602 602 OrderNum = 100,
603   - ParentId = dept.Id,
  603 + ParentId = dept.Id.ToString(),
604 604 IsDeleted = false
605 605 };
606 606 entities.Add(deptRemove);
... ... @@ -621,7 +621,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
621 621 Component = "system/post/index",
622 622 MenuIcon = "tabler:user-star",
623 623 OrderNum = 96,
624   - ParentId = system.Id,
  624 + ParentId = system.Id.ToString(),
625 625 IsDeleted = false
626 626 };
627 627 entities.Add(post);
... ... @@ -633,7 +633,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
633 633 PermissionCode = "system:post:query",
634 634 MenuType = MenuTypeEnum.Component,
635 635 OrderNum = 100,
636   - ParentId = post.Id,
  636 + ParentId = post.Id.ToString(),
637 637 IsDeleted = false
638 638 };
639 639 entities.Add(postQuery);
... ... @@ -645,7 +645,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
645 645 PermissionCode = "system:post:add",
646 646 MenuType = MenuTypeEnum.Component,
647 647 OrderNum = 100,
648   - ParentId = post.Id,
  648 + ParentId = post.Id.ToString(),
649 649 IsDeleted = false
650 650 };
651 651 entities.Add(postAdd);
... ... @@ -657,7 +657,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
657 657 PermissionCode = "system:post:edit",
658 658 MenuType = MenuTypeEnum.Component,
659 659 OrderNum = 100,
660   - ParentId = post.Id,
  660 + ParentId = post.Id.ToString(),
661 661 IsDeleted = false
662 662 };
663 663 entities.Add(postEdit);
... ... @@ -669,7 +669,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
669 669 PermissionCode = "system:post:remove",
670 670 MenuType = MenuTypeEnum.Component,
671 671 OrderNum = 100,
672   - ParentId = post.Id,
  672 + ParentId = post.Id.ToString(),
673 673 IsDeleted = false
674 674 };
675 675 entities.Add(postRemove);
... ... @@ -688,7 +688,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
688 688 Component = "system/dict/index",
689 689 MenuIcon = "fluent-mdl2:dictionary",
690 690 OrderNum = 95,
691   - ParentId = system.Id,
  691 + ParentId = system.Id.ToString(),
692 692 IsDeleted = false
693 693 };
694 694 entities.Add(dict);
... ... @@ -700,7 +700,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
700 700 PermissionCode = "system:dict:query",
701 701 MenuType = MenuTypeEnum.Component,
702 702 OrderNum = 100,
703   - ParentId = dict.Id,
  703 + ParentId = dict.Id.ToString(),
704 704 IsDeleted = false
705 705 };
706 706 entities.Add(dictQuery);
... ... @@ -712,7 +712,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
712 712 PermissionCode = "system:dict:add",
713 713 MenuType = MenuTypeEnum.Component,
714 714 OrderNum = 100,
715   - ParentId = dict.Id,
  715 + ParentId = dict.Id.ToString(),
716 716 IsDeleted = false
717 717 };
718 718 entities.Add(dictAdd);
... ... @@ -724,7 +724,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
724 724 PermissionCode = "system:dict:edit",
725 725 MenuType = MenuTypeEnum.Component,
726 726 OrderNum = 100,
727   - ParentId = dict.Id,
  727 + ParentId = dict.Id.ToString(),
728 728 IsDeleted = false
729 729 };
730 730 entities.Add(dictEdit);
... ... @@ -736,7 +736,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
736 736 PermissionCode = "system:dict:remove",
737 737 MenuType = MenuTypeEnum.Component,
738 738 OrderNum = 100,
739   - ParentId = dict.Id,
  739 + ParentId = dict.Id.ToString(),
740 740 IsDeleted = false
741 741 };
742 742 entities.Add(dictRemove);
... ... @@ -756,7 +756,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
756 756 Component = "system/config/index",
757 757 MenuIcon = "ant-design:setting-outlined",
758 758 OrderNum = 94,
759   - ParentId = system.Id,
  759 + ParentId = system.Id.ToString(),
760 760 IsDeleted = false
761 761 };
762 762 entities.Add(config);
... ... @@ -768,7 +768,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
768 768 PermissionCode = "system:config:query",
769 769 MenuType = MenuTypeEnum.Component,
770 770 OrderNum = 100,
771   - ParentId = config.Id,
  771 + ParentId = config.Id.ToString(),
772 772 IsDeleted = false
773 773 };
774 774 entities.Add(configQuery);
... ... @@ -780,7 +780,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
780 780 PermissionCode = "system:config:add",
781 781 MenuType = MenuTypeEnum.Component,
782 782 OrderNum = 100,
783   - ParentId = config.Id,
  783 + ParentId = config.Id.ToString(),
784 784 IsDeleted = false
785 785 };
786 786 entities.Add(configAdd);
... ... @@ -792,7 +792,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
792 792 PermissionCode = "system:config:edit",
793 793 MenuType = MenuTypeEnum.Component,
794 794 OrderNum = 100,
795   - ParentId = config.Id,
  795 + ParentId = config.Id.ToString(),
796 796 IsDeleted = false
797 797 };
798 798 entities.Add(configEdit);
... ... @@ -804,7 +804,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
804 804 PermissionCode = "system:config:remove",
805 805 MenuType = MenuTypeEnum.Component,
806 806 OrderNum = 100,
807   - ParentId = config.Id,
  807 + ParentId = config.Id.ToString(),
808 808 IsDeleted = false
809 809 };
810 810 entities.Add(configRemove);
... ... @@ -826,7 +826,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
826 826 Component = "system/notice/index",
827 827 MenuIcon = "fe:notice-push",
828 828 OrderNum = 93,
829   - ParentId = system.Id,
  829 + ParentId = system.Id.ToString(),
830 830 IsDeleted = false
831 831 };
832 832 entities.Add(notice);
... ... @@ -838,7 +838,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
838 838 PermissionCode = "system:notice:query",
839 839 MenuType = MenuTypeEnum.Component,
840 840 OrderNum = 100,
841   - ParentId = notice.Id,
  841 + ParentId = notice.Id.ToString(),
842 842 IsDeleted = false
843 843 };
844 844 entities.Add(noticeQuery);
... ... @@ -850,7 +850,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
850 850 PermissionCode = "system:notice:add",
851 851 MenuType = MenuTypeEnum.Component,
852 852 OrderNum = 100,
853   - ParentId = notice.Id,
  853 + ParentId = notice.Id.ToString(),
854 854 IsDeleted = false
855 855 };
856 856 entities.Add(noticeAdd);
... ... @@ -862,7 +862,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
862 862 PermissionCode = "system:notice:edit",
863 863 MenuType = MenuTypeEnum.Component,
864 864 OrderNum = 100,
865   - ParentId = notice.Id,
  865 + ParentId = notice.Id.ToString(),
866 866 IsDeleted = false
867 867 };
868 868 entities.Add(noticeEdit);
... ... @@ -874,7 +874,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
874 874 PermissionCode = "system:notice:remove",
875 875 MenuType = MenuTypeEnum.Component,
876 876 OrderNum = 100,
877   - ParentId = notice.Id,
  877 + ParentId = notice.Id.ToString(),
878 878 IsDeleted = false
879 879 };
880 880 entities.Add(noticeRemove);
... ... @@ -892,7 +892,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
892 892 IsLink = false,
893 893 MenuIcon = "material-symbols:logo-dev-outline",
894 894 OrderNum = 92,
895   - ParentId = system.Id,
  895 + ParentId = system.Id.ToString(),
896 896 IsDeleted = false
897 897 };
898 898 entities.Add(log);
... ... @@ -911,7 +911,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
911 911 Component = "monitor/operlog/index",
912 912 MenuIcon = "tabler:align-box-right-middle",
913 913 OrderNum = 100,
914   - ParentId = log.Id,
  914 + ParentId = log.Id.ToString(),
915 915 IsDeleted = false
916 916 };
917 917 entities.Add(operationLog);
... ... @@ -923,7 +923,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
923 923 PermissionCode = "monitor:operlog:query",
924 924 MenuType = MenuTypeEnum.Component,
925 925 OrderNum = 100,
926   - ParentId = operationLog.Id,
  926 + ParentId = operationLog.Id.ToString(),
927 927 IsDeleted = false
928 928 };
929 929 entities.Add(operationLogQuery);
... ... @@ -935,7 +935,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
935 935 PermissionCode = "monitor:operlog:remove",
936 936 MenuType = MenuTypeEnum.Component,
937 937 OrderNum = 100,
938   - ParentId = operationLog.Id,
  938 + ParentId = operationLog.Id.ToString(),
939 939 IsDeleted = false
940 940 };
941 941 entities.Add(operationLogRemove);
... ... @@ -955,7 +955,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
955 955 Component = "monitor/logininfor/index",
956 956 MenuIcon = "tabler:align-box-right-middle",
957 957 OrderNum = 100,
958   - ParentId = log.Id,
  958 + ParentId = log.Id.ToString(),
959 959 IsDeleted = false
960 960 };
961 961 entities.Add(loginLog);
... ... @@ -967,7 +967,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
967 967 PermissionCode = "monitor:logininfor:query",
968 968 MenuType = MenuTypeEnum.Component,
969 969 OrderNum = 100,
970   - ParentId = loginLog.Id,
  970 + ParentId = loginLog.Id.ToString(),
971 971 IsDeleted = false
972 972 };
973 973 entities.Add(loginLogQuery);
... ... @@ -979,7 +979,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
979 979 PermissionCode = "monitor:logininfor:remove",
980 980 MenuType = MenuTypeEnum.Component,
981 981 OrderNum = 100,
982   - ParentId = loginLog.Id,
  982 + ParentId = loginLog.Id.ToString(),
983 983 IsDeleted = false
984 984 };
985 985 entities.Add(loginLogRemove);
... ...
美国版/Food Labeling Management Platform/src/components/products/ProductsView.tsx
... ... @@ -68,6 +68,7 @@ import type { LocationDto } from &quot;../../types/location&quot;;
68 68 import type { ProductDto, ProductCreateInput, ProductUpdateInput } from "../../types/product";
69 69 import type { ProductCategoryDto, ProductCategoryCreateInput } from "../../types/productCategory";
70 70 import { SearchableSelect } from "../ui/searchable-select";
  71 +import { SearchableMultiSelect } from "../ui/searchable-multi-select";
71 72 import {
72 73 Pagination,
73 74 PaginationContent,
... ... @@ -101,24 +102,36 @@ async function buildProductLocationMap(signal?: AbortSignal): Promise&lt;Map&lt;string
101 102 return map;
102 103 }
103 104  
  105 +/**
  106 + * 按「一个产品 + 一个门店」一行(fl_location_product)同步:移除旧门店关联、补齐新门店关联。
  107 + */
104 108 async function syncProductStoreBinding(
105 109 productId: string,
106   - newLocationId: string,
  110 + newLocationIds: string[],
107 111 previousLocationIds: string[],
108 112 ): Promise<void> {
109 113 const prev = [...new Set(previousLocationIds.filter(Boolean))];
110   - for (const locId of prev) {
111   - if (locId === newLocationId) continue;
112   - const current = await getProductIdsByLocation(locId);
113   - if (current.includes(productId)) {
  114 + const next = [...new Set(newLocationIds.map((x) => x.trim()).filter(Boolean))];
  115 + const nextSet = new Set(next);
  116 + const prevSet = new Set(prev);
  117 +
  118 + const removals = prev.filter((locId) => !nextSet.has(locId));
  119 + await Promise.all(
  120 + removals.map(async (locId) => {
  121 + const current = await getProductIdsByLocation(locId);
  122 + if (!current.includes(productId)) return;
114 123 await updateProductLocation(locId, {
115 124 productIds: current.filter((x) => x !== productId),
116 125 });
117   - }
118   - }
119   - if (newLocationId.trim()) {
120   - await createProductLocation({ locationId: newLocationId, productIds: [productId] });
121   - }
  126 + }),
  127 + );
  128 +
  129 + const additions = next.filter((locId) => !prevSet.has(locId));
  130 + await Promise.all(
  131 + additions.map((locId) =>
  132 + createProductLocation({ locationId: locId, productIds: [productId] }),
  133 + ),
  134 + );
122 135 }
123 136  
124 137 export function ProductsView() {
... ... @@ -966,7 +979,7 @@ function ProductFormDialog({
966 979 const [categoryId, setCategoryId] = useState("");
967 980 const [productImageUrl, setProductImageUrl] = useState("");
968 981 const [state, setState] = useState(true);
969   - const [locationId, setLocationId] = useState("");
  982 + const [locationIds, setLocationIds] = useState<string[]>([]);
970 983  
971 984 useEffect(() => {
972 985 if (!open) return;
... ... @@ -977,14 +990,14 @@ function ProductFormDialog({
977 990 setProductImageUrl(editing.productImageUrl ?? "");
978 991 setState(editing.state !== false);
979 992 const lids = locationMap.get(editing.id) ?? [];
980   - setLocationId(lids[0] ?? "");
  993 + setLocationIds([...new Set(lids.filter(Boolean))]);
981 994 } else {
982 995 setProductCode("");
983 996 setProductName("");
984 997 setCategoryId("");
985 998 setProductImageUrl("");
986 999 setState(true);
987   - setLocationId("");
  1000 + setLocationIds([]);
988 1001 }
989 1002 }, [open, editing, locationMap]);
990 1003  
... ... @@ -993,8 +1006,9 @@ function ProductFormDialog({
993 1006 toast.error("Validation", { description: "Product code and name are required." });
994 1007 return;
995 1008 }
996   - if (!locationId.trim()) {
997   - toast.error("Validation", { description: "Select a store to bind this product." });
  1009 + const storeIds = [...new Set(locationIds.map((x) => x.trim()).filter(Boolean))];
  1010 + if (storeIds.length === 0) {
  1011 + toast.error("Validation", { description: "Select at least one store to bind this product." });
998 1012 return;
999 1013 }
1000 1014  
... ... @@ -1011,10 +1025,14 @@ function ProductFormDialog({
1011 1025 if (editing) {
1012 1026 await updateProduct(editing.id, body as ProductUpdateInput);
1013 1027 const prev = locationMap.get(editing.id) ?? [];
1014   - await syncProductStoreBinding(editing.id, locationId.trim(), prev);
  1028 + await syncProductStoreBinding(editing.id, storeIds, prev);
1015 1029 } else {
1016 1030 const created = await createProduct(body);
1017   - await createProductLocation({ locationId: locationId.trim(), productIds: [created.id] });
  1031 + await Promise.all(
  1032 + storeIds.map((locId) =>
  1033 + createProductLocation({ locationId: locId, productIds: [created.id] }),
  1034 + ),
  1035 + );
1018 1036 }
1019 1037 toast.success(editing ? "Product updated." : "Product created.");
1020 1038 onSaved();
... ... @@ -1033,7 +1051,9 @@ function ProductFormDialog({
1033 1051 <DialogHeader>
1034 1052 <DialogTitle>{editing ? "Edit Product" : "Add New Product"}</DialogTitle>
1035 1053 <DialogDescription>
1036   - {editing ? "Update product and store binding." : "Create a product and bind it to a store."}
  1054 + {editing
  1055 + ? "Update product and store bindings (one row per product–store pair)."
  1056 + : "Create a product and bind it to one or more stores (one row per pair)."}
1037 1057 </DialogDescription>
1038 1058 </DialogHeader>
1039 1059  
... ... @@ -1080,12 +1100,12 @@ function ProductFormDialog({
1080 1100 />
1081 1101 </div>
1082 1102 <div className="space-y-2">
1083   - <Label>Bind to store *</Label>
1084   - <SearchableSelect
1085   - value={locationId}
1086   - onValueChange={setLocationId}
  1103 + <Label>Bind to store(s) *</Label>
  1104 + <SearchableMultiSelect
  1105 + values={locationIds}
  1106 + onValuesChange={setLocationIds}
1087 1107 options={locationOptions}
1088   - placeholder="Select location"
  1108 + placeholder="Select one or more locations"
1089 1109 searchPlaceholder="Search location…"
1090 1110 emptyText="No locations."
1091 1111 />
... ...
项目相关文档/本次新增与优化接口汇总.md
... ... @@ -7,6 +7,7 @@
7 7 > - App `labeling-tree`:L1 标签分类返回 `buttonAppearance`
8 8 > - Web 管理端 `auth-session`:**当前用户菜单与权限**、**退出登录**(食品标签-美国版模块)
9 9 > - Web `rbac-menu` 列表/详情:补充返回 `routerName`、`router`
  10 +> - 产品 **Products**:`POST/PUT /api/app/product` 支持可选 Body 字段 **`locationIds`**(多门店批量绑定 / 编辑时整表替换关联),详见 `项目相关文档/标签模块接口对接说明.md` **§6**
10 11 >
11 12 > 其余标签打印相关接口不在本文范围内。
12 13  
... ...
项目相关文档/标签模块接口对接说明.md
... ... @@ -574,6 +574,10 @@ ADD UNIQUE KEY `uk_fl_ltpd_template_product_label_type` (`TemplateId`, `ProductI
574 574 入参:
575 575 - `id`:产品Id(`fl_product.Id`)
576 576  
  577 +返回(`ProductGetOutputDto`,与实现一致的主要字段):
  578 +- `id`、`productCode`、`productName`、`categoryId`、`categoryName`、`productImageUrl`、`state`
  579 +- **`locationIds`**:`string[]`,该产品在 **`fl_location_product`** 中绑定的门店 Id(去重);无关联时为空数组
  580 +
577 581 ### 6.3 新增产品
578 582  
579 583 方法:`POST /api/app/product`
... ... @@ -583,15 +587,30 @@ ADD UNIQUE KEY `uk_fl_ltpd_template_product_label_type` (`TemplateId`, `ProductI
583 587 {
584 588 "productCode": "PRD_TEST_001",
585 589 "productName": "Chicken",
586   - "categoryName": "Meat",
  590 + "categoryId": "a2696b9e-2277-11f1-b4c6-00163e0c7c4f",
587 591 "productImageUrl": "https://example.com/img.png",
588   - "state": true
  592 + "state": true,
  593 + "locationIds": [
  594 + "11111111-1111-1111-1111-111111111111",
  595 + "22222222-2222-2222-2222-222222222222"
  596 + ]
589 597 }
590 598 ```
591 599  
  600 +字段说明:
  601 +| 字段 | 类型 | 必填 | 说明 |
  602 +|------|------|------|------|
  603 +| `productCode` | string | 是 | 产品编码 |
  604 +| `productName` | string | 是 | 产品名称 |
  605 +| `categoryId` | string \| null | 否 | 产品分类 Id(`fl_product_category.id`) |
  606 +| `productImageUrl` | string \| null | 否 | 主图 URL |
  607 +| `state` | bool | 否 | 默认 `true` |
  608 +| **`locationIds`** | `string[]` \| **省略** | 否 | **可选。** 有该字段时:在同一事务内按列表批量写入 **`fl_location_product`**(**每个门店 Id 一行**,即「一产品一门店一条关联」)。**请求体中省略该字段**时:本接口不写门店关联,仍可通过 **§7 Product-Location** 维护。传空数组 `[]` 表示新建产品后不绑定任何门店。 |
  609 +
592 610 校验:
593   -- `productCode/productName` 不能为空
  611 +- `productCode` / `productName` 不能为空
594 612 - `productCode` 不能与未删除的数据重复
  613 +- 若传入 **`locationIds`** 且含非空项:每个 Id 须为合法 Guid,且对应门店存在于 **`Location`** 主数据且未删除;否则返回友好错误(如「门店Id格式不正确」「门店不存在」)
595 614  
596 615 ### 6.4 编辑产品
597 616  
... ... @@ -599,7 +618,13 @@ ADD UNIQUE KEY `uk_fl_ltpd_template_product_label_type` (`TemplateId`, `ProductI
599 618  
600 619 入参:
601 620 - Path:`id` 为当前产品Id(`fl_product.Id`)
602   -- Body:字段同新增(`ProductUpdateInputVo`)
  621 +- Body:字段同新增(`ProductUpdateInputVo`,继承 `ProductCreateInputVo`)
  622 +
  623 +**`locationIds` 行为(与新增不同,请注意):**
  624 +- **请求体中省略 `locationIds` 属性**:不修改 **`fl_location_product`**(仅更新 `fl_product` 主表字段;兼容原「先 PUT 产品再调 §7 同步门店」的调用方式)。
  625 +- **请求体中包含 `locationIds` 属性**(含空数组 `[]`):对该产品的门店关联做 **整表替换**——先删除本产品下全部 **`fl_location_product`** 行,再按列表逐条插入;`[]` 表示解除该产品与所有门店的关联。
  626 +
  627 +其它校验同 **§6.3**(含门店存在性校验,当 `locationIds` 含非空项时)。
603 628  
604 629 ### 6.5 删除(逻辑删除)
605 630  
... ... @@ -613,6 +638,7 @@ ADD UNIQUE KEY `uk_fl_ltpd_template_product_label_type` (`TemplateId`, `ProductI
613 638  
614 639 说明:
615 640 - 关联表:`fl_location_product`
  641 +- 也可在 **§6.3 / §6.4** 通过产品 Body 的 **`locationIds`** 一次性维护本产品在各门店的关联(与 §7 写入同一张表);二者可并存,按需选择调用方式。
616 642 - 关联按门店进行批量替换:
617 643 - `Create`:在门店下新增未存在的 product 关联
618 644 - `Update`:替换该门店下全部关联(先删后建)
... ...