|
@@ -3675,7 +3675,7 @@ function multitestOnFileSize (ossClient, storeAs, file,attachmentId,attachmentFl
|
|
|
});
|
|
|
};
|
|
|
|
|
|
-function multipartUploadWithStsOnProcessAccessoryAndFileSize(storeAs, file,attachmentId,attachmentFlag,uploadPath,divId,size, fileCount) {
|
|
|
+function multipartUploadWithStsOnProcessAccessoryAndFileSize(storeAs, file,attachmentId,attachmentFlag,uploadPath,divId,size, fileCount,collectType) {
|
|
|
file.name.replace(" ","")
|
|
|
file.name.replace(/—/g,"")
|
|
|
var fileName = file.name;
|
|
@@ -3739,12 +3739,12 @@ function multipartUploadWithStsOnProcessAccessoryAndFileSize(storeAs, file,attac
|
|
|
timeout:timeout
|
|
|
});
|
|
|
storeAs = "attachment-file/" + storeAs +"/"+today+new Date().getTime()+ file.name;
|
|
|
- multitestOnProcessAccessoryAndFileSize(client, storeAs, file,attachmentId,attachmentFlag,uploadPath.replace('http://dmtest-test.oss-cn-shanghai.aliyuncs.com', result.AliyunUrl),divId,size, fileCount);
|
|
|
+ multitestOnProcessAccessoryAndFileSize(client, storeAs, file,attachmentId,attachmentFlag,uploadPath.replace('http://dmtest-test.oss-cn-shanghai.aliyuncs.com', result.AliyunUrl),divId,size, fileCount,collectType);
|
|
|
})
|
|
|
};
|
|
|
|
|
|
|
|
|
-function multitestOnProcessAccessoryAndFileSize (ossClient, storeAs, file,attachmentId,attachmentFlag,uploadPath,divId, size,fileCount) {
|
|
|
+function multitestOnProcessAccessoryAndFileSize (ossClient, storeAs, file,attachmentId,attachmentFlag,uploadPath,divId, size,fileCount,collectType) {
|
|
|
// 根据文件大小动态配置 parallel
|
|
|
let parallel;
|
|
|
if (file.size < 50 * 1024 * 1024) { // 小于 50 MB
|
|
@@ -3799,7 +3799,11 @@ function multitestOnProcessAccessoryAndFileSize (ossClient, storeAs, file,attach
|
|
|
const bytes = Number(data.fileSize) || 0;
|
|
|
|
|
|
// 2. 直接计算MB并保留2位小数,拼接单位(核心逻辑一步完成)
|
|
|
- const fileSizeInMB = (bytes / (1024 * 1024)).toFixed(2);
|
|
|
+ let fileSizeInMB = (bytes / (1024 * 1024)).toFixed(2);
|
|
|
+
|
|
|
+ if(collectType){
|
|
|
+ fileSizeInMB = data.fileSize
|
|
|
+ }
|
|
|
|
|
|
var lowerType = data.type.toLowerCase();
|
|
|
if(data.status=="Success"){
|
|
@@ -3897,7 +3901,7 @@ function multitestOnProcessAccessoryAndFileSize (ossClient, storeAs, file,attach
|
|
|
};
|
|
|
|
|
|
|
|
|
-function multipartUploadWithStsCollectionCollectOnFileSize(storeAs, file,attachmentId,attachmentFlag,uploadPath,divId,size, fileCount,idx,prefix,currentUser) {
|
|
|
+function multipartUploadWithStsCollectionCollectOnFileSize(storeAs, file,attachmentId,attachmentFlag,uploadPath,divId,size, fileCount,collectType) {
|
|
|
console.log("-----------------------start");
|
|
|
console.log("-----------------------"+realPath);
|
|
|
var fileUrl=file.linUrl;
|
|
@@ -3966,12 +3970,12 @@ function multipartUploadWithStsCollectionCollectOnFileSize(storeAs, file,attachm
|
|
|
timeout:timeout
|
|
|
});
|
|
|
storeAs = url;
|
|
|
- multitestCollectionCollectOnFileSize(client, storeAs, file,attachmentId,attachmentFlag,uploadPath.replace('http://dmtest-test.oss-cn-shanghai.aliyuncs.com', result.AliyunUrl),divId,size, fileCount,fileUrl,fileSize);
|
|
|
+ multitestCollectionCollectOnFileSize(client, storeAs, file,attachmentId,attachmentFlag,uploadPath.replace('http://dmtest-test.oss-cn-shanghai.aliyuncs.com', result.AliyunUrl),divId,size, fileCount,fileUrl,fileSize,collectType);
|
|
|
})
|
|
|
|
|
|
};
|
|
|
|
|
|
-function multitestCollectionCollectOnFileSize (ossClient, storeAs, file,attachmentId,attachmentFlag,uploadPath,divId, size,fileCount,fileUrl,fileSize) {
|
|
|
+function multitestCollectionCollectOnFileSize (ossClient, storeAs, file,attachmentId,attachmentFlag,uploadPath,divId, size,fileCount,fileUrl,fileSize,collectType) {
|
|
|
|
|
|
var names = storeAs.split("/");
|
|
|
var name = names[names.length-1];
|
|
@@ -4015,7 +4019,11 @@ function multitestCollectionCollectOnFileSize (ossClient, storeAs, file,attachme
|
|
|
const bytes = Number(data.fileSize) || 0;
|
|
|
|
|
|
// 2. 直接计算MB并保留2位小数,拼接单位(核心逻辑一步完成)
|
|
|
- const fileSizeInMB = (bytes / (1024 * 1024)).toFixed(2);
|
|
|
+ let fileSizeInMB = (bytes / (1024 * 1024)).toFixed(2);
|
|
|
+
|
|
|
+ if(collectType){
|
|
|
+ fileSizeInMB = data.fileSize
|
|
|
+ }
|
|
|
|
|
|
var lowerType = data.type.toLowerCase();
|
|
|
if(data.status=="Success"){
|