Ver Fonte

接口对接

cqpCow há 9 meses atrás
pai
commit
704a77a48e

+ 11 - 0
app/Http/Controllers/Api/JRFIDController.php

@@ -138,6 +138,17 @@ class JRFIDController extends BaseController
         }
     }
 
+    public function screenGetDispatchDtData(Request $request){
+        list($bool, $data) = (new JRFIDServerService())->screenGetDispatchDtData($request->all(),$request->common_param);
+
+        if($bool){
+            return $this->json_return(200,'',$data);
+        }else{
+            if($bool === 0) return $this->json_return(401,$data);
+            return $this->json_return(201,$data);
+        }
+    }
+
     public function qualityOrders(Request $request){
         list($bool, $data) = (new JRFIDServerService())->qualityOrders($request->all(),$request->common_param);
 

+ 26 - 0
app/Service/JRFIDServerService.php

@@ -755,6 +755,32 @@ class JRFIDServerService extends Service
         return [true, $result['assembly_list']];
     }
 
+    public function screenGetDispatchDtData($data,$param){
+        if(empty($data['id'])) return [false, '数据ID不能为空'];
+        if(empty($data['type'])) return [false, 'TYPE不能为空'];
+
+        $url = config("j_rfid.screen_get_dispatch_dt_data");
+        $post = [
+            'id' => $data['id'],
+            'type' => $data['type'],
+            'contract_no' => $data['contract_no'] ?? null,
+            'drawing_no' => $data['drawing_no'] ?? null,
+        ];
+
+        list($status,$result) = $this->post_helper($url,$post,$param['header']);
+        if(! $status) return [$status, $result];
+
+        if(! empty($result['status']) && $result['status'] == 'error') return [false, $result['message']];
+        if(! empty($result['type']) && $result['type'] == 'errorVm') return [false, $result['message']];
+
+        if(! isset($result['furn_dispatch_product_dt'])) {
+            $error = $result[0]['message'] ?? "操作失败,请刷新页面";
+            return [false, $error];
+        }
+
+        return [true, $result];
+    }
+
     public function post_helper($url, $data, $header = [], $timeout = 20){
         Log::channel('apiLog')->info('工装云POST', ["api" => $url , "param" => $data ,"header" => $header]);
 

+ 2 - 0
config/j_rfid.php

@@ -31,6 +31,8 @@ return [
     'completion_orders' => 'https://gzy.qingyaokeji.com/api/module-data/furn_process_flow_dt/process_flow_dt/diy/screen_completed',
     //(扫码完工)
     'scanScreenCompleted' => 'https://gzy.qingyaokeji.com/api/module-data/furn_dispatch_order_dt/furn_dispatch_order_dt/diy/screen_completed',
+    //(根据芯片id、type、合同号、图号、工序查询派工单及其详情数据)
+    'screen_get_dispatch_dt_data' => 'https://gzy.qingyaokeji.com/api/module-data/furn_dispatch_order_dt/furn_dispatch_order_dt/diy/screen_get_dispatch_dt_data',
     //质检
     'quality_orders' => 'https://gzy.qingyaokeji.com/api/module-data/furn_process_flow_dt/process_flow_dt/diy/screen_quality',
     //打印

+ 2 - 0
routes/api.php

@@ -50,6 +50,8 @@ Route::group(['middleware'=> ['CheckJRFIDLogin']],function ($route){
     $route->any('completionOrders', 'Api\JRFIDController@completionOrders');
     //扫码完工
     $route->any('scanScreenCompleted', 'Api\JRFIDController@scanScreenCompleted');
+    //(根据芯片id、type、合同号、图号、工序查询派工单及其详情数据)
+    $route->any('screenGetDispatchDtData', 'Api\JRFIDController@screenGetDispatchDtData');
     //质检
     $route->any('qualityOrders', 'Api\JRFIDController@qualityOrders');
     //(查询合同号、图号、房间号)