From 51af3e4e7c5fb612576b98fd6407f6b65859f374 Mon Sep 17 00:00:00 2001
From: Van333 <van666666@foxmail.com>
Date: 星期三, 16 十一月 2022 15:58:06 +0800
Subject: [PATCH] 区分消息订阅类型,新增上下线监听,修复定时帧缺少CRC32,替换设备在线状态查询方法
---
ximon-admin/src/main/java/com/sandu/ximon/admin/service/LEDProgramService.java | 18 ++++++++++++------
1 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/ximon-admin/src/main/java/com/sandu/ximon/admin/service/LEDProgramService.java b/ximon-admin/src/main/java/com/sandu/ximon/admin/service/LEDProgramService.java
index 86f0aa9..346f302 100644
--- a/ximon-admin/src/main/java/com/sandu/ximon/admin/service/LEDProgramService.java
+++ b/ximon-admin/src/main/java/com/sandu/ximon/admin/service/LEDProgramService.java
@@ -35,6 +35,9 @@
led.setPreview(receiveParam.getPreviewUrl());
led.setWidth(receiveParam.getWidth());
led.setHeight(receiveParam.getHeight());
+ if (receiveParam.getPages() == null) {
+ throw new BusinessException("鑺傜洰鍐呭涓㈠け");
+ }
led.setPages(JSON.toJSONString(receiveParam.getPages()));
return save(led);
}
@@ -51,18 +54,21 @@
led.setPreview(receiveParam.getPreviewUrl());
led.setWidth(receiveParam.getWidth());
led.setHeight(receiveParam.getHeight());
+ if (receiveParam.getPages() == null) {
+ throw new BusinessException("鑺傜洰鍐呭涓㈠け");
+ }
led.setPages(JSON.toJSONString(receiveParam.getPages()));
return updateById(led);
}
- public boolean deleteProgram(Long id) {
- LEDProgram byId = getById(id);
- if (byId == null) {
+ public boolean deleteProgram(List<Long> pids) {
+ List<LEDProgram> ledPrograms = listByIds(pids);
+ if (ledPrograms.isEmpty()) {
throw new BusinessException("鏈壘鍒拌鑺傜洰");
}
- return removeById(id);
+ return removeByIds(pids);
}
@@ -102,10 +108,10 @@
if (seq != null) {
switch (seq) {
case 1:
- orderBySeq = " ASC";
+ orderBySeq = OrderByEnums.ASC.getCode();
break;
case 2:
- orderBySeq = " DESC";
+ orderBySeq = OrderByEnums.DESC.getCode();
break;
default:
break;
--
Gitblit v1.9.3