From 15fe445c820f28139e4e7e1a4cb286ad6ae37e6e Mon Sep 17 00:00:00 2001
From: liuhaonan <31457034@qq.com>
Date: 星期一, 06 六月 2022 11:05:17 +0800
Subject: [PATCH] bug修复

---
 ximon-admin/src/main/java/com/sandu/ximon/admin/service/PoleLightemitService.java |  423 ++++++++++++++++++++++++----------------------------
 1 files changed, 194 insertions(+), 229 deletions(-)

diff --git a/ximon-admin/src/main/java/com/sandu/ximon/admin/service/PoleLightemitService.java b/ximon-admin/src/main/java/com/sandu/ximon/admin/service/PoleLightemitService.java
index 316afaf..616465a 100644
--- a/ximon-admin/src/main/java/com/sandu/ximon/admin/service/PoleLightemitService.java
+++ b/ximon-admin/src/main/java/com/sandu/ximon/admin/service/PoleLightemitService.java
@@ -1,25 +1,24 @@
 package com.sandu.ximon.admin.service;
 
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import com.github.pagehelper.PageHelper;
 import com.google.gson.Gson;
 import com.sandu.common.execption.BusinessException;
-import com.sandu.common.object.BaseConditionVO;
 import com.sandu.common.service.impl.BaseServiceImpl;
-import com.sandu.ximon.admin.config.NginxConfigBean;
+import com.sandu.common.util.SpringContextHolder;
 import com.sandu.ximon.admin.config.RealtimeServerBean;
 import com.sandu.ximon.admin.entity.*;
 import com.sandu.ximon.admin.param.PoleBindingParam;
 import com.sandu.ximon.admin.security.SecurityUtils;
-import com.sandu.ximon.admin.utils.Constant;
 import com.sandu.ximon.admin.utils.FileUtil;
 import com.sandu.ximon.admin.utils.HtmlTemplateUtils;
 import com.sandu.ximon.admin.utils.LightemitUtils;
-import com.sandu.ximon.admin.utils.request.SubTitleSet;
+import com.sandu.ximon.admin.utils.StoreOperationRecordsUtils;
+import com.sandu.ximon.admin.vo.EquipmentInfomation;
+import com.sandu.ximon.dao.domain.Pole;
 import com.sandu.ximon.dao.domain.PoleLightemitEntity;
+import com.sandu.ximon.dao.enums.OrderByEnums;
+import com.sandu.ximon.dao.enums.PoleBindingEnums;
 import com.sandu.ximon.dao.mapper.PoleLightemitEntityMapper;
-import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.cache.annotation.EnableCaching;
@@ -49,8 +48,6 @@
     private String port;
     @Autowired
     ApplicationContext applicationContext;
-    @Autowired
-    NginxConfigBean nginxConfigBean;
 
     @Autowired
     PoleLightemitEntityMapper poleLightemitDao;
@@ -68,38 +65,129 @@
      * @param isOnLine
      * @return
      */
