Преглед изворни кода

修复离线创建同步PDF文件时出错。(字符串未转为字典)

Pen Li пре 9 година
родитељ
комит
462200eb77

BIN
RedAnt ERP Mobile/RedAnt ERP Mobile.xcworkspace/xcuserdata/macmini1.xcuserdatad/UserInterfaceState.xcuserstate


+ 8 - 6
RedAnt ERP Mobile/common/Functions/offline/OLDataProvider.m

@@ -237,7 +237,8 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
          
          for(int i=0;i<[values[@"count"] intValue];i++)
          {
-             NSMutableDictionary * valueitem=values[[NSString stringWithFormat:@"item_%d",i]];
+             NSMutableDictionary * valueitem= [[RAUtils string2dict:values[[NSString stringWithFormat:@"item_%d",i]]] mutableCopy];
+             
              if([valueitem[@"product_id"] intValue]==product_id)
              {
                  line_note=valueitem[@"linenotes"];
@@ -10359,9 +10360,9 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
     // 在preview情况下保存,则不需要新建了
     if (direct) {
         NSMutableDictionary *tear_sheet_params = params;
-        if (tear_sheet_id) {
-            tear_sheet_params = values;
-        }
+//        if (tear_sheet_id) {
+//            tear_sheet_params = values;
+//        }
         NSData *pdfData = [self offline_request_tearsheet:tear_sheet_params]; // 新建PDF,获取本地路径
         
         NSDictionary *pdfInfo = [NSJSONSerialization JSONObjectWithData:pdfData options:NSJSONReadingMutableContainers error:nil];
@@ -10396,10 +10397,11 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
     pdf_path = [newPath lastPathComponent];
     
     // 保存信息
+    [params setObject:[params objectForKey:@"product_ids"] forKey:@"productIds"];
     NSString *off_params = [RAUtils dict2string:params];
     
 
-    configureParams = [configureParams stringByAppendingFormat:@"productIds=%@",product_ids_string];
+//    configureParams = [configureParams stringByAppendingFormat:@"productIds=%@",product_ids_string];
     
     pdf_path = [self translateSingleQuote:pdf_path];
     create_user = [self translateSingleQuote:create_user];
@@ -10973,7 +10975,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
         [ret setObject:[NSNumber numberWithInteger:RESULT_FALSE] forKey:@"result"];
         
     }];
-    
+
     return ret;
 }