循环分配实施(数据库)

发布于 2024-07-11 07:47:20 字数 506 浏览 8 评论 0原文

我目前正在为 SalesLead 实现多种不同的分配算法<--> 销售人员情况。 总体思路非常简单:

  1. SalesLead 在公共网站上注册

  2. 代码自动生成使用循环调度将 SalesLead 分配给 SalesPerson(潜在客户以相同的顺序分配给 SalesPersons

我有一些认真的编码员- 阻止如何实际执行此操作,确保每次都以相同的顺序从数据库中提取代理,并使用另一个表来存储分配了 SalesLead 的最后一个代理(这实际上可能对构建报告有用) ,或者至少稍后有一个回溯方法)。 我离基地太远了吗?

说明:该代码目前无法将销售人员与潜在客户进行匹配。 这是一个全新的功能。 目前,他们可以注册特定的销售人员,但我们希望他们能够自动分配。

I'm currently in the process of implementing a number of different assignment algorithms for a SalesLead <--> SalesPerson situation. The general idea is quite simple:

  1. A SalesLead signs up on a public website

  2. The code automatically assigns the SalesLead to a SalesPerson using round-robin scheduling (Leads are assigned to SalesPersons in the same order)

I'm having some serious coders-block in how to actually perform this outside of making sure I pull the agents from the database in the same order each time, and using another table to store the last agent that was assigned a SalesLead (which may actually be useful for building a report, or at least having a trace-back method later on). Am I way off base?

Clarification: The code doesn't currently match a sales person to a lead. This is a completely new function. Currently they can sign up for a specific SalesPerson, but we'd like them to be able to be assigned automatically.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

像极了他 2024-07-18 07:47:21

非常简单:当创建 SalesPerson 时,给他们一个 LastActivityDate。 当他们被分配销售线索时,将该日期更新为当前日期。 将收到的销售线索提供给活动日期最近的销售人员。

可以通过 SQL 或代码轻松完成。

Pretty simple really: when a SalesPerson is created, give them a LastActivityDate. When they are assigned a SalesLead, update that date to the current date. Give a SalesLead, as it comes in, to a SalesPerson with the least recent activity date.

Can be done easily in SQL or code.

醉梦枕江山 2024-07-18 07:47:21

如果您有一个将 SalesLeads 和 SalesPersons 匹配在一起的表,并为其添加了时间戳,则不需要单独的表来跟踪最后选择的 SalesPerson。

If you have a table that matches SalesLeads and SalesPersons together and you timestamp it, you don't need a separate table to keep track of the last SalesPerson picked.

花期渐远 2024-07-18 07:47:21

在 SQL Server 中,您实际上希望它是日期时间,而不是时间戳字段,但@David 的想法是相同的。 跟踪分配给销售人员的最后一个销售线索并记录分配的时间。 然后,您可以通过查找未分配潜在客户的销售人员或最后分配的潜在客户最早的销售人员来选择要分配潜在客户的下一个销售人员。

In SQL Server you'd actually want it to be a datetime, not a timestamp field, but @David's idea is the same. Keep track of the last sales lead assigned to a sales person and record the time at which it was assigned. You can then pick the next sales person to assign a lead to by finding the sales person who does not have one assigned or the sales person whose last assigned lead is the oldest.

北城半夏 2024-07-18 07:47:21

看看 Salesforce 是如何做到的:
http://forums.sforce.com/ sforce/board/message?board.id=custom_formula&message.id=533

按销售人员的数量 + 1 修改 ID,然后将 1 分配给 Joe,2 分配给 Tom,等等。

Check out how Salesforce does it:
http://forums.sforce.com/sforce/board/message?board.id=custom_formula&message.id=533

MOD an ID by the number of salespeople + 1 and then assign 1 to Joe, 2, to Tom, etc.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文