From f8c33ad3fb09dd0f70b68b74d59ce28761142bf0 Mon Sep 17 00:00:00 2001
From: Van333 <van666666@foxmail.com>
Date: 星期一, 14 十一月 2022 15:21:51 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/xm-20221107' into xm-20221107
---
ximon-admin/src/main/java/com/sandu/ximon/admin/service/PoleService.java | 21 +++++++++++----------
1 files changed, 11 insertions(+), 10 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 bc17092..6d90489 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,24 +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).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);
}
@@ -745,7 +747,6 @@
// }
// return list;
// }
-
public List<Pole> isTrue(List<Pole> list, PoleStatesParam param) {
//瀹炰綋鐏潌
List<Pole> isTrue = new ArrayList<>();
@@ -864,8 +865,8 @@
*
* @return 鏄惁鎴愬姛
*/
- public boolean unBindPole(Long poleId, String deviceCode) {
- return poleBindingService.unBindPole(poleId, deviceCode);
+ public boolean unBindPole(Long poleId, String deviceCode, Integer deviceType) {
+ return poleBindingService.unBindPole(poleId, deviceCode, deviceType);
}
@@ -1337,7 +1338,7 @@
//璁剧疆瑙﹀彂鏉′欢 瀛樺叆Redis 15鍒嗛挓瓒呮椂 15鍒嗛挓鍐呭啀娆¤皟鐢ㄧ洿鎺ヨ繑鍥�
redisUtils.set("redisStatusKeyTimeout", System.currentTimeMillis(), 60 * 15);
- CountDownLatch countDownLatch = new CountDownLatch(7);//todo
+ CountDownLatch countDownLatch = new CountDownLatch(7);//todo 鍑犱釜璁惧璁剧疆涓哄嚑
//鑾峰彇涓�涓�7浣嶉殢鏈烘暟
String str = RandomStringUtils.randomAlphanumeric(7);
countDownLatchUtil.push(str, countDownLatch);
--
Gitblit v1.9.3