Selaa lähdekoodia

Merge branch 'zengjun' of ssh://was.baoshi56.com:10022/var/git/bswas

LD 5 vuotta sitten
vanhempi
commit
19b7454ddd

+ 20 - 1
app/Http/Controllers/api/thirdPart/hengli/PackageController.php

@@ -4,7 +4,6 @@
 namespace App\Http\Controllers\api\thirdPart\hengli;
 
 use App\Http\Controllers\api\thirdPart\weight\WeightBaseController;
-use App\Log;
 use Illuminate\Http\Request;
 
 class PackageController extends WeightBaseController
@@ -83,4 +82,24 @@ class PackageController extends WeightBaseController
         return json_encode(['success'=>false,'message'=> $e->getMessage],JSON_UNESCAPED_UNICODE);
     }
 
+    public function validator(Request $request): array
+    {
+        $params = $this->conversionRequest($request);
+        $errors = [];
+        $weight = $this->getWeightValue($params);
+        if(empty($weight) || $weight == ''){
+            $errors['weight'] = '称重重量为空';
+        }
+        $code = $this->getCodeValue($params);
+        $code = trim($code,"'");
+        if(empty($code) || $code == ''){
+            $errors['code'] = '快递单号为空';
+        }
+        $hid = $this->getValue($this->hid, $params);
+        if(empty($hid) || $hid == ''){
+            $errors['hid'] =  '称重设备号不能为空';
+        }
+        return $errors;
+    }
+
 }

+ 35 - 0
database/migrations/2021_04_09_141901_add_authority_to_rejected.php

@@ -0,0 +1,35 @@
+<?php
+
+use App\Authority;
+use Illuminate\Database\Migrations\Migration;
+
+class AddAuthorityToRejected extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        if(!Authority::query()->where('alias_name','退货管理-客户不可见')->exists()){
+            Authority::query()->create([
+                'name' => '退货管理-客户不可见',
+                'alias_name' => '退货管理-客户不可见',
+                'permission' => '禁止',
+            ]);
+        }
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        if(Authority::query()->where('alias_name','退货管理-客户不可见')->exists()){
+            Authority::query()->where('alias_name' ,'退货管理-客户不可见')->delete();
+        }
+    }
+}

+ 2 - 0
resources/views/rejected/search/general.blade.php

@@ -28,6 +28,7 @@
                 @can('退货管理-编辑')
                     <span class="btn btn-sm btn-outline-dark" @click="finishAll" style="cursor: pointer">完结</span>
                 @endcan
+                @cannot('退货管理-客户不可见')
                 <span class="dropdown">
                     <button class="btn btn-outline-dark btn-sm form-control-sm dropdown-toggle tooltipTarget"
                             data-toggle="dropdown" title="将勾选记录的入库状态设定为是或否,仅对未完结状态的记录有效">
@@ -41,6 +42,7 @@
                         <a class="dropdown-item" @click="setIsLoaded_batch(4)" href="javascript:">待确认</a>
                     </div>
                 </span>
+                @endcannot
 
                 @can('退货管理-编辑')
                     <a class="btn btn-sm btn-outline-dark" href="{{url('rejected/importRejectedNumber')}}" style="cursor: pointer">导入修改</a>

+ 3 - 1
resources/views/rejected/search/menu.blade.php

@@ -6,9 +6,11 @@
                     <a target="rejected/index/general" class="nav-link" href="{{url('rejected/index/general')}}" :class="{active:isActive('general',3)}">一般</a>
                 </li> @endcan
             @can('退货管理-查询')
+                @cannot('退货管理-客户不可见')
                 <li class="nav-item">
                     <a target="rejected/index/analyze" class="nav-link" href="{{url('rejected/index/analyze')}}" :class="{active:isActive('analyze',3)}">统计</a>
-                </li> @endcan
+                </li>@endcannot
+            @endcan
         </ul>
     </div>
 </div>

+ 2 - 1
tests/webApi/thirdPart/hengli/PackageController.http

@@ -8,7 +8,8 @@
 GET http://bswas/api/thirdPart/hengli/weight/new
 Content-Type: application/json
 
-{"hengli0012,75453499307751,0_12,2021\/04\/01_10:29:17":null}
+//{"hengli0012,75453499307751,0_12,2021\/04\/01_10:29:17":null}
+{"hengli0012,'',0_12,2021\/04\/01_10:29:17":null}
 ###