Переглянути джерело

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

LD 5 роки тому
батько
коміт
2d35f6f300

+ 77 - 9
app/Http/Controllers/TestController.php

@@ -60,11 +60,14 @@ use App\Warehouse;
 use App\Waybill;
 use App\WaybillPriceModel;
 use Carbon\Carbon;
+use Exception;
+use GuzzleHttp\Client;
 use Illuminate\Database\Eloquent\Builder;
 use Illuminate\Support\Facades\Auth;
 use Illuminate\Support\Facades\Cache;
 use Illuminate\Http\Request;
 use Illuminate\Support\Facades\DB;
+use Illuminate\Support\Facades\Http;
 use Illuminate\Support\Str;
 use Maatwebsite\Excel\Facades\Excel;
 use Ramsey\Collection\Collection;
@@ -106,18 +109,83 @@ class TestController extends Controller
             app(BatchUpdateService::class)->batchUpdate('inventory_accounts', $updateParams);
         }
     }
+    public function zui(){
+
+        $d = ["ada","超管","hospital_1","测试","hospital_5"];
+        $a = [];
+        foreach ($d as $item){
+            $arr = explode("_",$item);
+            if (count($arr) === 2 && $arr[0] == 'hospital' && is_numeric($arr[1]))$a[] = $arr[1];
+        }
+        dd($a);
+    }
     public function zzd()
     {
-        $a = DB::connection("oracle")->select(DB::raw("select * from DOC_WAVE_DETAILS where WAVENO = 'W201210000112'"));
-        $str="";
-        $a = array_column($a,"orderno");
-        foreach ($a as $t){
-            $str.="'".$t."',";
+        $post=Http::post("http://localhost:9722",["type"=>"base","format"=>[
+            "method"=>"warpText",
+            "mergeColumn"=>["column"],
+            "mergeRow"=>["row"=>"row"],
+            "datum"=>"datum",
+        ],"connection"=>[
+            "driver"=>"mysql",
+            "host"=>"host",
+            "port"=>"port",
+            "database"=>"databse",
+            "username"=>"username",
+            "password"=>"password",
+            "charset"=>"char",
+            "parsetime"=>"pars",
+            "sid"=>"",
+        ],"data"=>[
+            "row"=>["sql-row"],
+            "list"=>[["sql-list"]],
+            "sql"=>"sql",
+            "rule"=>["sql"=>"rule"],
+        ],"path"=>[
+            "log"=>"log",
+            "file"=>""
+        ]]);
+        $http = new Client();
+        $response = $http->get("http://localhost:9722", ["type"=>"base","format"=>[
+            "method"=>"warpText",
+            "mergeColumn"=>["column"],
+            "mergeRow"=>["row"=>"row"],
+            "datum"=>"datum",
+        ],"connection"=>[
+            "driver"=>"mysql",
+            "host"=>"host",
+            "port"=>"port",
+            "database"=>"databse",
+            "username"=>"username",
+            "password"=>"password",
+            "charset"=>"char",
+            "parsetime"=>"pars",
+            "sid"=>"",
+        ],"data"=>[
+            "row"=>["sql-row"],
+            "list"=>[["sql-list"]],
+            "sql"=>"sql",
+            "rule"=>["sql"=>"rule"],
+        ],"path"=>[
+            "log"=>"log",
+            "file"=>""
+        ]]);
+        if ($response->getStatusCode() == 500){
+            throw new \Exception($response->getHeader("Msg"));
         }
-        dd($str);
-        $str = rtrim($str,",");
-        $c = DB::connection("oracle")->select(DB::raw("select SUM(qtyordered) s from DOC_ORDER_DETAILS where ORDERNO IN (".$str.")"));
-        dd($c);
+        return \response($response,200, [
+            "Content-type"=>"application/octet-stream",
+            "Content-Disposition"=>"attachment; filename=测试.xlsx",
+        ]);
+
+        if ($post->status() == 500){
+            throw new Exception($post->header("Msg"));
+        }
+        $test = "test";
+        return response($response->get,200, [
+            "Content-type"=>"application/octet-stream",
+            "Content-Disposition"=>"attachment; filename=".$test."-".date('ymdHis').'.xlsx',
+        ]);
     }
 
     public function mergeCarrier(){

+ 2 - 2
app/Imports/UpdatePickZone.php

@@ -115,8 +115,8 @@ class UpdatePickZone implements ToCollection,WithHeadingRow
                         continue;
                     }
                     $model = app("OrderCommodityAssignService")->create([
-                        "order_id"      =>  1,//$order->id,
-                        "commodity_id"  =>  1,//$barcode->commodity_id,
+                        "order_id"      =>  $order->id,
+                        "commodity_id"  =>  $barcode->commodity_id,
                         "amount"        =>  $item["数量"],
                         "produced_at"   =>  $item["生产日期"],
                         "valid_at"      =>  $item["失效日期"],

+ 28 - 4
resources/views/station/monitor/_svg.blade.php

@@ -1,5 +1,5 @@
-<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" class="blue-cube"
-     viewBox="68 30 180 220" {{--style="transform: rotate3d(0,0,60,40deg)"--}}>
+{{--<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" class="blue-cube"
+     viewBox="68 30 180 220" --}}{{--style="transform: rotate3d(0,0,60,40deg)"--}}{{-->
     <defs>
         <g id="cube" style="fill-opacity: .9;stroke-miterlimit: 0;">
             <rect width="21" height="24" fill="#fff" stroke="#0079ad"
@@ -20,6 +20,30 @@
                   transform="scale(1.41,.81) rotate(45) translate(0 -21)" />
         </g>
     </defs>
-    <use v-for="box in boxes" xlink:href="#cube" :x="box.x" :y="box.y" />
+    <use v-for="box in boxes" :xlink:href="box.sign ? '#exceptionCube' : '#cube'" :x="box.x" :y="box.y" />
+</svg>--}}
 
-</svg>
+
+<svg width="579.9997059770881" height="399.999797225578" xmlns="http://www.w3.org/2000/svg">
+    <g>
+        <title>background</title>
+        <rect height="402" width="582" y="-1" x="-1" fill="#fff" id="canvas_background"/>
+        <g y="0" x="0" height="100%" width="100%" display="none" overflow="visible" id="canvasGrid">
+            <rect height="100%" width="100%" y="0" x="0" stroke-width="0" fill="url(#gridpattern)"/>
+        </g>
+    </g>
+    <g>
+        <title>Layer 1</title>
+        <line y2="228.67" x2="335.5" y1="229.67" x1="176.5" stroke-width="1.5" stroke-linejoin="undefined" stroke-linecap="undefined" stroke="#0000ff" fill="none" id="svg_1"/>
+        <line y2="267.67" x2="177.5" y1="229.67" x1="177.5" stroke-width="1.5" stroke-linejoin="undefined" stroke-linecap="undefined" stroke="#0000ff" fill="none" id="svg_4"/>
+        <line y2="266.67" x2="334.5" y1="229.67" x1="334.5" stroke-width="1.5" stroke-linejoin="undefined" stroke-linecap="undefined" stroke="#0000ff" fill="none" id="svg_8"/>
+        <line y2="146.17" x2="190.5" y1="230.17" x1="176.5" stroke-width="1.5" stroke-linejoin="undefined" stroke-linecap="undefined" stroke="#0000ff" fill="none" id="svg_10"/>
+        <line y2="228.67" x2="334.5" y1="141.67" x1="316.5" stroke-width="1.5" stroke-linejoin="undefined" stroke-linecap="undefined" fill="none" id="svg_13"/>
+        <line y2="264.67" x2="334.5" y1="265.67" x1="177.5" stroke-width="1.5" stroke-linejoin="undefined" stroke-linecap="undefined" stroke="#0000ff" fill="none" id="svg_14"/>
+        <line y2="145.835" x2="317.751" y1="146.835" x1="191.252" stroke-width="1.5" stroke-linejoin="undefined" stroke-linecap="undefined" stroke="#0000ff" fill="none" id="svg_15"/>
+        <line y2="229.334" x2="334.25" y1="144.835" x1="317.751" stroke-width="1.5" stroke-linejoin="undefined" stroke-linecap="undefined" stroke="#0000ff" fill="none" id="svg_16"/>
+        <line y2="181.835" x2="324.75" y1="182.335" x1="185.252" stroke-width="1.5" stroke-linejoin="undefined" stroke-linecap="undefined" stroke="#0000ff" fill="none" id="svg_17"/>
+        <line y2="228.834" x2="224.751" y1="147.335" x1="231.751" stroke-width="1.5" stroke-linejoin="undefined" stroke-linecap="undefined" stroke="#0000ff" fill="none" id="svg_18"/>
+        <line y2="228.834" x2="280.751" y1="145.835" x1="279.251" stroke-width="1.5" stroke-linejoin="undefined" stroke-linecap="undefined" stroke="#0000ff" fill="none" id="svg_19"/>
+    </g>
+</svg>

+ 4 - 3
resources/views/station/monitor/show.blade.php

@@ -40,7 +40,7 @@
                         </div>
                         <div class="row pt-2">
                             <div class="col">
-                                {{--@include("station.monitor._svg")--}}
+{{--                                @include("station.monitor._svg")--}}
                                 <img src="{{asset('images/demoBin.png')}}" alt="" class="img">
                             </div>
                         </div>
@@ -130,7 +130,7 @@
                 });
                 this._broadcast();
                 this._renderingWall(this.wall.amount,this.wall.row,this.wall.column);
-                this._renderingBox(2,4);
+               /* this._renderingBox(3,5);*/
             },
             methods:{
                 _broadcast(){
@@ -198,7 +198,8 @@
                     let boxes = [];
                     for (let i=0;i<column;i++){
                         for (let j=row-1;j>=0;j--){
-                            boxes.push({x:((i+j)*width)+x,y:(y+(i*height))-(j*height)});
+                            if (boxes.length===5) boxes.push({x:((i+j)*width)+x,y:(y+(i*height))-(j*height),sign:true});
+                            else boxes.push({x:((i+j)*width)+x,y:(y+(i*height))-(j*height),sign:false});
                         }
                     }
                     this.boxes = boxes;