通知
This commit is contained in:
parent
612306d1d9
commit
79f6f4e821
|
|
@ -25,6 +25,7 @@ class NoticeLogic
|
|||
|
||||
public function callIt($log)
|
||||
{
|
||||
try {
|
||||
$dispatch = OrderDispatch::get($log->dispatch_id);
|
||||
//1=派单,2=提前通知,3=超时通知
|
||||
$ttsCode = null;
|
||||
|
|
@ -51,7 +52,7 @@ class NoticeLogic
|
|||
$log->content = 'TTSID为空';
|
||||
$log->save();
|
||||
}
|
||||
try {
|
||||
|
||||
$reponse = DyvmsService::getInstance()->call($dispatch->worker_tel, $ttsCode, md5(time()));
|
||||
|
||||
if($reponse->statusCode == 200 && $reponse->body->code == 'OK'){
|
||||
|
|
|
|||
35
application/common/command/CheckTTSTaskCommand.php
Normal file
35
application/common/command/CheckTTSTaskCommand.php
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
<?php
|
||||
|
||||
namespace app\common\command;
|
||||
|
||||
use app\admin\model\Message;
|
||||
use app\admin\model\OrderDispatch;
|
||||
use app\admin\model\OrderDispatchRecord;
|
||||
|
||||
use app\admin\model\TtsLog;
|
||||
use app\common\Logic\NoticeLogic;
|
||||
use think\console\Command;
|
||||
use think\console\Input;
|
||||
use think\console\Output;
|
||||
|
||||
class CheckTTSTaskCommand extends Command
|
||||
{
|
||||
protected function configure()
|
||||
{
|
||||
$this->setName('check:dispatch-tts-task')
|
||||
->setDescription('任务语音任务,每分钟执行一次');
|
||||
}
|
||||
|
||||
protected function execute(Input $input, Output $output){
|
||||
$Model = new TtsLog();
|
||||
$ttsService = new NoticeLogic();
|
||||
$Model->where('status','=',OrderDispatch::STATUS_CLOCK)
|
||||
->where('tts_notice','<',3)
|
||||
->chunk(100, function ($list)use($ttsService) {
|
||||
foreach ($list as $item) {
|
||||
$ttsService->callIt($item);
|
||||
}
|
||||
});
|
||||
$output->info('OVER');
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user