Ray Zhang 8 лет назад
Родитель
Сommit
289d14392a

+ 2 - 2
RedAnt ERP Mobile/common/CommonEditor/CommonEditorViewController.h

@@ -61,7 +61,7 @@
 -(void) commonAction:(NSString *)value index:(NSIndexPath*) indexPath data:(NSMutableDictionary*) item_json;
 -(void) prepareReturn:(NSMutableDictionary*) value;
 -(NSMutableArray*) translate_json: (NSDictionary*) injson changed:(NSDictionary*) changed_value;
--(NSMutableDictionary*)create_cusromer_info_from_table;
+//-(NSMutableDictionary*)create_cusromer_info_from_table;
 @property (strong,nonatomic) NSIndexPath* from;
 -(subitem_data*) subitem_param:(NSDictionary*) itemjson addto:(NSMutableDictionary*) upparam alert:(bool)alert;
 -(NSMutableDictionary*) check_cancommit:(bool) alert;
@@ -88,7 +88,7 @@
 @property (strong,nonatomic) NSMutableDictionary* data_init;
 
 // Public
--(NSMutableDictionary*)create_value_map:(NSDictionary*)key_map;
+//-(NSMutableDictionary*)create_value_map:(NSDictionary*)key_map;
 -(NSMutableDictionary*) fill_switch_subitem:(NSMutableDictionary *) switch_item subid:(NSArray*) subid source:(NSMutableDictionary*)source mapping:(NSDictionary*)mapping;
 -(NSMutableDictionary*) fill_enum_subitem:(NSMutableDictionary *) enum_item subid:(NSArray*) subid source:(NSMutableDictionary*)source mapping:(NSDictionary*)mapping;
 -(void) refresh:(NSString*) trigger;

+ 19 - 202
RedAnt ERP Mobile/common/CommonEditor/CommonEditorViewController.m

@@ -43,6 +43,11 @@
 
 #import "AppDelegate.h"
 
+#import "FileCache.h"
+#import "RAConvertor.h"
+
+
+
 @interface subitem_data ()
 
 @end
@@ -1616,7 +1621,7 @@
             [self.content_data_download setObject:section_json forKey:[NSString stringWithFormat:@"section_%ld",(long)indexPath.section ]];
         }
         
-        DebugLog(@"CONTENT UPDATE:%@",[RANetwork DataTOjsonString:self.content_data_download]);
+        DebugLog(@"CONTENT UPDATE:%@",[RAConvertor DataTOjsonString:self.content_data_download]);
         self.content_data_control = [self translate_json:self.content_data_download changed:self.changed_data];
         
         
@@ -1803,7 +1808,7 @@
             [self.content_data_download setObject:section_json forKey:[NSString stringWithFormat:@"section_%ld",(long)indexPath.section ]];
         }
         
-        DebugLog(@"CONTENT UPDATE:%@",[RANetwork DataTOjsonString:self.content_data_download]);
+        DebugLog(@"CONTENT UPDATE:%@",[RAConvertor DataTOjsonString:self.content_data_download]);
         self.content_data_control = [self translate_json:self.content_data_download changed:self.changed_data];
         
         
@@ -2248,196 +2253,8 @@
     }
     return ret;
 }
--(NSMutableDictionary*)create_value_map:(NSDictionary*)key_map
-{
-    NSMutableDictionary* ret= [[NSMutableDictionary alloc] init];
-    NSArray *keys= [key_map allKeys];
-    //遍历keys
-    for(int i=0;i<[keys count];i++)
-    {
-        //得到当前key
-        NSString *key=[keys objectAtIndex:i];
-        //如果key不是pic,说明value是字符类型,比如name:Boris
-        NSString* valuefrom = [key_map valueForKey:key];
-        
-        if(valuefrom.length==0)
-            continue;
-        NSString* value=[self getValue:valuefrom];
-        
-        [ret setValue:value forKey:valuefrom];
-    }
-    NSDictionary * customerinfo =[self create_cusromer_info_from_table];
-    [ret setValue:[self create_customer_ext:customerinfo] forKey:@"customer_contact_ext"];
-    [ret setValue:customerinfo[@"customer_first_name"] forKey:@"customer_first_name"];
-    [ret setValue:customerinfo[@"customer_last_name"] forKey:@"customer_last_name"];
-    //        AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
-    //    //     self.labelContact.text=appDelegate.contact_name;
-    //
-    //    NSDictionary * customerinfo = appDelegate.customerInfo;
-    //
-    //
-    //    keys= [customerinfo allKeys];
-    //    //遍历keys
-    //    for(int i=0;i<[keys count];i++)
-    //    {
-    //        //得到当前key
-    //        NSString *key=[keys objectAtIndex:i];
-    //        //如果key不是pic,说明value是字符类型,比如name:Boris
-    //        NSString* valuefrom = key;
-    //        NSString* value=[customerinfo valueForKey:key];
-    //
-    //        [ret setValue:value forKey:valuefrom];
-    //    }
-    ////  add  customer_contact_ext
-    //    [ret setValue:[self create_customer_ext:customerinfo] forKey:@"customer_contact_ext"];
-    
-    //    NSString *string = [array componentsJoinedByString:@" "];
-    return ret;
-}
 
