gogs 1 ano atrás
pai
commit
f6ff093caa

+ 27 - 3
app/Http/Controllers/Api/DwyController.php

@@ -4,6 +4,7 @@ namespace App\Http\Controllers\Api;
 
 
 use App\Model\BigKingTbj;
+use App\Model\SysConfig;
 use App\Service\DwyService;
 use App\Service\EmployeeService;
 use App\Service\SysMenuService;
@@ -950,7 +951,7 @@ class DwyController extends BaseController
         file_put_contents('dwy.txt', json_encode($param) . PHP_EOL, 8);
 
         //单独的处理哪些口子不能用的逻辑
-        $url = 'http://122.112.196.99:7774/jbl/api/module-data/device/device/diy/device_code';
+        $url = 'https://tm.dwycloud.com/jbl/api/module-data/device/device/diy/device_code';
         $token = $param['token'];
         $json = ['device_code'=>$param['mac']];
         $header = [
@@ -963,6 +964,7 @@ class DwyController extends BaseController
         if(isset($box_data['data'])){
             foreach ($box_data['data'] as $d){
                 if(isset($d['status'])&&$d['status'] == 0){
+                    //这个数组重的仓库编码不需要
                     $un_box[] = $d['box_code'] ?? '';
                 }
             }
@@ -975,7 +977,7 @@ class DwyController extends BaseController
 ////
 //            return $this->test();
 //        }
-        $url = 'http://122.112.196.99:7774/jbl/api/module-data/brand_in_stock/brand_in_stock/diy/box_inventory';
+        $url = 'https://tm.dwycloud.com/jbl/api/module-data/brand_in_stock/brand_in_stock/diy/box_inventory';
         $header = [
             'Content-Type:application/json',
             'Authorization: ' . $token,
@@ -1219,7 +1221,7 @@ class DwyController extends BaseController
             'brand_out_stock_list' => $send_data
         ];
         if($send_status){
-            $url = 'http://122.112.196.99:7774/jbl/api/module-data/brand_in_stock/brand_in_stock/diy/lead_bind_out_stock';
+            $url = 'https://tm.dwycloud.com/jbl/api/module-data/brand_in_stock/brand_in_stock/diy/lead_bind_out_stock';
             $header = [
                 'Content-Type:application/json',
                 'Authorization: ' . $token,
@@ -1439,4 +1441,26 @@ class DwyController extends BaseController
         return ['status'=>200,'msg'=>'ok','data'=>[]];
     }
 
+
+    public function setAndroidVersion(Request $request){
+        $data = $request->all();
+        $type = $data['type'] ?? 'android';
+        $version = $data['version'];
+        $model = new SysConfig();
+        $model->where('type',$type)->update(
+            [
+                'value' => $version
+            ]
+        );
+        return ['status'=>200,'msg'=>'ok','data'=>[]];
+    }
+
+    public function androidVersion(Request $request){
+        $data = $request->all();
+        $type = $data['type'] ?? 'android';
+        $model = new SysConfig();
+        $v = $model->where('type',$type)->value('value');
+        return ['status'=>200,'msg'=>'ok','data'=>['version'=>$v]];
+    }
+
 }

Diferenças do arquivo suprimidas por serem muito extensas
+ 32 - 2
app/Http/Controllers/Api/TestController.php


+ 19 - 0
app/Model/SysConfig.php

@@ -0,0 +1,19 @@
+<?php
+
+namespace App\Model;
+
+use Illuminate\Database\Eloquent\Model;
+
+/**
+ * 菜单管理
+ * Class Unit
+ * @package App\Models
+ */
+class SysConfig extends Model
+{
+    protected $table = "sysconig"; //指定表
+    const CREATED_AT = null;
+    const UPDATED_AT = null;
+    protected $dateFormat = 'U';
+
+}

+ 24 - 3
app/Service/DwyService.php

@@ -10,7 +10,7 @@ namespace App\Service;
 class DwyService extends Service
 {
     private $url = 'https://tm.dwycloud.com';
-    private $url1 = 'http://122.112.196.99:7774';
+    private $url1 = 'https://tm.dwycloud.com';
 
     protected $num = 0;
 
@@ -239,6 +239,16 @@ class DwyService extends Service
 //            unset($l['brand_qr_code_list']);
 //            $l['qty'] = $l['fake_qty'];
 //            $l['brand_qr_code_list'] = $this->getValues( $code_key_data[$l['material_code']],$l['qty']);
+            $mma = $l['mat_material_a'] ?? [];
+            //"mat_material_a":{"mat_category_code_show":"免漆板1800香杉木","mat_category_code":"BC020202","cpdj_show":"尊贵型","cpdj":"cpdj01","grade_show":"E0","grade":"01"
+            if(isset($l['mat_material_a'])){
+                $l['mat_category_code_show'] = $l['mat_material_a']['mat_category_code_show'] ?? '';
+                $l['mat_category_code'] = $l['mat_material_a']['mat_category_code'] ?? '';
+                $l['cpdj'] = $l['mat_material_a']['cpdj'] ?? '';
+                $l['cpdj_show'] = $l['mat_material_a']['cpdj_show'] ?? '';
+                $l['grade_show'] = $l['mat_material_a']['grade_show'] ?? '';
+                $l['grade'] = $l['mat_material_a']['grade'] ?? '';
+            }
             $lind_bind_key_list[$l['order_item_id']] = [
                 'product_code' => $l['product_code'],
                 'product_code_show' => $l['product_code_show'],
@@ -246,11 +256,16 @@ class DwyService extends Service
                 'color' => $l['color']??'',
                 'process_title_two' => $l['process_title_two']??'',
                 'color_two' => $l['color_two']??'',
-                'mat_material_a' => $l['mat_material_a']
+                'mat_material_a' => $l['mat_material_a']??'',
+                'mat_category_code_show' => $mma['mat_category_code_show'] ?? '',
+                'mat_category_code' => $mma['mat_category_code'] ?? '',
+                'cpdj' => $mma['cpdj'] ?? '',
+                'cpdj_show' => $mma['cpdj_show'] ?? '',
+                'grade_show' => $mma['grade_show'] ?? '',
+                'grade' => $mma['grade'] ?? '',
             ];
             unset($l['fake_qty']);
         }
-
         $lead_out = $old_data['lead_out']['brand_out_stock_list'];
         foreach ($lead_out as &$ll){
             foreach ($ll['brand_out_stock_dtl'] as &$lll){
@@ -268,6 +283,12 @@ class DwyService extends Service
                 $lll['color'] = $lind_bind_key_list[$lll['bus_no']]['color'] ?? '';
                 $lll['process_title_two'] = $lind_bind_key_list[$lll['bus_no']]['process_title_two'] ?? '';
                 $lll['color_two'] = $lind_bind_key_list[$lll['bus_no']]['color_two'] ?? '';
+                $lll['mat_category_code_show'] = $lind_bind_key_list[$lll['bus_no']]['mat_category_code_show'] ?? '';
+                $lll['mat_category_code'] = $lind_bind_key_list[$lll['bus_no']]['mat_category_code'] ?? '';
+                $lll['cpdj'] = $lind_bind_key_list[$lll['bus_no']]['cpdj'] ?? '';
+                $lll['cpdj_show'] = $lind_bind_key_list[$lll['bus_no']]['cpdj_show'] ?? '';
+                $lll['grade_show'] = $lind_bind_key_list[$lll['bus_no']]['grade_show'] ?? '';
+                $lll['grade'] = $lind_bind_key_list[$lll['bus_no']]['grade'] ?? '';
             }
 
         }

+ 2 - 2
app/Service/LabelDealService.php

@@ -57,7 +57,7 @@ class LabelDealService extends Service
     public function boxOut1($lead_bind,$lead_out,$token,$id)
     {
         //商标出库
-        $url = 'http://122.112.196.99:7774/jbl/api/module-data/brand_in_stock/brand_in_stock/diy/lead_bind_out_stock';
+        $url = 'https://tm.dwycloud.com/jbl/api/module-data/brand_in_stock/brand_in_stock/diy/lead_bind_out_stock';
 //        $url = 'https://tm.dwycloud.com/jbl/api/module-data/brand_in_stock/brand_in_stock/diy/11';
         $return_out = $this->post_helper($url, $lead_out, $token);
         $return_out = json_decode($return_out, true);
@@ -67,7 +67,7 @@ class LabelDealService extends Service
 
         //商标绑定
 //        $url = 'https://tm.dwycloud.com/jbl/api/module-data/brand_in_stock/brand_in_stock/diy/1';
-        $url = 'http://122.112.196.99:7774/jbl/api/module-data/brand_in_stock/brand_in_stock/diy/lead_bind';
+        $url = 'https://tm.dwycloud.com/jbl/api/module-data/brand_in_stock/brand_in_stock/diy/lead_bind';
         $return_bind = $this->post_helper($url, $lead_bind, $token);
         $return_bind = json_decode($return_bind, true);
         Log::channel('apiLog')->info('商标绑定(返回结果)', ["message" => $return_bind]);

+ 2 - 0
routes/api.php

@@ -30,6 +30,8 @@ Route::any('maintenance', 'Api\DwyController@maintenance');
 Route::any('andriodDownload', 'Api\DwyController@andriodDownload');
 Route::any('setAndriodDownload', 'Api\DwyController@setAndriodDownload');
 Route::any('andriodUp', 'Api\DwyController@andriodUp');
+Route::any('androidVersion', 'Api\DwyController@androidVersion');
+Route::any('setAndroidVersion', 'Api\DwyController@setAndroidVersion');
 //Route::any('boxOut', 'Api\DwyController@boxOut');
 
 //贴标机

Alguns arquivos não foram mostrados porque muitos arquivos mudaram nesse diff