| | |
| | | led.setPreview(receiveParam.getPreviewUrl()); |
| | | led.setWidth(receiveParam.getWidth()); |
| | | led.setHeight(receiveParam.getHeight()); |
| | | if (receiveParam.getPages() == null) { |
| | | throw new BusinessException("节目内容丢失"); |
| | | } |
| | | led.setPages(JSON.toJSONString(receiveParam.getPages())); |
| | | return save(led); |
| | | } |
| | |
| | | led.setPreview(receiveParam.getPreviewUrl()); |
| | | led.setWidth(receiveParam.getWidth()); |
| | | led.setHeight(receiveParam.getHeight()); |
| | | if (receiveParam.getPages() == null) { |
| | | throw new BusinessException("节目内容丢失"); |
| | | } |
| | | led.setPages(JSON.toJSONString(receiveParam.getPages())); |
| | | return updateById(led); |
| | | } |
| | | |
| | | |
| | | public boolean deleteProgram(Long id) { |
| | | LEDProgram byId = getById(id); |
| | | if (byId == null) { |
| | | public boolean deleteProgram(List<Long> pids) { |
| | | List<LEDProgram> ledPrograms = listByIds(pids); |
| | | if (ledPrograms.isEmpty()) { |
| | | throw new BusinessException("未找到该节目"); |
| | | } |
| | | |
| | | return removeById(id); |
| | | return removeByIds(pids); |
| | | |
| | | } |
| | | |
| | |
| | | if (seq != null) { |
| | | switch (seq) { |
| | | case 1: |
| | | orderBySeq = " ASC"; |
| | | orderBySeq = OrderByEnums.ASC.getCode(); |
| | | break; |
| | | case 2: |
| | | orderBySeq = " DESC"; |
| | | orderBySeq = OrderByEnums.DESC.getCode(); |
| | | break; |
| | | default: |
| | | break; |