mirror of
https://gitee.com/qqtt-ah/ecom-dmb.git
synced 2026-11-24 10:29:19 +08:00
refactor(order-import): 改用 sys_file 外键替代 file_path
数据库变更: - ec_import_tasks 表:移除 file_path 字段,新增 file_id 外键关联 sys_file - sql/temp.sql:包含 ALTER 语句用于线上数据库变更 代码变更: - ImportTaskPO/VO/DTO:filePath → fileId - SysFileService:新增 getFileById 方法 - ImportTaskProcessorServiceImpl: - 注入 SysFileService - 通过 fileId 获取文件信息 - 根据 storageType(local/oss)读取文件:本地直读,OSS 下载到临时文件后处理 - 临时文件不再依赖 deleteOnExit
This commit is contained in:
+8
@@ -91,5 +91,13 @@ public interface SysFileService {
|
||||
* @param dto 更新内容
|
||||
*/
|
||||
void updateFile(Long id, SysFileUpdateDTO dto);
|
||||
|
||||
/**
|
||||
* 通过文件ID获取文件信息
|
||||
*
|
||||
* @param fileId 文件ID
|
||||
* @return 文件信息VO
|
||||
*/
|
||||
SysFileVO getFileById(Long fileId);
|
||||
}
|
||||
|
||||
|
||||
+14
@@ -617,5 +617,19 @@ public class SysFileServiceImpl extends ServiceImpl<SysFileMapper, SysFilePO> im
|
||||
}
|
||||
this.updateById(file);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SysFileVO getFileById(Long fileId) {
|
||||
if (fileId == null) {
|
||||
return null;
|
||||
}
|
||||
SysFilePO file = this.getById(fileId);
|
||||
if (file == null) {
|
||||
return null;
|
||||
}
|
||||
SysFileVO vo = new SysFileVO();
|
||||
BeanUtils.copyProperties(file, vo);
|
||||
return vo;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user