| | |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | @AllArgsConstructor |
| | | public class LEDProgramFileService extends BaseServiceImpl<LEDProgramFileMapper, LEDProgramFile> { |
| | |
| | | public boolean addProgramFile(LEDProgramFileParam param) { |
| | | LEDProgramFile file = new LEDProgramFile(); |
| | | BeanUtils.copyProperties(param, file); |
| | | if (SecurityUtils.getClientId() != null) { |
| | | file.setUserId(SecurityUtils.getUserId()); |
| | | file.setUserName(SecurityUtils.getUsername()); |
| | | if (clientService.findClientId()) { |
| | | file.setClientId(clientService.getClientId()); |
| | | } |
| | | |
| | | file.setUserId(SecurityUtils.getUserId()); |
| | | file.setUserName(SecurityUtils.getUsername()); |
| | | if (clientService.findClientId()) { |
| | | file.setClientId(clientService.getClientId()); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 诺瓦文件新增 日志记录开始 |
| | |
| | | return save(file); |
| | | } |
| | | |
| | | public boolean deleteFile(Long id) { |
| | | LEDProgramFile byId = getById(id); |
| | | if (byId == null) { |
| | | public boolean deleteFile(List<Long> fileIds) { |
| | | List<LEDProgramFile> ledProgramFiles = listByIds(fileIds); |
| | | if (ledProgramFiles.isEmpty()) { |
| | | throw new BusinessException("未找到该节目"); |
| | | } |
| | | /** |
| | | * 诺瓦文件删除 日志记录开始 |
| | | */ |
| | | String content = "文件id:" + id + "文件内容:" + JSON.toJSONString(byId); |
| | | String content = "文件id:" + fileIds + "文件内容:" + JSON.toJSONString(ledProgramFiles); |
| | | StoreOperationRecordsUtils.storeOperationData(null, null, "诺瓦文件删除", content); |
| | | /** |
| | | * 诺瓦文件删除 日志记录结束 |
| | | */ |
| | | return removeById(id); |
| | | return removeByIds(fileIds); |
| | | } |
| | | |
| | | public LambdaQueryWrapper<LEDProgramFile> listFile() { |