2021与蓝度共同重构项目,服务端
zhanzhiqin
2022-05-26 a1c416b13a71c293c3430f2c9cbce97ee96085ba
ximon-admin/src/main/java/com/sandu/ximon/admin/service/XiXunPlayerService.java
@@ -77,7 +77,7 @@
                                LedSFile file = xiXunFileService.getById(fileId);
                                String fileUrl = file.getFileUrl();
                                String[] split = fileUrl.split("/");
                                sourcePro.setId(split[split.length-1]);
                                sourcePro.setId(split[split.length - 1]);
                                sourcePro.setMd5(file.getMd5());
                            }
                    );
@@ -168,7 +168,9 @@
     * @param programId
     * @param lightemitIds
     */
    public void videoXixunPlayer(long programId, List<Long> lightemitIds) {
    public List<Map> videoXixunPlayer(long programId, List<Long> lightemitIds) {
        //记录操作结果
        List<Map> mapList = new ArrayList<>();
        ProgramPro pro = new ProgramPro();
        ItemPro items = new ItemPro();
@@ -215,11 +217,29 @@
        Collection<PoleLightemitEntity> poleLightemitEntities = poleLightemitService.listByIds(lightemitIds);
        if (poleLightemitEntities != null) {
            Map map;
            for (PoleLightemitEntity entity : poleLightemitEntities) {
                lightemitUtils.clear(entity.getLightemitControlCode());
                poleLightemitService.updateRequestBody(entity.getLightemitControlCode(), jsondata);
                String post = lightemitUtils.post(realtimeServerBean.getCommand() + entity.getLightemitControlCode(), jsondata);
                LogUtils.error("结果:" + post);
                map = new LinkedHashMap();
                String clearResult = lightemitUtils.clear(entity.getLightemitControlCode());
                if (clearResult.contains("does not exist")) {
                    map.put("LightemitId", entity.getLightemitId());
                    map.put("Result", "失败");
                    mapList.add(map);
                } else {
                    poleLightemitService.updateRequestBody(entity.getLightemitControlCode(), jsondata);
                    String post = lightemitUtils.post(realtimeServerBean.getCommand() + entity.getLightemitControlCode(), jsondata);
                    //{"_type":"success","_id":"ce8dc3ff-dc88-43b7-8f55-60abd8700f1a","timestamp":1653555160535}
                    if (post.startsWith("{") && post.endsWith("}") && post.contains("_type\":\"success")) {
                        map.put("LightemitId", entity.getLightemitId());
                        map.put("Result", "成功");
                        mapList.add(map);
                    } else {
                        map.put("LightemitId", entity.getLightemitId());
                        map.put("Result", "失败");
                        mapList.add(map);
                    }
                    LogUtils.error("结果:" + post);
                }
            }
        }
@@ -239,6 +259,8 @@
        /**
         * 熙汛节目推送日志记录结束
         */
        return mapList;
    }