orderRule($data); if(!$status) return [$status,$msg]; //操作人 $data['user_name'] = $user['emp_name']; // dd((new U8ServerService())->U8PO_PomainSave($data['id'])); try{ $job = ProcessDataJob::dispatch($data)->onQueue($data['job']); if(! $job) return [false,'任务没有进入队列!']; }catch (\Throwable $e){ return [false,$e->getMessage()]; } return [true,'']; } public function orderRule(&$data){ if(empty($data['type'])) return [false,'type不能为空!']; if(! in_array($data['type'],U8Job::$type)) return [false,'type不能存在!']; if(empty($data['id'])) return [false,'同步数据不能为空!']; $data['job'] = U8Job::$job[$data['type']] ?? ""; if(empty($data['job'])) return [false,'未找到同步任务!']; if($data['type'] == U8Job::one){ //采购同步校验 $bool = PurchaseOrder::whereIn('id',$data['id']) ->where('del_time',0) ->where('supplier',0) ->exists(); if($bool) return [false,'同步的采购单供应商不能为空!']; } return [true, '']; } }