| | |
| | | package com.sandu.ximon.admin.localMQTT.controller; |
| | | |
| | | import com.sandu.ximon.admin.localMQTT.util.MqttClientUtil; |
| | | import com.sandu.ximon.admin.newnova.param.NewNovaStatusParam; |
| | | import com.sandu.ximon.admin.newnova.utils.NovaAPIUtil; |
| | | import com.sandu.ximon.admin.utils.RedisUtils; |
| | | import com.sandu.ximon.dao.domain.NewNovaLed; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | import static com.sandu.ximon.admin.localMQTT.callback.StatusMqttCallBack.localMqttConnectStatus; |
| | | import static com.sandu.ximon.admin.newnova.utils.NovaAPIUtil.loginSn; |
| | | import static com.sandu.ximon.admin.newnova.utils.NovaAPIUtil.searchStatus; |
| | | import static java.lang.Thread.sleep; |
| | | |
| | | /** |
| | |
| | | @RequestMapping("/test") |
| | | public String localMQTT() throws InterruptedException { |
| | | |
| | | for (int i = 0; i < 1000; i++) { |
| | | for (int i = 0; i < 1; i++) { |
| | | |
| | | /* |
| | | * 开灯100 |
| | |
| | | // log.info("定时任务返回结果:"+result4); |
| | | // sleep(3000); |
| | | |
| | | boolean set = RedisUtils.getBean().set(localMqttConnectStatus+"363832544e5008ff4734ffff",0); |
| | | System.out.println(set); |
| | | System.out.println(RedisUtils.getBean().get(localMqttConnectStatus+"363832544e5008ff4734ffff")); |
| | | System.out.println("1".equals(RedisUtils.getBean().get(localMqttConnectStatus+"363832544e5008ff4734ffff"))); |
| | | System.out.println("------------"); |
| | | // boolean set = RedisUtils.getBean().set(localMqttConnectStatus+"363832544e5008ff4734ffff",0); |
| | | // System.out.println(set); |
| | | // System.out.println(RedisUtils.getBean().get(localMqttConnectStatus+"363832544e5008ff4734ffff")); |
| | | // System.out.println("1".equals(RedisUtils.getBean().get(localMqttConnectStatus+"363832544e5008ff4734ffff"))); |
| | | // System.out.println("------------"); |
| | | |
| | | // System.out.println("链接状态:---"+i+"---:"); |
| | | // System.out.println(RedisUtils.getBean().get(localMqttConnectStatus+"363832544e5008ff4734ffff")); |
| | | sleep(1000); |
| | | // sleep(1000); |
| | | NovaAPIUtil instanceUtil = NovaAPIUtil.getInstanceUtil(); |
| | | System.out.println(instanceUtil); |
| | | |
| | | |
| | | // System.out.println("循环重复登录:"); |
| | | // for (int j = 0; j < 1; j++) { |
| | | // System.out.println(j+"次循环,开始"); |
| | | // loginSn.forEach( |
| | | // (sn,data)->{ |
| | | // instanceUtil.login(sn, 0); |
| | | // } |
| | | // ); |
| | | // System.out.println(j+"次循环,结束"); |
| | | // } |
| | | |
| | | System.out.println("循环重复截图:"); |
| | | NewNovaStatusParam newNovaStatusParam = new NewNovaStatusParam(); |
| | | List<NewNovaStatusParam.NovascreenShotDTO> list = new ArrayList<>(); |
| | | NewNovaStatusParam.NovascreenShotDTO dto = new NewNovaStatusParam.NovascreenShotDTO(); |
| | | List<NewNovaStatusParam.NovaDTO> novaList = new ArrayList<>(); |
| | | |
| | | |
| | | loginSn.forEach( |
| | | (sn,data)->{ |
| | | dto.setSn(sn); |
| | | list.add(dto); |
| | | } |
| | | ); |
| | | |
| | | // instanceUtil.reboot(); |
| | | |
| | | newNovaStatusParam.setScreenShotList(list); |
| | | System.out.println("list中一共"+list.size()+"个屏幕"); |
| | | System.out.println("loginSn"+loginSn.size()+"个屏幕"); |
| | | for (int j = 0; j < 1; j++) { |
| | | System.out.println(j+"次循环,开始"); |
| | | List<NewNovaLed> newNovaLedList = new ArrayList<>(); |
| | | loginSn.forEach( |
| | | (sn,data)->{ |
| | | instanceUtil.screenShot(newNovaStatusParam); |
| | | NewNovaLed newNovaLed = new NewNovaLed(); |
| | | newNovaLed.setSn(sn); |
| | | instanceUtil.getInfo(newNovaLed); |
| | | newNovaLedList.add(newNovaLed); |
| | | } |
| | | |
| | | ); |
| | | instanceUtil.getOnlineStatus(newNovaLedList,false); |
| | | System.out.println(j+"次循环,结束"); |
| | | } |
| | | |
| | | |
| | | } |
| | | |