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/LightReportDataService.java |   17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/ximon-admin/src/main/java/com/sandu/ximon/admin/service/LightReportDataService.java b/ximon-admin/src/main/java/com/sandu/ximon/admin/service/LightReportDataService.java
index 1fe87b3..3090329 100644
--- a/ximon-admin/src/main/java/com/sandu/ximon/admin/service/LightReportDataService.java
+++ b/ximon-admin/src/main/java/com/sandu/ximon/admin/service/LightReportDataService.java
@@ -18,6 +18,7 @@
 import com.sandu.ximon.admin.security.SecurityUtils;
 import com.sandu.ximon.admin.utils.RedisUtils;
 import com.sandu.ximon.dao.bo.LightReportDataBo;
+import com.sandu.ximon.dao.domain.Light;
 import com.sandu.ximon.dao.domain.LightReportData;
 import com.sandu.ximon.dao.domain.Pole;
 import com.sandu.ximon.dao.domain.PoleBinding;
@@ -95,7 +96,7 @@
      * @param keyword    鍏抽敭璇�
      * @param deviceCode 璁惧鐮�
      */
-    public CommonPage listReportData(int pageNo, int pageSize, String keyword, String deviceCode,Integer order,Integer seq) {
+    public CommonPage listReportData(int pageNo, int pageSize, String keyword, String deviceCode, Integer order, Integer seq) {
 
         List<LightReportDataBo> lightReportDataBos = new ArrayList<>(pageSize);
         //鎺掑簭瀛楁
@@ -124,7 +125,7 @@
         }
         //鎺掑簭鏂瑰紡
         String orderBy = orderByResult + " " + orderBySeq;
-        CommonPage<String> stringCommonPage = SpringContextHolder.getBean(LightService.class).listDeviceCode(pageNo, pageSize, keyword, deviceCode,orderBy);
+        CommonPage<String> stringCommonPage = SpringContextHolder.getBean(LightService.class).listDeviceCode(pageNo, pageSize, keyword, deviceCode, orderBy);
         List<String> macList = stringCommonPage.getList();
         if (CollUtil.isEmpty(macList)) {
             return new CommonPage();
@@ -241,8 +242,20 @@
         if (macCode.isEmpty()) {
             throw new BusinessException("mac涓嶈兘涓虹┖");
         }
+
+        Light light = SpringContextHolder.getBean(LightService.class)
+                .getOne(Wrappers.lambdaQuery(Light.class).eq(Light::getDeviceCode, macCode));
+        if (light == null) {
+            throw new BusinessException("绯荤粺涓笉瀛樺湪璇ュ崟鐏�");
+        }
         PageHelper.startPage(conditionVO.getPageNo(), conditionVO.getPageSize());
         List<LightReportData> list = list(Wrappers.lambdaQuery(LightReportData.class).eq(LightReportData::getDeviceCode, macCode));
+        list.forEach(
+                lightReportData -> {
+                    lightReportData.setCreateTime(lightReportData.getCreateTime1().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
+                    lightReportData.setUpdateTime(lightReportData.getUpdateTime1().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
+                }
+        );
         return list;
     }
 }

--
Gitblit v1.9.3