cqpCow 8 mesi fa
parent
commit
d3a959ea02

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

@@ -182,6 +182,17 @@ class JRFIDController extends BaseController
         }
     }
 
+    public function screenGetSepData(Request $request){
+        list($bool, $data) = (new JRFIDServerService())->screenGetSepData($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 getContractDrawRoom(Request $request){
         list($bool, $data) = (new JRFIDServerService())->getContractDrawRoom($request->all(),$request->common_param);
 
@@ -226,6 +237,17 @@ class JRFIDController extends BaseController
         }
     }
 
+    public function screenAutoCreateDispatch(Request $request){
+        list($bool, $data) = (new JRFIDServerService())->screenAutoCreateDispatch($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 screenReceipt(Request $request){
         list($bool, $data) = (new JRFIDServerService())->screenReceipt($request->all(),$request->common_param);
 

+ 47 - 0
app/Service/JRFIDServerService.php

@@ -1047,6 +1047,53 @@ class JRFIDServerService extends Service
         return [true, $result];
     }
 
+    public function screenAutoCreateDispatch($data,$param){
+        if(empty($data['type'])) return [false, '类型不能为空'];
+        if(empty($data['id'])) return [false, 'ID不能为空'];
+        $post = [
+            'type' => $data['type'],
+            'id' => $data['id'],
+        ];
+        $url = config("j_rfid.screenAutoCreateDispatch");
+        if(! empty($data['procedure'])) $post['procedure'] = $data['procedure'];
+
+        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['msg']];
+
+        if(! isset($result['success'])) {
+            $error = $result[0]['message'] ?? "操作失败,请刷新页面";
+            return [false, $error];
+        }
+
+        return [true, ''];
+    }
+
+    public function screenGetSepData($data,$param){
+        if(empty($data['id'])) return [false, '数据ID不能为空'];
+        if(empty($data['type'])) return [false, 'TYPE不能为空'];
+
+        $url = config("j_rfid.screenGetSepData");
+        $post = [
+            'id' => $data['id'],
+            'type' => $data['type'],
+        ];
+
+        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_sep_order_dt_assem_list'])) {
+            $error = $result[0]['message'] ?? "操作失败,请刷新页面";
+            return [false, $error];
+        }
+
+        return [true, $result['furn_sep_order_dt_assem_list']];
+    }
+
     public function post_helper($url, $data, $header = [], $timeout = 20){
         Log::channel('apiLog')->info('工装云POST', ["api" => $url , "param" => $data ,"header" => $header]);
 

+ 4 - 0
config/j_rfid.php

@@ -69,4 +69,8 @@ return [
     'sendOrderDtAssemList' => 'https://gzy.qingyaokeji.com/api/module-data/send_order_dt_assem_list/page',
     //包装单列表
     'packageList' => 'https://gzy.qingyaokeji.com/api/module-data/package_list/page',
+    //没有查询到的派工单详情数据自动生成
+    'screenAutoCreateDispatch' => 'https://gzy.qingyaokeji.com/api/module-data/furn_dispatch_order_dt/furn_dispatch_order_dt/diy/screen_auto_create_dispatch',
+    //根据芯片id查找拆单相关数据
+    'screenGetSepData' => 'https://gzy.qingyaokeji.com/api/module-data/furn_separate_order_dt/furn_separate_order_dt/diy/screen_get_sep_data',
 ];

+ 4 - 0
routes/api.php

@@ -84,4 +84,8 @@ Route::group(['middleware'=> ['CheckJRFIDLogin']],function ($route){
     $route->any('sendOrderDtAssemList', 'Api\JRFIDController@sendOrderDtAssemList');
     //包装单列表
     $route->any('packageList', 'Api\JRFIDController@packageList');
+    //没有查询到的派工单详情数据自动生成
+    $route->any('screenAutoCreateDispatch', 'Api\JRFIDController@screenAutoCreateDispatch');
+    //根据芯片id查找拆单相关数据
+    $route->any('screenGetSepData', 'Api\JRFIDController@screenGetSepData');
 });