From 5459d7d124fc4c4eb93e8074354dd72c9527081e Mon Sep 17 00:00:00 2001
From: liuhaonan <konodioda2333@vip.qq.com>
Date: 星期二, 19 四月 2022 18:14:33 +0800
Subject: [PATCH] 首页

---
 ximon-admin/src/main/java/com/sandu/ximon/admin/service/LightService.java |   45 +++++++++++++++++++--------------------------
 1 files changed, 19 insertions(+), 26 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 481e2fa..4903e14 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
@@ -10,6 +10,8 @@
 import com.sandu.common.execption.BusinessException;
 import com.sandu.common.redis.RedisService;
 import com.sandu.common.service.impl.BaseServiceImpl;
+import com.sandu.common.util.SpringContextHolder;
+import com.sandu.ximon.admin.dto.LightTaskDto;
 import com.sandu.ximon.admin.manager.iot.frame.A5Frame;
 import com.sandu.ximon.admin.manager.iot.frame.inner.report.A5LightHeartbeatReportInnerFrame;
 import com.sandu.ximon.admin.manager.iot.frame.inner.request.A5LightBrightnessReqInnerFrame;
@@ -205,39 +207,30 @@
         Long clientId = SecurityUtils.getClientId();
 //        List<LightBo> listLight = baseMapper.listLight(clientId, null);
 //        List<String> deviceCodeList = listLight.stream().map(LightBo::getDeviceCode).collect(Collectors.toList());
-        List<String> deviceCodeList = new ArrayList<>();
-        deviceCodeList.add("32313243305005ffa633ffff");
-//        DateTime startDate = DateUtil.date();
-//        DateTime endDate = DateUtil.offsetDay(startDate, 3);
-//        if (CollectionUtil.isNotEmpty(deviceCodeList)) {
-//
-//            List<LightReportDataBo> reportDataList = lightReportDataService.reportDataList(deviceCodeList, startDate,  endDate);
-//        }
 
-        //鑾峰彇鐢ㄦ埛鏈�杩�7澶╃殑鍗曠伅鏁版嵁
-        List<LightReportData> reportDataList = lightReportDataService.list(Wrappers.<LightReportData>lambdaQuery()
-                .in(LightReportData::getDeviceCode, deviceCodeList)
-                .ge(LightReportData::getCreateTime, DateUtil.offsetDay(DateUtil.yesterday(), -7))
-                .orderByDesc(LightReportData::getCreateTime));
+        List<LightTaskDto> lightTaskDtos = SpringContextHolder.getBean(LightTaskService.class).listLightTask(null, null);
+        lightTaskDtos.forEach(Task -> {
 
 
-        LocalDateTime dateTime = LocalDateTime.now();
-        dateTime.plusDays(7L);
-        reportDataList.forEach(
-                reportData -> {
-                    LocalDateTime createTime = reportData.getCreateTime();
-                    if(dateTime.plusDays(-1L).getDayOfMonth()==createTime.getDayOfMonth()){
-
-                    }
-                }
-        );
+                });
 
 
-        Map map = new HashMap();
-        map.put("-1", null);
 
 
-        return reportDataList;
+        return null;
+    }
+
+    /**
+     * 瑙f瀽寮�鍏崇伅鎸囦护
+     */
+    public void parseSwitchLightCommand(String command) {
+        char[] chars = command.toCharArray();
+        if(chars.length==7){
+            int hour = Integer.valueOf(command.substring(0,2));
+            int min = Integer.valueOf(command.substring(2,4));
+            int brightness = Integer.valueOf(command.substring(4,7));
+        }
+
     }
 
     /**

--
Gitblit v1.9.3