优化部分功能
This commit is contained in:
parent
0fd2804517
commit
dbeccc65df
|
|
@ -24,4 +24,9 @@ public class FileBackLogVO {
|
|||
|
||||
private boolean backupSuccess;
|
||||
|
||||
private Integer dataOwn;
|
||||
|
||||
private String dataOwner;
|
||||
|
||||
private String filePath;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,6 +29,8 @@ import javax.annotation.Resource;
|
|||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
|
|
@ -53,14 +55,24 @@ public class FileBackLogServiceImpl extends ServiceImpl<FileBackupLogMapper, Fil
|
|||
return ElectromagneticResultUtil.success(new RespPageVO<>(0L, records));
|
||||
}
|
||||
|
||||
List<String> fileIds = records.stream().map(FileBackupLog::getFileId).collect(Collectors.toList());
|
||||
List<EdFileInfo> edFileInfos = edFileInfoMapper.selectList(Wrappers.<EdFileInfo>lambdaQuery()
|
||||
.select(EdFileInfo.class, file -> !StrUtil.equals(file.getColumn(), "file_content"))
|
||||
.in(EdFileInfo::getId, fileIds));
|
||||
Map<String, EdFileInfo> map = edFileInfos.stream().collect(Collectors.toMap(EdFileInfo::getId, e -> e));
|
||||
Map<String, String> paths = commonService.getFilesPath(edFileInfos.stream().map(EdFileInfo::getFilePath).collect(Collectors.toList()));
|
||||
long total = fileBackupLogPage.getTotal();
|
||||
List<FileBackLogVO> list = new ArrayList<>();
|
||||
for (FileBackupLog fileBackupLog : records) {
|
||||
FileBackLogVO fileBackLogVO = BeanUtil.copyProperties(fileBackupLog, FileBackLogVO.class);
|
||||
fileBackLogVO.setBackStartTime(DateUtil.date(fileBackupLog.getStartTime()));
|
||||
fileBackLogVO.setBackEndTime(DateUtil.date(fileBackupLog.getEndTime()));
|
||||
fileBackLogVO.setDataOwn(map.get(fileBackupLog.getFileId()).getDataOwn());
|
||||
fileBackLogVO.setDataOwner(DataOwnEnum.getTypeByCode(map.get(fileBackupLog.getFileId()).getDataOwn()));
|
||||
fileBackLogVO.setFilePath(paths.get(map.get(fileBackupLog.getFileId()).getFilePath()));
|
||||
list.add(fileBackLogVO);
|
||||
}
|
||||
|
||||
UserThreadLocal.setSuccessInfo("", "", "查询备份日志成功");
|
||||
return ElectromagneticResultUtil.success(new RespPageVO<>(total, list));
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue