| | |
| | | //package com.sandu.ximon.admin.service; |
| | | // |
| | | //import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | //import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | //import com.google.gson.Gson; |
| | | //import com.sandu.common.service.impl.BaseServiceImpl; |
| | | //import com.sandu.ximon.admin.config.NginxConfigBean; |
| | | //import com.sandu.ximon.admin.config.RealtimeServerBean; |
| | | //import com.sandu.ximon.admin.entity.*; |
| | | //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.dao.domain.PoleLightemitEntity; |
| | | //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; |
| | | //import org.springframework.context.ApplicationContext; |
| | | //import org.springframework.scheduling.annotation.Async; |
| | | //import org.springframework.stereotype.Service; |
| | | // |
| | | //import javax.annotation.PostConstruct; |
| | | //import java.io.File; |
| | | //import java.io.IOException; |
| | | //import java.util.*; |
| | | // |
| | | // |
| | | //@Service |
| | | //@EnableCaching |
| | | //public class PoleLightemitService extends BaseServiceImpl<PoleLightemitDao, PoleLightemitEntity> { |
| | | // |
| | | // @Autowired |
| | | package com.sandu.ximon.admin.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.google.gson.Gson; |
| | | import com.sandu.common.service.impl.BaseServiceImpl; |
| | | import com.sandu.ximon.admin.config.NginxConfigBean; |
| | | import com.sandu.ximon.admin.config.RealtimeServerBean; |
| | | import com.sandu.ximon.admin.entity.*; |
| | | 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.dao.domain.PoleLightemitEntity; |
| | | 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; |
| | | import org.springframework.context.ApplicationContext; |
| | | import org.springframework.scheduling.annotation.Async; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.PostConstruct; |
| | | import java.io.File; |
| | | import java.io.IOException; |
| | | import java.util.*; |
| | | |
| | | |
| | | @Service |
| | | @EnableCaching |
| | | public class PoleLightemitService extends BaseServiceImpl<PoleLightemitEntityMapper, PoleLightemitEntity> { |
| | | |
| | | // @Autowired |
| | | // PoleStreetlightLightemitService poleStreetlightLightemitService; |
| | | // LightemitUtils lightemitUtils; |
| | | // @Autowired |
| | | // RealtimeServerBean realtimeServerBean; |
| | | // @Value("${server.port}") |
| | | // private String port; |
| | | // @Autowired |
| | | // ApplicationContext applicationContext; |
| | | // @Autowired |
| | | |
| | | LightemitUtils lightemitUtils; |
| | | @Autowired |
| | | private RealtimeServerBean realtimeServerBean; |
| | | @Value("${server.port}") |
| | | private String port; |
| | | @Autowired |
| | | ApplicationContext applicationContext; |
| | | // @Autowired |
| | | // FfmpegUtils ffmpegUtils; |
| | | // @Autowired |
| | | // FileUploadPathBean fileUploadPathBean; |
| | | // @Autowired |
| | | // NginxConfigBean nginxConfigBean; |
| | | // @Autowired |
| | | // PoleLightemitDao poleLightemitDao; |
| | | // |
| | | // @PostConstruct |
| | | // public void init(){ |
| | | // //éæ°è·ååä¾ |
| | | // lightemitUtils = applicationContext.getBean(LightemitUtils.class); |
| | | @Autowired |
| | | NginxConfigBean nginxConfigBean; |
| | | |
| | | @Autowired |
| | | PoleLightemitEntityMapper poleLightemitDao; |
| | | |
| | | @PostConstruct |
| | | public void init() { |
| | | //éæ°è·ååä¾ |
| | | lightemitUtils = applicationContext.getBean(LightemitUtils.class); |
| | | } |
| | | |
| | | /*@Override |
| | | public PageUtils queryPage(Map<String, Object> params, Long userId) { |
| | | |
| | | String key = (String)params.get("key"); |
| | | |
| | | Long groupId = StringUtils.isNotBlank((String)params.get("group"))? Long.valueOf((String)params.get("group")): null; |
| | | |
| | | String order = (String)params.get("order"); |
| | | |
| | | String column = (String)params.get("sortby"); |
| | | |
| | | IPage<PoleLightemitEntity> page = new Page<>(); |
| | | //è·åè§è²å表 |
| | | Long roleId = (sysUserRoleService.queryRoleId(userId)); |
| | | |
| | | if(roleId == null || roleId == 0){ |
| | | return null; |
| | | } |
| | | |
| | | if(roleId.longValue() == Constant.SUPER_ADMIN){ |
| | | // page = this.page( |
| | | // new Query<PoleLightemitEntity>().getPage(params), |
| | | // new QueryWrapper<PoleLightemitEntity>().like(StringUtils.isNotBlank(key),"lightemit_name", key)); |
| | | if (order != null && order.equals("ASC") && column.equals("isOpen")) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | Integer pg = 1; |
| | | Integer size = 200; |
| | | map.put("page",pg); |
| | | params.put("limit",size); |
| | | page = baseMapper.superAdminSelectPageVo(PageTransform.transformPage(params),key,groupId,order,column); |
| | | ledOnlineCheck(page.getRecords()); |
| | | page.setRecords(page.getRecords().stream().filter(h-> h.getIsOpen().equals(true)).collect(Collectors.toList())); |
| | | return new PageUtils(page); |
| | | }else if (order != null && order.equals("DESC") && column.equals("isOpen")){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | | Integer pg = 1; |
| | | Integer size = 200; |
| | | map.put("page",pg); |
| | | params.put("limit",size); |
| | | page = baseMapper.superAdminSelectPageVo(PageTransform.transformPage(params),key,groupId,order,column); |
| | | ledOnlineCheck(page.getRecords()); |
| | | page.setRecords(page.getRecords().stream().filter(h-> h.getIsOpen().equals(false)).collect(Collectors.toList())); |
| | | return new PageUtils(page); |
| | | }else { |
| | | page = baseMapper.superAdminSelectPageVo(PageTransform.transformPage(params), key, groupId,order,column); |
| | | } |
| | | |
| | | }else if(roleId.longValue() == Constant.ADMIN){ |
| | | if (order != null && order.equals("ASC") && column.equals("isOpen")) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | Integer pg = 1; |
| | | Integer size = 200; |
| | | map.put("page",pg); |
| | | params.put("limit",size); |
| | | page = baseMapper.adminSelectPageVo(PageTransform.transformPage(params), userId, key, groupId,order,column); |
| | | ledOnlineCheck(page.getRecords()); |
| | | page.setRecords(page.getRecords().stream().filter(h-> h.getIsOpen().equals(true)).collect(Collectors.toList())); |
| | | return new PageUtils(page); |
| | | }else if (order != null && order.equals("DESC") && column.equals("isOpen")){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | | Integer pg = 1; |
| | | Integer size = 200; |
| | | map.put("page",pg); |
| | | params.put("limit",size); |
| | | page = baseMapper.adminSelectPageVo(PageTransform.transformPage(params), userId, key, groupId,order,column); |
| | | ledOnlineCheck(page.getRecords()); |
| | | page.setRecords(page.getRecords().stream().filter(h-> h.getIsOpen().equals(false)).collect(Collectors.toList())); |
| | | return new PageUtils(page); |
| | | }else { |
| | | page = baseMapper.adminSelectPageVo(PageTransform.transformPage(params), userId, key, groupId,order,column); |
| | | } |
| | | |
| | | }else if(roleId.longValue() == Constant.USER){ |
| | | if (order != null && order.equals("ASC") && column.equals("isOpen")) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | Integer pg = 1; |
| | | Integer size = 200; |
| | | map.put("page",pg); |
| | | params.put("limit",size); |
| | | page = baseMapper.userSelectPageVo(PageTransform.transformPage(params), userId, key, groupId,order,column); |
| | | ledOnlineCheck(page.getRecords()); |
| | | page.setRecords(page.getRecords().stream().filter(h-> h.getIsOpen().equals(true)).collect(Collectors.toList())); |
| | | return new PageUtils(page); |
| | | }else if (order != null && order.equals("DESC") && column.equals("isOpen")){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | | Integer pg = 1; |
| | | Integer size = 200; |
| | | map.put("page",pg); |
| | | params.put("limit",size); |
| | | page = baseMapper.userSelectPageVo(PageTransform.transformPage(params), userId, key, groupId,order,column); |
| | | ledOnlineCheck(page.getRecords()); |
| | | page.setRecords(page.getRecords().stream().filter(h-> h.getIsOpen().equals(false)).collect(Collectors.toList())); |
| | | return new PageUtils(page); |
| | | }else { |
| | | page = baseMapper.userSelectPageVo(PageTransform.transformPage(params), userId, key, groupId,order,column); |
| | | } |
| | | |
| | | } |
| | | ledOnlineCheck(page.getRecords()); |
| | | return new PageUtils(page); |
| | | } |
| | | *//* |
| | | @Override |
| | | public List<PoleLightemitEntity> getAll(Long userId) { |
| | | //è·åè§è²å表 |
| | | Long roleId = (sysUserRoleService.queryRoleId(userId)); |
| | | |
| | | if(roleId == null || roleId == 0){ |
| | | return null; |
| | | } |
| | | List<PoleLightemitEntity> list = null; |
| | | if(roleId.longValue() == Constant.SUPER_ADMIN){ |
| | | list = poleLightemitDao.selectAll(); |
| | | }else if(roleId.longValue() == Constant.ADMIN){ |
| | | list = poleLightemitDao.selectAllByCompany(userId); |
| | | }else if(roleId.longValue() == Constant.USER){ |
| | | list = poleLightemitDao.selectAllByUser(userId); |
| | | } |
| | | return list; |
| | | } |
| | | */ |
| | | |
| | | /* public void ledOnlineCheck(List<PoleLightemitEntity> list) { |
| | | |
| | | for(PoleLightemitEntity poleLightemitEntity : list){ |
| | | poleLightemitEntity.setIsOpen(lightemitUtils.getIsScreenOpen(poleLightemitEntity.getLightemitControlCode()).contains("true")); |
| | | } |
| | | }*/ |
| | | |
| | | |
| | | public void savePoleLightemit(PoleLightemitEntity poleLightemit) { |
| | | boolean save = this.save(poleLightemit); |
| | | // ç»å®ç¯æ |
| | | if(save&&poleLightemit.getPoleId()!=null){ |
| | | |
| | | } |
| | | // poleStreetlightLightemitService.saveStreetlightLightemit(poleLightemit.getLightemitId(),poleLightemit.getStreetlightId()); |
| | | } |
| | | |
| | | |
| | | /* public void updatePoleLightemit(PoleLightemitEntity poleLightemit) { |
| | | this.updateById(poleLightemit); |
| | | poleStreetlightLightemitService.saveStreetlightLightemit(poleLightemit.getLightemitId(),poleLightemit.getStreetlightId()); |
| | | }*/ |
| | | |
| | | /** |
| | | * æ¥è¯¢æéèå´å
çææledå±ä¿¡æ¯ |
| | | * |
| | | * @param |
| | | * @return |
| | | */ |
| | | /* public List<PoleLightemitEntity> selectLightemitByUserId(Long userId) { |
| | | List<PoleLightemitEntity> list = new ArrayList<>(); |
| | | |
| | | Long roleId = sysUserRoleService.queryRoleId(userId); |
| | | |
| | | if(roleId == null || roleId == 0){ |
| | | return new ArrayList<>(); |
| | | } |
| | | if(roleId.longValue() == Constant.SUPER_ADMIN){ |
| | | list = this.list(); |
| | | }else if(roleId.longValue() == Constant.ADMIN){ |
| | | list = baseMapper.selectCompanyLightemitByUserId(userId); |
| | | }else if(roleId.longValue() == Constant.USER){ |
| | | list = baseMapper.selectLightemitByUserId(userId); |
| | | } |
| | | return list; |
| | | } |
| | | */ |
| | | /* |
| | | éè¿å±å¹ç¼ç æ¥è¯¢ |
| | | */ |
| | | public PoleLightemitEntity selectByLightemitControlCode(String lightemitControlCode) { |
| | | QueryWrapper<PoleLightemitEntity> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("lightemit_control_code", lightemitControlCode); |
| | | return this.getOne(queryWrapper); |
| | | } |
| | | |
| | | /* |
| | | ledä¸ä¼ å¾ç |
| | | */ |
| | | @Async("taskExecutor") |
| | | public void photoUpload(String lightemitControlCode, String path, List<String> filenameList, String userName) throws IOException { |
| | | //è·åå±å¹å®½ |
| | | String screenWidth = lightemitUtils.getScreenWidth(lightemitControlCode); |
| | | String screenHeight = lightemitUtils.getScreenHeight(lightemitControlCode); |
| | | |
| | | //htmlå°å |
| | | String filenameTemp = path + userName + "_" + lightemitControlCode + ".html"; |
| | | File htmlFile = new File(filenameTemp); |
| | | if (!htmlFile.exists() || htmlFile.delete()) { |
| | | htmlFile.createNewFile(); |
| | | } |
| | | |
| | | //è·åbodyçhtml |
| | | Map<String, Object> params = new HashMap<>(); |
| | | params.put("imgList", filenameList); |
| | | params.put("screenWidth", screenWidth); |
| | | params.put("screenHeight", screenHeight); |
| | | |
| | | String body = new HtmlTemplateUtils().renderPath("classpath:templates/lightemitTemplates/photoTemplates.html", params); |
| | | |
| | | boolean flag = new FileUtil().writeToFile(body, filenameTemp); |
| | | |
| | | if (flag) { |
| | | //æ¸
å±æä½ |
| | | lightemitUtils.clear(lightemitControlCode); |
| | | //æ¸
餿æ¾å表 |
| | | lightemitUtils.clearVideoPlay(lightemitControlCode); |
| | | //æ¸
é¤èç®å表 |
| | | lightemitUtils.clearPlayerTask(lightemitControlCode); |
| | | //æ¨éå¾ç |
| | | lightemitUtils.postHtml(lightemitControlCode, userName); |
| | | } |
| | | } |
| | | |
| | | /* |
| | | ledä¸ä¼ è§é¢ |
| | | */ |
| | | |
| | | @Async("taskExecutor") |
| | | public void videoUpload(String lightemitControlCode, String filename, String path, String userName) throws IOException { |
| | | //è·åå±å¹å®½ |
| | | String screenWidth = lightemitUtils.getScreenWidth(lightemitControlCode); |
| | | String screenHeight = lightemitUtils.getScreenHeight(lightemitControlCode); |
| | | |
| | | //åéè§é¢è³å¼åæ¿å¹¶ææ¾ |
| | | lightemitUtils.postVideo(screenWidth, screenHeight, filename, lightemitControlCode); |
| | | |
| | | //æ¸
å± |
| | | lightemitUtils.clear(lightemitControlCode); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 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; |
| | | } |
| | | } |
| | | |
| | | /* |
| | | å é¤ |
| | | */ |
| | | |
| | | /* public void deleteByIds(List<Long> lightemitIds) { |
| | | this.removeByIds(lightemitIds); |
| | | //å é¤å
³ç³»è¡¨ä¸çæ°æ® |
| | | poleStreetlightLightemitService.remove( |
| | | new UpdateWrapper<PoleStreetlightLightemitEntity>().in("lightemit_id", lightemitIds.toArray())); |
| | | }*/ |
| | | |
| | | /* |
| | | ç讯è§é¢è®¾ç½® |
| | | */ |
| | | |
| | | @Async("taskExecutor") |
| | | public void videoXixunPlayer(String lightemitControlCode, String ip, String filename, Long filesize, Integer videoTime) { |
| | | //è·åå±å¹å®½ |
| | | Integer screenWidth = Integer.valueOf(lightemitUtils.getScreenWidth(lightemitControlCode)); |
| | | Integer screenHeight = Integer.valueOf(lightemitUtils.getScreenHeight(lightemitControlCode)); |
| | | Source source = new Source(); |
| | | Layer layer = new Layer(); |
| | | Program pro = new Program(); |
| | | TaskItem items = new TaskItem(); |
| | | ProgramsTask task = new ProgramsTask(); |
| | | Command command = new Command(); |
| | | XixunPlayer xixun = new XixunPlayer(); |
| | | source.set_id(UUID.randomUUID().toString());//ææ_idé½å¯ç¨UUIDéæºçæ |
| | | source.setId(filename);//请æ±å¤´æ¼æ¥è¯¥IDä¸ºè¯¥èµæºç宿´ä¸è½½å°å |
| | | source.set_type("Video"); //è®¾ç½®èµæºç±»åï¼å
¶ä»èµæºç±»å请åèxixunplayerèç®jsonè¯´æææ¡£ |
| | | source.setFileExt(".mp4"); //èµæºåç¼å |
| | | source.setHeight(screenHeight); //èµæºé«åº¦ |
| | | source.setWidth(screenWidth); //èµæºå®½åº¦ |
| | | source.setLeft(0); //è·å·¦ |
| | | source.setMd5("dd135d5d2d44d619a542db773ab529a4"); |
| | | source.setMime("video/mp4"); |
| | | source.setName(filename); |
| | | source.setPlayTime(0); //ææ¾èµ·å§æ¶é´ |
| | | source.setSize(filesize); //èµæºåèæ°ï¼è¦ç²¾å |
| | | source.setTimeSpan(videoTime); //è¯¥èµæºææ¾æ¶é¿ |
| | | source.setTop(0); //è·é¡¶ |
| | | List<Source> list = new ArrayList<Source>(); |
| | | list.add(source); |
| | | layer.setSources(list); |
| | | pro.set_id(UUID.randomUUID().toString()); |
| | | pro.setHeight(screenHeight); //èç®é«åº¦ |
| | | List<Layer> list1 = new ArrayList<Layer>(); |
| | | list1.add(layer); |
| | | pro.setLayers(list1); |
| | | pro.setName("demo"); //èç®åç§° |
| | | pro.setOthers(true);//å¦æä¸ºtrueï¼å该èç®æ¥èªç¬¬ä¸æ¹æ¥å£ï¼ä¸æ¯æ¥èªæä»¬èªå·±çwebï¼äºæ¬¡å¼å请å¡å¿
èµå¼ä¸ºtrue |
| | | pro.setTotalSize(filesize); //ææèµæºæ»åèæ° |
| | | pro.setVersion(0); //é«çº§èç®=0ï¼ç®æèç®=2 |
| | | pro.setWidth(screenWidth); //èç®å®½åº¦ |
| | | items.set_id(UUID.randomUUID().toString()); |
| | | items.set_program(pro); |
| | | items.setRepeatTimes(1); |
| | | items.setSchedules(null);//宿¶æ®µï¼ä¸å宿¶å¯ä¸ºnull |
| | | task.set_id(UUID.randomUUID().toString()); |
| | | task.setName("è¿æ¯ä¸ä¸ªç¤ºä¾"); |
| | | List<TaskItem> list2 = new ArrayList<TaskItem>(); |
| | | list2.add(items); |
| | | task.setItems(list2); |
| | | command.setId(UUID.randomUUID().toString()); |
| | | //è¿éæ¯ä¸æ¹çpoståè°å°åï¼éè¦ä¿®æ¹IPå°å |
| | | command.setNotificationURL("http://" + ip + ":" + port + "/machine-fast/serv/download/getJSON"); |
| | | //èµæºä¸è½½é¾æ¥ç请æ±å¤´ |
| | | command.setPreDownloadURL("http://" + ip + ":" + port + "/machine-fast/serv/download/downloadFile/"); |
| | | command.setTask(task); |
| | | xixun.set_id(UUID.randomUUID().toString()); |
| | | xixun.setCommand(command); |
| | | xixun.setType("commandXixunPlayer"); //å½ä»¤åºå®ç±»åï¼ä¸å¯æ´æ¹ |
| | | String jsondata = new Gson().toJson(xixun); |
| | | lightemitUtils.clear(lightemitControlCode); |
| | | poleLightemitDao.updateRequestBody(lightemitControlCode, jsondata); |
| | | lightemitUtils.post(realtimeServerBean.getCommand() + lightemitControlCode, jsondata); |
| | | } |
| | | |
| | | /* |
| | | æ¨éå¤©æ°æ°æ® |
| | | */ |
| | | |
| | | //@Async("taskExecutor") |
| | | /* public Boolean pushWeather(String lightemitControlCode, PoleSensorEntity sensorEntity, PoleStreetlightEntity streetlightEntity) { |
| | | if(StringUtils.isBlank(lightemitControlCode)){ |
| | | return Boolean.valueOf(false); |
| | | } |
| | | Integer screenHeight = Integer.parseInt(lightemitUtils.getScreenHeight(lightemitControlCode)); |
| | | String size = String.valueOf(screenHeight/18); |
| | | //åå¹ä¸»ä½æ¼æ¥ |
| | | String body = |
| | | "<head><style type=\"text/css\">body{background-color:#000;}</style></head>" + |
| | | "<p style=\"font-size:" + size + "px;line-height:17px;color:#fff\">" + |
| | | (streetlightEntity == null || streetlightEntity.getCity() == null? "": streetlightEntity.getCity().replace("å¸", "")) + "<br/>" + |
| | | "温度ï¼" + (sensorEntity == null || sensorEntity.getTemperature() == null? "-": sensorEntity.getTemperature()) + "â<br/>" + |
| | | "湿度ï¼" + (sensorEntity == null || sensorEntity.getHumidity() == null? "-": sensorEntity.getHumidity()) + "%RH<br/>" + |
| | | "亮度ï¼" + (sensorEntity == null || sensorEntity.getBrightness() == null? "-": sensorEntity.getBrightness()) + "lux<br/>" + |
| | | "é£éï¼" + (sensorEntity == null || sensorEntity.getWindSpeed() == null? "-": sensorEntity.getWindSpeed()) + "m/s<br/>" + |
| | | "CO2ï¼" + (sensorEntity == null || sensorEntity.getEco2() == null? "-": sensorEntity.getEco2()) + "ppm<br/>" + |
| | | "ç²éï¼" + (sensorEntity == null || sensorEntity.getEch2o() == null? "-": sensorEntity.getEch2o()) + "mg/m³<br/>" + |
| | | "TVOCï¼" + (sensorEntity == null || sensorEntity.getTvoc() == null? "-": sensorEntity.getTvoc()) + "mg/m³<br/>" + |
| | | "PM25ï¼" + (sensorEntity == null || sensorEntity.getPm25() == null? "-": sensorEntity.getPm25()) + "mg/m³<br/>" + |
| | | "PM10ï¼" + (sensorEntity == null || sensorEntity.getPm10() == null? "-": sensorEntity.getPm10()) + "mg/m³<br/>"; |
| | | |
| | | //ç»è£
请æ±åæ° |
| | | SubTitleSet subTitleSet = new SubTitleSet(); |
| | | subTitleSet.html = body; |
| | | subTitleSet.num = 1; |
| | | |
| | | //æ¸
å±æä½ |
| | | lightemitUtils.clear(lightemitControlCode); |
| | | //æ¸
餿æ¾å表 |
| | | lightemitUtils.clearVideoPlay(lightemitControlCode); |
| | | //æ¸
é¤èç®å表 |
| | | lightemitUtils.clearPlayerTask(lightemitControlCode); |
| | | try{ |
| | | lightemitUtils.subTitleSet(subTitleSet, lightemitControlCode, false); |
| | | return true; |
| | | }catch (Exception e){ |
| | | return false; |
| | | }finally { |
| | | //ä¸åé忏
é¤å±å¹ |
| | | new Timer().schedule(new TimerTask() { |
| | | @Override |
| | | public void run() { |
| | | lightemitUtils.clear(lightemitControlCode); |
| | | //æ¸
餿æ¾å表 |
| | | lightemitUtils.clearVideoPlay(lightemitControlCode); |
| | | //æ¸
é¤èç®å表 |
| | | lightemitUtils.clearPlayerTask(lightemitControlCode); |
| | | //æ¨éæåå½ä»¤ |
| | | lightemitUtils.sendLastCommand(lightemitControlCode); |
| | | } |
| | | }, 60*1000); |
| | | } |
| | | }*/ |
| | | |
| | | /* |
| | | æ´æ°è¯·æ±æ°æ® |
| | | */ |
| | | |
| | | public void updateRequestBody(String ledCode, String postBody) { |
| | | baseMapper.updateRequestBody(ledCode, postBody); |
| | | } |
| | | |
| | | /* |
| | | æ ¹æ®ledå±ç¼ç è·åç¯æææä¿¡æ¯ |
| | | */ |
| | | |
| | | // public PoleStreetlightEntity getStreetlightByLedCode(String ledCode) { |
| | | // return baseMapper.getStreetlightByLedCode(ledCode); |
| | | // } |
| | | // |
| | | // /*@Override |
| | | // public PageUtils queryPage(Map<String, Object> params, Long userId) { |
| | | // |
| | | // String key = (String)params.get("key"); |
| | | // |
| | | // Long groupId = StringUtils.isNotBlank((String)params.get("group"))? Long.valueOf((String)params.get("group")): null; |
| | | // |
| | | // String order = (String)params.get("order"); |
| | | // |
| | | // String column = (String)params.get("sortby"); |
| | | // |
| | | // IPage<PoleLightemitEntity> page = new Page<>(); |
| | | // //è·åè§è²å表 |
| | | // Long roleId = (sysUserRoleService.queryRoleId(userId)); |
| | | // |
| | | // if(roleId == null || roleId == 0){ |
| | | // return null; |
| | | // } |
| | | // |
| | | // if(roleId.longValue() == Constant.SUPER_ADMIN){ |
| | | //// page = this.page( |
| | | //// new Query<PoleLightemitEntity>().getPage(params), |
| | | //// new QueryWrapper<PoleLightemitEntity>().like(StringUtils.isNotBlank(key),"lightemit_name", key)); |
| | | // if (order != null && order.equals("ASC") && column.equals("isOpen")) { |
| | | // Map<String, Object> map = new HashMap<>(); |
| | | // Integer pg = 1; |
| | | // Integer size = 200; |
| | | // map.put("page",pg); |
| | | // params.put("limit",size); |
| | | // page = baseMapper.superAdminSelectPageVo(PageTransform.transformPage(params),key,groupId,order,column); |
| | | // ledOnlineCheck(page.getRecords()); |
| | | // page.setRecords(page.getRecords().stream().filter(h-> h.getIsOpen().equals(true)).collect(Collectors.toList())); |
| | | // return new PageUtils(page); |
| | | // }else if (order != null && order.equals("DESC") && column.equals("isOpen")){ |
| | | // Map<String, Object> map = new HashMap<>(); |
| | | // Integer pg = 1; |
| | | // Integer size = 200; |
| | | // map.put("page",pg); |
| | | // params.put("limit",size); |
| | | // page = baseMapper.superAdminSelectPageVo(PageTransform.transformPage(params),key,groupId,order,column); |
| | | // ledOnlineCheck(page.getRecords()); |
| | | // page.setRecords(page.getRecords().stream().filter(h-> h.getIsOpen().equals(false)).collect(Collectors.toList())); |
| | | // return new PageUtils(page); |
| | | // }else { |
| | | // page = baseMapper.superAdminSelectPageVo(PageTransform.transformPage(params), key, groupId,order,column); |
| | | // } |
| | | // |
| | | // }else if(roleId.longValue() == Constant.ADMIN){ |
| | | // if (order != null && order.equals("ASC") && column.equals("isOpen")) { |
| | | // Map<String, Object> map = new HashMap<>(); |
| | | // Integer pg = 1; |
| | | // Integer size = 200; |
| | | // map.put("page",pg); |
| | | // params.put("limit",size); |
| | | // page = baseMapper.adminSelectPageVo(PageTransform.transformPage(params), userId, key, groupId,order,column); |
| | | // ledOnlineCheck(page.getRecords()); |
| | | // page.setRecords(page.getRecords().stream().filter(h-> h.getIsOpen().equals(true)).collect(Collectors.toList())); |
| | | // return new PageUtils(page); |
| | | // }else if (order != null && order.equals("DESC") && column.equals("isOpen")){ |
| | | // Map<String, Object> map = new HashMap<>(); |
| | | // Integer pg = 1; |
| | | // Integer size = 200; |
| | | // map.put("page",pg); |
| | | // params.put("limit",size); |
| | | // page = baseMapper.adminSelectPageVo(PageTransform.transformPage(params), userId, key, groupId,order,column); |
| | | // ledOnlineCheck(page.getRecords()); |
| | | // page.setRecords(page.getRecords().stream().filter(h-> h.getIsOpen().equals(false)).collect(Collectors.toList())); |
| | | // return new PageUtils(page); |
| | | // }else { |
| | | // page = baseMapper.adminSelectPageVo(PageTransform.transformPage(params), userId, key, groupId,order,column); |
| | | // } |
| | | // |
| | | // }else if(roleId.longValue() == Constant.USER){ |
| | | // if (order != null && order.equals("ASC") && column.equals("isOpen")) { |
| | | // Map<String, Object> map = new HashMap<>(); |
| | | // Integer pg = 1; |
| | | // Integer size = 200; |
| | | // map.put("page",pg); |
| | | // params.put("limit",size); |
| | | // page = baseMapper.userSelectPageVo(PageTransform.transformPage(params), userId, key, groupId,order,column); |
| | | // ledOnlineCheck(page.getRecords()); |
| | | // page.setRecords(page.getRecords().stream().filter(h-> h.getIsOpen().equals(true)).collect(Collectors.toList())); |
| | | // return new PageUtils(page); |
| | | // }else if (order != null && order.equals("DESC") && column.equals("isOpen")){ |
| | | // Map<String, Object> map = new HashMap<>(); |
| | | // Integer pg = 1; |
| | | // Integer size = 200; |
| | | // map.put("page",pg); |
| | | // params.put("limit",size); |
| | | // page = baseMapper.userSelectPageVo(PageTransform.transformPage(params), userId, key, groupId,order,column); |
| | | // ledOnlineCheck(page.getRecords()); |
| | | // page.setRecords(page.getRecords().stream().filter(h-> h.getIsOpen().equals(false)).collect(Collectors.toList())); |
| | | // return new PageUtils(page); |
| | | // }else { |
| | | // page = baseMapper.userSelectPageVo(PageTransform.transformPage(params), userId, key, groupId,order,column); |
| | | // } |
| | | // |
| | | // } |
| | | // ledOnlineCheck(page.getRecords()); |
| | | // return new PageUtils(page); |
| | | |
| | | /* |
| | | æ ¹æ®ledå±ç¼ç 设置é³é |
| | | */ |
| | | |
| | | @Async("taskExecutor") |
| | | public void setVolume(String lightemitControlCode, Integer volume) { |
| | | lightemitUtils.setVoiume(lightemitControlCode, volume); |
| | | } |
| | | |
| | | |
| | | // public List<PoleLightemitEntity> listOfStreetlight(String streetlightId) { |
| | | // return baseMapper.listOfStreetlight(streetlightId); |
| | | // } |
| | | //*//* |
| | | // @Override |
| | | // public List<PoleLightemitEntity> getAll(Long userId) { |
| | | // //è·åè§è²å表 |
| | | // Long roleId = (sysUserRoleService.queryRoleId(userId)); |
| | | // |
| | | // if(roleId == null || roleId == 0){ |
| | | // return null; |
| | | // } |
| | | // List<PoleLightemitEntity> list = null; |
| | | // if(roleId.longValue() == Constant.SUPER_ADMIN){ |
| | | // list = poleLightemitDao.selectAll(); |
| | | // }else if(roleId.longValue() == Constant.ADMIN){ |
| | | // list = poleLightemitDao.selectAllByCompany(userId); |
| | | // }else if(roleId.longValue() == Constant.USER){ |
| | | // list = poleLightemitDao.selectAllByUser(userId); |
| | | // } |
| | | // return list; |
| | | |
| | | |
| | | // public List<PoleLightemitEntity> selectLedByStreetlightId(String streetlightId) { |
| | | // return baseMapper.getLedByStreetlightId(streetlightId); |
| | | // } |
| | | //*/ |
| | | // |
| | | ///* public void ledOnlineCheck(List<PoleLightemitEntity> list) { |
| | | // |
| | | // for(PoleLightemitEntity poleLightemitEntity : list){ |
| | | // poleLightemitEntity.setIsOpen(lightemitUtils.getIsScreenOpen(poleLightemitEntity.getLightemitControlCode()).contains("true")); |
| | | // } |
| | | // }*/ |
| | | // |
| | | // |
| | | // /* public void savePoleLightemit(PoleLightemitEntity poleLightemit) { |
| | | // this.save(poleLightemit); |
| | | // poleStreetlightLightemitService.saveStreetlightLightemit(poleLightemit.getLightemitId(),poleLightemit.getStreetlightId()); |
| | | // }*/ |
| | | // |
| | | // |
| | | // /* public void updatePoleLightemit(PoleLightemitEntity poleLightemit) { |
| | | // this.updateById(poleLightemit); |
| | | // poleStreetlightLightemitService.saveStreetlightLightemit(poleLightemit.getLightemitId(),poleLightemit.getStreetlightId()); |
| | | // }*/ |
| | | // |
| | | // /** |
| | | // * æ¥è¯¢æéèå´å
çææledå±ä¿¡æ¯ |
| | | // * @param |
| | | // * @return |
| | | // */ |
| | | // /* public List<PoleLightemitEntity> selectLightemitByUserId(Long userId) { |
| | | // List<PoleLightemitEntity> list = new ArrayList<>(); |
| | | // |
| | | // Long roleId = sysUserRoleService.queryRoleId(userId); |
| | | // |
| | | // if(roleId == null || roleId == 0){ |
| | | // return new ArrayList<>(); |
| | | // } |
| | | // if(roleId.longValue() == Constant.SUPER_ADMIN){ |
| | | // list = this.list(); |
| | | // }else if(roleId.longValue() == Constant.ADMIN){ |
| | | // list = baseMapper.selectCompanyLightemitByUserId(userId); |
| | | // }else if(roleId.longValue() == Constant.USER){ |
| | | // list = baseMapper.selectLightemitByUserId(userId); |
| | | // } |
| | | // return list; |
| | | // } |
| | | //*/ |
| | | // /* |
| | | // éè¿å±å¹ç¼ç æ¥è¯¢ |
| | | // */ |
| | | // |
| | | // public PoleLightemitEntity selectByLightemitControlCode(String lightemitControlCode) { |
| | | // QueryWrapper<PoleLightemitEntity> queryWrapper = new QueryWrapper<>(); |
| | | // queryWrapper.eq("lightemit_control_code", lightemitControlCode); |
| | | // return this.getOne(queryWrapper); |
| | | // } |
| | | // |
| | | // /* |
| | | // ledä¸ä¼ å¾ç |
| | | // */ |
| | | // @Async("taskExecutor") |
| | | // public void photoUpload(String lightemitControlCode, String path, List<String> filenameList, String userName) throws IOException { |
| | | // //è·åå±å¹å®½ |
| | | // String screenWidth = lightemitUtils.getScreenWidth(lightemitControlCode); |
| | | // String screenHeight = lightemitUtils.getScreenHeight(lightemitControlCode); |
| | | // |
| | | // //htmlå°å |
| | | // String filenameTemp = path + userName + "_"+lightemitControlCode + ".html"; |
| | | // File htmlFile = new File(filenameTemp); |
| | | // if (!htmlFile.exists() || htmlFile.delete()) { |
| | | // htmlFile.createNewFile(); |
| | | // } |
| | | // |
| | | // //è·åbodyçhtml |
| | | // Map<String, Object> params = new HashMap<>(); |
| | | // params.put("imgList",filenameList); |
| | | // params.put("screenWidth",screenWidth); |
| | | // params.put("screenHeight",screenHeight); |
| | | // |
| | | // String body = new HtmlTemplateUtils().renderPath("classpath:templates/lightemitTemplates/photoTemplates.html", params); |
| | | // |
| | | // boolean flag = new FileUtil().writeToFile(body, filenameTemp); |
| | | // |
| | | // if(flag){ |
| | | // //æ¸
å±æä½ |
| | | // lightemitUtils.clear(lightemitControlCode); |
| | | // //æ¸
餿æ¾å表 |
| | | // lightemitUtils.clearVideoPlay(lightemitControlCode); |
| | | // //æ¸
é¤èç®å表 |
| | | // lightemitUtils.clearPlayerTask(lightemitControlCode); |
| | | // //æ¨éå¾ç |
| | | // lightemitUtils.postHtml(lightemitControlCode,userName); |
| | | // } |
| | | // } |
| | | // |
| | | // /* |
| | | // ledä¸ä¼ è§é¢ |
| | | // */ |
| | | // |
| | | // @Async("taskExecutor") |
| | | // public void videoUpload(String lightemitControlCode, String filename, String path, String userName) throws IOException { |
| | | // //è·åå±å¹å®½ |
| | | // String screenWidth = lightemitUtils.getScreenWidth(lightemitControlCode); |
| | | // String screenHeight = lightemitUtils.getScreenHeight(lightemitControlCode); |
| | | // |
| | | // //åéè§é¢è³å¼åæ¿å¹¶ææ¾ |
| | | // lightemitUtils.postVideo(screenWidth, screenHeight, filename, lightemitControlCode); |
| | | // |
| | | // //æ¸
å± |
| | | // lightemitUtils.clear(lightemitControlCode); |
| | | // |
| | | // } |
| | | // |
| | | // /** |
| | | // * 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; |
| | | // } |
| | | // } |
| | | // |
| | | // /* |
| | | // å é¤ |
| | | // */ |
| | | // |
| | | // /* public void deleteByIds(List<Long> lightemitIds) { |
| | | // this.removeByIds(lightemitIds); |
| | | // //å é¤å
³ç³»è¡¨ä¸çæ°æ® |
| | | // poleStreetlightLightemitService.remove( |
| | | // new UpdateWrapper<PoleStreetlightLightemitEntity>().in("lightemit_id", lightemitIds.toArray())); |
| | | // }*/ |
| | | // |
| | | // /* |
| | | // ç讯è§é¢è®¾ç½® |
| | | // */ |
| | | // |
| | | // @Async("taskExecutor") |
| | | // public void videoXixunPlayer(String lightemitControlCode, String ip, String filename, Long filesize, Integer videoTime) { |
| | | // //è·åå±å¹å®½ |
| | | |
| | | /* |
| | | ä¸ä¼ æ°´å¹³æ»å¨åè¡åå¹ |
| | | */ |
| | | 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>"; |
| | | |
| | | //è·åææledæ°æ® |
| | | 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); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /* |
| | | ä¸ä¼ åç´æ»å¨åè¡åå¹ |
| | | */ |
| | | private void BuildVerticalSingSubTitleText(SubTitleSetEntity subTitleSetEntity, String path, String userName) throws IOException { |
| | | //htmlå°å |
| | | //è·åææledæ°æ® |
| | | 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); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | /* |
| | | ä¸ä¼ åç´æ»å¨å¤è¡åå¹ |
| | | */ |
| | | private void BuildVerticalMultiSubTitleText(SubTitleSetEntity subTitleSetEntity, String path, String userName) throws IOException { |
| | | //htmlå°å |
| | | //è·åææledæ°æ® |
| | | 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); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | // @Override |
| | | public void xixunplaySetting(String lightemitControlCode) { |
| | | //è·åå±å¹å®½ |
| | | // Integer screenWidth = Integer.valueOf(lightemitUtils.getScreenWidth(lightemitControlCode)); |
| | | // Integer screenHeight = Integer.valueOf(lightemitUtils.getScreenHeight(lightemitControlCode)); |
| | | // Source source = new Source(); |
| | |
| | | // Program pro = new Program(); |
| | | // TaskItem items = new TaskItem(); |
| | | // ProgramsTask task = new ProgramsTask(); |
| | | // Command command = new Command(); |
| | | // Command payload = new Command(); |
| | | // XixunPlayer xixun = new XixunPlayer(); |
| | | // source.set_id(UUID.randomUUID().toString());//ææ_idé½å¯ç¨UUIDéæºçæ |
| | | // source.setId(filename);//请æ±å¤´æ¼æ¥è¯¥IDä¸ºè¯¥èµæºç宿´ä¸è½½å°å |
| | |
| | | // source.setSize(filesize); //èµæºåèæ°ï¼è¦ç²¾å |
| | | // source.setTimeSpan(videoTime); //è¯¥èµæºææ¾æ¶é¿ |
| | | // source.setTop(0); //è·é¡¶ |
| | | // List<Source> list=new ArrayList<Source>(); |
| | | // List<Source> list = new ArrayList<Source>(); |
| | | // list.add(source); |
| | | // layer.setSources(list); |
| | | // pro.set_id(UUID.randomUUID().toString()); |
| | |
| | | // List<TaskItem> list2=new ArrayList<TaskItem>(); |
| | | // list2.add(items); |
| | | // task.setItems(list2); |
| | | // command.setId(UUID.randomUUID().toString()); |
| | | // payload.setId(UUID.randomUUID().toString()); |
| | | // //è¿éæ¯ä¸æ¹çpoståè°å°åï¼éè¦ä¿®æ¹IPå°å |
| | | // command.setNotificationURL("http://" + ip + ":" + port + "/machine-fast/serv/download/getJSON"); |
| | | // payload.setNotificationURL("http://" + ip + ":" + port + "/machine-fast/serv/download/getJSON"); |
| | | // //èµæºä¸è½½é¾æ¥ç请æ±å¤´ |
| | | // command.setPreDownloadURL("http://" + ip + ":" + port + "/machine-fast/serv/download/downloadFile/"); |
| | | // command.setTask(task); |
| | | // payload.setPreDownloadURL("http://" + ip + ":" + port + "/machine-fast/serv/download/downloadFile/"); |
| | | // payload.setTask(task); |
| | | // xixun.set_id(UUID.randomUUID().toString()); |
| | | // xixun.setCommand(command); |
| | | // xixun.setCommand(payload); |
| | | // xixun.setType("commandXixunPlayer"); //å½ä»¤åºå®ç±»åï¼ä¸å¯æ´æ¹ |
| | | // String jsondata = new Gson().toJson(xixun); |
| | | // lightemitUtils.clear(lightemitControlCode); |
| | | // this.updateRequestBody(lightemitControlCode,jsondata); |
| | | // lightemitUtils.post(realtimeServerBean.getCommand() + lightemitControlCode,jsondata); |
| | | // } |
| | | // |
| | | // /* |
| | | // æ¨éå¤©æ°æ°æ® |
| | | // */ |
| | | // |
| | | // //@Async("taskExecutor") |
| | | // /* public Boolean pushWeather(String lightemitControlCode, PoleSensorEntity sensorEntity, PoleStreetlightEntity streetlightEntity) { |
| | | // if(StringUtils.isBlank(lightemitControlCode)){ |
| | | // return Boolean.valueOf(false); |
| | | // } |
| | | // Integer screenHeight = Integer.parseInt(lightemitUtils.getScreenHeight(lightemitControlCode)); |
| | | // String size = String.valueOf(screenHeight/18); |
| | | // //åå¹ä¸»ä½æ¼æ¥ |
| | | // String body = |
| | | // "<head><style type=\"text/css\">body{background-color:#000;}</style></head>" + |
| | | // "<p style=\"font-size:" + size + "px;line-height:17px;color:#fff\">" + |
| | | // (streetlightEntity == null || streetlightEntity.getCity() == null? "": streetlightEntity.getCity().replace("å¸", "")) + "<br/>" + |
| | | // "温度ï¼" + (sensorEntity == null || sensorEntity.getTemperature() == null? "-": sensorEntity.getTemperature()) + "â<br/>" + |
| | | // "湿度ï¼" + (sensorEntity == null || sensorEntity.getHumidity() == null? "-": sensorEntity.getHumidity()) + "%RH<br/>" + |
| | | // "亮度ï¼" + (sensorEntity == null || sensorEntity.getBrightness() == null? "-": sensorEntity.getBrightness()) + "lux<br/>" + |
| | | // "é£éï¼" + (sensorEntity == null || sensorEntity.getWindSpeed() == null? "-": sensorEntity.getWindSpeed()) + "m/s<br/>" + |
| | | // "CO2ï¼" + (sensorEntity == null || sensorEntity.getEco2() == null? "-": sensorEntity.getEco2()) + "ppm<br/>" + |
| | | // "ç²éï¼" + (sensorEntity == null || sensorEntity.getEch2o() == null? "-": sensorEntity.getEch2o()) + "mg/m³<br/>" + |
| | | // "TVOCï¼" + (sensorEntity == null || sensorEntity.getTvoc() == null? "-": sensorEntity.getTvoc()) + "mg/m³<br/>" + |
| | | // "PM25ï¼" + (sensorEntity == null || sensorEntity.getPm25() == null? "-": sensorEntity.getPm25()) + "mg/m³<br/>" + |
| | | // "PM10ï¼" + (sensorEntity == null || sensorEntity.getPm10() == null? "-": sensorEntity.getPm10()) + "mg/m³<br/>"; |
| | | // |
| | | // //ç»è£
请æ±åæ° |
| | | // SubTitleSet subTitleSet = new SubTitleSet(); |
| | | // subTitleSet.html = body; |
| | | // subTitleSet.num = 1; |
| | | // |
| | | // //æ¸
å±æä½ |
| | | // lightemitUtils.clear(lightemitControlCode); |
| | | // //æ¸
餿æ¾å表 |
| | | // lightemitUtils.clearVideoPlay(lightemitControlCode); |
| | | // //æ¸
é¤èç®å表 |
| | | // lightemitUtils.clearPlayerTask(lightemitControlCode); |
| | | // try{ |
| | | // lightemitUtils.subTitleSet(subTitleSet, lightemitControlCode, false); |
| | | // return true; |
| | | // }catch (Exception e){ |
| | | // return false; |
| | | // }finally { |
| | | // //ä¸åé忏
é¤å±å¹ |
| | | // new Timer().schedule(new TimerTask() { |
| | | // @Override |
| | | // public void run() { |
| | | // lightemitUtils.clear(lightemitControlCode); |
| | | // //æ¸
餿æ¾å表 |
| | | // lightemitUtils.clearVideoPlay(lightemitControlCode); |
| | | // //æ¸
é¤èç®å表 |
| | | // lightemitUtils.clearPlayerTask(lightemitControlCode); |
| | | // //æ¨éæåå½ä»¤ |
| | | // lightemitUtils.sendLastCommand(lightemitControlCode); |
| | | // } |
| | | // }, 60*1000); |
| | | // } |
| | | // }*/ |
| | | // |
| | | // /* |
| | | // æ´æ°è¯·æ±æ°æ® |
| | | // */ |
| | | // |
| | | // public void updateRequestBody(String ledCode, String postBody) { |
| | | // baseMapper.updateRequestBody(ledCode, postBody); |
| | | // } |
| | | // |
| | | // /* |
| | | // æ ¹æ®ledå±ç¼ç è·åç¯æææä¿¡æ¯ |
| | | // */ |
| | | // |
| | | // public PoleStreetlightEntity getStreetlightByLedCode(String ledCode) { |
| | | // return baseMapper.getStreetlightByLedCode(ledCode); |
| | | // } |
| | | // |
| | | // /* |
| | | // æ ¹æ®ledå±ç¼ç 设置é³é |
| | | // */ |
| | | // |
| | | // @Async("taskExecutor") |
| | | // public void setVolume(String lightemitControlCode, Integer volume) { |
| | | // lightemitUtils.setVoiume(lightemitControlCode, volume); |
| | | // } |
| | | // |
| | | // |
| | | // public List<PoleLightemitEntity> listOfStreetlight(String streetlightId) { |
| | | // return baseMapper.listOfStreetlight(streetlightId); |
| | | // } |
| | | // |
| | | // |
| | | // public List<PoleLightemitEntity> selectLedByStreetlightId(String streetlightId) { |
| | | // return baseMapper.getLedByStreetlightId(streetlightId); |
| | | // } |
| | | // |
| | | // /* |
| | | // ä¸ä¼ æ°´å¹³æ»å¨åè¡åå¹ |
| | | // */ |
| | | // 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>"; |
| | | // |
| | | // //è·åææledæ°æ® |
| | | // 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); |
| | | // } |
| | | // } |
| | | // } |
| | | // |
| | | // /* |
| | | // ä¸ä¼ åç´æ»å¨åè¡åå¹ |
| | | // */ |
| | | // private void BuildVerticalSingSubTitleText(SubTitleSetEntity subTitleSetEntity, String path, String userName) throws IOException { |
| | | // //htmlå°å |
| | | // //è·åææledæ°æ® |
| | | // 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); |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | // |
| | | // |
| | | // /* |
| | | // ä¸ä¼ åç´æ»å¨å¤è¡åå¹ |
| | | // */ |
| | | // private void BuildVerticalMultiSubTitleText(SubTitleSetEntity subTitleSetEntity, String path, String userName) throws IOException { |
| | | // //htmlå°å |
| | | // //è·åææledæ°æ® |
| | | // 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); |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | // |
| | | // @Override |
| | | // public void xixunplaySetting(String lightemitControlCode) { |
| | | // //è·åå±å¹å®½ |
| | | //// Integer screenWidth = Integer.valueOf(lightemitUtils.getScreenWidth(lightemitControlCode)); |
| | | //// Integer screenHeight = Integer.valueOf(lightemitUtils.getScreenHeight(lightemitControlCode)); |
| | | //// Source source = new Source(); |
| | | //// Layer layer = new Layer(); |
| | | //// Program pro = new Program(); |
| | | //// TaskItem items = new TaskItem(); |
| | | //// ProgramsTask task = new ProgramsTask(); |
| | | //// Command payload = new Command(); |
| | | //// XixunPlayer xixun = new XixunPlayer(); |
| | | //// source.set_id(UUID.randomUUID().toString());//ææ_idé½å¯ç¨UUIDéæºçæ |
| | | //// source.setId(filename);//请æ±å¤´æ¼æ¥è¯¥IDä¸ºè¯¥èµæºç宿´ä¸è½½å°å |
| | | //// source.set_type("Video"); //è®¾ç½®èµæºç±»åï¼å
¶ä»èµæºç±»å请åèxixunplayerèç®jsonè¯´æææ¡£ |
| | | //// source.setFileExt(".mp4"); //èµæºåç¼å |
| | | //// source.setHeight(screenHeight); //èµæºé«åº¦ |
| | | //// source.setWidth(screenWidth); //èµæºå®½åº¦ |
| | | //// source.setLeft(0); //è·å·¦ |
| | | //// source.setMd5("dd135d5d2d44d619a542db773ab529a4"); |
| | | //// source.setMime("video/mp4"); |
| | | //// source.setName(filename); |
| | | //// source.setPlayTime(0); //ææ¾èµ·å§æ¶é´ |
| | | //// source.setSize(filesize); //èµæºåèæ°ï¼è¦ç²¾å |
| | | //// source.setTimeSpan(videoTime); //è¯¥èµæºææ¾æ¶é¿ |
| | | //// source.setTop(0); //è·é¡¶ |
| | | //// List<Source> list = new ArrayList<Source>(); |
| | | //// list.add(source); |
| | | //// layer.setSources(list); |
| | | //// pro.set_id(UUID.randomUUID().toString()); |
| | | //// pro.setHeight(screenHeight); //èç®é«åº¦ |
| | | //// List<Layer> list1=new ArrayList<Layer>(); |
| | | //// list1.add(layer); |
| | | //// pro.setLayers(list1); |
| | | //// pro.setName("demo"); //èç®åç§° |
| | | //// pro.setOthers(true);//å¦æä¸ºtrueï¼å该èç®æ¥èªç¬¬ä¸æ¹æ¥å£ï¼ä¸æ¯æ¥èªæä»¬èªå·±çwebï¼äºæ¬¡å¼å请å¡å¿
èµå¼ä¸ºtrue |
| | | //// pro.setTotalSize(filesize); //ææèµæºæ»åèæ° |
| | | //// pro.setVersion(0); //é«çº§èç®=0ï¼ç®æèç®=2 |
| | | //// pro.setWidth(screenWidth); //èç®å®½åº¦ |
| | | //// items.set_id(UUID.randomUUID().toString()); |
| | | //// items.set_program(pro); |
| | | //// items.setRepeatTimes(1); |
| | | //// items.setSchedules(null);//宿¶æ®µï¼ä¸å宿¶å¯ä¸ºnull |
| | | //// task.set_id(UUID.randomUUID().toString()); |
| | | //// task.setName("è¿æ¯ä¸ä¸ªç¤ºä¾"); |
| | | //// List<TaskItem> list2=new ArrayList<TaskItem>(); |
| | | //// list2.add(items); |
| | | //// task.setItems(list2); |
| | | //// payload.setId(UUID.randomUUID().toString()); |
| | | //// //è¿éæ¯ä¸æ¹çpoståè°å°åï¼éè¦ä¿®æ¹IPå°å |
| | | //// payload.setNotificationURL("http://" + ip + ":" + port + "/machine-fast/serv/download/getJSON"); |
| | | //// //èµæºä¸è½½é¾æ¥ç请æ±å¤´ |
| | | //// payload.setPreDownloadURL("http://" + ip + ":" + port + "/machine-fast/serv/download/downloadFile/"); |
| | | //// payload.setTask(task); |
| | | //// xixun.set_id(UUID.randomUUID().toString()); |
| | | //// xixun.setCommand(payload); |
| | | //// xixun.setType("commandXixunPlayer"); //å½ä»¤åºå®ç±»åï¼ä¸å¯æ´æ¹ |
| | | //// String jsondata = new Gson().toJson(xixun); |
| | | //// lightemitUtils.clear(lightemitControlCode); |
| | | //// this.updateRequestBody(lightemitControlCode,jsondata); |
| | | //// lightemitUtils.post(realtimeServerBean.getCommand() + lightemitControlCode,jsondata); |
| | | // } |
| | | //} |
| | | } |
| | | } |