解决对接中遇到的问题

This commit is contained in:
648540858
2022-03-01 17:42:22 +08:00
parent 9c5b1060af
commit 4c53b10737
23 changed files with 249 additions and 133 deletions

View File

@@ -149,8 +149,16 @@ public class PlatformController {
if (updateResult) {
// 保存时启用就发送注册
if (parentPlatform.isEnable()) {
// 只要保存就发送注册
commanderForPlatform.register(parentPlatform, null, null);
if (parentPlatformOld.isStatus()) {
commanderForPlatform.unregister(parentPlatformOld, null, eventResult -> {
// 只要保存就发送注册
commanderForPlatform.register(parentPlatform, null, null);
});
}else {
// 只要保存就发送注册
commanderForPlatform.register(parentPlatform, null, null);
}
} else if (parentPlatformOld != null && parentPlatformOld.isEnable() && !parentPlatform.isEnable()){ // 关闭启用时注销
commanderForPlatform.unregister(parentPlatform, null, null);
}
@@ -203,8 +211,24 @@ public class PlatformController {
if (updateResult) {
// 保存时启用就发送注册
if (parentPlatform.isEnable()) {
// 只要保存就发送注册
commanderForPlatform.register(parentPlatform, null, null);
// 保存时启用就发送注册
if (parentPlatform.isEnable()) {
if (parentPlatformOld.isStatus()) {
commanderForPlatform.unregister(parentPlatformOld, null, null);
try {
Thread.sleep(500);
} catch (InterruptedException e) {
e.printStackTrace();
}
// 只要保存就发送注册
commanderForPlatform.register(parentPlatform, null, null);
}else {
// 只要保存就发送注册
commanderForPlatform.register(parentPlatform, null, null);
}
} else if (parentPlatformOld != null && parentPlatformOld.isEnable() && !parentPlatform.isEnable()){ // 关闭启用时注销
commanderForPlatform.unregister(parentPlatformOld, null, null);
}
} else if (parentPlatformOld != null && parentPlatformOld.isEnable() && !parentPlatform.isEnable()){ // 关闭启用时注销
commanderForPlatform.unregister(parentPlatform, null, null);
}