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
+2
View File
@@ -12,3 +12,5 @@
/windows.php /windows.php
/bootstrap.php /bootstrap.php
/composer.lock /composer.lock
.env_copy
/public/excel
@@ -1,6 +1,6 @@
<?php <?php
namespace app\inquery\command; namespace app\command;
use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputInterface;
@@ -13,9 +13,9 @@ use Webman\RedisQueue\Redis as RedisQueueRedis;
/** /**
* 轮询分配 inquiry_log 里的询盘给业务员,并推送到 CRM 队列 * 轮询分配 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 队列'; protected static $defaultDescription = '轮询分配询盘给业务员,并推送到 CRM 队列';
/** /**
@@ -23,9 +23,25 @@ class AssignInquiryCommand extends Command
* 比如:销售1=186,销售2=233... * 比如:销售1=186,销售2=233...
*/ */
protected const SALES_USER_IDS = [ protected const SALES_USER_IDS = [
1, 63,
74, 64,
78, 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 protected function execute(InputInterface $input, OutputInterface $output): int
{ {
@@ -72,7 +88,7 @@ class AssignInquiryCommand extends Command
foreach ($inquiries as $row) { foreach ($inquiries as $row) {
$inquiryId = (int)$row->id; $inquiryId = (int)$row->id;
sleep(1);
// 轮询取出一个业务员 ID // 轮询取出一个业务员 ID
$recipientUserId = $this->nextRecipientId($userIds, static::ROUND_ROBIN_GROUP_KEY); $recipientUserId = $this->nextRecipientId($userIds, static::ROUND_ROBIN_GROUP_KEY);
@@ -1,8 +1,8 @@
<?php <?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\Command\Command;
use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Output\OutputInterface;
@@ -11,9 +11,9 @@ use support\Db;
/** /**
* 将 fb_leads 数据清洗后导入 inquiry_log * 将 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'; protected static $defaultDescription = '将 fb_leads 数据清洗后导入 inquiry_log';
// 这些常量根据你实际业务改 // 这些常量根据你实际业务改
@@ -1,6 +1,6 @@
<?php <?php
namespace app\inquery\command; namespace app\command;
use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputInterface;
@@ -8,12 +8,12 @@ use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Output\OutputInterface;
use support\Db; use support\Db;
use PhpOffice\PhpSpreadsheet\IOFactory; use PhpOffice\PhpSpreadsheet\IOFactory;
use app\inquery\utils\FbLeadHeaderMapper; use app\inquiry\utils\FbLeadHeaderMapper;
use support\exception\BusinessException; 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 static $defaultDescription = '导入 Facebook Leads Excel 数据';
protected function configure(): void protected function configure(): void
+1 -1
View File
@@ -1,6 +1,6 @@
<?php <?php
namespace app\inquery\utils; namespace app\inquiry\utils;
use support\exception\BusinessException; use support\exception\BusinessException;
+1 -1
View File
@@ -1,6 +1,6 @@
<?php <?php
namespace app\inquery\utils; namespace app\inquiry\utils;
use support\Db; use support\Db;
+1 -1
View File
@@ -1,6 +1,6 @@
<?php <?php
namespace app\inquery\utils; namespace app\inquiry\utils;
use support\Redis; use support\Redis;
use support\exception\BusinessException; use support\exception\BusinessException;
+2 -1
View File
@@ -48,7 +48,8 @@
"webman/gateway-worker": "^1.0", "webman/gateway-worker": "^1.0",
"mpdf/mpdf": "^8.2", "mpdf/mpdf": "^8.2",
"jaeger/querylist": "^4.4", "jaeger/querylist": "^4.4",
"zoujingli/ip2region": "^3.0" "zoujingli/ip2region": "^3.0",
"webman/log": "^2.1"
}, },
"suggest": { "suggest": {
"ext-event": "For better performance. " "ext-event": "For better performance. "
Generated
+403 -308
View File
File diff suppressed because it is too large Load Diff
+19
View File
@@ -0,0 +1,19 @@
<?php
return [
'enable' => true,
'exception' => [
// 是否记录异常到日志
'enable' => true,
// 不会记录到日志的异常类
'dontReport' => [
support\exception\BusinessException::class
]
],
'dontReport' => [
'app' => [],
'controller' => [],
'action' => [],
'path' => []
],
'channel' => 'default' // 日志通道(在config/log.php里配置,默认是default)
];
+21
View File
@@ -0,0 +1,21 @@
<?php
/**
* This file is part of webman.
*
* Licensed under The MIT License
* For full copyright and license information, please see the MIT-LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @author walkor<walkor@workerman.net>
* @copyright walkor<walkor@workerman.net>
* @link http://www.workerman.net/
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
use Webman\Log\Middleware;
return [
'@' => [
Middleware::class
]
];