cqpCow пре 1 година
родитељ
комит
a0b2fd19ac
4 измењених фајлова са 45 додато и 0 уклоњено
  1. 11 0
      app/Http/Controllers/Api/JRFIDController.php
  2. 31 0
      app/Service/JRFIDServerService.php
  3. 2 0
      config/j_rfid.php
  4. 1 0
      routes/api.php

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

@@ -149,6 +149,17 @@ class JRFIDController extends BaseController
         }
     }
 
+    public function screenPrintSepData(Request $request){
+        list($bool, $data) = (new JRFIDServerService())->screenPrintSepData($request->all());
+
+        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);
 

+ 31 - 0
app/Service/JRFIDServerService.php

@@ -454,6 +454,37 @@ class JRFIDServerService extends Service
         return [true, ''];
     }
 
+    public function screenPrintSepData($data){
+        if(empty($data['id'])) return [false, '数据ID不能为空'];
+        if(empty($data['type'])) return [false, 'TYPE不能为空'];
+
+        $rsaService = new RsaEncryptionService();
+        $dataToEncrypt = [
+            'id' => $data['id'],
+            'type' => $data['type']
+        ];
+        $this->recKSort($dataToEncrypt);
+
+        //加密
+        $encryptedData = $rsaService->encrypt2($dataToEncrypt);
+
+        $url = config("j_rfid.screen_print_sep_data");
+
+        Log::channel('apiLog')->info('工装云POST:源数据', ["api" => $url , "param" => $dataToEncrypt]);
+
+        $post = [
+            'body' => $encryptedData,
+        ];
+
+        list($status,$result) = $this->post_helper($url,$post,['Content-Type:application/json']);
+        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']];
+
+        return [true, ''];
+    }
+
     public function getE8AndUTC(){
         $eastEightTimeZone = new \DateTimeZone('Asia/Shanghai'); // 东八区时区
         $utcTimeZone = new \DateTimeZone('UTC'); // UTC时区

+ 2 - 0
config/j_rfid.php

@@ -31,6 +31,8 @@ return [
     'quality_orders' => 'https://gzy.qingyaokeji.com/api/module-data/furn_process_flow_dt/process_flow_dt/diy/screen_quality',
     //打印
     'screen_print' => 'https://gzy.qingyaokeji.com/api/module-data/furn_process_flow_dt/process_flow_dt/diy/screen_print',
+    //打印芯片—修改拆单及详情打印信息
+    'screen_print_sep_data' => 'https://gzy.qingyaokeji.com/api/module-data/furn_separate_order_dt/furn_separate_order_dt/diy/screen_print_sep_data',
     //(查询合同号、图号、房间号)
     'get_contract_draw_room' => 'https://gzy.qingyaokeji.com/api/module-data/sales_order/sales_order/diy/get_contract_draw_room',
     //(根据合同号、图号、房间号查询工艺流程单数据)

+ 1 - 0
routes/api.php

@@ -23,6 +23,7 @@ Route::any('getSite', 'Api\JRFIDController@getSite');
 Route::any('getPrintData', 'Api\JRFIDController@getPrintData');
 Route::any('getSepOrderDtData', 'Api\JRFIDController@getPrintData2');
 Route::any('screenPrint', 'Api\JRFIDController@screenPrint');
+Route::any('screenPrintSepData', 'Api\JRFIDController@screenPrintSepData');
 Route::any('pdfLogo', 'Api\ThirdController@pdfLogo');
 Route::any('pdfData', 'Api\ThirdController@pdfData');