whj 4 éve
szülő
commit
eb42db36fa

+ 4 - 4
app/Console/Commands/SendDeviceRule.php

xqd xqd
@@ -65,7 +65,6 @@ class SendDeviceRule extends Command
                 //没有锁协议跳出
                 $lock = LockInfo::where(['device_id'=>$id,'box_type'=>$box_type])->get();
                 if(empty($lock)) continue;
-                //dd($lock->toArray());
                 $send_rule = [];
                 foreach ($lock as $protol){
                     $send_rule["box".$protol->box_type][] = [
@@ -75,13 +74,14 @@ class SendDeviceRule extends Command
                         'type'=>$protol['type'],
                         'value'=>$protol['value']
                     ];
-                    LockInfo::where(['id'=>$protol->id])->updated(['sned_status'=>2]);
                 }
                 $send_rule['query'] = 3600;
+                LockInfo::where(['id'=>$protol->id])->update(['send_status'=>2]);
                 $res = (new DeviceServer())->sendMsg($device_name ,json_encode($send_rule));
+                dd($res);
                 sleep('20');
-                if($res['success'] == 'success') {
-                    DeviceInfo::
+                if($res['Success'] == 'success') {
+                    LockInfo::where(['device_id'=>$id,'box_type'=>$box_type])->update(['send_status'=>2]);
                 }
                 Log::info('执行规则'.json_encode($send_rule).PHP_EOL);
             }

+ 13 - 14
resources/views/test_opreation.blade.php

xqd xqd
@@ -62,13 +62,13 @@
         </div>
         <div class="bianhao" style="padding-top: 0; border-bottom: 0.01rem solid #efefef;">
             <button @click="startbtn()" :class="classbtn" :disabled="startbtndib">@{{mssage}}</button>
-            <div style="font-size: .3rem;padding-top: .1rem;padding-bottom: .1rem;">点击【开始测试】,全部箱体立即锁死,每20秒锁位状态改变一次
+            <div style="font-size: .3rem;padding-top: .1rem;padding-bottom: .1rem;">点击【开始测试】,全部箱体立即锁死,每15秒锁位状态改变一次
             </div>
         </div>
         <div class="bianhao" style="padding-top: 0; margin-top: .4rem; border-bottom: 0.01rem solid #efefef;">
             <button v-preventclick @click="dingshi()" class="" :disabled="dingshibtn">@{{time}}s定时</button>
             <div style="font-size: .3rem;padding-top: .1rem;padding-bottom: .1rem;">
-                点击【定时测试】,2min后,锁位开启,3min后锁位关闭,设备配置后,无法点击调试</div>
+                点击【定时测试】,3min后,锁位开启,4min后锁位关闭,设备配置后,无法点击调试</div>
         </div>
         <div v-for="(item,index) in boxarr" :key="index">
             <div class="bianhao"
@@ -142,21 +142,20 @@
                 })
             },
             dingshi() {
+                this.startbtndib = true
+                this.allbtn = true
+                let timestop = setInterval(() => {
+                    this.time--
+                    if (this.time == 0) {
+                        clearInterval(timestop)
+                        this.time = 180
+                        this.startbtndib = false
+                        this.allbtn = false
+                    }
+                }, 1000)
                 axios.get("http://172.31.31.199/send_protocol?id="+id+"&type=" + this.dingshitype).then(res => {
                     if (res.data.code == 603) {
                         alert(res.data.msg)
-                    } else {
-                        this.startbtndib = true
-                        this.allbtn = true
-                        let timestop = setInterval(() => {
-                            this.time--
-                            if (this.time == 0) {
-                                clearInterval(timestop)
-                                this.time = 180
-                                this.startbtndib = false
-                                this.allbtn = false
-                            }
-                        }, 1000)
                     }
                 })
             },