| | |
| | | package com.sandu.ximon.admin.controller; |
| | | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.sandu.common.domain.CommonPage; |
| | | import com.sandu.common.domain.ResponseVO; |
| | |
| | | import com.sandu.ximon.admin.security.SecurityUtils; |
| | | import com.sandu.ximon.admin.service.*; |
| | | import com.sandu.ximon.admin.utils.LightemitUtils; |
| | | import com.sandu.ximon.dao.domain.Pole; |
| | | import com.sandu.ximon.dao.domain.PoleBinding; |
| | | import com.sandu.ximon.admin.vo.LedScheduleVO; |
| | | import com.sandu.ximon.dao.domain.PoleLightemitEntity; |
| | | import com.sandu.ximon.dao.domain.PoleXixunPlayerEntity; |
| | | import com.sandu.ximon.dao.enums.AdministratorEnums; |
| | | import com.sandu.ximon.dao.enums.MenuEnum; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | return ResponseUtil.success("推送成功"); |
| | | } |
| | | |
| | | //执行中的节目 |
| | | @GetMapping("/getProgram/{lightemitId}") |
| | | public ResponseVO<Object> getProgram(@PathVariable Long lightemitId) { |
| | | return ResponseUtil.success(xiXunPlayerService.getByPid(lightemitId)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * LED屏幕新增 |
| | | * |
| | |
| | | throw new BusinessException("LED控制卡编号不能重复"); |
| | | } |
| | | |
| | | poleLightemit.setCreateUserId(SecurityUtils.getClientId()); |
| | | if (SecurityUtils.getClientId() == null) { |
| | | poleLightemit.setClientId(clientService.getClientId()); |
| | | poleLightemit.setUserId(SecurityUtils.getUserId()); |
| | | poleLightemit.setCreateUserId(SecurityUtils.getUserId()); |
| | | } |
| | | |
| | | poleLightemitService.savePoleLightemit(poleLightemit); |
| | | |
| | |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | List<PoleLightemitEntity> poleLightemitEntityList = poleLightemitService.listLed(keyword, isOnLine); |
| | | poleLightemitEntityList.forEach( |
| | | led -> { |
| | | led.setStreetlightId(led.getPoleId()); |
| | | led.setStreetlightName(led.getPoleName()); |
| | | } |
| | | ); |
| | | |
| | | CommonPage commonPage = CommonPage.restPage(poleLightemitEntityList); |
| | | int size = poleLightemitEntityList.size(); |
| | |
| | | return ResponseUtil.success("设置成功"); |
| | | } |
| | | |
| | | /** |
| | | * 获取执行中的定时 |
| | | * @param |
| | | * @return |
| | | */ |
| | | |
| | | @GetMapping("/getPushSchedule") |
| | | public ResponseVO<Object> getPushSchedule(@RequestBody List<Long> ids) { |
| | | if(ids.isEmpty()){ |
| | | throw new BusinessException("未选择LED屏"); |
| | | } |
| | | List<LedScheduleVO> list = new ArrayList<>(); |
| | | for(Long id : ids) { |
| | | LedScheduleVO ledScheduleVO = scheduleService.getledschedules(id); |
| | | list.add(ledScheduleVO); |
| | | } |
| | | return ResponseUtil.success(list); |
| | | } |
| | | } |