S0OrgSeedData.cs 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. namespace Admin.NET.Plugin.AiDOP;
  2. /// <summary>
  3. /// S0 示范组织节点种子(灌入 SysOrg,公司 Type=201 / 工厂 Type=501)
  4. /// </summary>
  5. [IncreSeed]
  6. public class S0OrgSeedData : ISqlSugarEntitySeedData<SysOrg>
  7. {
  8. private const long S0CompanyId = 1329900200001L;
  9. private const long S0Factory1Id = 1329900200002L;
  10. private const long S0Factory2Id = 1329900200003L;
  11. public IEnumerable<SysOrg> HasData()
  12. {
  13. var ct = DateTime.Parse("2022-02-10 00:00:00");
  14. var tenantId = SqlSugarConst.DefaultTenantId;
  15. return new[]
  16. {
  17. new SysOrg
  18. {
  19. Id = S0CompanyId,
  20. Pid = tenantId,
  21. Name = "S0示范公司",
  22. Code = "S0-C001",
  23. Type = "201",
  24. Level = 2,
  25. OrderNo = 200,
  26. Status = StatusEnum.Enable,
  27. Remark = "S0 运营建模示范公司",
  28. TenantId = tenantId,
  29. CreateTime = ct,
  30. },
  31. new SysOrg
  32. {
  33. Id = S0Factory1Id,
  34. Pid = S0CompanyId,
  35. Name = "一工厂",
  36. Code = "S0-F001",
  37. Type = "501",
  38. Level = 3,
  39. OrderNo = 201,
  40. Status = StatusEnum.Enable,
  41. Remark = "S0 示范工厂 1",
  42. TenantId = tenantId,
  43. CreateTime = ct,
  44. },
  45. new SysOrg
  46. {
  47. Id = S0Factory2Id,
  48. Pid = S0CompanyId,
  49. Name = "二工厂",
  50. Code = "S0-F002",
  51. Type = "501",
  52. Level = 3,
  53. OrderNo = 202,
  54. Status = StatusEnum.Enable,
  55. Remark = "S0 示范工厂 2",
  56. TenantId = tenantId,
  57. CreateTime = ct,
  58. },
  59. };
  60. }
  61. }