概括工单

Generalizing work orders

你好 Whosebugians,

我正在为工单设计 tables。

问题:

需要什么

约束

做了什么

将所有工单及其详细信息设计为以工单编号为母节点的层次结构。

WorkOrderTable (ID, ParentID, Type, Value)

工单示例

ID  ParentID    Type        Value
38  0           Num         327
39  38          Sector      21
40  38          Sector      22
43  40          Product     NS
44  40          Product     MS
50  40          Temp        RAS
48  44          Quantity    60
47  43          Quantity    25
41  39          Product     ARF
42  39          Product     BRF
49  39          Temp        RAS
51  39          Cible       Acarien A.
46  42          Quantity    30
52  42          Cible       Acarien B.
45  41          Quantity    20

问题

我正在做的事情 good/efficient 易于维护还是有其他想法?

更新一:更多细节

State of the design

  • Specific tables for participants sectors,people,machines...
  • Meta-data table (ID, meta-data, lvl). Example :

    • Sector, 1 (directly to WO)
    • Tank Storage, 1
    • Product, 2 (can be part of sector job not directly to WO) sd
  • Work Order table (ID, parentID, metadataID, valueID) the value ID is taken from the participants table

关于 XML 我对如何存储和操作它们一无所知。

我想如果你在寻找设计建议,你应该去元堆栈组,即 code review exchange

话虽如此,您征求有关设计的建议,但只提供抽象信息。一个系统的规模,量CRUD expected, and several other factors need to be considered in design. With out getting the details and targets its really hard to answer your question. There are trade offs with different approaches. It may even be advisable to use a nosql solution

话虽这么说,我还是建议不要构建自己的 ERP 系统,而是从供应商那里购买一个特定于行业的系统,然后将您的定制应用于它。

编写自己的系统非常昂贵,保持更新、增加安全性和许多其他功能使得从软件供应商处购买是一个值得的商业决策。

如果您只是想通过编写本文获得更多经验,我建议您浏览 github 和前面提到的堆栈交换。

在不知道任何数字和进一步了解您的需求的情况下,不可能提供好的建议。这是我想到的一些问题

  • 有多少用户?
  • 有多少 products/locations/sectors/people...?
    • 这是在更改数据吗?
  • 有多少口碑?
  • 如何是一个典型的口碑?
  • 它是一个普通的树层次结构吗
    • 如果没有:是否有替代路线、圈子、岛屿?
  • 这些 WOM 是修复了还是改变了?
    • 如果更改:您需要版本控制吗?

看起来像是在尝试重新发明一个专业的 ERP 系统。正如 Bostwick 已经告诉您的那样,您应该考虑使用现有的...

只是一些一般提示: