Kaynağa Gözat

去除二次加工数量限制

Zhouzhendong 5 yıl önce
ebeveyn
işleme
a5abdfe134

+ 62 - 0
app/Http/Controllers/api/thirdPart/haiq/StorageController.php

@@ -0,0 +1,62 @@
+<?php
+
+
+namespace App\Http\Controllers\api\thirdPart\haiq;
+
+
+use App\Services\LogService;
+use Illuminate\Support\Facades\Http;
+use Illuminate\Support\Facades\Request;
+
+class StorageController
+{
+    public function out(Request $request){
+        $bin = json_encode([
+            "taskCode" => "",
+            "binCode" => "",
+            "sequence" => 0,
+            "fromLocCode" => "",
+            "toLocCode" => "",
+        ],JSON_UNESCAPED_UNICODE);
+        $req = [
+            "groupCode" => 0,
+            "priority" => 0,
+            "taskMode" => 0,
+            "emptyBinQty" => 0,
+            "toWorkStations" => [""],
+            "bins" => [$bin],
+        ];
+
+        $req = json_encode($req, JSON_UNESCAPED_UNICODE);
+        $response = Http::post(config('api.haiq.storage.out'));
+        $msg = "haiq-料箱出库成功";
+        if ($response["code"] != 200){
+            $msg = "haiq-料箱出库失败";
+        }
+        LogService::log(__METHOD__,$msg,"REQUEST:".$req." | RESPONSE:".json_encode($response,JSON_UNESCAPED_UNICODE));
+    }
+    public function in(Request $request){
+        $stockInfo = json_encode([
+            "skuCode" => "",
+            "qty" => 0,
+        ]);
+        $req = [
+            "taskCode" => "",
+            "taskMode" => 0,
+            "binCode" => "",
+            "fromWorkStation" => "",
+            "fromLocCode" => "",
+            "toLocCode" => "",
+            "isEmpty" => 0,
+            "stockInfo" => [$stockInfo],
+        ];
+
+        $req = json_encode($req, JSON_UNESCAPED_UNICODE);
+        $response = Http::post(config('api.haiq.storage.in'));
+        $msg = "haiq-料箱回库成功";
+        if ($response["code"] != 200){
+            $msg = "haiq-料箱回库失败";
+        }
+        LogService::log(__METHOD__,$msg,"REQUEST:".$req." | RESPONSE:".json_encode($response,JSON_UNESCAPED_UNICODE));
+    }
+}

+ 7 - 0
config/api.php

@@ -29,6 +29,13 @@ return [
         ],
     ],
 
+    'haiq'=>[
+        'storage'=>[
+            'out' => "",
+            'in' => "",
+        ],
+    ],
+
     'baidu'=>[
         'speech'=>[
             'APP_ID'=> '18688250',

+ 2 - 2
resources/views/process/create.blade.php

@@ -454,7 +454,7 @@
                     if (!type)_this.sum+= Number(amount);
                     _this.processContents.some(function (processContent) {
                         if (processContent.wms_code==wms_code && processContent.commodity_id==commodity_id && processContent.type==type) {
-                            processContent.commodities.every(function (commodity) {
+                            /*processContent.commodities.every(function (commodity) {
                                 if (commodity.id===commodity_id && commodity.amount<amount){
                                     tempTip.setDuration(2000);
                                     tempTip.show("数量不得超出原有数量!");
@@ -463,7 +463,7 @@
                                 }
                                 return true;
                             });
-                            if (is_return)return true;
+                            if (is_return)return true;*/
                             _this._addSignCommodity(wms_code,processContent.commodity_id,type);
                             processContent.addBtnShow=false;
                             processContentTemp=Object.assign({},processContent);