diff --git a/electrmangnetic/src/main/java/com/electromagnetic/industry/software/manage/controller/FileBackupLogController.java b/electrmangnetic/src/main/java/com/electromagnetic/industry/software/manage/controller/FileBackupLogController.java index ee84204..c7bf5f1 100644 --- a/electrmangnetic/src/main/java/com/electromagnetic/industry/software/manage/controller/FileBackupLogController.java +++ b/electrmangnetic/src/main/java/com/electromagnetic/industry/software/manage/controller/FileBackupLogController.java @@ -18,7 +18,7 @@ public class FileBackupLogController { private FileBackLogService fileBackLogService; @RequestMapping(value = "list") - @UserOperation(value="查询了备份日志", modelName = UserOperationModuleEnum.BACKUP_FILE) + @UserOperation(value="查询备份日志", modelName = UserOperationModuleEnum.BACKUP_FILE) public ElectromagneticResult list(@RequestParam int pageNum, @RequestParam int pageSize) { return fileBackLogService.query(pageNum, pageSize); } diff --git a/electrmangnetic/src/main/java/com/electromagnetic/industry/software/manage/pojo/resp/FileBackLogVO.java b/electrmangnetic/src/main/java/com/electromagnetic/industry/software/manage/pojo/resp/FileBackLogVO.java index 2a66667..89f5df3 100644 --- a/electrmangnetic/src/main/java/com/electromagnetic/industry/software/manage/pojo/resp/FileBackLogVO.java +++ b/electrmangnetic/src/main/java/com/electromagnetic/industry/software/manage/pojo/resp/FileBackLogVO.java @@ -19,4 +19,6 @@ public class FileBackLogVO { private Date backEndTime; + private boolean backupSuccess; + } diff --git a/electrmangnetic/src/main/java/com/electromagnetic/industry/software/manage/service/serviceimpl/FileRecycleServiceImpl.java b/electrmangnetic/src/main/java/com/electromagnetic/industry/software/manage/service/serviceimpl/FileRecycleServiceImpl.java index ab9b63e..818bbd1 100644 --- a/electrmangnetic/src/main/java/com/electromagnetic/industry/software/manage/service/serviceimpl/FileRecycleServiceImpl.java +++ b/electrmangnetic/src/main/java/com/electromagnetic/industry/software/manage/service/serviceimpl/FileRecycleServiceImpl.java @@ -19,6 +19,7 @@ import com.electromagnetic.industry.software.common.util.IdWorker; import com.electromagnetic.industry.software.common.util.UserThreadLocal; import com.electromagnetic.industry.software.manage.config.ElePropertyConfig; import com.electromagnetic.industry.software.manage.mapper.EdFileInfoMapper; +import com.electromagnetic.industry.software.manage.mapper.FileBackupLogMapper; import com.electromagnetic.industry.software.manage.mapper.UserMapper; import com.electromagnetic.industry.software.manage.pojo.models.EdFileInfo; import com.electromagnetic.industry.software.manage.pojo.models.FileBackupLog; @@ -53,11 +54,13 @@ public class FileRecycleServiceImpl implements FileRecycleService { @Resource private CommonService commonService; @Resource - private BackupTask backupTask; + private FileBackupLogMapper fileBackupLogMapper; @Resource private FileSystemService fileSystemService; @Resource private ElePropertyConfig elePropertyConfig; + @Resource + private BackupTask backupTask; @Override public ElectromagneticResult list(RecycleFileQueryDTO pars) { @@ -127,7 +130,7 @@ public class FileRecycleServiceImpl implements FileRecycleService { List fileSysPaths = new ArrayList<>(); for (EdFileInfo edFileInfo : edFileInfos) { String fileSysPath = commonService.getFileSysPath(edFileInfo.getFilePath(), edFileInfo.getDataOwn()); - FileBackupLog fileBackupLog = backupTask.getBaseMapper().selectOne(Wrappers.lambdaQuery(FileBackupLog.class).eq(FileBackupLog::getFileId, edFileInfo.getId())); + FileBackupLog fileBackupLog = fileBackupLogMapper.selectOne(Wrappers.lambdaQuery(FileBackupLog.class).eq(FileBackupLog::getFileId, edFileInfo.getId())); String saveFileName = edFileInfo.getFileName() + "." + edFileInfo.getFileType() + "." + edFileInfo.getFileCode(); @@ -152,11 +155,11 @@ public class FileRecycleServiceImpl implements FileRecycleService { if (backup.getBackupSuccess()) { backupLog.setBackupSuccess(true); - backupTask.getBaseMapper().insert(backupLog); + fileBackupLogMapper.insert(backupLog); } else { backupLog.setBackupSuccess(false); backupLog.setFailInfoDetail(backup.getFailInfoDetail()); - backupTask.getBaseMapper().insert(backupLog); + fileBackupLogMapper.insert(backupLog); throw new BizException(StrFormatter.format("删除文件 {} 失败,原因 备份该文件出现错误,联系管理员查看日志", saveFileName)); } @@ -174,11 +177,11 @@ public class FileRecycleServiceImpl implements FileRecycleService { .setFileName(saveFileName); if (backup.getBackupSuccess()) { fileBackupLog.setBackupSuccess(true); - backupTask.getBaseMapper().update(fileBackupLog, null); + fileBackupLogMapper.update(fileBackupLog, null); } else { fileBackupLog.setBackupSuccess(false); fileBackupLog.setFailInfoDetail(backup.getFailInfoDetail()); - backupTask.getBaseMapper().update(fileBackupLog, null); + fileBackupLogMapper.update(fileBackupLog, null); throw new BizException(StrFormatter.format("删除文件 {} 失败,原因 备份该文件出现错误,联系管理员查看日志", saveFileName)); } }