From c2e93e1d046878fab50eb5379470baff822b493e Mon Sep 17 00:00:00 2001
From: liuhaonan <31457034@qq.com>
Date: 星期一, 16 五月 2022 16:35:41 +0800
Subject: [PATCH] 日志

---
 ximon-admin/src/main/java/com/sandu/ximon/admin/service/PlayPlanNvService.java |   44 +++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 43 insertions(+), 1 deletions(-)

diff --git a/ximon-admin/src/main/java/com/sandu/ximon/admin/service/PlayPlanNvService.java b/ximon-admin/src/main/java/com/sandu/ximon/admin/service/PlayPlanNvService.java
index a63ca7b..2b57a7a 100644
--- a/ximon-admin/src/main/java/com/sandu/ximon/admin/service/PlayPlanNvService.java
+++ b/ximon-admin/src/main/java/com/sandu/ximon/admin/service/PlayPlanNvService.java
@@ -121,8 +121,29 @@
         playPlan.setEndTime(playPlanParam.getEndTime());
         //  BeanUtils.copyProperties(playPlanParam, playPlan);
 
+        /**
+         * 璇虹摝瀹氭椂浠诲姟/鎾斁璁″垝鏂板鏃ュ織璁板綍寮�濮�
+         */
+        boolean save = save(playPlan);
+        String content = "{鎾斁璁″垝锛�" + playPlan.getId()
+                + "锛� 鑺傜洰鍚嶇О锛�" + byId.getName()
+                + "锛� 鎾斁璁″垝璁″垝鍚嶇О锛�"
+                + playPlan.getName()
+                + "锛� 鎾斁璁″垝璁″垝鍐呭锛�"
+                + JSON.toJSONString(playPlan)
+                + "锛� 瀹氭椂浠诲姟鍐呭锛�" + playPlan.getSchedule()
+                + "}," + " 鎺ㄩ�佺粨鏋滐細" + save
+                + " }";
+        if (playPlanParam.getId() == null) {
+            StoreOperationRecordsUtils.storeOperationData(null, null, "璇虹摝瀹氭椂浠诲姟/鎾斁璁″垝鏂板", content);
+        } else {
+            StoreOperationRecordsUtils.storeOperationData(null, null, "璇虹摝瀹氭椂浠诲姟/鎾斁璁″垝淇敼", content);
+        }
+        /**
+         * 璇虹摝瀹氭椂浠诲姟/鎾斁璁″垝鏂板鏃ュ織璁板綍缁撴潫
+         */
 
-        return save(playPlan);
+        return save;
 
     }
 
@@ -132,6 +153,7 @@
             throw new BusinessException("鎿嶄綔瀵硅薄涓嶅瓨鍦�");
         }
         if (removeById(id)) {
+            playPlanParam.setId(id);
             return addPlan(playPlanParam);
         }
 
@@ -151,6 +173,7 @@
 
     public Map<String, Object> pushToLed(Long planId, List<NovaPushResultVO> nova) {
         PushToLed pushToLed = playPlanMapper.pushToLed(planId);
+        PlayPlanNv byId = getById(planId);
         if (pushToLed == null) {
             throw new BusinessException("鏈壘鍒拌鎾斁璁″垝");
         }
@@ -208,6 +231,25 @@
         result.put("success", successList);
         result.put("fail", faileList);
 
+        /**
+         * 璇虹摝鎺ㄩ�佽妭鐩棩蹇楄褰曞紑濮�
+         */
+        List<LedPlayerEntity> list = SpringContextHolder.getBean(LedPlayerEntityService.class)
+                .list(Wrappers.lambdaQuery(LedPlayerEntity.class).in(LedPlayerEntity::getId, nova.stream().map(NovaPushResultVO::getPlayerId).toArray()));
+        List<String> listCode = new ArrayList<>();
+        for (LedPlayerEntity temp : list) {
+            listCode.add(temp.getSn());
+        }
+
+        String content = "{鑺傜洰ID锛�" + planId
+                + "锛� 鑺傜洰鍚嶇О锛�" + byId.getName()
+                + "}," + " 鎺ㄩ�佺粨鏋滐細" + result
+                + " }";
+        StoreOperationRecordsUtils.storeOperationData(listCode, null, "璇虹摝鎺ㄩ�佸畾鏃朵换鍔�", content);
+        /**
+         * 璇虹摝鎺ㄩ�佽妭鐩棩蹇楄褰曠粨鏉�
+         */
+
         return result;
     }
 

--
Gitblit v1.9.3