mirror of
https://gitee.com/qqtt-ah/ecom-dmb.git
synced 2026-11-25 02:29:19 +08:00
fix(order-import): 修复编译错误
1. ImportTaskProcessorServiceImpl: 将 totalCount/successCount/failCount/errorMessages 变量声明移到 try 块外部,确保 finally 后的代码能访问 2. OssServiceImpl: 使用 GetObjectRequest 替代不存在的 getObject 重载方法
This commit is contained in:
+4
-4
@@ -310,6 +310,10 @@ public class ImportTaskProcessorServiceImpl implements ImportTaskProcessorServic
|
|||||||
// 通过 fileId 从统一文件系统获取文件信息,根据存储类型读取文件
|
// 通过 fileId 从统一文件系统获取文件信息,根据存储类型读取文件
|
||||||
File csvFile = null;
|
File csvFile = null;
|
||||||
File tempOssFile = null; // 仅当从OSS下载时使用,用于后续清理
|
File tempOssFile = null; // 仅当从OSS下载时使用,用于后续清理
|
||||||
|
int totalCount = 0;
|
||||||
|
int successCount = 0;
|
||||||
|
int failCount = 0;
|
||||||
|
StringBuilder errorMessages = new StringBuilder();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// 获取文件信息
|
// 获取文件信息
|
||||||
@@ -346,10 +350,6 @@ public class ImportTaskProcessorServiceImpl implements ImportTaskProcessorServic
|
|||||||
// 获取默认订单状态ID(尝试查找"未知状态",如果不存在则使用第一个状态)
|
// 获取默认订单状态ID(尝试查找"未知状态",如果不存在则使用第一个状态)
|
||||||
Long defaultStatusId = getDefaultOrderStatusId(companyId);
|
Long defaultStatusId = getDefaultOrderStatusId(companyId);
|
||||||
|
|
||||||
int totalCount = 0;
|
|
||||||
int successCount = 0;
|
|
||||||
int failCount = 0;
|
|
||||||
StringBuilder errorMessages = new StringBuilder();
|
|
||||||
long lastProgressNotifyAt = 0L;
|
long lastProgressNotifyAt = 0L;
|
||||||
|
|
||||||
// 尝试多种编码读取CSV文件(常见的中文编码)
|
// 尝试多种编码读取CSV文件(常见的中文编码)
|
||||||
|
|||||||
+2
-1
@@ -306,7 +306,8 @@ public class OssServiceImpl implements OssService {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
ossClient.getObject(ossConfig.getBucketName(), storagePath, localFile);
|
com.aliyun.oss.model.GetObjectRequest request = new com.aliyun.oss.model.GetObjectRequest(ossConfig.getBucketName(), storagePath);
|
||||||
|
ossClient.getObject(request, localFile);
|
||||||
return true;
|
return true;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user