代码优化
This commit is contained in:
@@ -97,6 +97,9 @@ public class AccessApplicationRunner implements ApplicationRunner {
|
|||||||
csDeviceService.wlDevRegister(item.getNdid());
|
csDeviceService.wlDevRegister(item.getNdid());
|
||||||
} else {
|
} else {
|
||||||
String version = csTopicService.getVersion(item.getNdid());
|
String version = csTopicService.getVersion(item.getNdid());
|
||||||
|
if (Objects.isNull(version)) {
|
||||||
|
version = "V1";
|
||||||
|
}
|
||||||
csDeviceService.devAccessAskTemplate(item.getNdid(),version,1);
|
csDeviceService.devAccessAskTemplate(item.getNdid(),version,1);
|
||||||
}
|
}
|
||||||
redisUtil.saveByKey(AppRedisKey.DEVICE_MID + item.getNdid(),1);
|
redisUtil.saveByKey(AppRedisKey.DEVICE_MID + item.getNdid(),1);
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ public class AutoAccessTimer implements ApplicationRunner {
|
|||||||
for (Future<Void> future : futures) {
|
for (Future<Void> future : futures) {
|
||||||
try {
|
try {
|
||||||
future.get();
|
future.get();
|
||||||
} catch (Exception e) {
|
} catch (InterruptedException | ExecutionException e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -91,6 +91,9 @@ public class AutoAccessTimer implements ApplicationRunner {
|
|||||||
csDeviceService.wlDevRegister(item.getNdid());
|
csDeviceService.wlDevRegister(item.getNdid());
|
||||||
} else {
|
} else {
|
||||||
String version = csTopicService.getVersion(item.getNdid());
|
String version = csTopicService.getVersion(item.getNdid());
|
||||||
|
if (Objects.isNull(version)) {
|
||||||
|
version = "V1";
|
||||||
|
}
|
||||||
csDeviceService.devAccessAskTemplate(item.getNdid(),version,1);
|
csDeviceService.devAccessAskTemplate(item.getNdid(),version,1);
|
||||||
}
|
}
|
||||||
redisUtil.saveByKey(AppRedisKey.DEVICE_MID + item.getNdid(),1);
|
redisUtil.saveByKey(AppRedisKey.DEVICE_MID + item.getNdid(),1);
|
||||||
|
|||||||
@@ -371,7 +371,7 @@ public class CsDeviceServiceImpl implements ICsDeviceService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
//@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public String wlDevRegister(String nDid) {
|
public String wlDevRegister(String nDid) {
|
||||||
String result = "fail";
|
String result = "fail";
|
||||||
// 设备状态判断
|
// 设备状态判断
|
||||||
|
|||||||
Reference in New Issue
Block a user