如何设置有关共享项目的组织特定数据元素? [英] How to setup organization specific data elements about shared items?

查看:73
本文介绍了如何设置有关共享项目的组织特定数据元素?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

第一篇文章,请提供帮助。

First post, please be kind.

注意:我已经审查了条目#20856(如何实施标记),但是由于我正在考虑的标签方法在我的应用中特定于组织。我希望有人可以确定我要去的方向或指出其他选择。

NOTE: I have reviewed entry #20856 (how to implement tagging) but feel this is different due to the fact that the tags method I'm considering is organization specific in my app. I’m hoping someone can confirm the direction I’m going or point out some other options.

(背景)我们正在构建一个Web应用程序,该应用程序可以使不同组织看到他们在不同位置的广告资源。该数据库存储用户,组织,站点和项目,并且存在从站点和项目到组织的链接,这些链接使我们能够确定向哪些用户显示哪些项目/站点(基于他们的组织)。

(background) We are building a web application that gives different organizations visibility to their inventory in different locations. The database stores users, organizations, sites, and items and there are links from sites and items to organizations that allow us to determine which items / sites to show to which users (based on their organization).

两个(或多个)组织通常希望使用门户来检查(例如)洛杉矶仓库中Widget A的库存状态。那部分很好。但是,不同的组织还跟踪有关小部件A的唯一信息。例如,组织1希望跟踪每个项目的颜色,数量和主要供应商。组织2希望跟踪每个项目的颜色,库存类型,库存周期,买方代码。我想避免出现这样的情况,即必须将所有可能的字段装入表,然后找出哪些组织使用哪些字段。

It is common for two (or more) organizations to want to use the portal to check on the stock status of (for example) Widget A in the Los Angeles Warehouse. That part is fine. However, the different organizations also track unique information about Widget A. For example, Org 1 wants to track the color, volume, and primary vendor for each item. Org 2 wants to track Color, Stock Type, Inventory Cycle, Buyer Code for each item. I want to avoid a situation where I have to have a table loaded with all these possible fields and then figure out which organizations use which fields.

我正在考虑使用某些内容沿着标记行,但添加了标记类别,并在组织级别定义了标记类别。因此,基本表结构将类似于:

I’m considering using something along the lines of tags, but adding a tag category, and having the tag category be defined at the Org level. So, the basic table structure would be something like:

表:OrgTagCategory

字段:OrgId,TagCategoryId,CategoryTitle

Table: OrgTagCategory
Fields: OrgId, TagCategoryId, CategoryTitle

表:OrgTag

字段:OrgId,TagCategoryId,TagId,TagTitle

Table: OrgTag
Fields: OrgId, TagCategoryId, TagId, TagTitle

表:OrgItemTag

字段:OrgId,ItemId,TagId

Table: OrgItemTag
Fields: OrgId, ItemId, TagId

然后,当用户登录主仪表板时,网格将包括其适当的项目字段,作为网格中的列。因此,从上面的示例中,组织1将看到项目号,描述(将全部显示),颜色,数量和主要供应商。组织2将显示项目编号,描述,颜色,库存类型,库存周期,购买者代码。

Then, when the user logged in the main dashboard the grid would include their appropriate item fields as columns in the grid. So, from above example, Org 1 would see Item#, Description (would be shown for all), color, volume, and primary vendor. Org 2 would be shown Item#, Description, Color, Stock Type, Inventory Cycle, Buyer Code.

我对此是否考虑过多,或者是否有更简单的方法来做到这一点我迷路了?衷心感谢所有想法/反馈。

Am I overthinking this or is there a simpler method of doing this that I’m missing? All thoughts / feedback sincerely appreciated.

推荐答案

应该没问题,但是您要存储 OrgId 是多余的。标签和组织之间似乎也可能有一些重叠(实际上可能是很多重叠)。

That should be no problem, but you're storing the OrgId redundantly. Also it seems like there could be some overlap (probably a lot of overlap, realistically) between tags and orgs.

这是我的处理方式:


  • 表:OrgTag

  • Table: OrgTag

字段:OrgId,TagId

Fields: OrgId, TagId

表:标签

字段:TagId,TagTitle

Fields: TagId, TagTitle

表:ItemTag

字段:ItemId,TagId

Fields: ItemId, TagId

通过这种方式,每个组织都与其感兴趣的标签相关联,但是您没有多余的标签。多个组织使用的给定标记仅在OrgTag中获得一堆行,而不是在具有相同TagTitle的Tag中获得多行。

This way each org is associated with the tags it's interested in, but you don't have redundant tags. A given tag that's used by multiple orgs just gets a bunch of rows in OrgTag, instead of multiple rows in Tag with the same TagTitle.

您只需要一个表 OrgTagCategory (如果每个组织有多个标签类别)。但是您没有将这种额外的关联描述为必要条件。

You'd only need a table OrgTagCategory if there were multiple tag categories per org. But you haven't described this extra association as a requirement.

这篇关于如何设置有关共享项目的组织特定数据元素?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