| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.basic.entity.StorageAttachment; |
| | | import com.ruoyi.basic.service.StorageAttachmentService; |
| | | import com.ruoyi.business.dto.ArchiveDto; |
| | | import com.ruoyi.business.entity.Archive; |
| | | import com.ruoyi.business.mapper.ArchiveMapper; |
| | |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | import static com.ruoyi.common.constant.StorageAttachmentConstants.StorageAttachmentFile; |
| | | import static com.ruoyi.common.enums.StorageAttachmentRecordType.Archives; |
| | | |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | |
| | | private final ArchiveMapper archiveMapper; |
| | | |
| | | private final StorageAttachmentService storageAttachmentService; |
| | | |
| | | |
| | | |
| | | @Override |
| | | public IPage<Archive> selectArchiveList(Page page, ArchiveDto archiveDto) { |
| | | LambdaQueryWrapper<Archive> queryWrapper = new LambdaQueryWrapper<>(); |
| | |
| | | public int addOrEditArchive(ArchiveDto archiveDto) { |
| | | Archive archive = new Archive(); |
| | | BeanUtils.copyProperties(archiveDto, archive); |
| | | int i ; |
| | | if (Objects.isNull(archiveDto.getId())) { |
| | | |
| | | return archiveMapper.insert(archive); |
| | | i= archiveMapper.insert(archive); |
| | | } else { |
| | | return archiveMapper.updateById(archive); |
| | | i= archiveMapper.updateById(archive); |
| | | } |
| | | storageAttachmentService.saveStorageAttachment(archiveDto.getAttachments(), archive.getId(),Archives,StorageAttachmentFile); |
| | | return i; |
| | | } |
| | | |
| | | @Override |
| | |
| | | // 执行批量逻辑删除 |
| | | return archiveMapper.update(null, updateWrapper); |
| | | } |
| | | |
| | | @Override |
| | | public List<StorageAttachment> fileList(ArchiveDto archiveDto) { |
| | | storageAttachmentService.selectStorageAttachments(archiveDto.getId(), Archives, StorageAttachmentFile); |
| | | return null; |
| | | } |
| | | } |