|
|
@@ -541,7 +541,7 @@ static dispatch_semaphore_t _lock;
|
|
|
|
|
|
NSDate *date = [NSDate date];
|
|
|
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
|
|
|
- formatter.dateFormat = @"MM/DD/YYYY HH:mm";
|
|
|
+ formatter.dateFormat = @"MM/dd/YYYY HH:mm";
|
|
|
|
|
|
return [formatter stringFromDate:date];
|
|
|
}
|
|
|
@@ -756,6 +756,7 @@ static dispatch_semaphore_t _lock;
|
|
|
// NSString *paramPath = [upDir stringByAppendingPathComponent:@"params.json"];
|
|
|
// [self _writeJson:mParams toPath:paramPath];
|
|
|
|
|
|
+ NSString *zipF = nil;
|
|
|
if (photos.count > 0) {
|
|
|
// 生成图片目录
|
|
|
NSString *imageDir = [upDir stringByAppendingPathComponent:@"images"];
|
|
|
@@ -772,7 +773,7 @@ static dispatch_semaphore_t _lock;
|
|
|
BOOL move = [fm moveItemAtPath:path toPath:toPath error:&err];
|
|
|
if (!move) {
|
|
|
|
|
|
- NSString *msg = @"Sorry,there is something error";
|
|
|
+ NSString *msg = NSLocalizedString(@"sorry", nil);
|
|
|
if (err) {
|
|
|
msg = err.localizedDescription;
|
|
|
}
|
|
|
@@ -786,14 +787,16 @@ static dispatch_semaphore_t _lock;
|
|
|
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ // 压缩目录
|
|
|
+ NSString *zip = [self _zipDir:upDir];
|
|
|
+
|
|
|
+ // 删除目录
|
|
|
+ [fm removeItemAtPath:upDir error:nil];
|
|
|
+
|
|
|
+ zipF = zip;
|
|
|
}
|
|
|
|
|
|
- // 压缩目录
|
|
|
- NSString *zip = [self _zipDir:upDir];
|
|
|
-
|
|
|
- // 删除目录
|
|
|
- [fm removeItemAtPath:upDir error:nil];
|
|
|
-
|
|
|
Unlock();
|
|
|
|
|
|
// 创建Task
|
|
|
@@ -803,14 +806,21 @@ static dispatch_semaphore_t _lock;
|
|
|
@"name" : title,
|
|
|
@"time" : time,
|
|
|
@"url" : URL_UPLOAD,
|
|
|
- @"file" : zip,
|
|
|
@"params" : mParams
|
|
|
} mutableCopy];
|
|
|
+ if (zipF) {
|
|
|
+ [task setObject:zipF forKey:@"file"];
|
|
|
+ } else {
|
|
|
+ [task setObject:@(YES) forKey:@"noFile"];
|
|
|
+ }
|
|
|
|
|
|
// 提交Task
|
|
|
AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
|
|
|
[appDelegate.uploadManager addTask:task];
|
|
|
|
|
|
+ // 删除Edit文件
|
|
|
+ [self deleteEditJsonFileForOrder:orderId withActionIndex:idx];
|
|
|
+
|
|
|
// 判断是否完成order 所有操作
|
|
|
BOOL finish = [self isLastActionForOrder:orderId];
|
|
|
if (finish) {
|
|
|
@@ -872,8 +882,7 @@ static dispatch_semaphore_t _lock;
|
|
|
}
|
|
|
|
|
|
return @{
|
|
|
- @"result" : @(RESULT_TRUE),
|
|
|
- @"err_msg" : [NSString stringWithFormat:@"%@ %@ is submitted,you will find it in upload list.",title,orderId]
|
|
|
+ @"result" : @(RESULT_TRUE)
|
|
|
};
|
|
|
}
|
|
|
|