| | |
| | | package com.sandu.ximon.admin.service; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.google.gson.Gson; |
| | | import com.sandu.common.execption.BusinessException; |
| | |
| | | |
| | | @Autowired |
| | | PoleLightemitEntityMapper poleLightemitDao; |
| | | |
| | | @Autowired |
| | | LedSFileService xiXunFileService; |
| | | |
| | | @PostConstruct |
| | | public void init() { |
| | |
| | | } |
| | | } |
| | | return temp; |
| | | } |
| | | |
| | | /** |
| | | * 熙讯设备列表(用于首页数据统计) |
| | | * |
| | | * @return |
| | | */ |
| | | public List<PoleLightemitEntity> listLedOnHome() { |
| | | List<PoleLightemitEntity> poleLightemitEntityList; |
| | | //超管 |
| | | if (SecurityUtils.getClientId() == null) { |
| | | poleLightemitEntityList = poleLightemitDao.listLed(null, null, null); |
| | | } else { |
| | | poleLightemitEntityList = poleLightemitDao.listLed(null, SecurityUtils.getUserId(), null); |
| | | } |
| | | |
| | | return poleLightemitEntityList; |
| | | } |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | PoleLightemitEntity xiXun = getOne(Wrappers.lambdaQuery(PoleLightemitEntity.class).eq(PoleLightemitEntity::getLightemitControlCode, lightControlCode)); |
| | | boolean isScreenOpen = false; |
| | | if (xiXun != null) { |
| | | equipmentInfo.setEquipmentCreateTime(xiXun.getCreateTime()); |
| | | equipmentInfo.setEquipmentMac(xiXun.getLightemitControlCode()); |
| | | equipmentInfo.setEquipmentName(xiXun.getLightemitName()); |
| | | isScreenOpen = lightemitUtils.getLedOnLine(xiXun.getLightemitControlCode()); |
| | | } |
| | | boolean isScreenOpen = lightemitUtils.getLedOnLine(xiXun.getLightemitControlCode()); |
| | | if (isScreenOpen) { |
| | | equipmentInfo.setEquipmentState("在线"); |
| | | } else { |
| | |
| | | lightemitUtils.setBrightness(lightemitControlCode, brightness); |
| | | } |
| | | |
| | | public Object getProgram(Long lightemitId) { |
| | | PoleLightemitEntity xiXun = getById(lightemitId); |
| | | |
| | | String requestBody = xiXun.getRequestBody(); |
| | | if (requestBody == null || requestBody.isEmpty()) { |
| | | throw new BusinessException("未找到节目"); |
| | | } |
| | | |
| | | Map map = JSON.parseObject(requestBody, Map.class); |
| | | return map; |
| | | } |
| | | } |