--(NSMutableDictionary*)create_cusromer_info_from_table
-{
-    
-    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
-    
-    NSMutableDictionary* ret= [appDelegate.customerInfo mutableCopy] ;
-    
-    [ret setValue:[self getValue:@"customer_country"] forKey:@"customer_country"];
-    [ret setValue:[self getValue:@"customer_phone"] forKey:@"customer_phone"];
-    [ret setValue:[self getValue:@"customer_email"] forKey:@"customer_email"];
-    [ret setValue:[self getValue:@"customer_name"] forKey:@"customer_name"];
-    [ret setValue:[self getValue:@"customer_address4"] forKey:@"customer_address4"];
-    [ret setValue:[self getValue:@"customer_address3"] forKey:@"customer_address3"];
-    [ret setValue:[self getValue:@"customer_address2"] forKey:@"customer_address2"];
-    [ret setValue:[self getValue:@"customer_address1"] forKey:@"customer_address1"];
-    [ret setValue:[self getValue:@"customer_zipcode"] forKey:@"customer_zipcode"];
-    [ret setValue:[self getValue:@"customer_city"] forKey:@"customer_city"];
-    [ret setValue:[self getValue:@"customer_state"] forKey:@"customer_state"];
-    [ret setValue:[self getValue:@"customer_cid"] forKey:@"customer_cid"];
-    [ret setValue:[self getValue:@"customer_state"] forKey:@"customer_state"];
-    [ret setValue:[self getValue:@"customer_contact"] forKey:@"customer_contact"];
-    [ret setValue:[self getValue:@"customer_fax"] forKey:@"customer_fax"];
-    
-    NSString * firstname =nil;
-    
-    NSString* lastname = nil;
-    NSString* contact_name = [self getValue:@"customer_contact"];
-    if(contact_name!=nil)
-    {
-        NSArray *_arr = [contact_name componentsSeparatedByString:NSLocalizedString(@" ", nil)];
-        
-        
-        
-        if(_arr.count>=1)
-        {
-            firstname =_arr[0];
-            if(_arr.count>1)
-            {
-                
-                lastname=[[_arr subarrayWithRange:NSMakeRange(1, _arr.count-1)] componentsJoinedByString:@" "];
-            }
-        }
-    }
-    [ret setValue:firstname forKey:@"customer_first_name"];
-    [ret setValue:lastname forKey:@"customer_last_name"];
-    
-    //    [ret setValue:[self create_customer_ext:ret] forKey:@"customer_contact_ext"];
-    
-    return ret;
-}
--(NSString* )create_customer_ext:(NSDictionary*)customerinfo
-{
-    NSString* ret=nil;
-    NSString* customer_address1= [customerinfo valueForKey:@"customer_address1"];
-    NSString* customer_address2= [customerinfo valueForKey:@"customer_address2"];
-    NSString* customer_address3= [customerinfo valueForKey:@"customer_address3"];
-    NSString* customer_address4= [customerinfo valueForKey:@"customer_address4"];
-    
-    NSMutableArray* arraddr = [[NSMutableArray alloc] init];
-    if(customer_address1.length>0)
-        [arraddr addObject:customer_address1];
-    if(customer_address2.length>0)
-        [arraddr addObject:customer_address2];
-    if(customer_address3.length>0)
-        [arraddr addObject:customer_address3];
-    if(customer_address4.length>0)
-        [arraddr addObject:customer_address4];
-    NSString *addr_string = [arraddr componentsJoinedByString:@"\r\n"];
-    
-    
-    NSString* customer_city= [customerinfo valueForKey:@"customer_city"];
-    NSString* customer_country= [customerinfo valueForKey:@"customer_country"];
-    NSString* customer_zipcode= [customerinfo valueForKey:@"customer_zipcode"];
-    NSString* customer_state= [customerinfo valueForKey:@"customer_state"];
-    
-    NSMutableArray* arrcty = [[NSMutableArray alloc] init];
-    if(customer_city.length>0)
-        [arrcty addObject:customer_city];
-    if(customer_state.length>0)
-        [arrcty addObject:customer_state];
-    if(customer_zipcode.length>0)
-        [arrcty addObject:customer_zipcode];
-    if(customer_country.length>0)
-        [arrcty addObject:customer_country];
-    NSString *cty_string = [arrcty componentsJoinedByString:@", "];
-    
-    
-    //    NSString* customer_phone= [customerinfo valueForKey:@"customer_phone"];
-    //    NSString* customer_fax= [customerinfo valueForKey:@"customer_fax"];
-    //
-    //    NSMutableArray* arrpho = [[NSMutableArray alloc] init];
-    //    if(customer_phone.length>0)
-    //    {
-    //        customer_phone = [NSString stringWithFormat:@"TEL: %@",customer_phone];
-    //        [arrpho addObject:customer_phone];
-    //    }
-    //    if(customer_fax.length>0)
-    //    {
-    //        customer_fax = [NSString stringWithFormat:@"FAX: %@",customer_fax];
-    //        [arrpho addObject:customer_fax];
-    //    }
-    //    NSString *phone_string = [arrpho componentsJoinedByString:@", "];
-    //
-    //
-    //    NSString* customer_contact= [customerinfo valueForKey:@"customer_contact"];
-    //    if(customer_contact.length>0)
-    //    {
-    //        customer_contact = [NSString stringWithFormat:@"ATTN: %@",customer_contact];
-    //
-    //    }
-    //    NSString *contact_string = customer_contact;
-    //
-    //
-    //    NSString* customer_email= [customerinfo valueForKey:@"customer_email"];
-    //    if(customer_email.length>0)
-    //    {
-    //        customer_email = [NSString stringWithFormat:@"Email: %@",customer_email];
-    //
-    //    }
-    //    NSString *email_string = customer_email;
-    
-    
-    NSMutableArray* arrext = [[NSMutableArray alloc] init];
-    if(addr_string.length>0)
-        [arrext addObject:addr_string];
-    if(cty_string.length>0)
-        [arrext addObject:cty_string];
-    //    if(phone_string.length>0)
-    //        [arrext addObject:phone_string];
-    //    if(contact_string.length>0)
-    //        [arrext addObject:contact_string];
-    //    if(email_string.length>0)
-    //        [arrext addObject:email_string];
-    
-    ret = [arrext componentsJoinedByString:@"\r\n"];
-    
-    //    NSString *string = [array componentsJoinedByString:@" "];
-    
-    //    NSString* customer_name= [customerinfo valueForKey:@"customer_name"];
-    
-    
-    return ret;
-}
+
 #pragma mark - hide section button clicked
 - (void)HideSction:(UIButton *)sender {
     
@@ -2922,7 +2739,7 @@
                         img_url_up=@"";
                     cell.imgs[0]=img_url_up;
                     NSString* file_name=[img_url0 lastPathComponent];
-                    NSData* img_data=[iSalesDB load_cached_img:file_name loadFrom:img_url0];
+                    NSData* img_data=[FileCache load_cached_img:file_name loadFrom:img_url0];
                     if(img_data!=nil)
                     {
                         
@@ -2947,7 +2764,7 @@
                                 if(downloadimg_data!=nil)
                                 {
                                     
-                                    [iSalesDB cache_img:downloadimg_data filename:file_name saveTo:img_url0];
+                                    [FileCache cache_img:downloadimg_data filename:file_name saveTo:img_url0];
                                     
                                     UIImage * img =[UIImage imageWithData:downloadimg_data];
                                     cell.touchImageView0.image=img;
@@ -2983,7 +2800,7 @@
                     
                     cell.imgs[1]=img_url_up;
                     NSString* file_name=[img_url1 lastPathComponent];
-                    NSData* img_data=[iSalesDB load_cached_img:file_name loadFrom:img_url1];
+                    NSData* img_data=[FileCache load_cached_img:file_name loadFrom:img_url1];
                     if(img_data!=nil)
                     {
                         
@@ -3009,7 +2826,7 @@
                                 if(downloadimg_data!=nil)
                                 {
                                     
-                                    [iSalesDB cache_img:downloadimg_data filename:file_name saveTo:img_url1];
+                                    [FileCache cache_img:downloadimg_data filename:file_name saveTo:img_url1];
                                     
                                     UIImage * img =[UIImage imageWithData:downloadimg_data];
                                     cell.touchImageView1.image=img;
@@ -3042,7 +2859,7 @@
                         img_url_up=@"";
                     cell.imgs[2]=img_url_up;
                     NSString* file_name=[img_url2 lastPathComponent];
-                    NSData* img_data=[iSalesDB load_cached_img:file_name loadFrom:img_url2];
+                    NSData* img_data=[FileCache load_cached_img:file_name loadFrom:img_url2];
                     if(img_data!=nil)
                     {
                         
@@ -3067,7 +2884,7 @@
                                 if(downloadimg_data!=nil)
                                 {
                                     
-                                    [iSalesDB cache_img:downloadimg_data filename:file_name saveTo:img_url2];
+                                    [FileCache cache_img:downloadimg_data filename:file_name saveTo:img_url2];
                                     
                                     UIImage * img =[UIImage imageWithData:downloadimg_data];
                                     cell.touchImageView2.image=img;
@@ -3751,7 +3568,7 @@
             cell.imgModel.image = [UIImage imageNamed:@"loading_s"];
             
             NSString* file_name=[img_url lastPathComponent];
-            NSData* img_data=[iSalesDB load_cached_img:file_name loadFrom:img_url];
+            NSData* img_data=[FileCache load_cached_img:file_name loadFrom:img_url];
             if(img_data!=nil)
             {
                 
@@ -3772,7 +3589,7 @@
                         if(downloadimg_data!=nil)
                         {
                             
-                            [iSalesDB cache_img:downloadimg_data filename:file_name saveTo:img_url];
+                            [FileCache cache_img:downloadimg_data filename:file_name saveTo:img_url];
                             
                             UIImage * img =[UIImage imageWithData:downloadimg_data];
                             cell.imgModel.image = img;
@@ -3946,7 +3763,7 @@
             
             
             NSString* file_name=[img_url lastPathComponent];
-            NSData* img_data=[iSalesDB load_cached_img:file_name loadFrom:img_url];
+            NSData* img_data=[FileCache load_cached_img:file_name loadFrom:img_url];
             if(img_data!=nil)
             {
                 
@@ -3967,7 +3784,7 @@
                         if(downloadimg_data!=nil)
                         {
                             
-                            [iSalesDB cache_img:downloadimg_data filename:file_name saveTo:img_url];
+                            [FileCache cache_img:downloadimg_data filename:file_name saveTo:img_url];
                             
                             UIImage * img =[UIImage imageWithData:downloadimg_data];
                             cell.imageviewSignature.image=img ;
@@ -4685,7 +4502,7 @@
     }
     
     
-    DebugLog(@"CONTENT UPDATE:%@",[RANetwork DataTOjsonString:self.content_data_download]);
+    DebugLog(@"CONTENT UPDATE:%@",[RAConvertor DataTOjsonString:self.content_data_download]);
     
     
     

+ 168 - 0
RedAnt ERP Mobile/common/Functions/order/CreateOrderViewController.m

@@ -3108,6 +3108,174 @@
     
 }
 
+-(NSString* )create_customer_ext:(NSDictionary*)customerinfo
+{
+    NSString* ret=nil;
+    NSString* customer_address1= [customerinfo valueForKey:@"customer_address1"];
+    NSString* customer_address2= [customerinfo valueForKey:@"customer_address2"];
+    NSString* customer_address3= [customerinfo valueForKey:@"customer_address3"];
+    NSString* customer_address4= [customerinfo valueForKey:@"customer_address4"];
+    
+    NSMutableArray* arraddr = [[NSMutableArray alloc] init];
+    if(customer_address1.length>0)
+        [arraddr addObject:customer_address1];
+    if(customer_address2.length>0)
+        [arraddr addObject:customer_address2];
+    if(customer_address3.length>0)
+        [arraddr addObject:customer_address3];
+    if(customer_address4.length>0)
+        [arraddr addObject:customer_address4];
+    NSString *addr_string = [arraddr componentsJoinedByString:@"\r\n"];
+    
+    
+    NSString* customer_city= [customerinfo valueForKey:@"customer_city"];
+    NSString* customer_country= [customerinfo valueForKey:@"customer_country"];
+    NSString* customer_zipcode= [customerinfo valueForKey:@"customer_zipcode"];
+    NSString* customer_state= [customerinfo valueForKey:@"customer_state"];
+    
+    NSMutableArray* arrcty = [[NSMutableArray alloc] init];
+    if(customer_city.length>0)
+        [arrcty addObject:customer_city];
+    if(customer_state.length>0)
+        [arrcty addObject:customer_state];
+    if(customer_zipcode.length>0)
+        [arrcty addObject:customer_zipcode];
+    if(customer_country.length>0)
+        [arrcty addObject:customer_country];
+    NSString *cty_string = [arrcty componentsJoinedByString:@", "];
+    
+    
+    //    NSString* customer_phone= [customerinfo valueForKey:@"customer_phone"];
+    //    NSString* customer_fax= [customerinfo valueForKey:@"customer_fax"];
+    //
+    //    NSMutableArray* arrpho = [[NSMutableArray alloc] init];
+    //    if(customer_phone.length>0)
+    //    {
+    //        customer_phone = [NSString stringWithFormat:@"TEL: %@",customer_phone];
+    //        [arrpho addObject:customer_phone];
+    //    }
+    //    if(customer_fax.length>0)
+    //    {
+    //        customer_fax = [NSString stringWithFormat:@"FAX: %@",customer_fax];
+    //        [arrpho addObject:customer_fax];
+    //    }
+    //    NSString *phone_string = [arrpho componentsJoinedByString:@", "];
+    //
+    //
+    //    NSString* customer_contact= [customerinfo valueForKey:@"customer_contact"];
+    //    if(customer_contact.length>0)
+    //    {
+    //        customer_contact = [NSString stringWithFormat:@"ATTN: %@",customer_contact];
+    //
+    //    }
+    //    NSString *contact_string = customer_contact;
+    //
+    //
+    //    NSString* customer_email= [customerinfo valueForKey:@"customer_email"];
+    //    if(customer_email.length>0)
+    //    {
+    //        customer_email = [NSString stringWithFormat:@"Email: %@",customer_email];
+    //
+    //    }
+    //    NSString *email_string = customer_email;
+    
+    
+    NSMutableArray* arrext = [[NSMutableArray alloc] init];
+    if(addr_string.length>0)
+        [arrext addObject:addr_string];
+    if(cty_string.length>0)
+        [arrext addObject:cty_string];
+    //    if(phone_string.length>0)
+    //        [arrext addObject:phone_string];
+    //    if(contact_string.length>0)
+    //        [arrext addObject:contact_string];
+    //    if(email_string.length>0)
+    //        [arrext addObject:email_string];
+    
+    ret = [arrext componentsJoinedByString:@"\r\n"];
+    
+    //    NSString *string = [array componentsJoinedByString:@" "];
+    
+    //    NSString* customer_name= [customerinfo valueForKey:@"customer_name"];
+    
+    
+    return ret;
+}
+-(NSMutableDictionary*)create_value_map:(NSDictionary*)key_map
+{
+    NSMutableDictionary* ret= [[NSMutableDictionary alloc] init];
+    NSArray *keys= [key_map allKeys];
+    //遍历keys
+    for(int i=0;i<[keys count];i++)
+    {
+        //得到当前key
+        NSString *key=[keys objectAtIndex:i];
+        //如果key不是pic,说明value是字符类型,比如name:Boris
+        NSString* valuefrom = [key_map valueForKey:key];
+        
+        if(valuefrom.length==0)
+            continue;
+        NSString* value=[self getValue:valuefrom];
+        
+        [ret setValue:value forKey:valuefrom];
+    }
+    NSDictionary * customerinfo =[self create_cusromer_info_from_table];
+    [ret setValue:[self create_customer_ext:customerinfo] forKey:@"customer_contact_ext"];
+    [ret setValue:customerinfo[@"customer_first_name"] forKey:@"customer_first_name"];
+    [ret setValue:customerinfo[@"customer_last_name"] forKey:@"customer_last_name"];
+    return ret;
+}
+
+-(NSMutableDictionary*)create_cusromer_info_from_table
+{
+    
+    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+    
+    NSMutableDictionary* ret= [appDelegate.customerInfo mutableCopy] ;
+    
+    [ret setValue:[self getValue:@"customer_country"] forKey:@"customer_country"];
+    [ret setValue:[self getValue:@"customer_phone"] forKey:@"customer_phone"];
+    [ret setValue:[self getValue:@"customer_email"] forKey:@"customer_email"];
+    [ret setValue:[self getValue:@"customer_name"] forKey:@"customer_name"];
+    [ret setValue:[self getValue:@"customer_address4"] forKey:@"customer_address4"];
+    [ret setValue:[self getValue:@"customer_address3"] forKey:@"customer_address3"];
+    [ret setValue:[self getValue:@"customer_address2"] forKey:@"customer_address2"];
+    [ret setValue:[self getValue:@"customer_address1"] forKey:@"customer_address1"];
+    [ret setValue:[self getValue:@"customer_zipcode"] forKey:@"customer_zipcode"];
+    [ret setValue:[self getValue:@"customer_city"] forKey:@"customer_city"];
+    [ret setValue:[self getValue:@"customer_state"] forKey:@"customer_state"];
+    [ret setValue:[self getValue:@"customer_cid"] forKey:@"customer_cid"];
+    [ret setValue:[self getValue:@"customer_state"] forKey:@"customer_state"];
+    [ret setValue:[self getValue:@"customer_contact"] forKey:@"customer_contact"];
+    [ret setValue:[self getValue:@"customer_fax"] forKey:@"customer_fax"];
+    
+    NSString * firstname =nil;
+    
+    NSString* lastname = nil;
+    NSString* contact_name = [self getValue:@"customer_contact"];
+    if(contact_name!=nil)
+    {
+        NSArray *_arr = [contact_name componentsSeparatedByString:NSLocalizedString(@" ", nil)];
+        
+        
+        
+        if(_arr.count>=1)
+        {
+            firstname =_arr[0];
+            if(_arr.count>1)
+            {
+                
+                lastname=[[_arr subarrayWithRange:NSMakeRange(1, _arr.count-1)] componentsJoinedByString:@" "];
+            }
+        }
+    }
+    [ret setValue:firstname forKey:@"customer_first_name"];
+    [ret setValue:lastname forKey:@"customer_last_name"];
+    
+    //    [ret setValue:[self create_customer_ext:ret] forKey:@"customer_contact_ext"];
+    
+    return ret;
+}
 #pragma mark - multi_action sub action clicked
 
 - (void)MActionClicked:(UIButton *)sender {

+ 12 - 0
RedAnt ERP Mobile/iSales-NPD.xcodeproj/project.pbxproj

@@ -223,6 +223,8 @@
 		71BF33031EFA1D6100842CB4 /* YTViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 71BF33001EFA1D6100842CB4 /* YTViewController.m */; };
 		71C1D84E1F456CAA00CEA1C9 /* HWWeakTimer.m in Sources */ = {isa = PBXBuildFile; fileRef = 71C1D84D1F456CAA00CEA1C9 /* HWWeakTimer.m */; };
 		71C1D8541F456D2700CEA1C9 /* ModelDescriptionController.m in Sources */ = {isa = PBXBuildFile; fileRef = 71C1D8531F456D2700CEA1C9 /* ModelDescriptionController.m */; };
+		71CB70751F99DF02009FDCB7 /* FileCache.m in Sources */ = {isa = PBXBuildFile; fileRef = 71CB70731F99DF01009FDCB7 /* FileCache.m */; };
+		71CB70781F99E338009FDCB7 /* RAConvertor.m in Sources */ = {isa = PBXBuildFile; fileRef = 71CB70771F99E338009FDCB7 /* RAConvertor.m */; };
 		71D01ADD1E08CB1C006620CE /* signature.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 71D01ADC1E08CB1C006620CE /* signature.storyboard */; };
 		71D01B1A1E0A2055006620CE /* ImageUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 71D01B151E0A2055006620CE /* ImageUtils.m */; };
 		71D01B1B1E0A2055006620CE /* PDFUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 71D01B171E0A2055006620CE /* PDFUtils.m */; };
@@ -671,6 +673,10 @@
 		71C1D84D1F456CAA00CEA1C9 /* HWWeakTimer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = HWWeakTimer.m; path = common/AutoScrollImage/HWWeakTimer.m; sourceTree = SOURCE_ROOT; };
 		71C1D8521F456D2700CEA1C9 /* ModelDescriptionController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ModelDescriptionController.h; path = common/Functions/modelDetail/ModelDescriptionController.h; sourceTree = SOURCE_ROOT; };
 		71C1D8531F456D2700CEA1C9 /* ModelDescriptionController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ModelDescriptionController.m; path = common/Functions/modelDetail/ModelDescriptionController.m; sourceTree = SOURCE_ROOT; };
+		71CB70731F99DF01009FDCB7 /* FileCache.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = FileCache.m; path = ../../common/FileCache.m; sourceTree = "<group>"; };
+		71CB70741F99DF02009FDCB7 /* FileCache.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = FileCache.h; path = ../../common/FileCache.h; sourceTree = "<group>"; };
+		71CB70761F99E337009FDCB7 /* RAConvertor.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = RAConvertor.h; path = ../../common/RAConvertor.h; sourceTree = "<group>"; };
+		71CB70771F99E338009FDCB7 /* RAConvertor.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = RAConvertor.m; path = ../../common/RAConvertor.m; sourceTree = "<group>"; };
 		71D01ADC1E08CB1C006620CE /* signature.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = signature.storyboard; path = common/Functions/signature/signature.storyboard; sourceTree = SOURCE_ROOT; };
 		71D01B141E0A2055006620CE /* ImageUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ImageUtils.h; path = common/ImageUtils.h; sourceTree = SOURCE_ROOT; };
 		71D01B151E0A2055006620CE /* ImageUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ImageUtils.m; path = common/ImageUtils.m; sourceTree = SOURCE_ROOT; };
@@ -1398,6 +1404,10 @@
 				71BE066E1BA1607400FA6544 /* AES */,
 				71DF74291C57560600F2789C /* Reachability.h */,
 				71DF742A1C57560600F2789C /* Reachability.m */,
+				71CB70761F99E337009FDCB7 /* RAConvertor.h */,
+				71CB70771F99E338009FDCB7 /* RAConvertor.m */,
+				71CB70741F99DF02009FDCB7 /* FileCache.h */,
+				71CB70731F99DF01009FDCB7 /* FileCache.m */,
 				71DF742D1C5756C600F2789C /* const.h */,
 				71DF742E1C57572600F2789C /* RAUtils.h */,
 				71DF742F1C57572600F2789C /* RAUtils.m */,
@@ -2074,6 +2084,7 @@
 				715850461CF6F0E500856B20 /* DefaultAppearance.m in Sources */,
 				71DF74301C57572600F2789C /* RAUtils.m in Sources */,
 				7162A5B61C58738600AB630E /* SCShapeView.m in Sources */,
+				71CB70751F99DF02009FDCB7 /* FileCache.m in Sources */,
 				7162A54A1C58719D00AB630E /* RATreeView+UIScrollView.m in Sources */,
 				7162A55D1C58724700AB630E /* ContactListViewController.m in Sources */,
 				7162A5751C58728D00AB630E /* LineView.m in Sources */,
@@ -2104,6 +2115,7 @@
 				71E9F6BC1F8B52DD0052C78E /* NetworkUtils.m in Sources */,
 				7162A5C41C5873BB00AB630E /* ItemSearchViewController.m in Sources */,
 				7162A5481C58719D00AB630E /* RATreeView+TableViewDataSource.m in Sources */,
+				71CB70781F99E338009FDCB7 /* RAConvertor.m in Sources */,
 				42D3A4A31EFA6D36007A54C1 /* PhotoPreviewCell.m in Sources */,
 				7162A5DB1C5876E300AB630E /* CacheViewController.m in Sources */,
 				7162A5C21C5873BB00AB630E /* FilterCellValue.m in Sources */,

BIN
RedAnt Mobile/RedAnt Mobile.xcodeproj/project.xcworkspace/xcuserdata/ray.xcuserdatad/UserInterfaceState.xcuserstate


+ 3 - 0
RedAnt Mobile/RedAnt Mobile/AppDelegate.h

@@ -17,6 +17,9 @@
 @property (strong,nonatomic) NSString* build;
 @property (strong,nonatomic) NSString* shortver;
 
+@property bool can_see_price;
+@property bool price_hidden;
+
 @property bool bEnable_Cache;//图片缓存
 
 @property (nonatomic,strong) NSMutableDictionary *urgencyDic;///<程序闪退需要保存的数据

+ 2 - 0
RedAnt Mobile/RedAnt Mobile/RANetwork.h

@@ -10,4 +10,6 @@
 
 @interface RANetwork : NetworkUtils
 +(NSDictionary*)require_server : (NSMutableDictionary*) params;
++(NSDictionary*)request_Editor:(NSString*) request_url params:(NSMutableDictionary*)params;
++(NSDictionary*)commoneditor_partialrefresh: (NSMutableDictionary*)params url:(NSString*)url;
 @end

+ 171 - 0
RedAnt Mobile/RedAnt Mobile/RANetwork.m

@@ -118,4 +118,175 @@
     
     return params;
 }
++(NSDictionary*)commoneditor_partialrefresh: (NSMutableDictionary*)params url:(NSString*)url
+{
+    //    NSMutableDictionary* params = [[NSMutableDictionary alloc] init];
+//    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+//    if(appDelegate.user!=nil)
+//        [params setValue:appDelegate.user forKey:@"user"];
+//    if(appDelegate.contact_id!=nil)
+//        [params setValue:appDelegate.contact_id forKey:@"contactId"];
+//    if(appDelegate.password!=nil)
+//        [params setValue:appDelegate.password forKey:@"password"];
+    
+    //    if(appDelegate.order_code!=nil)
+    //        [params setValue:appDelegate.order_code forKey:@"orderCode"];
+    
+    //    NSDictionary* customerinfo= appDelegate.customerInfo;
+    //
+    //    NSArray* keys=[customerinfo allKeys];
+    //    for(int i=0;i<keys.count;i++)
+    //    {
+    //        [params setValue:[customerinfo valueForKey:(NSString*)keys[i]] forKey:keys[i] ];
+    //    }
+    //
+    //    [params setValue:sourceid forKey:@"sourceid"];
+    //    [params setValue:editor forKey:@"editor"];
+    
+//    [params setObject:ScreenCodeModelInfo forKey:kScreenName];
+    
+//    if(appDelegate.offline_mode)
+//    {
+//        params[@"offline_Command"]=url;
+//        return [OLDataProvider offline_commoneditor_partialrefresh:params];
+//    }
+    
+    if(![self IsNetworkAvailable])
+        return [RAUtils error_json:RESULT_NET_NOTAVAILABLE err_msg:nil];
+    
+    NSData* json=[self get_json:url parameters:params file:nil];
+    if(json!=nil)
+    {
+        NSError *error=nil;
+        NSDictionary *jsobj = [NSJSONSerialization JSONObjectWithData:json options:NSJSONReadingMutableLeaves error:&error];
+//        if([[jsobj valueForKey:@"result"]intValue]==2)
+//            [appDelegate SetSo:nil];
+        
+        
+        return jsobj;
+    }
+    else
+        return nil;
+}
+
++(NSDictionary*)request_Editor:(NSString*) request_url params:(NSMutableDictionary*)params
+{
+    //    NSMutableDictionary* params = [[NSMutableDictionary alloc] init];
+    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+    if(appDelegate.user!=nil)
+        [params setValue:appDelegate.user forKey:@"user"];
+    
+    
+    //    if(![appDelegate.order_customer_id isEqualToString: appDelegate.contact_id]&& appDelegate.order_customer_id!=nil)
+    //        [params setValue:appDelegate.order_customer_id forKey:@"contactId"];
+    //    else
+    
+//    if(appDelegate.contact_id!=nil)
+//        [params setValue:appDelegate.contact_id forKey:@"contactId"];
+//    if(appDelegate.password!=nil)
+//        [params setValue:appDelegate.password forKey:@"password"];
+//
+//    if(appDelegate.order_code!=nil)
+//        [params setValue:appDelegate.order_code forKey:@"orderCode"];
+//    //    [params setValue:sourceid forKey:@"sourceid"];
+//    //    [params setValue:editor forKey:@"editor"];
+//    DebugLog(@"request editor url:%@",request_url);
+//
+//
+//    if([request_url isEqualToString:URL_NEW_CUSTOMER])
+//    {
+//        [params setObject:ScreenCodeNewCustomer forKey:kScreenName];
+//    }
+//    else if([request_url isEqualToString:URL_EDIT_CUSTOMER])
+//    {
+//        [params setObject:ScreenCodeEditCustomer forKey:kScreenName];
+//    }
+//    else if([request_url isEqualToString:URL_CUSTOMER_ADV_SEARCH])
+//    {
+//        [params setObject:ScreenCodeAdvanceSearch forKey:kScreenName];
+//    }
+//    else if([request_url isEqualToString:URL_CARTDELIVERY])
+//    {
+//        [params setObject:ScreenCodePlaceOrder forKey:kScreenName];
+//    }
+//    else if([request_url isEqualToString:URL_ADDRESS_EDOTOR])
+//    {
+//        [params setObject:ScreenCodeNewAddress forKey:kScreenName];
+//    }
+//    else if ([request_url isEqualToString:URL_DM_PARAMS]){
+//        [params setObject:ScreenCodeCreatePortfolio forKey:kScreenName];
+//    }
+    
+    NSData* json = nil;
+//    if(appDelegate.offline_mode)
+//    {
+//        if([request_url isEqualToString:URL_NEW_CUSTOMER])
+//        {
+//            json= [OLDataProvider offline_createContact:params];
+//        }
+//        else if([request_url isEqualToString:URL_EDIT_CUSTOMER])
+//        {
+//            json= [OLDataProvider offline_editContact:params];
+//        }
+//        else if([request_url isEqualToString:URL_CUSTOMER_ADV_SEARCH])
+//        {
+//            json= [OLDataProvider offline_contactAdvancedSearch:params];
+//        }
+//        else if([request_url isEqualToString:URL_CARTDELIVERY])
+//        {
+//            json= [OLDataProvider offline_placeorder:params];
+//        }
+//        else if([request_url isEqualToString:URL_ADDRESS_EDOTOR])
+//        {
+//            json= [OLDataProvider offline_addreditor:params];
+//        }
+//        else if ([request_url isEqualToString:URL_DM_PARAMS]){
+//            json = [OLDataProvider offline_createTearSheet:params];
+//        }
+//
+//        else
+//            return [OLDataProvider offline_notimpl];
+//    }
+//    else
+    {
+        if(![self IsNetworkAvailable])
+            return [RAUtils error_json:RESULT_NET_NOTAVAILABLE err_msg:nil];
+        
+//        if([request_url isEqualToString:URL_CARTDELIVERY])
+//        {
+//            NSError *error=nil;
+//
+//            NSString * uuid= [[NSUUID UUID] UUIDString];
+//            params[@"resultSerial"]=uuid;
+//
+//            for(int i=0;i<150;i++)
+//            {
+//                //           NSMutableDictionary* result_params = [[NSMutableDictionary alloc]init];
+//                //            result_params[@"resultSerial"]=uuid;
+//                json=[self get_json:request_url parameters:params];
+//                if(json!=nil)
+//                {
+//
+//                    NSDictionary *jsobj = [NSJSONSerialization JSONObjectWithData:json options:NSJSONReadingMutableLeaves error:&error];
+//                    if([jsobj[@"result"] intValue]==2 || [jsobj[@"result"] intValue] == 8)
+//                    {
+//                        break;
+//                    }
+//                }
+//                sleep(2);
+//            }
+//        }
+//        else
+        
+            json =[self get_json:request_url parameters:params file:nil];
+    }
+    if(json!=nil)
+    {
+        NSError *error=nil;
+        NSDictionary *jsobj = [NSJSONSerialization JSONObjectWithData:json options:NSJSONReadingMutableLeaves error:&error];
+        return jsobj;
+    }
+    else
+        return nil;
+}
 @end