| | |
| | | import com.sandu.ximon.admin.param.*; |
| | | import com.sandu.ximon.admin.redis.LightKey; |
| | | import com.sandu.ximon.admin.security.SecurityUtils; |
| | | import com.sandu.ximon.admin.utils.LightemitUtils; |
| | | import com.sandu.ximon.admin.utils.RedisUtils; |
| | | import com.sandu.ximon.admin.utils.response.VnnoxResult; |
| | | import com.sandu.ximon.admin.vo.PoleBindVO; |
| | |
| | | */ |
| | | public boolean pushAirDataToXiXun(Long poleId) { |
| | | Pole pole = getById(poleId); |
| | | //判断归属权 |
| | | if (SecurityUtils.getClientId() != null) { |
| | | if (!pole.getClientId().equals(SecurityUtils.getUserId()) && !pole.getUserId().equals(SecurityUtils.getUserId())) { |
| | | throw new BusinessException("无权限操作"); |
| | | } |
| | | } |
| | | PoleBinding air = poleBindingService.getOne(Wrappers.lambdaQuery(PoleBinding.class).eq(PoleBinding::getPoleId, poleId).eq(PoleBinding::getDeviceType, 3)); |
| | | PoleBinding xixun = poleBindingService.getOne(Wrappers.lambdaQuery(PoleBinding.class).eq(PoleBinding::getPoleId, poleId).eq(PoleBinding::getDeviceType, 10)); |
| | | if (pole == null) { |
| | |
| | | return SpringContextHolder.getBean(XiXunPlayerService.class).pushWeather(xixun.getDeviceCode(), data, pole); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 关闭熙讯大气推送 |
| | | */ |
| | | public void closeXiXunAirPush(Long poleId) { |
| | | Pole pole = getById(poleId); |
| | | if (SecurityUtils.getClientId() != null) { |
| | | if (!pole.getClientId().equals(SecurityUtils.getUserId()) && !pole.getUserId().equals(SecurityUtils.getUserId())) { |
| | | throw new BusinessException("无权限操作"); |
| | | } |
| | | } |
| | | PoleBinding air = poleBindingService.getOne(Wrappers.lambdaQuery(PoleBinding.class).eq(PoleBinding::getPoleId, poleId).eq(PoleBinding::getDeviceType, 3)); |
| | | PoleBinding xixun = poleBindingService.getOne(Wrappers.lambdaQuery(PoleBinding.class).eq(PoleBinding::getPoleId, poleId).eq(PoleBinding::getDeviceType, 10)); |
| | | if (pole == null || air == null || xixun == null) { |
| | | throw new BusinessException("设备不存在"); |
| | | } |
| | | //关闭推送 |
| | | SpringContextHolder.getBean(LightemitUtils.class).clear(xixun.getDeviceCode()); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 推送大气监测数据到novaLED |
| | | */ |