From bfce748e37a753c729e15dd233600379f504d019 Mon Sep 17 00:00:00 2001
From: zhanzhiqin <895896009@qq.com>
Date: 星期四, 28 四月 2022 13:59:28 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
ximon-admin/src/main/java/com/sandu/ximon/admin/service/LightService.java | 31 +++++++++++++++++++++++++++++--
1 files changed, 29 insertions(+), 2 deletions(-)
diff --git a/ximon-admin/src/main/java/com/sandu/ximon/admin/service/LightService.java b/ximon-admin/src/main/java/com/sandu/ximon/admin/service/LightService.java
index 58a4ddb..f47039a 100644
--- a/ximon-admin/src/main/java/com/sandu/ximon/admin/service/LightService.java
+++ b/ximon-admin/src/main/java/com/sandu/ximon/admin/service/LightService.java
@@ -5,6 +5,7 @@
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.pagehelper.PageHelper;
+import com.sandu.common.domain.CommonPage;
import com.sandu.common.execption.BusinessException;
import com.sandu.common.redis.RedisService;
import com.sandu.common.service.impl.BaseServiceImpl;
@@ -116,7 +117,7 @@
);
for (LightReportData lightReportData : reportDataList) {
if (StrUtil.equals(lightBo.getDeviceCode(), lightReportData.getDeviceCode())) {
- lightBo.setReportTime(lightReportData.getCreateTime());
+ lightBo.setReportTime(lightReportData.getCreateTime1());
break;
}
}
@@ -166,7 +167,7 @@
List<Map<String, Object>> resultList = new ArrayList<>();
for (LightControlParam param : paramList) {
- A5LightBrightnessReqInnerFrame lightControlFrame = new A5LightBrightnessReqInnerFrame(param.getBrightness());
+ A5LightBrightnessReqInnerFrame lightControlFrame = new A5LightBrightnessReqInnerFrame(param.getBrightness(), param.getLightAddress());
A5Frame a5Frame = new A5Frame(A5OrderEnum.REQUEST_LIGHT_DATA.getCode(), lightControlFrame);
Map<String, Object> map = new HashMap<>();
try {
@@ -467,4 +468,30 @@
return lightList;
}
+ /**
+ * 鑾峰彇鐢ㄦ埛鎵�鏈夌殑璁惧鐮�
+ */
+ public CommonPage<String> listDeviceCode(int pageNo, int pageSize, String keyword, String deviceCode) {
+ List<String> list;
+ if (SecurityUtils.getClientId() != null) {
+ PageHelper.startPage(pageNo, pageSize);
+ list = baseMapper.listCode(SecurityUtils.getUserId(), keyword, deviceCode);
+ } else {
+
+ PageHelper.startPage(pageNo, pageSize);
+ list = baseMapper.listCode(null, keyword, deviceCode);
+ }
+
+ return CommonPage.restPage(list);
+ }
+
+ public boolean setPower(List<Long> ids, Integer power1, Integer power2) {
+ List<Light> lights = listByIds(ids);
+ lights.forEach(light -> {
+ light.setPower1(power1);
+ light.setPower2(power2);
+ }
+ );
+ return updateBatchById(lights);
+ }
}
--
Gitblit v1.9.3