| | |
| | | // MqttCustomerClient mqttCustomerClient = new MqttCustomerClient(); |
| | | // mqttCustomerClient.connect(lockTypeParam.getCarId()+"change"+UUID.randomUUID()); |
| | | // mqttCustomerClient.pushlish(ardSyCarRtu.getTopicPublish(),mapString); |
| | | try { |
| | | int min = lockTypeParam.getNum() -5; int max = lockTypeParam.getNum() +5; |
| | | while(true){ |
| | | TimeUnit.SECONDS.sleep(5); |
| | | ArdSyCarLock ardSyCarLockLoop = lockMapper.selectById(lockTypeParam.getLockId()); |
| | | Double currentInfo = ardSyCarLockLoop.getCurrentInfo(); |
| | | int d = (int) ((int)(currentInfo*150/138.3 - 4)/0.16); |
| | | if(d >= min && d <= max){ |
| | | break; |
| | | } |
| | | } catch (InterruptedException e) { |
| | | e.printStackTrace(); |
| | | // TimeUnit.SECONDS.sleep(5); |
| | | } |
| | | return AjaxResult.success("开关锁命令发送成功,发送进度为"+lockTypeParam.getNum()); |
| | | return AjaxResult.success("开关锁成功,进度为"+lockTypeParam.getNum()); |
| | | } |
| | | |
| | | @Override |