代码优化

This commit is contained in:
xy
2025-01-14 11:33:35 +08:00
parent c6e938e7a0
commit 1fb08ab66c
3 changed files with 8 additions and 2 deletions

View File

@@ -97,6 +97,9 @@ public class AccessApplicationRunner implements ApplicationRunner {
csDeviceService.wlDevRegister(item.getNdid());
} else {
String version = csTopicService.getVersion(item.getNdid());
if (Objects.isNull(version)) {
version = "V1";
}
csDeviceService.devAccessAskTemplate(item.getNdid(),version,1);
}
redisUtil.saveByKey(AppRedisKey.DEVICE_MID + item.getNdid(),1);

View File

@@ -69,7 +69,7 @@ public class AutoAccessTimer implements ApplicationRunner {
for (Future<Void> future : futures) {
try {
future.get();
} catch (Exception e) {
} catch (InterruptedException | ExecutionException e) {
throw new RuntimeException(e);
}
}
@@ -91,6 +91,9 @@ public class AutoAccessTimer implements ApplicationRunner {
csDeviceService.wlDevRegister(item.getNdid());
} else {
String version = csTopicService.getVersion(item.getNdid());
if (Objects.isNull(version)) {
version = "V1";
}
csDeviceService.devAccessAskTemplate(item.getNdid(),version,1);
}
redisUtil.saveByKey(AppRedisKey.DEVICE_MID + item.getNdid(),1);

View File

@@ -371,7 +371,7 @@ public class CsDeviceServiceImpl implements ICsDeviceService {
}
@Override
//@Transactional(rollbackFor = Exception.class)
@Transactional(rollbackFor = Exception.class)
public String wlDevRegister(String nDid) {
String result = "fail";
// 设备状态判断