Commit 84c60381cc77a1f7fba206900ebcfed4918859d3
1 parent
f9ae4cfd
增加设备通道数为0时自动发起更新通道
Showing
1 changed file
with
5 additions
and
0 deletions
src/main/java/com/genersoft/iot/vmp/service/impl/DeviceServiceImpl.java
| ... | ... | @@ -118,6 +118,7 @@ public class DeviceServiceImpl implements IDeviceService { |
| 118 | 118 | } |
| 119 | 119 | sync(device); |
| 120 | 120 | }else { |
| 121 | + | |
| 121 | 122 | if(device.getOnline() == 0){ |
| 122 | 123 | device.setOnline(1); |
| 123 | 124 | device.setCreateTime(now); |
| ... | ... | @@ -132,6 +133,10 @@ public class DeviceServiceImpl implements IDeviceService { |
| 132 | 133 | sync(device); |
| 133 | 134 | // TODO 如果设备下的通道级联到了其他平台,那么需要发送事件或者notify给上级平台 |
| 134 | 135 | }else { |
| 136 | + if (deviceChannelMapper.queryAllChannels(device.getDeviceId()).size() == 0) { | |
| 137 | + sync(device); | |
| 138 | + } | |
| 139 | + | |
| 135 | 140 | deviceMapper.update(device); |
| 136 | 141 | redisCatchStorage.updateDevice(device); |
| 137 | 142 | } | ... | ... |