|
@@ -16,6 +16,7 @@
|
|
|
#import "CreditCardEditorViewController.h"
|
|
#import "CreditCardEditorViewController.h"
|
|
|
#import "JKTimerManager.h"
|
|
#import "JKTimerManager.h"
|
|
|
#import "ZipArchive.h"
|
|
#import "ZipArchive.h"
|
|
|
|
|
+#import "StockViewController.h"
|
|
|
|
|
|
|
|
#define SUBMIT_CONFIRM 123
|
|
#define SUBMIT_CONFIRM 123
|
|
|
#define KEEP_TAIL 456
|
|
#define KEEP_TAIL 456
|
|
@@ -29,6 +30,343 @@
|
|
|
|
|
|
|
|
@implementation CreateOrderViewController
|
|
@implementation CreateOrderViewController
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+- (void)onScanSwitchUserTypeClick:(id)sender
|
|
|
|
|
+{
|
|
|
|
|
+ AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
|
|
|
|
|
+ NSString *orderdir =[OLDataProvider getScanPath];
|
|
|
|
|
+
|
|
|
|
|
+ UIAlertController *alertControl = [UIAlertController alertControllerWithTitle:@"Select Customer type" message:@"" preferredStyle:UIAlertControllerStyleAlert];
|
|
|
|
|
+ //block代码块取代了delegate
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ UIAlertAction *actionOne = [UIAlertAction actionWithTitle:@"Existing Customer" style:UIAlertActionStyleDestructive handler:^(UIAlertAction *action) {
|
|
|
|
|
+
|
|
|
|
|
+ NSMutableDictionary* dict = nil;
|
|
|
|
|
+ dict=[OLDataProvider loadScanTemplate:@"e_order.json"];
|
|
|
|
|
+
|
|
|
|
|
+ NSString *orderPath = [orderdir stringByAppendingPathComponent:@"order.json"];
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ [RAUtils dicttofile:orderPath dict:dict];
|
|
|
|
|
+
|
|
|
|
|
+ NSString *orderdir = [OLDataProvider getScanPath];
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+// NSMutableDictionary* dict= [[RAUtils dictfromfile:[orderdir stringByAppendingPathComponent:@"order.json"]] mutableCopy];
|
|
|
|
|
+
|
|
|
|
|
+ int section_count = [dict[@"section_count"] intValue];
|
|
|
|
|
+
|
|
|
|
|
+ for(int i=0;i<section_count;i++)
|
|
|
|
|
+ {
|
|
|
|
|
+ NSMutableDictionary* section = [dict[[NSString stringWithFormat:@"section_%d",i]] mutableCopy];
|
|
|
|
|
+ NSString* title = section[@"title"];
|
|
|
|
|
+ if([title isEqualToString:@"Model Information"])
|
|
|
|
|
+ {
|
|
|
|
|
+
|
|
|
|
|
+ NSMutableDictionary* cart_section = RASingleton.sharedInstance.scan_cart[@"section_0"];
|
|
|
|
|
+ int cart_count = [cart_section[@"count"] intValue];
|
|
|
|
|
+ for(int j=0;j<cart_count;j++)
|
|
|
|
|
+ {
|
|
|
|
|
+ NSMutableDictionary* cart_item = [cart_section[[NSString stringWithFormat:@"item_%d",j]] mutableCopy];
|
|
|
|
|
+ cart_item[@"description"]= [NSString stringWithFormat:@"%@\n%@\n%@",cart_item[@"model"],cart_item[@"description"],cart_item[@"dimension"] ];
|
|
|
|
|
+ cart_item[@"control"]=@"model";
|
|
|
|
|
+ section[[NSString stringWithFormat:@"item_%d",j]] = cart_item;
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ section[@"count"] = @(cart_count);
|
|
|
|
|
+ dict[[NSString stringWithFormat:@"section_%d",i]] = section;
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ if([title isEqualToString:@"Customer"])
|
|
|
|
|
+ {
|
|
|
|
|
+
|
|
|
|
|
+ int scount = [section[@"count"] intValue];
|
|
|
|
|
+ for(int j=0;j<scount;j++)
|
|
|
|
|
+ {
|
|
|
|
|
+ NSMutableDictionary * item = [section[[NSString stringWithFormat:@"item_%d",j]] mutableCopy];
|
|
|
|
|
+ NSString * name = item[@"name"];
|
|
|
|
|
+
|
|
|
|
|
+ if([name isEqualToString:@"business_card"])
|
|
|
|
|
+ {
|
|
|
|
|
+ NSArray*arr =[RAConvertor string2arr:appDelegate.customerInfo[name] separator:@","];
|
|
|
|
|
+ for(int l=0;l<arr.count;l++)
|
|
|
|
|
+ {
|
|
|
|
|
+ item[[NSString stringWithFormat:@"img_url_%d",l] ]=arr[l];
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ if(item[@"value"]==nil ||[item[@"value"] stringValue].length==0) //order 内没有值才从customer 复制
|
|
|
|
|
+ item[@"value"]=appDelegate.customerInfo[name];
|
|
|
|
|
+ }
|
|
|
|
|
+ section[[NSString stringWithFormat:@"item_%d",j]] = item;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // NSDictionary* item_0=@{@"control":@"text",@"name":@"customer_cid",@"aname":@"Contact",@"value":appDelegate.contact_id};
|
|
|
|
|
+ dict[[NSString stringWithFormat:@"section_%d",i]] = section;
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ if([title isEqualToString:@"Remarks Content"])
|
|
|
|
|
+ {
|
|
|
|
|
+
|
|
|
|
|
+ int scount = [section[@"count"] intValue];
|
|
|
|
|
+ for(int j=0;j<scount;j++)
|
|
|
|
|
+ {
|
|
|
|
|
+ NSMutableDictionary * item = [section[[NSString stringWithFormat:@"item_%d",j]] mutableCopy];
|
|
|
|
|
+ NSString * name = item[@"name"];
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ if([name isEqualToString:@"comments"])
|
|
|
|
|
+ {
|
|
|
|
|
+ item[@"value"] = RASingleton.sharedInstance.scan_cart[@"general_note"];
|
|
|
|
|
+ section[[NSString stringWithFormat:@"item_%d",j]] = item;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // NSDictionary* item_0=@{@"control":@"text",@"name":@"customer_cid",@"aname":@"Contact",@"value":appDelegate.contact_id};
|
|
|
|
|
+ dict[[NSString stringWithFormat:@"section_%d",i]] = section;
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ else if([title isEqualToString:@"Order Total"])
|
|
|
|
|
+ {
|
|
|
|
|
+//
|
|
|
|
|
+// int scount = [section[@"count"] intValue];
|
|
|
|
|
+// for(int j=0;j<scount;j++)
|
|
|
|
|
+// {
|
|
|
|
|
+// NSMutableDictionary * item = [section[[NSString stringWithFormat:@"item_%d",j]] mutableCopy];
|
|
|
|
|
+// NSString * name = item[@"name"];
|
|
|
|
|
+//
|
|
|
|
|
+//
|
|
|
|
|
+// if([name isEqualToString:@"totalPrice"])
|
|
|
|
|
+// {
|
|
|
|
|
+// item[@"value"] = [NSString stringWithFormat:@"%.2f",self.total];
|
|
|
|
|
+// section[[NSString stringWithFormat:@"item_%d",j]] = item;
|
|
|
|
|
+// }
|
|
|
|
|
+//
|
|
|
|
|
+//
|
|
|
|
|
+// }
|
|
|
|
|
+//
|
|
|
|
|
+// // NSDictionary* item_0=@{@"control":@"text",@"name":@"customer_cid",@"aname":@"Contact",@"value":appDelegate.contact_id};
|
|
|
|
|
+// dict[[NSString stringWithFormat:@"section_%d",i]] = section;
|
|
|
|
|
+//
|
|
|
|
|
+//
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // NSString *path = NSTemporaryDirectory();
|
|
|
|
|
+ //
|
|
|
|
|
+ // NSString* file=[NSString stringWithFormat:@"SO_%@.json",appDelegate.order_code];
|
|
|
|
|
+ // NSString *filePath = [path stringByAppendingPathComponent:file];
|
|
|
|
|
+ //
|
|
|
|
|
+ //
|
|
|
|
|
+ //
|
|
|
|
|
+ [RAUtils dicttofile:[orderdir stringByAppendingPathComponent:@"order.json"] dict:dict];
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ NSData* json =nil;
|
|
|
|
|
+ if(self.url_type== URL_LOCAL)
|
|
|
|
|
+ json=[NSData dataWithContentsOfFile:[[NSBundle mainBundle] pathForResource:self.request_url ofType:@"json" ]];
|
|
|
|
|
+ else
|
|
|
|
|
+ json=[NSData dataWithContentsOfFile:self.request_url];
|
|
|
|
|
+ NSError *error=nil;
|
|
|
|
|
+ self.content_data_download = [[NSJSONSerialization JSONObjectWithData:json options:NSJSONReadingMutableLeaves error:nil] mutableCopy];
|
|
|
|
|
+ self.content_data_control=[self translate_json:self.content_data_download changed:self.changed_data];
|
|
|
|
|
+
|
|
|
|
|
+ self.navigationItem.title = [self.content_data_download valueForKey:@"title"] ;
|
|
|
|
|
+ [self.editorTable reloadData];
|
|
|
|
|
+// self refresh:<#(NSString *)#> discardDirty:<#(bool)#>
|
|
|
|
|
+
|
|
|
|
|
+//
|
|
|
|
|
+// NSString *contactpath = [orderdir stringByAppendingPathComponent:@"contact.json"];
|
|
|
|
|
+//
|
|
|
|
|
+//
|
|
|
|
|
+//
|
|
|
|
|
+// [RAUtils dicttofile:contactpath dict:appDelegate.customerInfo];
|
|
|
|
|
+//
|
|
|
|
|
+// [self scanPlaceOrder];
|
|
|
|
|
+//
|
|
|
|
|
+ }];
|
|
|
|
|
+
|
|
|
|
|
+ UIAlertAction *alert2 = [UIAlertAction actionWithTitle:@"New customer" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
|
|
|
|
|
+ NSMutableDictionary* dict = nil;
|
|
|
|
|
+ dict=[OLDataProvider loadScanTemplate:@"n_order.json"];
|
|
|
|
|
+ NSString *orderPath = [orderdir stringByAppendingPathComponent:@"order.json"];
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ [RAUtils dicttofile:orderPath dict:dict];
|
|
|
|
|
+
|
|
|
|
|
+ NSString *orderdir = [OLDataProvider getScanPath];
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+// NSMutableDictionary* dict= [[RAUtils dictfromfile:[orderdir stringByAppendingPathComponent:@"order.json"]] mutableCopy];
|
|
|
|
|
+
|
|
|
|
|
+ int section_count = [dict[@"section_count"] intValue];
|
|
|
|
|
+
|
|
|
|
|
+ for(int i=0;i<section_count;i++)
|
|
|
|
|
+ {
|
|
|
|
|
+ NSMutableDictionary* section = [dict[[NSString stringWithFormat:@"section_%d",i]] mutableCopy];
|
|
|
|
|
+ NSString* title = section[@"title"];
|
|
|
|
|
+ if([title isEqualToString:@"Model Information"])
|
|
|
|
|
+ {
|
|
|
|
|
+
|
|
|
|
|
+ NSMutableDictionary* cart_section = RASingleton.sharedInstance.scan_cart[@"section_0"];
|
|
|
|
|
+ int cart_count = [cart_section[@"count"] intValue];
|
|
|
|
|
+ for(int j=0;j<cart_count;j++)
|
|
|
|
|
+ {
|
|
|
|
|
+ NSMutableDictionary* cart_item = [cart_section[[NSString stringWithFormat:@"item_%d",j]] mutableCopy];
|
|
|
|
|
+ cart_item[@"description"]= [NSString stringWithFormat:@"%@\n%@\n%@",cart_item[@"model"],cart_item[@"description"],cart_item[@"dimension"] ];
|
|
|
|
|
+ cart_item[@"control"]=@"model";
|
|
|
|
|
+ section[[NSString stringWithFormat:@"item_%d",j]] = cart_item;
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ section[@"count"] = @(cart_count);
|
|
|
|
|
+ dict[[NSString stringWithFormat:@"section_%d",i]] = section;
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ if([title isEqualToString:@"Customer"])
|
|
|
|
|
+ {
|
|
|
|
|
+
|
|
|
|
|
+ int scount = [section[@"count"] intValue];
|
|
|
|
|
+ for(int j=0;j<scount;j++)
|
|
|
|
|
+ {
|
|
|
|
|
+ NSMutableDictionary * item = [section[[NSString stringWithFormat:@"item_%d",j]] mutableCopy];
|
|
|
|
|
+ NSString * name = item[@"name"];
|
|
|
|
|
+
|
|
|
|
|
+ if([name isEqualToString:@"business_card"])
|
|
|
|
|
+ {
|
|
|
|
|
+ NSArray*arr =[RAConvertor string2arr:appDelegate.customerInfo[name] separator:@","];
|
|
|
|
|
+ for(int l=0;l<arr.count;l++)
|
|
|
|
|
+ {
|
|
|
|
|
+ item[[NSString stringWithFormat:@"img_url_%d",l] ]=arr[l];
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ if(item[@"value"]==nil ||[item[@"value"] stringValue].length==0) //order 内没有值才从customer 复制
|
|
|
|
|
+ item[@"value"]=appDelegate.customerInfo[name];
|
|
|
|
|
+ }
|
|
|
|
|
+ section[[NSString stringWithFormat:@"item_%d",j]] = item;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // NSDictionary* item_0=@{@"control":@"text",@"name":@"customer_cid",@"aname":@"Contact",@"value":appDelegate.contact_id};
|
|
|
|
|
+ dict[[NSString stringWithFormat:@"section_%d",i]] = section;
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ if([title isEqualToString:@"Remarks Content"])
|
|
|
|
|
+ {
|
|
|
|
|
+
|
|
|
|
|
+ int scount = [section[@"count"] intValue];
|
|
|
|
|
+ for(int j=0;j<scount;j++)
|
|
|
|
|
+ {
|
|
|
|
|
+ NSMutableDictionary * item = [section[[NSString stringWithFormat:@"item_%d",j]] mutableCopy];
|
|
|
|
|
+ NSString * name = item[@"name"];
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ if([name isEqualToString:@"comments"])
|
|
|
|
|
+ {
|
|
|
|
|
+ item[@"value"] = RASingleton.sharedInstance.scan_cart[@"general_note"];
|
|
|
|
|
+ section[[NSString stringWithFormat:@"item_%d",j]] = item;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // NSDictionary* item_0=@{@"control":@"text",@"name":@"customer_cid",@"aname":@"Contact",@"value":appDelegate.contact_id};
|
|
|
|
|
+ dict[[NSString stringWithFormat:@"section_%d",i]] = section;
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ else if([title isEqualToString:@"Order Total"])
|
|
|
|
|
+ {
|
|
|
|
|
+//
|
|
|
|
|
+// int scount = [section[@"count"] intValue];
|
|
|
|
|
+// for(int j=0;j<scount;j++)
|
|
|
|
|
+// {
|
|
|
|
|
+// NSMutableDictionary * item = [section[[NSString stringWithFormat:@"item_%d",j]] mutableCopy];
|
|
|
|
|
+// NSString * name = item[@"name"];
|
|
|
|
|
+//
|
|
|
|
|
+//
|
|
|
|
|
+// if([name isEqualToString:@"totalPrice"])
|
|
|
|
|
+// {
|
|
|
|
|
+// item[@"value"] = [NSString stringWithFormat:@"%.2f",self.total];
|
|
|
|
|
+// section[[NSString stringWithFormat:@"item_%d",j]] = item;
|
|
|
|
|
+// }
|
|
|
|
|
+//
|
|
|
|
|
+//
|
|
|
|
|
+// }
|
|
|
|
|
+//
|
|
|
|
|
+// // NSDictionary* item_0=@{@"control":@"text",@"name":@"customer_cid",@"aname":@"Contact",@"value":appDelegate.contact_id};
|
|
|
|
|
+// dict[[NSString stringWithFormat:@"section_%d",i]] = section;
|
|
|
|
|
+//
|
|
|
|
|
+//
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // NSString *path = NSTemporaryDirectory();
|
|
|
|
|
+ //
|
|
|
|
|
+ // NSString* file=[NSString stringWithFormat:@"SO_%@.json",appDelegate.order_code];
|
|
|
|
|
+ // NSString *filePath = [path stringByAppendingPathComponent:file];
|
|
|
|
|
+ //
|
|
|
|
|
+ //
|
|
|
|
|
+ //
|
|
|
|
|
+ [RAUtils dicttofile:[orderdir stringByAppendingPathComponent:@"order.json"] dict:dict];
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ NSData* json =nil;
|
|
|
|
|
+ if(self.url_type== URL_LOCAL)
|
|
|
|
|
+ json=[NSData dataWithContentsOfFile:[[NSBundle mainBundle] pathForResource:self.request_url ofType:@"json" ]];
|
|
|
|
|
+ else
|
|
|
|
|
+ json=[NSData dataWithContentsOfFile:self.request_url];
|
|
|
|
|
+ NSError *error=nil;
|
|
|
|
|
+ self.content_data_download = [[NSJSONSerialization JSONObjectWithData:json options:NSJSONReadingMutableLeaves error:nil] mutableCopy];
|
|
|
|
|
+ self.content_data_control=[self translate_json:self.content_data_download changed:self.changed_data];
|
|
|
|
|
+
|
|
|
|
|
+ self.navigationItem.title = [self.content_data_download valueForKey:@"title"] ;
|
|
|
|
|
+ [self.editorTable reloadData];
|
|
|
|
|
+ }];
|
|
|
|
|
+ UIAlertAction *alertthree = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {
|
|
|
|
|
+ DebugLog(@"No");
|
|
|
|
|
+ }];
|
|
|
|
|
+ [alertControl addAction:actionOne];
|
|
|
|
|
+ [alertControl addAction:alert2];
|
|
|
|
|
+ [alertControl addAction:alertthree];
|
|
|
|
|
+
|
|
|
|
|
+ //UIAlertControllerStyle类型为UIAlertControllerStyleAlert可以添加addTextFieldWithConfigurationHandler:^(UITextField *textField)
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ [self presentViewController:alertControl animated:YES completion:nil];
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+}
|
|
|
- (void)alertMessage:(NSString *)msg {
|
|
- (void)alertMessage:(NSString *)msg {
|
|
|
|
|
|
|
|
|
|
|
|
@@ -325,6 +663,17 @@
|
|
|
|
|
|
|
|
#ifdef SCANNER_ORDER
|
|
#ifdef SCANNER_ORDER
|
|
|
[items addObject:self.btnSubmitOrder];
|
|
[items addObject:self.btnSubmitOrder];
|
|
|
|
|
+ [items addObject:fixedItem];
|
|
|
|
|
+ UIBarButtonItem *switchbtn = nil;
|
|
|
|
|
+
|
|
|
|
|
+ switchbtn = [[UIBarButtonItem alloc] initWithImage:[[UIImage imageNamed:@"select"] imageWithRenderingMode:UIImageRenderingModeAutomatic]
|
|
|
|
|
+ style:UIBarButtonItemStylePlain
|
|
|
|
|
+ target:self
|
|
|
|
|
+ action:@selector(onScanSwitchUserTypeClick:)];
|
|
|
|
|
+
|
|
|
|
|
+// [items addObject:switchbtn];
|
|
|
|
|
+ if([self.content_data_download[@"readonly"] boolValue])
|
|
|
|
|
+ [items removeAllObjects];
|
|
|
#else
|
|
#else
|
|
|
if (!self.isResume) {
|
|
if (!self.isResume) {
|
|
|
// 正常情况
|
|
// 正常情况
|
|
@@ -406,7 +755,8 @@
|
|
|
// closeButton.title = @"Close";
|
|
// closeButton.title = @"Close";
|
|
|
|
|
|
|
|
self.navigationItem.leftBarButtonItem = closeButton;
|
|
self.navigationItem.leftBarButtonItem = closeButton;
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+// self.navigationItem.rightBarButtonItem = switchbtn;
|
|
|
// self.navigationItem.backBarButtonItem = backButton;
|
|
// self.navigationItem.backBarButtonItem = backButton;
|
|
|
|
|
|
|
|
|
|
|
|
@@ -2949,172 +3299,182 @@
|
|
|
return upparams;
|
|
return upparams;
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
-- (void)empolyee_commit_order:(NSMutableDictionary *)upparams {
|
|
|
|
|
|
|
+
|
|
|
|
|
+-(NSString*) scan_stock
|
|
|
|
|
+{
|
|
|
|
|
+ NSMutableArray* ret=[NSMutableArray new];
|
|
|
|
|
+ NSDictionary* section=self.content_data_download[@"section_0"];
|
|
|
|
|
+ int count = [section[@"count"] intValue];
|
|
|
|
|
+ for(int i=0;i<count;i++)
|
|
|
|
|
+ {
|
|
|
|
|
+ NSDictionary* item = section[[NSString stringWithFormat:@"item_%d",i]];
|
|
|
|
|
+ NSDictionary* newitem =@{@"count":item[@"count"],@"model":item[@"model"]}; //@"product_id":item[@"product_id"],
|
|
|
|
|
+ [ret addObject:newitem];
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
+ return [RAConvertor dict2string:ret];
|
|
|
|
|
|
|
|
|
|
|
|
|
-#ifdef SCANNER_ORDER
|
|
|
|
|
|
|
+}
|
|
|
|
|
+-(NSMutableArray*) scan_split_models:(NSMutableArray*) smodels
|
|
|
|
|
+{
|
|
|
|
|
|
|
|
-// if(RASingleton.sharedInstance.enable_OfflineOrder)
|
|
|
|
|
|
|
+ NSMutableDictionary* cart_section = RASingleton.sharedInstance.scan_cart[@"section_0"];
|
|
|
|
|
+ int cart_count = [cart_section[@"count"] intValue];
|
|
|
|
|
+ for(int i=0;i<smodels.count;i++)
|
|
|
{
|
|
{
|
|
|
|
|
+ for(int j=0;j<cart_count;j++)
|
|
|
|
|
+ {
|
|
|
|
|
+ NSMutableDictionary* cart_item = [cart_section[[NSString stringWithFormat:@"item_%d",j]] mutableCopy];
|
|
|
|
|
+ if([cart_item[@"model"] isEqualToString:smodels[i][@"model"] ])
|
|
|
|
|
+ {
|
|
|
|
|
+ NSMutableDictionary* newitem = [[NSMutableDictionary dictionaryWithDictionary:cart_item] mutableCopy];
|
|
|
|
|
+ [newitem addEntriesFromDictionary:smodels[i]];
|
|
|
|
|
+ newitem[@"cuft"]=@([newitem[@"count"] intValue] * [newitem[@"unit_cuft"] doubleValue]);
|
|
|
|
|
+// NSString * mpack=newitem[@"stockUom"];
|
|
|
|
|
+ newitem[@"control"]=@"model";
|
|
|
|
|
+ newitem[@"description"]= [NSString stringWithFormat:@"%@\n%@\n%@",cart_item[@"model"],cart_item[@"description"],cart_item[@"dimension"] ];
|
|
|
|
|
+ newitem[@"subtotal_price"] = @([newitem[@"count"] intValue]* [newitem[@"unit_price"] doubleValue]*(1-[newitem[@"discount"] doubleValue]/100.0));
|
|
|
|
|
+ smodels[i]=newitem;
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+ return smodels;
|
|
|
|
|
+
|
|
|
|
|
+ // for(int j=0;j<cart_count;j++)
|
|
|
|
|
+ // {
|
|
|
|
|
+ // NSMutableDictionary* cart_item = [cart_section[[NSString stringWithFormat:@"item_%d",j]] mutableCopy];
|
|
|
|
|
+ // cart_item[@"description"]= [NSString stringWithFormat:@"%@\n%@\n%@",cart_item[@"model"],cart_item[@"description"],cart_item[@"dimension"] ];
|
|
|
|
|
+ // cart_item[@"control"]=@"model";
|
|
|
|
|
+ // section[[NSString stringWithFormat:@"item_%d",j]] = cart_item;
|
|
|
|
|
+ //
|
|
|
|
|
+ // }
|
|
|
|
|
+ // section[@"count"] = @(cart_count);
|
|
|
|
|
+ // dict[[NSString stringWithFormat:@"section_%d",i]] = section;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+-(void) scan_commit:(NSMutableDictionary *)upparams newmodel:(NSMutableDictionary *)newmodel{
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
|
|
|
|
|
+ NSString *documents = [paths objectAtIndex:0];
|
|
|
|
|
+
|
|
|
|
|
|
|
|
-// if([appDelegate.user isEqualToString:@"GUEST"])
|
|
|
|
|
-// {
|
|
|
|
|
-//
|
|
|
|
|
-// UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"Submit Order" message:@"Please enter your user name and password." preferredStyle:UIAlertControllerStyleAlert];
|
|
|
|
|
-// [alertController addTextFieldWithConfigurationHandler:^(UITextField * _Nonnull textField) {
|
|
|
|
|
-// textField.placeholder = @"User";
|
|
|
|
|
-//// textField.secureTextEntry = YES;
|
|
|
|
|
-// }];
|
|
|
|
|
-// [alertController addTextFieldWithConfigurationHandler:^(UITextField * _Nonnull textField) {
|
|
|
|
|
-// textField.placeholder = @"Password";
|
|
|
|
|
-// textField.secureTextEntry = YES;
|
|
|
|
|
-// }];
|
|
|
|
|
-//
|
|
|
|
|
-// UIAlertAction *okAction = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) {
|
|
|
|
|
-// UITextField *user = alertController.textFields[0];
|
|
|
|
|
-// UITextField *password = alertController.textFields[1];
|
|
|
|
|
-//// if (![user.text isEqualToString:@""]) {
|
|
|
|
|
-////
|
|
|
|
|
-//// //change password
|
|
|
|
|
-////
|
|
|
|
|
-//// }
|
|
|
|
|
-//// else{
|
|
|
|
|
-//// [self presentViewController:alertController animated:YES completion:nil];
|
|
|
|
|
-//// }
|
|
|
|
|
-// }];
|
|
|
|
|
-//
|
|
|
|
|
-//
|
|
|
|
|
-// [alertController addAction:okAction];
|
|
|
|
|
-// UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
|
|
|
|
|
-// NSLog(@"Canelled");
|
|
|
|
|
-// }];
|
|
|
|
|
-// [alertController addAction:cancelAction];
|
|
|
|
|
-// [self presentViewController:alertController animated:YES completion:nil];
|
|
|
|
|
-//
|
|
|
|
|
-//
|
|
|
|
|
-//
|
|
|
|
|
-// }
|
|
|
|
|
-//
|
|
|
|
|
-
|
|
|
|
|
- NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
|
|
|
|
|
- NSString *documents = [paths objectAtIndex:0];
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- NSString *orderdir = [OLDataProvider getScanPath];
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-//
|
|
|
|
|
-// NSArray *cachepaths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
|
|
|
|
|
-// NSString *cachefolder = [paths objectAtIndex:0];
|
|
|
|
|
-//
|
|
|
|
|
-// NSString *upfolder = [cachefolder stringByAppendingPathComponent:@"upload_data"];
|
|
|
|
|
-// NSString* str=[RAConvertor dict2string:upparams];
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-// NSString *ordercontrol = [orderdir stringByAppendingPathComponent:@"order_control.json"];
|
|
|
|
|
- NSString *orderPath = [orderdir stringByAppendingPathComponent:@"order.json"];
|
|
|
|
|
|
|
|
|
|
|
|
+ NSString *orderdir = [OLDataProvider getScanPath];
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+// NSString *ordercontrol = [orderdir stringByAppendingPathComponent:@"order_control.json"];
|
|
|
|
|
+ NSString *orderPath = [orderdir stringByAppendingPathComponent:@"order.json"];
|
|
|
|
|
+
|
|
|
|
|
+ NSMutableDictionary* saveorder = [[NSMutableDictionary dictionaryWithDictionary:self.content_data_download] mutableCopy];
|
|
|
|
|
+ if(newmodel)
|
|
|
|
|
+ saveorder[@"section_0"]=newmodel;
|
|
|
|
|
+
|
|
|
|
|
|
|
|
// [RAUtils dicttofile:ordercontrol dict:self.content_data_control];
|
|
// [RAUtils dicttofile:ordercontrol dict:self.content_data_control];
|
|
|
- [RAUtils dicttofile:orderPath dict:self.content_data_download];
|
|
|
|
|
-
|
|
|
|
|
- for(int os=0;os<[self.content_data_download[@"section_count"] intValue];os++)
|
|
|
|
|
|
|
+ [RAUtils dicttofile:orderPath dict:saveorder];
|
|
|
|
|
+
|
|
|
|
|
+ for(int os=0;os<[self.content_data_download[@"section_count"] intValue];os++)
|
|
|
|
|
+ {
|
|
|
|
|
+ NSDictionary* section = self.content_data_download[[NSString stringWithFormat:@"section_%d",os]];
|
|
|
|
|
+ for(int oi=0;oi<[section[@"count"] intValue];oi++)
|
|
|
{
|
|
{
|
|
|
- NSDictionary* section = self.content_data_download[[NSString stringWithFormat:@"section_%d",os]];
|
|
|
|
|
- for(int oi=0;oi<[section[@"count"] intValue];oi++)
|
|
|
|
|
|
|
+ NSDictionary* item = section [[NSString stringWithFormat:@"item_%d",oi]];
|
|
|
|
|
+ if([item[@"control"] isEqualToString:@"img"])
|
|
|
{
|
|
{
|
|
|
- NSDictionary* item = section [[NSString stringWithFormat:@"item_%d",oi]];
|
|
|
|
|
- if([item[@"control"] isEqualToString:@"img"])
|
|
|
|
|
|
|
+ // 复制图片到打包目录
|
|
|
|
|
+ NSString* img_url_0=item[@"img_url_0"];
|
|
|
|
|
+ NSString* img_url_1=item[@"img_url_1"];
|
|
|
|
|
+ NSString* img_url_2=item[@"img_url_2"];
|
|
|
|
|
+
|
|
|
|
|
+ NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
|
|
|
|
|
+ NSString *cachefolder = [paths objectAtIndex:0];
|
|
|
|
|
+// NSString *offline_createimg = [cachefolder stringByAppendingPathComponent:@"offline_createimg"];
|
|
|
|
|
+ NSString *img_cache = [cachefolder stringByAppendingPathComponent:@"img_cache"];
|
|
|
|
|
+ NSFileManager* fileManager=[NSFileManager defaultManager];
|
|
|
|
|
+ if(img_url_0.length>0&&[fileManager fileExistsAtPath:[img_cache stringByAppendingPathComponent:img_url_0]])
|
|
|
{
|
|
{
|
|
|
- // 复制图片到打包目录
|
|
|
|
|
- NSString* img_url_0=item[@"img_url_0"];
|
|
|
|
|
- NSString* img_url_1=item[@"img_url_1"];
|
|
|
|
|
- NSString* img_url_2=item[@"img_url_2"];
|
|
|
|
|
|
|
+ NSError* err;
|
|
|
|
|
|
|
|
- NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
|
|
|
|
|
- NSString *cachefolder = [paths objectAtIndex:0];
|
|
|
|
|
-// NSString *offline_createimg = [cachefolder stringByAppendingPathComponent:@"offline_createimg"];
|
|
|
|
|
- NSString *img_cache = [cachefolder stringByAppendingPathComponent:@"img_cache"];
|
|
|
|
|
- NSFileManager* fileManager=[NSFileManager defaultManager];
|
|
|
|
|
- if(img_url_0.length>0&&[fileManager fileExistsAtPath:[img_cache stringByAppendingPathComponent:img_url_0]])
|
|
|
|
|
- {
|
|
|
|
|
- NSError* err;
|
|
|
|
|
-
|
|
|
|
|
- [fileManager copyItemAtURL:[NSURL fileURLWithPath:[img_cache stringByAppendingPathComponent:img_url_0]] toURL:[NSURL fileURLWithPath:[orderdir stringByAppendingPathComponent:img_url_0]] error:&err];
|
|
|
|
|
- int i=0;
|
|
|
|
|
- }
|
|
|
|
|
- if(img_url_1.length>0&&[fileManager fileExistsAtPath:[img_cache stringByAppendingPathComponent:img_url_1]])
|
|
|
|
|
- {
|
|
|
|
|
- NSError* err;
|
|
|
|
|
- [fileManager copyItemAtURL:[NSURL fileURLWithPath:[img_cache stringByAppendingPathComponent:img_url_1]] toURL:[NSURL fileURLWithPath:[orderdir stringByAppendingPathComponent:img_url_1]] error:&err];
|
|
|
|
|
- }
|
|
|
|
|
- if(img_url_2.length>0&&[fileManager fileExistsAtPath:[img_cache stringByAppendingPathComponent:img_url_2]])
|
|
|
|
|
- {
|
|
|
|
|
- NSError* err;
|
|
|
|
|
- [fileManager copyItemAtURL:[NSURL fileURLWithPath:[img_cache stringByAppendingPathComponent:img_url_2]] toURL:[NSURL fileURLWithPath:[orderdir stringByAppendingPathComponent:img_url_2]] error:&err];
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ [fileManager copyItemAtURL:[NSURL fileURLWithPath:[img_cache stringByAppendingPathComponent:img_url_0]] toURL:[NSURL fileURLWithPath:[orderdir stringByAppendingPathComponent:img_url_0]] error:&err];
|
|
|
|
|
+ int i=0;
|
|
|
}
|
|
}
|
|
|
- else if([item[@"control"] isEqualToString:@"signature"])
|
|
|
|
|
|
|
+ if(img_url_1.length>0&&[fileManager fileExistsAtPath:[img_cache stringByAppendingPathComponent:img_url_1]])
|
|
|
{
|
|
{
|
|
|
- // 复制图片到打包目录
|
|
|
|
|
- NSString* img_url_0=item[@"value"];
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
|
|
|
|
|
- NSString *cachefolder = [paths objectAtIndex:0];
|
|
|
|
|
|
|
+ NSError* err;
|
|
|
|
|
+ [fileManager copyItemAtURL:[NSURL fileURLWithPath:[img_cache stringByAppendingPathComponent:img_url_1]] toURL:[NSURL fileURLWithPath:[orderdir stringByAppendingPathComponent:img_url_1]] error:&err];
|
|
|
|
|
+ }
|
|
|
|
|
+ if(img_url_2.length>0&&[fileManager fileExistsAtPath:[img_cache stringByAppendingPathComponent:img_url_2]])
|
|
|
|
|
+ {
|
|
|
|
|
+ NSError* err;
|
|
|
|
|
+ [fileManager copyItemAtURL:[NSURL fileURLWithPath:[img_cache stringByAppendingPathComponent:img_url_2]] toURL:[NSURL fileURLWithPath:[orderdir stringByAppendingPathComponent:img_url_2]] error:&err];
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ else if([item[@"control"] isEqualToString:@"signature"])
|
|
|
|
|
+ {
|
|
|
|
|
+ // 复制图片到打包目录
|
|
|
|
|
+ NSString* img_url_0=item[@"value"];
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
|
|
|
|
|
+ NSString *cachefolder = [paths objectAtIndex:0];
|
|
|
// NSString *offline_createimg = [cachefolder stringByAppendingPathComponent:@"offline_createimg"];
|
|
// NSString *offline_createimg = [cachefolder stringByAppendingPathComponent:@"offline_createimg"];
|
|
|
- NSString *img_cache = [cachefolder stringByAppendingPathComponent:@"img_cache"];
|
|
|
|
|
- NSFileManager* fileManager=[NSFileManager defaultManager];
|
|
|
|
|
- if(img_url_0.length>0&&[fileManager fileExistsAtPath:[img_cache stringByAppendingPathComponent:img_url_0]])
|
|
|
|
|
- {
|
|
|
|
|
- NSError* err;
|
|
|
|
|
- [fileManager copyItemAtURL:[NSURL fileURLWithPath:[img_cache stringByAppendingPathComponent:img_url_0]] toURL:[NSURL fileURLWithPath:[orderdir stringByAppendingPathComponent:img_url_0]] error:&err];
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
|
|
+ NSString *img_cache = [cachefolder stringByAppendingPathComponent:@"img_cache"];
|
|
|
|
|
+ NSFileManager* fileManager=[NSFileManager defaultManager];
|
|
|
|
|
+ if(img_url_0.length>0&&[fileManager fileExistsAtPath:[img_cache stringByAppendingPathComponent:img_url_0]])
|
|
|
|
|
+ {
|
|
|
|
|
+ NSError* err;
|
|
|
|
|
+ [fileManager copyItemAtURL:[NSURL fileURLWithPath:[img_cache stringByAppendingPathComponent:img_url_0]] toURL:[NSURL fileURLWithPath:[orderdir stringByAppendingPathComponent:img_url_0]] error:&err];
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- NSString * parampath= [orderdir stringByAppendingPathComponent:@"param.json"];
|
|
|
|
|
-
|
|
|
|
|
- NSDictionary* param=[self convertScanOrder:self.content_data_download];
|
|
|
|
|
-
|
|
|
|
|
- [RAUtils dicttofile:parampath dict:param];
|
|
|
|
|
-
|
|
|
|
|
- NSString *contactpath = [orderdir stringByAppendingPathComponent:@"contact.json"];
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- if(appDelegate.customerInfo==nil)
|
|
|
|
|
- appDelegate.customerInfo = [NSMutableDictionary new];
|
|
|
|
|
- [RAUtils dicttofile:contactpath dict:appDelegate.customerInfo];
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- NSString *cartpath = [orderdir stringByAppendingPathComponent:@"cart.json"];
|
|
|
|
|
-
|
|
|
|
|
- RASingleton.sharedInstance.scan_cart[@"price_type"] = @(RASingleton.sharedInstance.price_type);
|
|
|
|
|
-
|
|
|
|
|
- [RAUtils dicttofile:cartpath dict:RASingleton.sharedInstance.scan_cart];
|
|
|
|
|
-
|
|
|
|
|
- NSString * zippath= [orderdir stringByAppendingPathComponent:[NSString stringWithFormat:@"%@.zip",appDelegate.order_code]];
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
|
|
+ NSString * parampath= [orderdir stringByAppendingPathComponent:@"param.json"];
|
|
|
|
|
+
|
|
|
|
|
+ NSDictionary* param=[self convertScanOrder:self.content_data_download];
|
|
|
|
|
+
|
|
|
|
|
+ [RAUtils dicttofile:parampath dict:param];
|
|
|
|
|
+
|
|
|
|
|
+ NSString *contactpath = [orderdir stringByAppendingPathComponent:@"contact.json"];
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ if(appDelegate.customerInfo==nil)
|
|
|
|
|
+ appDelegate.customerInfo = [NSMutableDictionary new];
|
|
|
|
|
+ [RAUtils dicttofile:contactpath dict:appDelegate.customerInfo];
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ NSString *cartpath = [orderdir stringByAppendingPathComponent:@"cart.json"];
|
|
|
|
|
+
|
|
|
|
|
+ RASingleton.sharedInstance.scan_cart[@"price_type"] = @(RASingleton.sharedInstance.price_type);
|
|
|
|
|
+ NSMutableDictionary* savecart = [[NSMutableDictionary dictionaryWithDictionary:RASingleton.sharedInstance.scan_cart] mutableCopy];
|
|
|
|
|
+
|
|
|
|
|
+ if(newmodel)
|
|
|
|
|
+ savecart[@"section_0"]=newmodel;
|
|
|
|
|
+ [RAUtils dicttofile:cartpath dict:savecart];
|
|
|
|
|
+
|
|
|
|
|
+ NSString * zippath= [orderdir stringByAppendingPathComponent:[NSString stringWithFormat:@"%@.zip",appDelegate.order_code]];
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
// NSError *error=nil;
|
|
// NSError *error=nil;
|
|
|
//
|
|
//
|
|
|
// [str writeToFile:jsonpath atomically:true encoding:NSUTF8StringEncoding error:&error];
|
|
// [str writeToFile:jsonpath atomically:true encoding:NSUTF8StringEncoding error:&error];
|
|
|
-
|
|
|
|
|
- NSArray* arr_files=[RAUtils allFilesAtPath:orderdir];
|
|
|
|
|
-
|
|
|
|
|
- ZipArchive* zip = [[ZipArchive alloc] init];
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+ NSArray* arr_files=[RAUtils allFilesAtPath:orderdir];
|
|
|
|
|
+
|
|
|
|
|
+ ZipArchive* zip = [[ZipArchive alloc] init];
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
// if ([[NSFileManager defaultManager] fileExistsAtPath:zippath]) {
|
|
// if ([[NSFileManager defaultManager] fileExistsAtPath:zippath]) {
|
|
|
//
|
|
//
|
|
|
//
|
|
//
|
|
@@ -3122,162 +3482,342 @@
|
|
|
//
|
|
//
|
|
|
//
|
|
//
|
|
|
// }
|
|
// }
|
|
|
|
|
+
|
|
|
|
|
+ BOOL r = [zip CreateZipFile2:zippath Password:@"usai2010"];
|
|
|
|
|
+
|
|
|
|
|
+ for(int i=0;i<arr_files.count;i++)
|
|
|
|
|
+ {
|
|
|
|
|
+ NSString* file=arr_files[i];
|
|
|
|
|
|
|
|
- BOOL r = [zip CreateZipFile2:zippath Password:@"usai2010"];
|
|
|
|
|
-
|
|
|
|
|
- for(int i=0;i<arr_files.count;i++)
|
|
|
|
|
|
|
+ r = [zip addFileToZip:file newname:[file lastPathComponent]];
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ NSString * filepath=[[RADataProvider getSiteName] stringByAppendingPathComponent:appDelegate.user];
|
|
|
|
|
+ filepath=[filepath stringByAppendingPathComponent:appDelegate.order_code];
|
|
|
|
|
+ filepath=[filepath stringByAppendingPathComponent:[NSString stringWithFormat:@"%@.zip",appDelegate.order_code]];
|
|
|
|
|
+ if( ![zip CloseZipFile2] )
|
|
|
{
|
|
{
|
|
|
- NSString* file=arr_files[i];
|
|
|
|
|
-
|
|
|
|
|
- r = [zip addFileToZip:file newname:[file lastPathComponent]];
|
|
|
|
|
|
|
+ zippath = @"";
|
|
|
|
|
+ filepath =@"";
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- NSString * filepath=[[RADataProvider getSiteName] stringByAppendingPathComponent:appDelegate.user];
|
|
|
|
|
- filepath=[filepath stringByAppendingPathComponent:appDelegate.order_code];
|
|
|
|
|
- filepath=[filepath stringByAppendingPathComponent:[NSString stringWithFormat:@"%@.zip",appDelegate.order_code]];
|
|
|
|
|
- if( ![zip CloseZipFile2] )
|
|
|
|
|
- {
|
|
|
|
|
- zippath = @"";
|
|
|
|
|
- filepath =@"";
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
|
- NSString *md5 = [RAUtils md5WithFile:zippath];
|
|
|
|
|
|
|
+
|
|
|
|
|
+ NSString *md5 = [RAUtils md5WithFile:zippath];
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ {
|
|
|
|
|
+ //括号内为单个文件上传
|
|
|
|
|
+ NSString *fileName = [zippath lastPathComponent];
|
|
|
|
|
+ NSData * file_data= [NSData dataWithContentsOfFile:zippath];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+ NSString* realuser;
|
|
|
|
|
+ NSString* realpassword;
|
|
|
|
|
|
|
|
|
|
+ if(self.realuser.length>0)
|
|
|
{
|
|
{
|
|
|
- //括号内为单个文件上传
|
|
|
|
|
- NSString *fileName = [zippath lastPathComponent];
|
|
|
|
|
- NSData * file_data= [NSData dataWithContentsOfFile:zippath];
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- NSString* realuser;
|
|
|
|
|
- NSString* realpassword;
|
|
|
|
|
-
|
|
|
|
|
- if(self.realuser.length>0)
|
|
|
|
|
|
|
+ realuser = self.realuser;
|
|
|
|
|
+ realpassword = self.realpassword;
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ realuser = appDelegate.user;
|
|
|
|
|
+ realpassword = appDelegate.password;
|
|
|
|
|
+ }
|
|
|
|
|
+ NSDictionary* params = @{
|
|
|
|
|
+// @"site_name":[RADataProvider getSiteName],
|
|
|
|
|
+ @"user":realuser,
|
|
|
|
|
+ @"_method":@"uploadOfflineOrder",
|
|
|
|
|
+ @"password" : realpassword,
|
|
|
|
|
+ @"md5":md5
|
|
|
|
|
+ };
|
|
|
|
|
+ [RANetwork request_fastupload:[params mutableCopy] filename:fileName data:file_data url:appDelegate.uploadurl completionHandler:^(NSMutableDictionary *result) {
|
|
|
|
|
+ int iresult = [result[@"result"] intValue];
|
|
|
|
|
+ if(iresult == RESULT_TRUE)
|
|
|
{
|
|
{
|
|
|
- realuser = self.realuser;
|
|
|
|
|
- realpassword = self.realpassword;
|
|
|
|
|
|
|
+ NSString* soid = result[@"so_id"];
|
|
|
|
|
+ if(soid.length==0)
|
|
|
|
|
+ soid=@"N/A";
|
|
|
|
|
+// upparams[@"soid"]=soid;
|
|
|
|
|
+
|
|
|
|
|
+// NSMutableDictionary* saveorder = [[NSMutableDictionary dictionaryWithDictionary:self.content_data_download] mutableCopy];
|
|
|
|
|
+ if(newmodel)
|
|
|
|
|
+ { self.content_data_download[@"section_0"]=newmodel;
|
|
|
|
|
+ self.content_data_download[@"readonly"]=@1;
|
|
|
|
|
+ }
|
|
|
|
|
+ [self scanSave:upparams];
|
|
|
|
|
+ NSString* company = upparams[@"customer_name"];
|
|
|
|
|
+ [OLDataProvider save2submitScanOrder:soid company:company];
|
|
|
|
|
+ [appDelegate closeOrder];
|
|
|
|
|
+ RASingleton.sharedInstance.scan_cart = nil;
|
|
|
|
|
+
|
|
|
|
|
+ #ifdef RA_NOTIFICATION
|
|
|
|
|
+ [ActiveViewController Notify:@"CartViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
|
|
|
|
|
+ #else
|
|
|
|
|
+ MainViewController* main_vc=(MainViewController*)appDelegate.main_vc;
|
|
|
|
|
+ [main_vc reloadCart:true immediately:false];
|
|
|
|
|
+ #endif
|
|
|
|
|
+
|
|
|
|
|
+ //
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ [self prepareReturn:nil];
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ [self.navigationController popViewControllerAnimated:true];
|
|
|
|
|
+ [((MainViewController*)appDelegate.main_vc) switchToOrder];
|
|
|
|
|
+ // NSMutableDictionary* ret = [[NSMutableDictionary alloc] init];
|
|
|
|
|
+ // ret[@"result"]=@2;
|
|
|
|
|
+ // ret[@"file"]=zippath;
|
|
|
|
|
+ // result(ret);
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ else if(iresult==1)
|
|
|
|
|
+ {
|
|
|
|
|
+ self.fail_submit = true;
|
|
|
|
|
+ self.realuser = nil;
|
|
|
|
|
+ self.realpassword = nil;
|
|
|
|
|
+ [RAUtils message_alert:@"Can not submit the order, wrong password" title:@"Submit Order" controller:self];
|
|
|
|
|
+ if ([[NSFileManager defaultManager] fileExistsAtPath:zippath]) {
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ [[NSFileManager defaultManager] removeItemAtPath:zippath error:nil];
|
|
|
|
|
+
|
|
|
|
|
+ // [orderlist addObject:appDelegate.order_code];
|
|
|
|
|
+ // [RAUtils dicttofile:orderlistPath dict:orderlist];
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
|
- realuser = appDelegate.user;
|
|
|
|
|
- realpassword = appDelegate.password;
|
|
|
|
|
|
|
+ self.fail_submit = true;
|
|
|
|
|
+ [RAUtils message_alert:@"Can not submit the order, please check your network" title:@"Submit Order" controller:self];
|
|
|
|
|
+
|
|
|
|
|
+ if ([[NSFileManager defaultManager] fileExistsAtPath:zippath]) {
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ [[NSFileManager defaultManager] removeItemAtPath:zippath error:nil];
|
|
|
|
|
+
|
|
|
|
|
+ // [orderlist addObject:appDelegate.order_code];
|
|
|
|
|
+ // [RAUtils dicttofile:orderlistPath dict:orderlist];
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
- NSDictionary* params = @{
|
|
|
|
|
-// @"site_name":[RADataProvider getSiteName],
|
|
|
|
|
- @"user":realuser,
|
|
|
|
|
- @"_method":@"uploadOfflineOrder",
|
|
|
|
|
- @"password" : realpassword,
|
|
|
|
|
- @"md5":md5
|
|
|
|
|
- };
|
|
|
|
|
- [RANetwork request_fastupload:[params mutableCopy] filename:fileName data:file_data url:appDelegate.uploadurl completionHandler:^(NSMutableDictionary *result) {
|
|
|
|
|
- int iresult = [result[@"result"] intValue];
|
|
|
|
|
- if(iresult == RESULT_TRUE)
|
|
|
|
|
- {
|
|
|
|
|
- NSString* soid = result[@"so_id"];
|
|
|
|
|
- if(soid.length==0)
|
|
|
|
|
- soid=@"N/A";
|
|
|
|
|
-// upparams[@"soid"]=soid;
|
|
|
|
|
- [self scanSave:upparams];
|
|
|
|
|
- NSString* company = upparams[@"customer_name"];
|
|
|
|
|
- [OLDataProvider save2submitScanOrder:soid company:company];
|
|
|
|
|
- [appDelegate closeOrder];
|
|
|
|
|
- RASingleton.sharedInstance.scan_cart = nil;
|
|
|
|
|
-
|
|
|
|
|
- #ifdef RA_NOTIFICATION
|
|
|
|
|
- [ActiveViewController Notify:@"CartViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
|
|
|
|
|
- #else
|
|
|
|
|
- MainViewController* main_vc=(MainViewController*)appDelegate.main_vc;
|
|
|
|
|
- [main_vc reloadCart:true immediately:false];
|
|
|
|
|
- #endif
|
|
|
|
|
-
|
|
|
|
|
- //
|
|
|
|
|
|
|
+ }];
|
|
|
|
|
+
|
|
|
|
|
|
|
|
-
|
|
|
|
|
- [self prepareReturn:nil];
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- [self.navigationController popViewControllerAnimated:true];
|
|
|
|
|
- [((MainViewController*)appDelegate.main_vc) switchToOrder];
|
|
|
|
|
- // NSMutableDictionary* ret = [[NSMutableDictionary alloc] init];
|
|
|
|
|
- // ret[@"result"]=@2;
|
|
|
|
|
- // ret[@"file"]=zippath;
|
|
|
|
|
- // result(ret);
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
- else if(iresult==1)
|
|
|
|
|
- {
|
|
|
|
|
- self.fail_submit = true;
|
|
|
|
|
- self.realuser = nil;
|
|
|
|
|
- self.realpassword = nil;
|
|
|
|
|
- [RAUtils message_alert:@"Can not submit the order, wrong password" title:@"Submit Order" controller:self];
|
|
|
|
|
- if ([[NSFileManager defaultManager] fileExistsAtPath:zippath]) {
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- [[NSFileManager defaultManager] removeItemAtPath:zippath error:nil];
|
|
|
|
|
-
|
|
|
|
|
- // [orderlist addObject:appDelegate.order_code];
|
|
|
|
|
- // [RAUtils dicttofile:orderlistPath dict:orderlist];
|
|
|
|
|
-
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- }
|
|
|
|
|
- else
|
|
|
|
|
- {
|
|
|
|
|
- self.fail_submit = true;
|
|
|
|
|
- [RAUtils message_alert:@"Can not submit the order, please check your network" title:@"Submit Order" controller:self];
|
|
|
|
|
-
|
|
|
|
|
- if ([[NSFileManager defaultManager] fileExistsAtPath:zippath]) {
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- [[NSFileManager defaultManager] removeItemAtPath:zippath error:nil];
|
|
|
|
|
-
|
|
|
|
|
- // [orderlist addObject:appDelegate.order_code];
|
|
|
|
|
- // [RAUtils dicttofile:orderlistPath dict:orderlist];
|
|
|
|
|
-
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- }
|
|
|
|
|
- }];
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
-// [self addTasks:filepath md5:md5];
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
|
|
|
-
|
|
|
|
|
|
|
+ return;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+- (void)empolyee_commit_order:(NSMutableDictionary *)upparams {
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+#ifdef SCANNER_ORDER
|
|
|
|
|
+
|
|
|
|
|
+ AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
|
|
|
|
|
+
|
|
|
|
|
+ NSString* realuser;
|
|
|
|
|
+ NSString* realpassword;
|
|
|
|
|
+
|
|
|
|
|
+ if(self.realuser.length>0)
|
|
|
|
|
+ {
|
|
|
|
|
+ realuser = self.realuser;
|
|
|
|
|
+ realpassword = self.realpassword;
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ realuser = appDelegate.user;
|
|
|
|
|
+ realpassword = appDelegate.password;
|
|
|
|
|
+ }
|
|
|
|
|
+ if(appDelegate.user_type==USER_ROLE_CUSTOMER || [upparams[@"customer_cid"] stringValue].length>0 ||[appDelegate.user.uppercaseString isEqualToString:@"GUEST"])
|
|
|
|
|
+ {
|
|
|
|
|
+ NSMutableDictionary* param = [NSMutableDictionary new];
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ NSString* model = [self scan_stock];
|
|
|
|
|
+ param[@"models"]=model;
|
|
|
|
|
+ param[@"customer_cid"]=upparams[@"customer_cid"];
|
|
|
|
|
+ param[@"user"]=realuser;
|
|
|
|
|
+ param[@"password"]=realpassword;
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+ [RADataProvider request_scan_stock:param completionHandler:^(NSMutableDictionary *result) {
|
|
|
|
|
+
|
|
|
|
|
+ if([result[@"result"] intValue]==2)
|
|
|
|
|
+ {
|
|
|
|
|
+
|
|
|
|
|
+ NSMutableArray* models = [result[@"models"] mutableCopy];
|
|
|
|
|
+ if(models.count==0)
|
|
|
|
|
+ {
|
|
|
|
|
+ //不可拆分,直接提交
|
|
|
|
|
+ [self scan_commit:upparams newmodel:nil];
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ StockViewController * vc =[[UIStoryboard storyboardWithName:@"SO" bundle:nil] instantiateViewControllerWithIdentifier:@"StockViewController"];
|
|
|
//
|
|
//
|
|
|
-// [OLDataProvider save2submitScanOrder];
|
|
|
|
|
|
|
+// NSMutableArray* testmodels =[[RAConvertor string2dict:@"[{\"model\":\"1420-1*\",\"count\":1,\"is_back_order\":true,\"etd\":\"2022-06-23\"},{\"model\":\"1420-1*\",\"count\":1,\"is_back_order\":false,\"etd\":\"2022-06-23\"}]"] mutableCopy];
|
|
|
|
|
+ NSMutableArray* testmodels =[[RAConvertor string2dict:@"[{\"model\":\"1420-1*\",\"count\":1,\"is_back_order\":false,\"etd\":\"2022-06-23\"}]"] mutableCopy];
|
|
|
|
|
+
|
|
|
|
|
+// models = testmodels;
|
|
|
|
|
+
|
|
|
|
|
+ models = [self scan_split_models:models];
|
|
|
|
|
+ vc.data =models;
|
|
|
|
|
+ vc.returnValue = ^(NSMutableDictionary * _Nonnull models) {
|
|
|
|
|
+// model
|
|
|
|
|
+// int i=0;
|
|
|
|
|
+// RASingleton.sharedInstance.scan_cart[@"section_0"]=models;
|
|
|
|
|
+// self.content_data_download[@"section_0"]=models;
|
|
|
|
|
+ [self scan_commit:upparams newmodel:models];
|
|
|
|
|
+ return;
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ UINavigationController* navi = [[UINavigationController alloc] initWithRootViewController:vc] ;
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ // [self hackModalSheetSize:CGSizeMake(450, 200) ofVC:navi];
|
|
|
|
|
+
|
|
|
|
|
+// navi.modalPresentationStyle = UIModalPresentationFormSheet;//有三种状态,自己看看是哪种
|
|
|
|
|
+ [self presentViewController:navi animated:YES completion:^{
|
|
|
|
|
+
|
|
|
|
|
+ // navi.view.superview.bounds = CGRectMake(0, 0, 480, 320);
|
|
|
|
|
+
|
|
|
|
|
+ DebugLog(@"EditModelPriceViewController present.........");
|
|
|
|
|
+
|
|
|
|
|
+ // self.btop = false;
|
|
|
|
|
+ // <#code#>
|
|
|
|
|
+ }];
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ else if([result[@"result"] intValue]==1)
|
|
|
|
|
+ {
|
|
|
|
|
+ self.fail_submit = true;
|
|
|
|
|
+ self.realuser = nil;
|
|
|
|
|
+ self.realpassword = nil;
|
|
|
|
|
+ [RAUtils message_alert:@"Can not submit the order, wrong password" title:@"Submit Order" controller:self];
|
|
|
|
|
+// if ([[NSFileManager defaultManager] fileExistsAtPath:zippath]) {
|
|
|
//
|
|
//
|
|
|
-// [appDelegate closeOrder];
|
|
|
|
|
-// RASingleton.sharedInstance.scan_cart = nil;
|
|
|
|
|
//
|
|
//
|
|
|
-// #ifdef RA_NOTIFICATION
|
|
|
|
|
-// [ActiveViewController Notify:@"CartViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
|
|
|
|
|
-// #else
|
|
|
|
|
-// MainViewController* main_vc=(MainViewController*)appDelegate.main_vc;
|
|
|
|
|
-// [main_vc reloadCart:true immediately:false];
|
|
|
|
|
-// #endif
|
|
|
|
|
|
|
+// [[NSFileManager defaultManager] removeItemAtPath:zippath error:nil];
|
|
|
//
|
|
//
|
|
|
-////
|
|
|
|
|
|
|
+// // [orderlist addObject:appDelegate.order_code];
|
|
|
|
|
+// // [RAUtils dicttofile:orderlistPath dict:orderlist];
|
|
|
//
|
|
//
|
|
|
|
|
+// }
|
|
|
|
|
+ return;
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ }];
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ //无contact 直接提交
|
|
|
|
|
+ [self scan_commit:upparams newmodel:nil];
|
|
|
|
|
+// [RANetwork request_fastupload:[params mutableCopy] filename:fileName data:file_data url:appDelegate.uploadurl completionHandler:^(NSMutableDictionary *result) {
|
|
|
|
|
+// int iresult = [result[@"result"] intValue];
|
|
|
|
|
+// if(iresult == RESULT_TRUE)
|
|
|
|
|
+// {
|
|
|
|
|
+// NSString* soid = result[@"so_id"];
|
|
|
|
|
+// if(soid.length==0)
|
|
|
|
|
+// soid=@"N/A";
|
|
|
|
|
+//// upparams[@"soid"]=soid;
|
|
|
|
|
+// [self scanSave:upparams];
|
|
|
|
|
+// NSString* company = upparams[@"customer_name"];
|
|
|
|
|
+// [OLDataProvider save2submitScanOrder:soid company:company];
|
|
|
|
|
+// [appDelegate closeOrder];
|
|
|
|
|
+// RASingleton.sharedInstance.scan_cart = nil;
|
|
|
//
|
|
//
|
|
|
-// [self prepareReturn:nil];
|
|
|
|
|
|
|
+// #ifdef RA_NOTIFICATION
|
|
|
|
|
+// [ActiveViewController Notify:@"CartViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
|
|
|
|
|
+// #else
|
|
|
|
|
+// MainViewController* main_vc=(MainViewController*)appDelegate.main_vc;
|
|
|
|
|
+// [main_vc reloadCart:true immediately:false];
|
|
|
|
|
+// #endif
|
|
|
//
|
|
//
|
|
|
|
|
+// //
|
|
|
//
|
|
//
|
|
|
//
|
|
//
|
|
|
-// [self.navigationController popViewControllerAnimated:true];
|
|
|
|
|
-// [((MainViewController*)appDelegate.main_vc) switchToOrder];
|
|
|
|
|
-//// NSMutableDictionary* ret = [[NSMutableDictionary alloc] init];
|
|
|
|
|
-//// ret[@"result"]=@2;
|
|
|
|
|
-//// ret[@"file"]=zippath;
|
|
|
|
|
-//// result(ret);
|
|
|
|
|
- return;
|
|
|
|
|
|
|
+// [self prepareReturn:nil];
|
|
|
|
|
+//
|
|
|
|
|
+//
|
|
|
|
|
+//
|
|
|
|
|
+// [self.navigationController popViewControllerAnimated:true];
|
|
|
|
|
+// [((MainViewController*)appDelegate.main_vc) switchToOrder];
|
|
|
|
|
+// // NSMutableDictionary* ret = [[NSMutableDictionary alloc] init];
|
|
|
|
|
+// // ret[@"result"]=@2;
|
|
|
|
|
+// // ret[@"file"]=zippath;
|
|
|
|
|
+// // result(ret);
|
|
|
|
|
+// return;
|
|
|
|
|
+// }
|
|
|
|
|
+// else if(iresult==1)
|
|
|
|
|
+// {
|
|
|
|
|
+// self.fail_submit = true;
|
|
|
|
|
+// self.realuser = nil;
|
|
|
|
|
+// self.realpassword = nil;
|
|
|
|
|
+// [RAUtils message_alert:@"Can not submit the order, wrong password" title:@"Submit Order" controller:self];
|
|
|
|
|
+// if ([[NSFileManager defaultManager] fileExistsAtPath:zippath]) {
|
|
|
|
|
+//
|
|
|
|
|
+//
|
|
|
|
|
+// [[NSFileManager defaultManager] removeItemAtPath:zippath error:nil];
|
|
|
|
|
+//
|
|
|
|
|
+// // [orderlist addObject:appDelegate.order_code];
|
|
|
|
|
+// // [RAUtils dicttofile:orderlistPath dict:orderlist];
|
|
|
|
|
+//
|
|
|
|
|
+// }
|
|
|
|
|
+//
|
|
|
|
|
+//
|
|
|
|
|
+// }
|
|
|
|
|
+// else
|
|
|
|
|
+// {
|
|
|
|
|
+// self.fail_submit = true;
|
|
|
|
|
+// [RAUtils message_alert:@"Can not submit the order, please check your network" title:@"Submit Order" controller:self];
|
|
|
|
|
+//
|
|
|
|
|
+// if ([[NSFileManager defaultManager] fileExistsAtPath:zippath]) {
|
|
|
|
|
+//
|
|
|
|
|
+//
|
|
|
|
|
+// [[NSFileManager defaultManager] removeItemAtPath:zippath error:nil];
|
|
|
|
|
+//
|
|
|
|
|
+// // [orderlist addObject:appDelegate.order_code];
|
|
|
|
|
+// // [RAUtils dicttofile:orderlistPath dict:orderlist];
|
|
|
|
|
+//
|
|
|
|
|
+// }
|
|
|
|
|
+//
|
|
|
|
|
+// }
|
|
|
|
|
+// }];
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
+ return;
|
|
|
|
|
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|