作者 刘锟

合并分支 'akun' 到 'master'

Akun



查看合并请求 !1376
@@ -214,4 +214,23 @@ class InquiryForwardController extends BaseController @@ -214,4 +214,23 @@ class InquiryForwardController extends BaseController
214 $lists = $inquiryForwardLogic->getInquiryDetailLists($this->map, $this->page, $this->row, $this->order); 214 $lists = $inquiryForwardLogic->getInquiryDetailLists($this->map, $this->page, $this->row, $this->order);
215 $this->response('success', Code::SUCCESS, $lists); 215 $this->response('success', Code::SUCCESS, $lists);
216 } 216 }
  217 +
  218 + /**
  219 + * 停止转发
  220 + * @param InquiryForwardLogic $inquiryForwardLogic
  221 + * @author Akun
  222 + * @date 2025/03/10 10:59
  223 + */
  224 + public function stopForwardInquiry(InquiryForwardLogic $inquiryForwardLogic)
  225 + {
  226 + $this->request->validate([
  227 + 'id' => 'required',
  228 + ], [
  229 + 'id.required' => 'ID不能为空',
  230 + ]);
  231 +
  232 + $inquiryForwardLogic->stopInquiry();
  233 +
  234 + $this->response('success');
  235 + }
217 } 236 }
@@ -12,6 +12,7 @@ use App\Models\Inquiry\InquiryInfo; @@ -12,6 +12,7 @@ use App\Models\Inquiry\InquiryInfo;
12 use App\Models\Inquiry\InquiryProject; 12 use App\Models\Inquiry\InquiryProject;
13 use App\Models\Inquiry\InquiryProjectRoute; 13 use App\Models\Inquiry\InquiryProjectRoute;
14 use App\Models\Inquiry\InquiryRelayDetail; 14 use App\Models\Inquiry\InquiryRelayDetail;
  15 +use App\Models\Inquiry\InquiryRelayDetailLog;
15 use Illuminate\Support\Arr; 16 use Illuminate\Support\Arr;
16 use Illuminate\Support\Facades\DB; 17 use Illuminate\Support\Facades\DB;
17 use Illuminate\Support\Str; 18 use Illuminate\Support\Str;
@@ -385,4 +386,23 @@ class InquiryForwardLogic extends BaseLogic @@ -385,4 +386,23 @@ class InquiryForwardLogic extends BaseLogic
385 $lists = $model->listsWith($map, $page, $row, $order, $filed, 'desc', ['detailLog']); 386 $lists = $model->listsWith($map, $page, $row, $order, $filed, 'desc', ['detailLog']);
386 return $this->success($lists); 387 return $this->success($lists);
387 } 388 }
  389 +
  390 + /**
  391 + * 停止转发
  392 + * @return array
  393 + * @throws \App\Exceptions\AsideGlobalException
  394 + * @throws \App\Exceptions\BsideGlobalException
  395 + * @author Akun
  396 + * @date 2025/03/10 11:00
  397 + */
  398 + public function stopInquiry()
  399 + {
  400 + $model = new InquiryRelayDetailLog();
  401 + $rs = $model->edit(['status' => InquiryRelayDetailLog::STATUS_STOP], ['detail_id' => $this->param['id']]);
  402 +
  403 + if ($rs === false) {
  404 + $this->fail('设置失败');
  405 + }
  406 + return $this->success();
  407 + }
388 } 408 }
@@ -23,11 +23,12 @@ class InquiryRelayDetailLog extends Base @@ -23,11 +23,12 @@ class InquiryRelayDetailLog extends Base
23 protected $table = 'gl_inquiry_relay_detail_log'; 23 protected $table = 'gl_inquiry_relay_detail_log';
24 24
25 /** 25 /**
26 - * 任务状态, 0:未发送,1:发送中,2:发送成功,9:发送失败 26 + * 任务状态, 0:未发送,1:发送中,2:发送成功,8:停止发送,9:发送失败
27 */ 27 */
28 const STATUS_INIT = 0; 28 const STATUS_INIT = 0;
29 const STATUS_PEND = 1; 29 const STATUS_PEND = 1;
30 const STATUS_SUCCESS = 2; 30 const STATUS_SUCCESS = 2;
  31 + const STATUS_STOP = 8;
31 const STATUS_FAIL = 9; 32 const STATUS_FAIL = 9;
32 33
33 /** 34 /**