瀏覽代碼

Merge branch 'han' of http://47.111.81.118:3000/uskycloud/usky-modules into han
# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.

james 1 周之前
父節點
當前提交
a60bc4aeb4

+ 12 - 9
service-sas/service-sas-biz/src/main/java/com/usky/sas/service/impl/SasDeviceServiceImpl.java

@@ -367,15 +367,18 @@ public class SasDeviceServiceImpl extends AbstractCrudService<SasDeviceMapper, S
             return;
         }
         String ipcId = device.getBindingIpc();
-        device.setBindingIpc(null);
-        device.setUpdateTime(LocalDateTime.now());
-        this.updateById(device);
-        SasDevice ipc = this.getById(ipcId);
-        if (ipc != null) {
-            ipc.setIsBinding(false);
-            ipc.setUpdateTime(LocalDateTime.now());
-            this.updateById(ipc);
-        }
+        // 显式更新绑定关系,避免依赖通用 updateById 未更新 binding_ipc 的问题
+        this.lambdaUpdate()
+                .set(SasDevice::getBindingIpc, null)
+                .set(SasDevice::getUpdateTime, LocalDateTime.now())
+                .eq(SasDevice::getId, id)
+                .update();
+
+        this.lambdaUpdate()
+                .set(SasDevice::getIsBinding, false)
+                .set(SasDevice::getUpdateTime, LocalDateTime.now())
+                .eq(SasDevice::getId, ipcId)
+                .update();
     }
 
     @Override