From e55c8b0a92eb9715edd90c31dfd4de51a47b588b Mon Sep 17 00:00:00 2001
From: liuhaonan <31457034@qq.com>
Date: 星期五, 04 十一月 2022 17:40:08 +0800
Subject: [PATCH] changes
---
ximon-admin/src/main/java/com/sandu/ximon/admin/service/PoleService.java | 14 +++++++-------
1 files changed, 7 insertions(+), 7 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 e112f59..7d542dc 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
@@ -129,26 +129,26 @@
/**
* 鍒犻櫎鐏潌
*/
- public boolean deletePole(Long poleId) {
- Pole pole = getById(poleId);
- if (pole == null) {
+ public boolean deletePole(List<Long> poleIds) {
+ List<Pole> poles = listByIds(poleIds);
+ if (poles.isEmpty()) {
throw new BusinessException("鏈壘鍒拌鐏潌");
}
// 鍒犻櫎鐏潌缁戝畾鍏崇郴
- poleBindingService.remove(Wrappers.<PoleBinding>lambdaQuery().eq(PoleBinding::getPoleId, poleId));
+ poleBindingService.remove(Wrappers.<PoleBinding>lambdaQuery().in(PoleBinding::getPoleId, poleIds));
SpringContextHolder.getBean(LightTaskPoleRelationService.class)
- .remove(Wrappers.lambdaQuery(LightTaskPoleRelation.class).eq(LightTaskPoleRelation::getPoleId, poleId));
+ .remove(Wrappers.lambdaQuery(LightTaskPoleRelation.class).in(LightTaskPoleRelation::getPoleId, poleIds));
/**
* 鍒犻櫎鐏潌鏃ュ織璁板綍寮�濮�
*/
- String content = "{鐏潌Code锛�" + pole.getDeviceCode() + "锛� 鐏潌鍚嶇О锛�" + pole.getPoleName() + " }";
+ String content = "{鐏潌id锛�" + poles + " }";
StoreOperationRecordsUtils.storeOperationData(null, null, "鍒犻櫎鐏潌", content);
/**
* 鍒犻櫎鐏潌鏃ュ織璁板綍缁撴潫
*/
- return removeById(poleId);
+ return removeByIds(poleIds);
}
--
Gitblit v1.9.3