| | |
| | | String json = JSON.toJSONString(taskSchedules, SerializerFeature.WriteMapNullValue); |
| | | // String json = new Gson().toJson(taskSchedules); |
| | | ledScheduleEntity.setSchedule(json); |
| | | if (SecurityUtils.getClientId() != null) { |
| | | ledScheduleEntity.setUserId(SecurityUtils.getUserId()); |
| | | if (clientService.findClientId()) { |
| | | ledScheduleEntity.setClientId(clientService.getClientId()); |
| | | } |
| | | } |
| | | return this.save(ledScheduleEntity); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 播放计划列表(熙讯) |
| | | * |
| | | * @param baseConditionVO |
| | | * @param keyword |
| | | * @return |
| | | */ |
| | | public List listSchedule(BaseConditionVO baseConditionVO, String keyword) { |
| | | LambdaQueryWrapper<LedScheduleEntity> eq = new LambdaQueryWrapper<>(); |
| | | PageHelper.startPage(baseConditionVO.getPageNo(), baseConditionVO.getPageSize()); |
| | | if (SecurityUtils.getClientId() != null && clientService.findClientId()) { |
| | | eq = Wrappers.lambdaQuery(LedScheduleEntity.class).eq(LedScheduleEntity::getUserId, SecurityUtils.getUserId()); |
| | | } else if (SecurityUtils.getClientId() != null && !clientService.findClientId()) { |
| | | eq = Wrappers.lambdaQuery(LedScheduleEntity.class).eq(LedScheduleEntity::getClientId, SecurityUtils.getUserId()); |
| | | } else { |
| | | eq = Wrappers.lambdaQuery(LedScheduleEntity.class); |
| | | LambdaQueryWrapper<LedScheduleEntity> eq = Wrappers.lambdaQuery(LedScheduleEntity.class); |
| | | //用户类型判断 |
| | | if (SecurityUtils.getClientId() != null) { |
| | | eq = eq.eq(LedScheduleEntity::getUserId, SecurityUtils.getUserId()).or(w -> { |
| | | w.eq(LedScheduleEntity::getClientId, SecurityUtils.getUserId()); |
| | | }); |
| | | } |
| | | if (!keyword.isEmpty()) { |
| | | //模糊查询关键字判断 |
| | | if (keyword != null && !keyword.isEmpty()) { |
| | | eq = eq.like(LedScheduleEntity::getName, keyword); |
| | | } |
| | | |
| | | PageHelper.startPage(baseConditionVO.getPageNo(), baseConditionVO.getPageSize()); |
| | | return list(eq); |
| | | } |
| | | |