| | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.sandu.common.execption.BusinessException; |
| | | import com.sandu.common.service.impl.BaseServiceImpl; |
| | | import com.sandu.common.util.SpringContextHolder; |
| | | import com.sandu.ximon.admin.config.VnnoxConstant; |
| | | import com.sandu.ximon.admin.dto.PlanDto; |
| | | import com.sandu.ximon.admin.dto.SchedulesDTO; |
| | |
| | | import com.sandu.ximon.admin.entity.Plans; |
| | | import com.sandu.ximon.admin.param.PlayPlanParam; |
| | | import com.sandu.ximon.admin.security.SecurityUtils; |
| | | import com.sandu.ximon.admin.utils.StoreOperationRecordsUtils; |
| | | import com.sandu.ximon.admin.utils.VnnoxAPIUtil; |
| | | import com.sandu.ximon.admin.utils.VnnoxProgramAPIUtil; |
| | | import com.sandu.ximon.admin.utils.response.VnnoxResultResponse; |
| | |
| | | import com.sandu.ximon.admin.vo.NovaPushResultVO; |
| | | import com.sandu.ximon.admin.vo.PlansVO; |
| | | import com.sandu.ximon.dao.domain.LEDProgram; |
| | | import com.sandu.ximon.dao.domain.LedPlayerEntity; |
| | | import com.sandu.ximon.dao.domain.PlayPlanNv; |
| | | import com.sandu.ximon.dao.domain.PushToLed; |
| | | import com.sandu.ximon.dao.mapper.PlayPlanNvMapper; |
| | |
| | | //推送定时到LED |
| | | public Map<String, Object> pushSchedule(Long planId, List<NovaPushResultVO> nova) { |
| | | PlayPlanNv one = getOne(Wrappers.lambdaQuery(PlayPlanNv.class).eq(PlayPlanNv::getId, planId)); |
| | | if (one == null) { |
| | | throw new BusinessException("未找到节目"); |
| | | } |
| | | List<SchedulesDTO> schedulesDTOS = JSON.parseArray(one.getSchedules(), SchedulesDTO.class); |
| | | ProgramSchedule programSchedule = new ProgramSchedule(); |
| | | programSchedule.setSchedules(schedulesDTOS); |
| | |
| | | |
| | | result.put("success", successList); |
| | | result.put("fail", faileList); |
| | | |
| | | /** |
| | | * 诺瓦推送定时日志记录开始 |
| | | */ |
| | | List<LedPlayerEntity> list = SpringContextHolder.getBean(LedPlayerEntityService.class) |
| | | .list(Wrappers.lambdaQuery(LedPlayerEntity.class).in(LedPlayerEntity::getId, nova.stream().map(NovaPushResultVO::getPlayerId).toArray())); |
| | | List<String> listCode = new ArrayList<>(); |
| | | for (LedPlayerEntity temp : list) { |
| | | listCode.add(temp.getSn()); |
| | | } |
| | | |
| | | String content = "{节目ID:" + one.getId() |
| | | + ", 节目名称:" + one.getName() |
| | | + "}," + " 推送结果:" + result |
| | | + " }"; |
| | | StoreOperationRecordsUtils.storeOperationData(listCode, null, "诺瓦推送定时任务", content); |
| | | /** |
| | | * 诺瓦推送定时日志记录结束 |
| | | */ |
| | | return result; |
| | | } |
| | | |