Compare commits

..

No commits in common. "5f0c7ce8615ebd1342cc66cc825a6b7cd89a70ff" and "080d369e42d53b41624e2f526b12fedbd70e7835" have entirely different histories.

3 changed files with 7 additions and 12 deletions

View File

@ -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);
}

View File

@ -19,6 +19,4 @@ public class FileBackLogVO {
private Date backEndTime;
private boolean backupSuccess;
}

View File

@ -19,7 +19,6 @@ 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;
@ -54,13 +53,11 @@ public class FileRecycleServiceImpl implements FileRecycleService {
@Resource
private CommonService commonService;
@Resource
private FileBackupLogMapper fileBackupLogMapper;
private BackupTask backupTask;
@Resource
private FileSystemService fileSystemService;
@Resource
private ElePropertyConfig elePropertyConfig;
@Resource
private BackupTask backupTask;
@Override
public ElectromagneticResult<?> list(RecycleFileQueryDTO pars) {
@ -130,7 +127,7 @@ public class FileRecycleServiceImpl implements FileRecycleService {
List<String> fileSysPaths = new ArrayList<>();
for (EdFileInfo edFileInfo : edFileInfos) {
String fileSysPath = commonService.getFileSysPath(edFileInfo.getFilePath(), edFileInfo.getDataOwn());
FileBackupLog fileBackupLog = fileBackupLogMapper.selectOne(Wrappers.lambdaQuery(FileBackupLog.class).eq(FileBackupLog::getFileId, edFileInfo.getId()));
FileBackupLog fileBackupLog = backupTask.getBaseMapper().selectOne(Wrappers.lambdaQuery(FileBackupLog.class).eq(FileBackupLog::getFileId, edFileInfo.getId()));
String saveFileName = edFileInfo.getFileName() + "." + edFileInfo.getFileType() + "." + edFileInfo.getFileCode();
@ -155,11 +152,11 @@ public class FileRecycleServiceImpl implements FileRecycleService {
if (backup.getBackupSuccess()) {
backupLog.setBackupSuccess(true);
fileBackupLogMapper.insert(backupLog);
backupTask.getBaseMapper().insert(backupLog);
} else {
backupLog.setBackupSuccess(false);
backupLog.setFailInfoDetail(backup.getFailInfoDetail());
fileBackupLogMapper.insert(backupLog);
backupTask.getBaseMapper().insert(backupLog);
throw new BizException(StrFormatter.format("删除文件 {} 失败,原因 备份该文件出现错误,联系管理员查看日志", saveFileName));
}
@ -177,11 +174,11 @@ public class FileRecycleServiceImpl implements FileRecycleService {
.setFileName(saveFileName);
if (backup.getBackupSuccess()) {
fileBackupLog.setBackupSuccess(true);
fileBackupLogMapper.update(fileBackupLog, null);
backupTask.getBaseMapper().update(fileBackupLog, null);
} else {
fileBackupLog.setBackupSuccess(false);
fileBackupLog.setFailInfoDetail(backup.getFailInfoDetail());
fileBackupLogMapper.update(fileBackupLog, null);
backupTask.getBaseMapper().update(fileBackupLog, null);
throw new BizException(StrFormatter.format("删除文件 {} 失败,原因 备份该文件出现错误,联系管理员查看日志", saveFileName));
}
}