LD 6 лет назад
Родитель
Сommit
9e848a2d2d

+ 7 - 0
app/Http/Controllers/api/thirdPart/flux/ReceiveController.php

@@ -13,6 +13,7 @@ use App\SkuNew;
 use App\Store;
 use App\WMSReflectReceive;
 use App\WMSReflectReceiveSku;
+use Carbon\Carbon;
 use Illuminate\Http\Request;
 use Illuminate\Support\Facades\Auth;
 use Illuminate\Support\Facades\Validator;
@@ -26,8 +27,12 @@ class ReceiveController extends Controller
      */
     public function new_(Request $request)
     {
+        $now=Carbon::now();
+        (new Controller())->log(__METHOD__,'time1_'.__FUNCTION__,$now->toDateTimeString());
         ini_set('max_execution_time',2500);
+        ini_set('memory_limit','1526M');
         $errors=$this->validatorForNew($request->all())->errors();
+        (new Controller())->log(__METHOD__,'time_validated_'.__FUNCTION__,Carbon::now()->diffInMicroseconds($now));
         if(count($errors)>0){
             $this->log(__METHOD__, 'error_body' . __FUNCTION__, json_encode($request->getContent()));
             (new Controller())->log(__METHOD__,'error_'.__FUNCTION__,'fields wrong, see Errors report please.'.'|'.json_encode($request).'|'.json_encode($errors));
@@ -35,7 +40,9 @@ class ReceiveController extends Controller
                 'errors'=>$errors]])
                 ->setEncodingOptions(JSON_UNESCAPED_UNICODE);
         }
+        (new Controller())->log(__METHOD__,'time_3_'.__FUNCTION__,Carbon::now()->toDateTimeString());
         $receiveInputs=$request->input('request');
+        (new Controller())->log(__METHOD__,'time_3_'.__FUNCTION__,Carbon::now()->toDateTimeString());
         foreach ($receiveInputs as $receiveInput){
             $isRepeated=WMSReflectReceive::where('ASNNO',$receiveInput['ASNNO'])->first();
             if($isRepeated){

+ 30 - 30
resources/views/weight/measureMonitor/index.blade.php

@@ -40,7 +40,7 @@
                                             </tr>
                                             <tr>
                                                 <th class="tag" scope="row" scope="row">承运商</th>
-                                                <td style="border-right:thick double #aaaaaa;">@{{package.logistic}}</td>
+                                                <td style="border-right:thick double #aaaaaa;">@{{package.logistic_name}}</td>
                                                 <th class="tag" scope="row" scope="row">快递单号</th>
                                                 <td>@{{package.logistic_number}}</td>
                                             </tr>
@@ -81,7 +81,7 @@
                     {id:'',logistic_number:'',delivery_number:'',
                         weight:'',owner:'',paperBox:'',
                         measuringMachine:'',recipient:'',measuringMachine_status:'',
-                        status:'',weighed_at:'',bulk:'',logistic:''},
+                        status:'',weighed_at:'',bulk:'',logistic_name:''},
                 measuringMachines:[
                         @foreach($measuringMachines as $measuringMachine)
                     {id:'{{$measuringMachine->id}}',name:'{{$measuringMachine->name}}',code:'{{$measuringMachine->code}}',status:'{{$measuringMachine->status}}',},
@@ -95,7 +95,7 @@
                 onColor:{color:'green'},
                 offColor:{color:'red'},
                 logisticAudioURL:{},
-                initAmount:1,
+                currentAudioIndex:1,
                 amount:3,
             },
             mounted(){
@@ -113,11 +113,11 @@
                 Echo.channel('{{$laravelEchoPrefix}}package').listen('WeighedEvent',(e)=>{
                     let package=e.package;
                     let _this=this;
-                    let audio=document.getElementById("audio"+_this.initAmount);
-                    if (_this.initAmount==_this.amount){
-                        _this.initAmount=1;
+                    let audio=document.getElementById("audio"+_this.currentAudioIndex);
+                    if (_this.currentAudioIndex==_this.amount){
+                        _this.currentAudioIndex=1;
                     }else{
-                        _this.initAmount=_this.initAmount+1;
+                        _this.currentAudioIndex=_this.currentAudioIndex+1;
                     }
                     if (package&& package.measuringMachine_name===_this.package.measuringMachine){
                         if (package.id===_this.package.id){
@@ -125,31 +125,31 @@
                             _this.measuringMachinesIndex[package.measuringMachine_name].status=package.measuringMachine_status;
                             tempTip.setDuration(4000);
                             tempTip.showSuccess('暂无新数据');
+                            return;
+                        }
+                        _this.updateData(_this,package);
+                        if (_this.logisticAudioURL[package.logistic_name]){
+                            audio.src=_this.logisticAudioURL[package.logistic_name];
+                            audio.play();
                         }else {
-                            _this.updateData(_this,package);
-                            if (_this.logisticAudioURL[package.logistic_number]){
-                                audio.src=_this.logisticAudioURL[package.logistic_number];
-                                audio.play();
-                            }else {
-                                axios.post('/package/measureMonitor/speech',{logistic:package.logistic_name})
-                                    .then(function (response) {
-                                        if (response.data){
-                                            _this.logisticAudioURL[_this.package.logistic_number]=response.data;
-                                            audio.src=response.data;
-                                            audio.play();
-                                        }else {
-                                            tempTip.setDuration(4000);
-                                            tempTip.showSuccess('文件名不规范!');
-                                        }
-                                    })
-                                    .catch(function (err) {
+                            axios.post('/package/measureMonitor/speech',{logistic:package.logistic_name})
+                                .then(function (response) {
+                                    if (response.data){
+                                        _this.logisticAudioURL[_this.package.logistic_name]=response.data;
+                                        audio.src=response.data;
+                                        audio.play();
+                                    }else {
                                         tempTip.setDuration(4000);
-                                        tempTip.showSuccess('语音合成发生错误:'+err);
-                                    });
-                            }
-                            tempTip.setDuration(4000);
-                            tempTip.showSuccess('刷新成功!');
+                                        tempTip.showSuccess('文件名不规范!');
+                                    }
+                                })
+                                .catch(function (err) {
+                                    tempTip.setDuration(4000);
+                                    tempTip.showSuccess('语音合成发生错误:'+err);
+                                });
                         }
+                        tempTip.setDuration(1000);
+                        tempTip.showSuccess('刷新成功!');
                     }
                 });
                 /*                if(this.timer){
@@ -183,7 +183,7 @@
                     _this.package.paperBox=package.paperBox_name;
                     _this.package.recipient=package.recipient;_this.package.status=package.status;
                     _this.package.weighed_at=package.weighed_at;_this.package.bulk=package.bulk;
-                    _this.package.logistic=package.logistic_name;
+                    _this.package.logistic_name=package.logistic_name;
                     _this.package.measuringMachine_status=package.measuringMachine_status;
                     _this.measuringMachinesIndex[package.measuringMachine_name].status=package.measuringMachine_status;
                 }