| | |
| | | package com.sandu.ximon.admin.service; |
| | | |
| | | import cn.hutool.json.JSONUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | |
| | | public List<PoleXixunPlayerEntity> listProgram(BaseConditionVO baseConditionVO, Integer order, Integer seq, String keyword) { |
| | | LambdaQueryWrapper<PoleXixunPlayerEntity> wrapper = XixunPlayerList(keyword); |
| | | //排序字段 |
| | | String orderByResult = "id"; |
| | | String orderByResult = "program_id"; |
| | | //正序、倒叙 |
| | | String orderBySeq = OrderByEnums.ASC.getCode(); |
| | | if (order != null) { |
| | |
| | | } |
| | | //排序方式 |
| | | String orderBy = orderByResult + " " + orderBySeq; |
| | | PageHelper.startPage(baseConditionVO.getPageNo(), baseConditionVO.getPageSize(), orderBy); |
| | | if (baseConditionVO != null) { |
| | | PageHelper.startPage(baseConditionVO.getPageNo(), baseConditionVO.getPageSize(), orderBy); |
| | | } |
| | | return list(wrapper); |
| | | } |
| | | |
| | |
| | | return updateResult; |
| | | } |
| | | |
| | | public boolean deleteProgram(Long pid) { |
| | | PoleXixunPlayerEntity byId = getById(pid); |
| | | if (byId == null) { |
| | | public boolean deleteProgram(List<Long> pids) { |
| | | List<PoleXixunPlayerEntity> poleXixunPlayerEntities = listByIds(pids); |
| | | if (poleXixunPlayerEntities.isEmpty()) { |
| | | throw new BusinessException("未找到该节目"); |
| | | } |
| | | /** |
| | | * 熙汛节目删除日志记录开始 |
| | | */ |
| | | String content = "{删除的节目id:" + byId.getProgramId() |
| | | + ", 删除的节目名称:" + byId.getProgramName() |
| | | String content = "{删除的节目id:" + pids |
| | | + " }"; |
| | | StoreOperationRecordsUtils.storeOperationData(null, null, "熙汛节目删除", content); |
| | | /** |
| | | * 熙汛节目删除日志记录结束 |
| | | */ |
| | | return removeById(pid); |
| | | return removeByIds(pids); |
| | | } |
| | | |
| | | public Object getByPid(Long pid) { |
| | |
| | | layerPro.getSources().forEach(sourcePro -> { |
| | | long fileId = Long.parseLong(sourcePro.getId()); |
| | | LedSFile file = xiXunFileService.getById(fileId); |
| | | String fileUrl = file.getFileUrl(); |
| | | String[] split = fileUrl.split("/"); |
| | | sourcePro.setId(split[split.length - 1]); |
| | | sourcePro.setMd5(file.getMd5()); |
| | | if (file != null) { |
| | | String fileUrl = file.getFileUrl(); |
| | | String[] split = fileUrl.split("/"); |
| | | sourcePro.setId(split[split.length - 1]); |
| | | sourcePro.setMd5(file.getMd5()); |
| | | } |
| | | }); |
| | | }); |
| | | } catch (Exception e) { |
| | |
| | | |
| | | Gson gson = new GsonBuilder().disableHtmlEscaping().create(); |
| | | String jsondata = gson.toJson(xixun); |
| | | System.out.println("推送内容" + JSONUtil.toJsonStr(jsondata)); |
| | | |
| | | |
| | | Collection<PoleLightemitEntity> poleLightemitEntities = poleLightemitService.listByIds(lightemitIds); |
| | | |
| | |
| | | lightemitUtils.clearPlayerTask(lightemitControlCode); |
| | | //推送最后命令 |
| | | lightemitUtils.sendLastCommand(lightemitControlCode); |
| | | |
| | | /** |
| | | * 熙汛大气数据推送日志记录开始 |
| | | // */ |
| | | // String content = "{设备code:" + lightemitControlCode |
| | | // + ", 推送内容:" + body |
| | | // + " }"; |
| | | // List<String> listCode = new ArrayList<>(); |
| | | // listCode.add(lightemitControlCode); |
| | | // StoreOperationRecordsUtils.storeOperationData(listCode, null, "熙汛大气数据推送", content); |
| | | /** |
| | | * 熙汛大气数据推送日志记录结束 |
| | | */ |
| | | } |
| | | }, 60 * 1000); |
| | | } |