This commit is contained in:
mzl
2025-12-10 12:15:17 +00:00
parent 460de92912
commit ba7c00e942
11 changed files with 482 additions and 328 deletions
@@ -1,6 +1,6 @@
<?php
namespace app\inquery\command;
namespace app\command;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
@@ -13,9 +13,9 @@ use Webman\RedisQueue\Redis as RedisQueueRedis;
/**
* 轮询分配 inquiry_log 里的询盘给业务员,并推送到 CRM 队列
*/
class AssignInquiryCommand extends Command
class InquiryAssignInquiryCommand extends Command
{
protected static $defaultName = 'assign-inquiry';
protected static $defaultName = 'iq-assign';
protected static $defaultDescription = '轮询分配询盘给业务员,并推送到 CRM 队列';
/**
@@ -23,9 +23,25 @@ class AssignInquiryCommand extends Command
* 比如:销售1=186,销售2=233...
*/
protected const SALES_USER_IDS = [
1,
74,
78,
63,
64,
67,
93,
108,
132,
143,
145,
157,
160,
168,
172,
173,
191,
193,
194,
195,
196,
197
];
/**
@@ -36,7 +52,7 @@ class AssignInquiryCommand extends Command
/**
* 每次脚本最多分配多少条
*/
protected const BATCH_LIMIT = 100;
protected const BATCH_LIMIT = 10;
protected function execute(InputInterface $input, OutputInterface $output): int
{
@@ -72,7 +88,7 @@ class AssignInquiryCommand extends Command
foreach ($inquiries as $row) {
$inquiryId = (int)$row->id;
sleep(1);
// 轮询取出一个业务员 ID
$recipientUserId = $this->nextRecipientId($userIds, static::ROUND_ROBIN_GROUP_KEY);
@@ -1,8 +1,8 @@
<?php
namespace app\inquery\command;
namespace app\command;
use app\inquery\utils\PhoneCountryHelper;
use app\inquiry\utils\PhoneCountryHelper;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
@@ -11,9 +11,9 @@ use support\Db;
/**
* 将 fb_leads 数据清洗后导入 inquiry_log
*/
class FbLeadToInquiryCommand extends Command
class InquiryFbLeadCommand extends Command
{
protected static $defaultName = 'fb-to-inquiry';
protected static $defaultName = 'iq-fb-to';
protected static $defaultDescription = '将 fb_leads 数据清洗后导入 inquiry_log';
// 这些常量根据你实际业务改
@@ -1,6 +1,6 @@
<?php
namespace app\inquery\command;
namespace app\command;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
@@ -8,12 +8,12 @@ use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use support\Db;
use PhpOffice\PhpSpreadsheet\IOFactory;
use app\inquery\utils\FbLeadHeaderMapper;
use app\inquiry\utils\FbLeadHeaderMapper;
use support\exception\BusinessException;
class ImportFbCommand extends Command
class InquiryImportFbCommand extends Command
{
protected static $defaultName = 'import-fb';
protected static $defaultName = 'iq-fb';
protected static $defaultDescription = '导入 Facebook Leads Excel 数据';
protected function configure(): void
+1 -1
View File
@@ -1,6 +1,6 @@
<?php
namespace app\inquery\utils;
namespace app\inquiry\utils;
use support\exception\BusinessException;
+1 -1
View File
@@ -1,6 +1,6 @@
<?php
namespace app\inquery\utils;
namespace app\inquiry\utils;
use support\Db;
+1 -1
View File
@@ -1,6 +1,6 @@
<?php
namespace app\inquery\utils;
namespace app\inquiry\utils;
use support\Redis;
use support\exception\BusinessException;