MdmMirrorCatalog.cs 1.3 KB

1234567891011121314151617181920212223242526
  1. namespace Admin.NET.Plugin.AiDOP.DataPlatform.Inbound;
  2. /// <summary>实体码到 S0 镜像表的路由。已有专用写入方法的表走专用方法,其余表走通用列对齐。</summary>
  3. public static class MdmMirrorCatalog
  4. {
  5. public sealed record Route(string EntityCode, string Table, string KeyColumn, string? ParentColumn);
  6. public static readonly Route[] Routes =
  7. [
  8. new("MDM_ITEM", "ItemMaster", "ItemNum", null),
  9. new("MDM_CUSTOMER", "CustMaster", "Cust", null),
  10. new("MDM_SUPPLIER", "SuppMaster", "Supp", null),
  11. new("MDM_LOCATION", "LocationMaster", "Location", null),
  12. new("MDM_EMPLOYEE_HEADCOUNT", "EmployeeMaster", "Employee", null),
  13. new("MDM_DEPARTMENT", "DepartmentMaster", "Department", null),
  14. new("MDM_SOURCE_LIST", "srm_purchase", "ItemNum", null),
  15. new("MDM_BOM", "ProductStructureMaster", "ParentItem", "ParentItem"),
  16. new("MDM_ROUTING", "RoutingOpDetail", "Routing", "Routing"),
  17. new("MDM_STD_OPERATION", "StdOpMaster", "StdOpCode", null),
  18. new("MDM_WORK_CENTER", "WorkCtrMaster", "WorkCtr", null),
  19. new("MDM_LINE", "LineMaster", "Line", null)
  20. ];
  21. public static Route? Find(string? entityCode) =>
  22. Routes.FirstOrDefault(r => string.Equals(r.EntityCode, entityCode, StringComparison.OrdinalIgnoreCase));
  23. }