| | |
| | | import com.sandu.common.execption.BusinessException; |
| | | import com.sandu.common.service.impl.BaseServiceImpl; |
| | | 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.param.PlayPlanParam; |
| | | import com.sandu.ximon.admin.security.SecurityUtils; |
| | | import com.sandu.ximon.admin.utils.VnnoxAPIUtil; |
| | |
| | | playPlan.setStartDate(playPlanParam.getStartDate()); |
| | | playPlan.setEndDate(playPlanParam.getEndDate()); |
| | | playPlan.setWeekDays(playPlanParam.getWeekDays()); |
| | | playPlan.setSchedule(JSON.toJSONString(playPlanParam.getSchedule())); |
| | | |
| | | |
| | | Map schedule = playPlanParam.getSchedule(); |
| | | |
| | | String s = JSON.toJSONString(schedule.get("plans")); |
| | | List<PlanDto> plans = JSON.parseArray(s, PlanDto.class); |
| | | System.out.println(plans.toString()+"plans"); |
| | | |
| | | // List<PlanDto> plans = (List<PlanDto>) schedule.get("plans"); |
| | | plans.forEach(plan -> { |
| | | System.out.println(plan+"plan"); |
| | | } |
| | | ); |
| | | |
| | | List<SchedulesDTO> schedulesDTOS = new ArrayList<>(); |
| | | for (int i = 0; i < plans.size(); i++) { |
| | | SchedulesDTO schedulesDTO = new SchedulesDTO(); |
| | | schedulesDTO.setStartDate(playPlanParam.getStartDate()); |
| | | schedulesDTO.setEndDate(playPlanParam.getEndDate()); |
| | | if (i % 2 == 1) { |
| | | schedulesDTO.setExecTime(plans.get(i).getStartTime()); |
| | | } else { |
| | | schedulesDTO.setWeekDays(plans.get(i).getWeekDays()); |
| | | schedulesDTO.setExecTime(plans.get(i).getEndTime()); |
| | | } |
| | | schedulesDTOS.add(schedulesDTO); |
| | | } |
| | | |
| | | playPlan.setSchedule(JSON.toJSONString(schedulesDTOS)); |
| | | playPlan.setStartTime(playPlanParam.getStartTime()); |
| | | playPlan.setEndTime(playPlanParam.getEndTime()); |
| | | // BeanUtils.copyProperties(playPlanParam, playPlan); |
| | |
| | | System.out.println(pushToLed.getPages()); |
| | | |
| | | program.setPages(JSON.parseObject(pushToLed.getPages(), List.class)); |
| | | program.setSchedules(JSON.parseObject(pushToLed.getSchedule(), List.class)); |
| | | Map map = JSON.parseObject(pushToLed.getSchedule(), Map.class); |
| | | // |
| | | // test test = JSON.parseObject(pushToLed.getSchedule(), test.class); |
| | | // |
| | | // SchedulesDTO schedulesDTO = new SchedulesDTO(); |
| | | // schedulesDTO.setExecTime(A.get); |
| | | |
| | | |
| | | program.setSchedules((JSON.parseArray(pushToLed.getSchedule(), SchedulesDTO.class))); |
| | | |
| | | |
| | | // Map map = JSON.parseObject(pushToLed.getSchedule(), Map.class); |
| | | |
| | | program.setNoticeUrl(VnnoxConstant.NOTIFY_URL); |
| | | VnnoxResultResponse vnnoxResultResponse = vnnoxProgramAPIUtil.timeProgram(program); |
| | |
| | | success = vnnoxResultResponse.getData().getSuccess(); |
| | | fail = vnnoxResultResponse.getData().getFail(); |
| | | } |
| | | |
| | | |
| | | // fail.addAll(vnnoxResult.getFail()); |
| | | Map<String, Object> result = new HashMap<>(); |