S8RolePermissionSeedData.cs 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. namespace Admin.NET.Plugin.AiDOP;
  2. /// <summary>
  3. /// S8 业务角色基线种子(灌入 ado_s8_role_permission_config)。
  4. /// 作为异常类型配置的责任角色来源:tenant_id=0 / factory_id=0 表示全局默认。
  5. /// </summary>
  6. [IncreSeed]
  7. public class S8RolePermissionSeedData : ISqlSugarEntitySeedData<Entity.S8.AdoS8RolePermissionConfig>
  8. {
  9. public IEnumerable<Entity.S8.AdoS8RolePermissionConfig> HasData()
  10. {
  11. var ct = DateTime.Parse("2026-04-18 00:00:00");
  12. long seq = 1329908000001L;
  13. return new[]
  14. {
  15. R(seq++, "ROLE_ORDER_PLANNER", "s8:exception:read,s8:exception:assign", ct),
  16. R(seq++, "ROLE_PRODUCTION_PLANNER", "s8:exception:read,s8:exception:assign", ct),
  17. R(seq++, "ROLE_PURCHASER", "s8:exception:read,s8:exception:assign", ct),
  18. R(seq++, "ROLE_WH_INBOUND", "s8:exception:read,s8:exception:assign", ct),
  19. R(seq++, "ROLE_WH_OUTBOUND", "s8:exception:read,s8:exception:assign", ct),
  20. R(seq++, "ROLE_QC", "s8:exception:read,s8:exception:assign", ct),
  21. R(seq++, "ROLE_EQUIP_MAINT", "s8:exception:read,s8:exception:assign", ct),
  22. };
  23. }
  24. private static Entity.S8.AdoS8RolePermissionConfig R(long id, string roleCode, string perms, DateTime ct) =>
  25. new()
  26. {
  27. Id = id,
  28. TenantId = 0,
  29. FactoryId = 0,
  30. RoleCode = roleCode,
  31. PermissionCodes = perms,
  32. CreatedAt = ct,
  33. };
  34. }