From cfb17d6e329f3cc7afe3018d6cc8784ebafd5965 Mon Sep 17 00:00:00 2001
From: liuhaonan <31457034@qq.com>
Date: 星期三, 14 九月 2022 16:08:57 +0800
Subject: [PATCH] changes
---
ximon-admin/src/main/java/com/sandu/ximon/admin/service/PoleService.java | 27 ++++++++++++++++++++++++++-
1 files changed, 26 insertions(+), 1 deletions(-)
diff --git a/ximon-admin/src/main/java/com/sandu/ximon/admin/service/PoleService.java b/ximon-admin/src/main/java/com/sandu/ximon/admin/service/PoleService.java
index 5838125..c65a4ff 100644
--- a/ximon-admin/src/main/java/com/sandu/ximon/admin/service/PoleService.java
+++ b/ximon-admin/src/main/java/com/sandu/ximon/admin/service/PoleService.java
@@ -717,7 +717,7 @@
throw new BusinessException("鐏潌涓嶅瓨鍦�");
}
pole.setClientId(clientId);
- if (!clientService.findClientId(clientId)) {
+ if (clientService.findClientId(clientId)) {
pole.setUserId(clientService.getClientId(clientId));
}
@@ -731,6 +731,31 @@
return r;
}
+ /**
+ * 鐢ㄦ埛瑙g粦鐏潌
+ *
+ * @param clientId
+ * @param poleIds
+ * @return
+ */
+ public boolean ClientUnBindingPole(long clientId, int[] poleIds) {
+ boolean r = false;
+ for (int poleId : poleIds) {
+ Pole pole = getById(poleId);
+ if (pole == null) {
+ throw new BusinessException("鐏潌涓嶅瓨鍦�");
+ }
+ pole.setClientId(-1L);
+ r = updateById(pole);
+
+ if (!r) {
+ throw new BusinessException("鐏潌ID涓�" + poleId + "璁剧疆澶辫触,鑷姩鍋滄");
+ }
+
+ }
+ return r;
+ }
+
public List<Pole> getOwnerPole(BaseConditionVO baseConditionVO, String keyword, Long cilentId) {
LambdaQueryWrapper<Pole> eq;
--
Gitblit v1.9.3