cqp 3 ヶ月 前
コミット
4fbf1c244c
1 ファイル変更19 行追加1 行削除
  1. 19 1
      app/Service/SalesOrderService.php

+ 19 - 1
app/Service/SalesOrderService.php

@@ -1321,7 +1321,7 @@ class SalesOrderService extends Service
         $state_array = $this->getStateMake($data['data']);
 
         //同步用友信息
-        $u8 = (new U8ServerService())->getMessage($data_id,U8Job::two);
+        $u8 = $this->getMessage($data_id,U8Job::two);
 
         //关联施工单号
         $construction_array = $this->getConstruction($data_id);
@@ -1427,6 +1427,24 @@ class SalesOrderService extends Service
         return $data;
     }
 
+    public function getMessage($id,$type){
+        $result = U8Job::where('del_time',0)
+            ->whereIn('data',$id)
+            ->where('data_type',$type)
+            ->select('data','state','crt_time','msg')
+            ->get()->toArray();
+        $return = [];
+        foreach ($result as $value){
+            if($value['state'] == 1){
+                $return[$value['data']] = '同步成功';
+            }else{
+                $return[$value['data']] = '同步失败:' . $value['msg'];
+            }
+        }
+
+        return $return;
+    }
+
     public function getCustomer($customer_id){
         $customer_contact_map = [];
         $contact_type_id = [];