代码优化
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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";
|
||||
// 设备状态判断
|
||||
|
||||
Reference in New Issue
Block a user