-    public List<PoleLightemitEntity> listLed(String keyword, boolean isOnLine) {
+    public List<PoleLightemitEntity> listLed(String keyword, Integer order, Integer seq, boolean isOnLine) {
         List<PoleLightemitEntity> poleLightemitEntityList;
+        //鎺掑簭瀛楁
+        String orderByResult = "id";
+        //姝e簭銆佸�掑彊
+        String orderBySeq = OrderByEnums.ASC.getCode();
+        if (order != null) {
+            switch (order) {
+                case 1:
+                    orderByResult = OrderByEnums.LED_S_CODE.getCode();
+                    break;
+                case 2:
+                    orderByResult = OrderByEnums.LED_S_NAME.getCode();
+                    break;
+                case 3:
+                    orderByResult = OrderByEnums.LED_S_POLE_NAME.getCode();
+                    break;
+                case 4:
+                    orderByResult = OrderByEnums.LED_S_CREATE_TIME.getCode();
+                    break;
+                default:
+            }
+        }
+        if (seq != null) {
+            switch (seq) {
+                case 1:
+                    orderBySeq = " ASC";
+                    break;
+                case 2:
+                    orderBySeq = " DESC";
+                    break;
+                default:
+                    break;
+            }
+        }
+        //鎺掑簭鏂瑰紡
+        String orderBy = orderByResult + " " + orderBySeq;
+
         //瓒呯
         if (SecurityUtils.getClientId() == null) {
-            poleLightemitEntityList = poleLightemitDao.listLed(keyword, null);
+            poleLightemitEntityList = poleLightemitDao.listLed(keyword, null, orderBy);
         } else {
-            poleLightemitEntityList = poleLightemitDao.listLed(keyword, SecurityUtils.getUserId());
+            poleLightemitEntityList = poleLightemitDao.listLed(keyword, SecurityUtils.getUserId(), orderBy);
         }
-        if (isOnLine) {
-            return ledOnline(poleLightemitEntityList);
-        } else {
-            ledOnlineCheck(poleLightemitEntityList);
-            return poleLightemitEntityList;
+
+        List<PoleLightemitEntity> temp = new ArrayList<>();
+        for (PoleLightemitEntity poleLightemitEntity : poleLightemitEntityList) {
+            //鏌ヨ璁惧鍦ㄧ嚎鐘舵��
+            boolean onLine = lightemitUtils.getLedOnLine(poleLightemitEntity.getLightemitControlCode());
+            //鏌ヨ灞忓箷鐨勫紑鍚姸鎬�
+            String isOpen = lightemitUtils.getIsScreenOpen(poleLightemitEntity.getLightemitControlCode());
+            poleLightemitEntity.setIsOpen(String.valueOf(isOpen));
+            poleLightemitEntity.setOnLine(onLine);
+            if (!isOnLine || onLine) {
+                temp.add(poleLightemitEntity);
+            }
         }
+        return temp;
     }
 
+
+    /**
+     * 缁戝畾浣跨敤
+     *
+     * @param keyword
+     * @return
+     */
+    public List<PoleLightemitEntity> listLedOnBinding(String keyword) {
+        List<PoleLightemitEntity> poleLightemitEntityList;
+
+
+        //瓒呯
+        if (SecurityUtils.getClientId() == null) {
+            poleLightemitEntityList = poleLightemitDao.listLedOnBinding(keyword, null);
+        } else {
+            poleLightemitEntityList = poleLightemitDao.listLedOnBinding(keyword, SecurityUtils.getUserId());
+        }
+
+        for (PoleLightemitEntity poleLightemitEntity : poleLightemitEntityList) {
+            //鏌ヨ璁惧鍦ㄧ嚎鐘舵��
+            boolean onLine = lightemitUtils.getLedOnLine(poleLightemitEntity.getLightemitControlCode());
+            //鏌ヨ灞忓箷鐨勫紑鍚姸鎬�
+            String isOpen = lightemitUtils.getIsScreenOpen(poleLightemitEntity.getLightemitControlCode());
+            poleLightemitEntity.setIsOpen(String.valueOf(isOpen));
+            poleLightemitEntity.setOnLine(onLine);
+        }
+        return poleLightemitEntityList;
+    }
+
+    /**
+     * 鍙栧嚭鍦ㄧ嚎鐨勭啓璁�
+     *
+     * @param list
+     * @return
+     */
     public List<PoleLightemitEntity> ledOnline(List<PoleLightemitEntity> list) {
         List<PoleLightemitEntity> onLineList = new ArrayList<>();
         for (PoleLightemitEntity poleLightemitEntity : list) {
-            poleLightemitEntity.setIsOpen(lightemitUtils.getIsScreenOpen(poleLightemitEntity.getLightemitControlCode()).contains("true"));
-            if (poleLightemitEntity.getIsOpen()) {
+//            if(lightemitUtils.getIsScreenOpen(poleLightemitEntity.getLightemitControlCode()).contains("true")){
+//                poleLightemitEntity.setIsOpen(lightemitUtils.getIsScreenOpen(poleLightemitEntity.getLightemitControlCode()).contains("true"));
+//            }
+            poleLightemitEntity.setIsOpen(lightemitUtils.getIsScreenOpen(poleLightemitEntity.getLightemitControlCode()));
+            boolean ledOnLine = lightemitUtils.getLedOnLine(poleLightemitEntity.getLightemitControlCode());
+            if (ledOnLine) {
+                poleLightemitEntity.setOnLine(true);
                 onLineList.add(poleLightemitEntity);
+            } else {
+                poleLightemitEntity.setOnLine(false);
             }
         }
         return onLineList;
     }
 
 
+    /**
+     * 璁剧疆鍦ㄧ嚎鐘舵��
+     *
+     * @param list
+     */
     public void ledOnlineCheck(List<PoleLightemitEntity> list) {
         for (PoleLightemitEntity poleLightemitEntity : list) {
-            poleLightemitEntity.setIsOpen(lightemitUtils.getIsScreenOpen(poleLightemitEntity.getLightemitControlCode()).contains("true"));
-
+            poleLightemitEntity.setIsOpen(lightemitUtils.getIsScreenOpen(poleLightemitEntity.getLightemitControlCode()));
+            poleLightemitEntity.setOnLine(lightemitUtils.getLedOnLine(poleLightemitEntity.getLightemitControlCode()));
         }
     }
 
@@ -112,15 +200,44 @@
      */
     public PoleLightemitEntity getLedByLightControlCode(String lightControlCode) {
         PoleLightemitEntity xiXun = getOne(Wrappers.lambdaQuery(PoleLightemitEntity.class).eq(PoleLightemitEntity::getLightemitControlCode, lightControlCode));
+        Pole getpole = poleLightemitDao.getpole(lightControlCode);
         if (xiXun == null) {
             return null;
         }
-        String isScreenOpen = lightemitUtils.getIsScreenOpen(xiXun.getLightemitControlCode());
-        if (isScreenOpen.contains("true")) {
-            xiXun.setIsOpen(true);
-        }
-        xiXun.setIsOpen(false);
+        boolean isScreenOpen = lightemitUtils.getLedOnLine(xiXun.getLightemitControlCode());
+
+        xiXun.setIsOpen(lightemitUtils.getIsScreenOpen(lightControlCode));
+        xiXun.setOnLine(isScreenOpen);
+        xiXun.setStreetlightName(getpole.getPoleName());
+        xiXun.setStreetlightId(getpole.getId());
+
         return xiXun;
+    }
+
+    /**
+     * 棣栭〉鐏潌缁戝畾淇℃伅
+     */
+    public EquipmentInfomation getLedByLightControlCodeInfo(String lightControlCode) {
+        EquipmentInfomation equipmentInfo = new EquipmentInfomation();
+        equipmentInfo.setEquipmentType("鐔欒LED");
+        if (lightControlCode == null || lightControlCode.trim().length() == 0) {
+            return equipmentInfo;
+        }
+
+        PoleLightemitEntity xiXun = getOne(Wrappers.lambdaQuery(PoleLightemitEntity.class).eq(PoleLightemitEntity::getLightemitControlCode, lightControlCode));
+        if (xiXun != null) {
+            equipmentInfo.setEquipmentCreateTime(xiXun.getCreateTime());
+            equipmentInfo.setEquipmentMac(xiXun.getLightemitControlCode());
+            equipmentInfo.setEquipmentName(xiXun.getLightemitName());
+        }
+        boolean isScreenOpen = lightemitUtils.getLedOnLine(xiXun.getLightemitControlCode());
+        if (isScreenOpen) {
+            equipmentInfo.setEquipmentState("鍦ㄧ嚎");
+        } else {
+            equipmentInfo.setEquipmentState("绂荤嚎");
+        }
+
+        return equipmentInfo;
     }
 
 
@@ -128,13 +245,24 @@
         boolean save = this.save(poleLightemit);
         // 缁戝畾鐏潌
 
-        if (save && poleLightemit.getPoleId() != null) {
+        if (save && poleLightemit.getStreetlightId() != null) {
             PoleBindingParam poleBindingParam = new PoleBindingParam();
             poleBindingParam.setDeviceCode(poleLightemit.getLightemitControlCode());
             poleBindingParam.setDeviceType(1);
             poleBindingParam.setDeviceName(poleLightemit.getLightemitName());
-            poleBindingService.bindPole(poleLightemit.getPoleId(), poleBindingParam);
+            poleBindingService.bindPole(poleLightemit.getStreetlightId(), poleBindingParam);
         }
+
+        /**
+         * 鐔欐睕led鏂板鏃ュ織璁板綍寮�濮�
+         */
+        List<String> listCode = new ArrayList<>();
+        listCode.add(poleLightemit.getLightemitControlCode());
+        String content = "{灞忓箷id锛�" + poleLightemit.getLightemitId() + "锛� 灞忓箷鍚嶇О锛�" + poleLightemit.getLightemitName() + "锛� 灞忓箷缂栫爜锛�" + poleLightemit.getLightemitControlCode() + " }";
+        StoreOperationRecordsUtils.storeOperationData(listCode, null, "鐔欐睕LED鏂板", content);
+        /**
+         * 鐔欐睕led鏂板鏃ュ織璁板綍缁撴潫
+         */
         //  poleStreetlightLightemitService.saveStreetlightLightemit(poleLightemit.getLightemitId(),poleLightemit.getStreetlightId());
     }
 
@@ -144,11 +272,16 @@
         if (byId == null) {
             throw new BusinessException("鏈壘鍒癓ED灞�");
         }
+
+        boolean belong = SpringContextHolder.getBean(PoleBindingService.class).isBelong(byId.getLightemitControlCode(), PoleBindingEnums.XIXUN);
+        if (!belong) {
+            throw new BusinessException("璇ヨ澶囦笉灞炰簬鎮�,涓嶈兘淇敼璁惧淇℃伅");
+        }
         poleLightemit.setLightemitId(ledId);
         boolean b = this.updateById(poleLightemit);
         // 缁戝畾鐏潌
 
-        if (b && poleLightemit.getPoleId() != null) {
+        if (b && poleLightemit.getStreetlightId() != null) {
             //鍏堝垹闄ょ粦瀹氬叧绯�
             poleBindingService.unBindPole(null, poleLightemit.getLightemitControlCode());
             //鍐嶇粦瀹�
@@ -156,26 +289,56 @@
             poleBindingParam.setDeviceCode(poleLightemit.getLightemitControlCode());
             poleBindingParam.setDeviceType(10);
             poleBindingParam.setDeviceName(poleLightemit.getLightemitName());
-            poleBindingService.bindPole(poleLightemit.getPoleId(), poleBindingParam);
+            poleBindingService.bindPole(poleLightemit.getStreetlightId(), poleBindingParam);
         }
+
+        /**
+         * 鐔欐睕led缂栬緫鏃ュ織璁板綍寮�濮�
+         */
+        List<String> listCode = new ArrayList<>();
+        listCode.add(byId.getLightemitControlCode());
+        String content = "{灞忓箷id锛�" + byId.getLightemitId() + "锛� 灞忓箷鍘熷悕锛�" + byId.getLightemitName() + "锛� 灞忓箷鍚嶇О锛�" + poleLightemit.getLightemitName() + "锛� 灞忓箷缂栫爜锛�" + byId.getLightemitControlCode() + " }";
+        StoreOperationRecordsUtils.storeOperationData(listCode, null, "鐔欐睕LED缂栬緫", content);
+        /**
+         * 鐔欐睕led缂栬緫鏃ュ織璁板綍缁撴潫
+         */
         // poleStreetlightLightemitService.saveStreetlightLightemit(poleLightemit.getLightemitId(),poleLightemit.getStreetlightId());
     }
 
     public boolean deletePoleLightemit(List<Long> ledIds) {
 
         List<PoleLightemitEntity> poleLightemitEntities = listByIds(ledIds);
+        if (poleLightemitEntities != null && poleLightemitEntities.size() != 0) {
+            throw new BusinessException("璁惧涓嶅瓨鍦�");
+        }
 
+        List<String> listCode = new ArrayList<>();
         // 鍒犻櫎璁惧缁戝畾
         if (poleLightemitEntities != null && poleLightemitEntities.size() != 0) {
             for (PoleLightemitEntity poleLightemitEntitie : poleLightemitEntities) {
                 if (poleLightemitEntitie.getLightemitControlCode() != null) {
                     //鍒犻櫎缁戝畾鍏崇郴//鍏堝垹闄ょ粦瀹氬叧绯�
+                    listCode.add(poleLightemitEntitie.getLightemitControlCode());
                     poleBindingService.unBindPole(poleLightemitEntitie.getLightemitControlCode());
                 }
             }
         }
         //鍒犻櫎璁惧
         boolean b = removeByIds(ledIds);
+
+        /**
+         * 鐔欐睕led鍒犻櫎鏃ュ織璁板綍寮�濮�
+         */
+        List<String> nameList = new ArrayList<>();
+        for (PoleLightemitEntity poleLightemitEntitie : poleLightemitEntities) {
+            nameList.add(poleLightemitEntitie.getLightemitName());
+        }
+
+        String content = "{鍒犻櫎鐔欐睕LED鐨勮澶囦俊鎭細" + nameList.toString() + " }";
+        StoreOperationRecordsUtils.storeOperationData(listCode, null, "鐔欐睕LED鍒犻櫎", content);
+        /**
+         * 鐔欐睕led鍒犻櫎鏃ュ織璁板綍缁撴潫
+         */
         return b;
         // poleStreetlightLightemitService.saveStreetlightLightemit(poleLightemit.getLightemitId(),poleLightemit.getStreetlightId());
     }
@@ -247,40 +410,6 @@
 
     }
 
-    /**
-     * LED涓婁紶鍗曡瀛楀箷
-     */
-    @Async("taskExecutor")
-    public Boolean subTitleSet(SubTitleSetEntity subTitleSetEntity, String path, String userName) {
-        if (subTitleSetEntity == null) {
-            return false;
-        }
-        if (subTitleSetEntity.getDirection().equals(Constant.LEFT) || subTitleSetEntity.getDirection().equals(Constant.RIGHT)) {
-            //瀛楀箷妯悜婊氬姩
-            this.BuildHorizonSingSubTitleText(subTitleSetEntity);
-        } else if (subTitleSetEntity.getDirection().equals(Constant.UP) || subTitleSetEntity.getDirection().equals(Constant.DOWN)) {
-            //瀛楀箷绾靛悜婊氬姩
-            try {
-                this.BuildVerticalSingSubTitleText(subTitleSetEntity, path, userName);
-            } catch (IOException e) {
-                return false;
-            }
-        }
-        return true;
-    }
-
-    /**
-     * LED涓婁紶澶氳瀛楀箷
-     */
-    @Async("taskExecutor")
-    public Boolean subMultiTitleSet(SubTitleSetEntity subTitleSetEntity, String path, String userName) {
-        try {
-            this.BuildVerticalMultiSubTitleText(subTitleSetEntity, path, userName);
-            return true;
-        } catch (IOException e) {
-            return false;
-        }
-    }
 
     @Async("taskExecutor")
     public void videoXixunPlayer(String lightemitControlCode, String ip, String filename, Long filesize, Integer videoTime) {
@@ -385,7 +514,7 @@
     }
 
     /**
-     * 鏍规嵁led灞忕紪鐮佽缃煶閲�
+     * 鏍规嵁led灞忕紪鐮佽缃寒搴�
      *
      * @param lightemitControlCode
      * @param brightness
@@ -395,168 +524,4 @@
         lightemitUtils.setBrightness(lightemitControlCode, brightness);
     }
 
-    /**
-     * 涓婁紶姘村钩婊氬姩鍗曡瀛楀箷
-     *
-     * @param subTitleSetEntity
-     */
-    private void BuildHorizonSingSubTitleText(SubTitleSetEntity subTitleSetEntity) {
-        //鎷艰LED灞忓箷璁剧疆璇锋眰body
-        SubTitleSet subTitleSet = new SubTitleSet();
-        subTitleSet.num = subTitleSetEntity.getNum() != null ? subTitleSetEntity.getNum() : subTitleSet.num;
-        subTitleSet.interval = subTitleSetEntity.getInterval() != null ? subTitleSetEntity.getInterval() : subTitleSet.interval;
-        subTitleSet.step = subTitleSetEntity.getStep() != null ? subTitleSetEntity.getStep() : subTitleSet.step;
-        subTitleSet.direction = subTitleSetEntity.getDirection() != null ? subTitleSetEntity.getDirection() : subTitleSet.direction;
-        subTitleSet.align = subTitleSetEntity.getAlign() != null ? subTitleSetEntity.getAlign() : subTitleSet.align;
-        //鎷兼帴html 鑳屾櫙榛樿鏄捐壊涓虹櫧鑹�
-        subTitleSet.html = "<head><style type=\"text/css\">body{background-color:" +
-                (subTitleSetEntity.getColor() != null && StringUtils.isNotBlank(subTitleSetEntity.getColor()) ? subTitleSetEntity.getColor() : "#000000") +
-                "}</style></head><i style=\"color:" +
-                (subTitleSetEntity.getFontColor() != null && StringUtils.isNotBlank(subTitleSetEntity.getFontColor()) ? subTitleSetEntity.getFontColor() : "#ffffff")
-                + "; font-size: " +
-                (subTitleSetEntity.getFontSize() != null && StringUtils.isNotBlank(subTitleSetEntity.getFontSize()) ? subTitleSetEntity.getFontSize() : "1")
-                + "em\">" + subTitleSetEntity.getContent() + "</i>";
-
-        //鑾峰彇鎵�鏈塴ed鏁版嵁
-        Collection poleLightemitControllers = this.listByIds(Arrays.asList(subTitleSetEntity.getId()));
-        if (!poleLightemitControllers.isEmpty()) {
-            Iterator iterator = poleLightemitControllers.iterator();
-            while (iterator.hasNext()) {
-                PoleLightemitEntity poleLightemitEntity = (PoleLightemitEntity) iterator.next();
-                //娓呭睆鎿嶄綔
-                lightemitUtils.clear(poleLightemitEntity.getLightemitControlCode());
-                //娓呴櫎鎾斁鍒楄〃
-                lightemitUtils.clearVideoPlay(poleLightemitEntity.getLightemitControlCode());
-                //娓呴櫎鑺傜洰鍒楄〃
-                lightemitUtils.clearPlayerTask(poleLightemitEntity.getLightemitControlCode());
-                //鍙戦�佸瓧骞曡缃姹�
-                lightemitUtils.subTitleSet(subTitleSet, poleLightemitEntity.getLightemitControlCode(), true);
-            }
-        }
-    }
-
-    /**
-     * 涓婁紶鍨傜洿婊氬姩鍗曡瀛楀箷
-     *
-     * @param subTitleSetEntity
-     * @param path
-     * @param userName
-     * @throws IOException
-     */
-    private void BuildVerticalSingSubTitleText(SubTitleSetEntity subTitleSetEntity, String path, String userName) throws IOException {
-        //html鍦板潃
-        //鑾峰彇鎵�鏈塴ed鏁版嵁
-        Collection poleLightemitControllers = this.listByIds(Arrays.asList(subTitleSetEntity.getId()));
-        if (!poleLightemitControllers.isEmpty()) {
-            Iterator iterator = poleLightemitControllers.iterator();
-            while (iterator.hasNext()) {
-                PoleLightemitEntity poleLightemitEntity = (PoleLightemitEntity) iterator.next();
-
-                String lightemitControlCode = poleLightemitEntity.getLightemitControlCode();
-
-                //鑾峰彇灞忓箷瀹�
-                Integer screenWidth = Integer.valueOf(lightemitUtils.getScreenWidth(lightemitControlCode));
-                Integer screenHeight = Integer.valueOf(lightemitUtils.getScreenHeight(lightemitControlCode));
-
-                String filenameTemp = path + userName + "_" + lightemitControlCode + ".html";
-                File htmlFile = new File(filenameTemp);
-                if (!htmlFile.exists() || htmlFile.delete()) {
-                    htmlFile.createNewFile();
-                }
-
-                //鑻ュ悜涓嬫粴鍔紝鏂囧瓧椤哄簭鐩稿弽
-                if (Constant.DOWN.equals(subTitleSetEntity.getDirection())) {
-                    subTitleSetEntity.setContent(StringUtils.reverse(subTitleSetEntity.getContent()));
-                }
-
-                Map<String, Object> params = new HashMap<>();
-                params.put("direction", subTitleSetEntity.getDirection());
-                params.put("screenWidth", screenWidth);
-                params.put("screenHeight", screenHeight);
-                params.put("fontSize", subTitleSetEntity.getFontSize() != null && StringUtils.isNotBlank(subTitleSetEntity.getFontSize()) ? subTitleSetEntity.getFontSize() : "1");
-                params.put("align", subTitleSetEntity.getAlign());
-                params.put("fontColor", subTitleSetEntity.getFontColor() != null && StringUtils.isNotBlank(subTitleSetEntity.getFontColor()) ? subTitleSetEntity.getFontColor() : "#ffffff");
-                params.put("backgroundColor", subTitleSetEntity.getColor() != null && StringUtils.isNotBlank(subTitleSetEntity.getColor()) ? subTitleSetEntity.getColor() : "#000000");
-                params.put("interval", subTitleSetEntity.getInterval() != null ? subTitleSetEntity.getInterval() : 50);
-                params.put("step", subTitleSetEntity.getStep() != null ? subTitleSetEntity.getStep() : 1);
-                params.put("num", subTitleSetEntity.getNum() != null ? subTitleSetEntity.getNum() : -1);
-                params.put("contentArray", subTitleSetEntity.getContent().toCharArray());
-
-                String body = new HtmlTemplateUtils().renderPath("classpath:templates/lightemitTemplates/buildVerticalSingSubTitleTemplates.html", params);
-
-                boolean flag = new FileUtil().writeToFile(body, filenameTemp);
-
-                if (flag) {
-                    //娓呭睆鎿嶄綔
-                    lightemitUtils.clear(lightemitControlCode);
-                    //娓呴櫎鎾斁鍒楄〃
-                    lightemitUtils.clearVideoPlay(lightemitControlCode);
-                    //娓呴櫎鑺傜洰鍒楄〃
-                    lightemitUtils.clearPlayerTask(lightemitControlCode);
-                    //鎺ㄩ��
-                    lightemitUtils.postHtmlUseNginx(lightemitControlCode, userName);
-                }
-            }
-        }
-    }
-
-    /**
-     * 涓婁紶鍨傜洿婊氬姩澶氳瀛楀箷
-     *
-     * @param subTitleSetEntity
-     * @param path
-     * @param userName
-     * @throws IOException
-     */
-    private void BuildVerticalMultiSubTitleText(SubTitleSetEntity subTitleSetEntity, String path, String userName) throws IOException {
-        //html鍦板潃
-        //鑾峰彇鎵�鏈塴ed鏁版嵁
-        Collection poleLightemitControllers = this.listByIds(Arrays.asList(subTitleSetEntity.getId()));
-        if (!poleLightemitControllers.isEmpty()) {
-            Iterator iterator = poleLightemitControllers.iterator();
-            while (iterator.hasNext()) {
-                PoleLightemitEntity poleLightemitEntity = (PoleLightemitEntity) iterator.next();
-
-                String lightemitControlCode = poleLightemitEntity.getLightemitControlCode();
-
-                //鑾峰彇灞忓箷瀹�
-                Integer screenWidth = Integer.valueOf(lightemitUtils.getScreenWidth(lightemitControlCode));
-                Integer screenHeight = Integer.valueOf(lightemitUtils.getScreenHeight(lightemitControlCode));
-
-                String filenameTemp = path + userName + "_" + lightemitControlCode + ".html";
-                File htmlFile = new File(filenameTemp);
-                if (!htmlFile.exists() || htmlFile.delete()) {
-                    htmlFile.createNewFile();
-                }
-
-                Map<String, Object> params = new HashMap<>();
-                params.put("direction", subTitleSetEntity.getDirection());
-                params.put("screenWidth", screenWidth);
-                params.put("screenHeight", screenHeight);
-                params.put("fontSize", subTitleSetEntity.getFontSize() != null && StringUtils.isNotBlank(subTitleSetEntity.getFontSize()) ? subTitleSetEntity.getFontSize() : "1");
-                params.put("align", subTitleSetEntity.getAlign());
-                params.put("fontColor", subTitleSetEntity.getFontColor() != null && StringUtils.isNotBlank(subTitleSetEntity.getFontColor()) ? subTitleSetEntity.getFontColor() : "#ffffff");
-                params.put("backgroundColor", subTitleSetEntity.getColor() != null && StringUtils.isNotBlank(subTitleSetEntity.getColor()) ? subTitleSetEntity.getColor() : "#000000");
-                params.put("interval", subTitleSetEntity.getInterval() != null ? subTitleSetEntity.getInterval() : 50);
-                params.put("step", subTitleSetEntity.getStep() != null ? subTitleSetEntity.getStep() : 1);
-                params.put("num", subTitleSetEntity.getNum() != null ? subTitleSetEntity.getNum() : -1);
-                params.put("contentArray", subTitleSetEntity.getContent().split("\n"));
-
-                String body = new HtmlTemplateUtils().renderPath("classpath:templates/lightemitTemplates/buildVerticalSingSubTitleTemplates.html", params);
-
-                boolean flag = new FileUtil().writeToFile(body, filenameTemp);
-
-                if (flag) {
-                    //娓呭睆鎿嶄綔
-                    lightemitUtils.clear(lightemitControlCode);
-                    //娓呴櫎鎾斁鍒楄〃
-                    lightemitUtils.clearVideoPlay(lightemitControlCode);
-                    //娓呴櫎鑺傜洰鍒楄〃
-                    lightemitUtils.clearPlayerTask(lightemitControlCode);
-                    //鎺ㄩ��
-                    lightemitUtils.postHtmlUseNginx(lightemitControlCode, userName);
-                }
-            }
-        }
-    }
 }
\ No newline at end of file

--
Gitblit v1.9.3