//
//  SearchProgressNet.m
//  Open
//
//  Created by 看看智能 on 2017/11/30.
//  Copyright © 2017年 黄江涛 . All rights reserved.
//

#import "SearchProgressNet.h"

@implementation SearchProgressNet
+getbindIdCards:(NSString*)name andUserName:(NSString*)names andIdentityNumber:(NSString*)idNUmber andOCR:(NSString*)ocr Handle:(void(^)(SearchProgress*, NSError *))complete{
    NSString * pathNew_1 =[IPDIZHI stringByAppendingString:@"/socialsecurity/kankan/bindIdCards"];
    NSString * pathNew1 =  [pathNew_1 stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
  

    
    
    
    NSDictionary *dictNew =@{
                             @"userId":@([getPeopleID PeopleID]),
                             @"identityNumber": idNUmber,
                             @"name":names,
                             @"orcImage":ocr,
                             @"flag":@2
                             };
    NSLog(@"dictNew:%@",dictNew);
    NSLog(@"Path:%@",pathNew1);
    return [self  POST:pathNew1 parameters:dictNew completionHandler:^(verifyAdressModel* responseObj, NSError *error) {
        NSLog(@"response:%@",responseObj);
        if (error) {
            NSLog(@"打印错误:%@",error);
            
        }else
        {
            complete( [SearchProgress mj_objectWithKeyValues:responseObj],error);
        }
    }];
    
    
    
}



+getgetBindIdCardsListHandle:(void(^)(SearchProgress*, NSError *))complete{
    
    NSString * pathNew_1 =[IPDIZHI stringByAppendingString:@"/socialsecurity/kankan/getBindIdCardsList"];
    NSString * pathNew1 =  [pathNew_1 stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
    NSDictionary *dictNew =@{
                             @"userId":@([getPeopleID PeopleID])
                             };
    NSLog(@"dictNew:%@",dictNew);
    NSLog(@"Path:%@",pathNew1);
    return [self  POST:pathNew1 parameters:dictNew completionHandler:^(verifyAdressModel* responseObj, NSError *error) {
        if ([responseObj isKindOfClass:[NSData class]]) {
            NSLog(@"response:%@",[NSJSONSerialization JSONObjectWithData:(NSData *)responseObj options:NSJSONReadingMutableLeaves error:nil]);
        }else{
            NSLog(@"response:%@",responseObj);
        }
        if (error) {
         
            [SVProgressHUD showErrorWithStatus:@"网络状态差"];
            
        }else
        {
            complete( [SearchProgress mj_objectWithKeyValues:responseObj],error);
        }
    }];
    
}
+verifyProgress:(NSString*)names andID:(NSString*)ID Handle:(void(^)(SearchProgress*, NSError *))complete{
    NSString * pathNew_1 =[IPDIZHI stringByAppendingString:@"/socialsecurity/kankan/verifyProgress"];
    NSString * pathNew1 =  [pathNew_1 stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
    NSDictionary *dictNew =@{
                             @"identityNumber": ID,
                             @"name":names
                             };
    NSLog(@"dictNew:%@",dictNew);
    NSLog(@"Path:%@",pathNew1);
    return [self  POST:pathNew1 parameters:dictNew completionHandler:^(verifyAdressModel* responseObj, NSError *error) {
        
        if ([responseObj isKindOfClass:[NSData class]]) {
            NSLog(@"response:%@",[NSJSONSerialization JSONObjectWithData:(NSData *)responseObj options:NSJSONReadingMutableLeaves error:nil]);
        }else{
            NSLog(@"response:%@",responseObj);
        }
        if (error) {
            NSLog(@"打印错误:%@",error);
        }else
        {
            complete( [SearchProgress mj_objectWithKeyValues:responseObj],error);
        }
    }];
    
}


+obtainverifyProgressWithParams:(NSDictionary *)params Handle:(void(^)(SSRecordModel*, NSError *))complete
{
    NSString * url =[IPDIZHI stringByAppendingString:@"/socialsecurity/kankan/verifyProgress"];
    
    NSLog(@"verifyProgress-URL:%@",url);
    NSLog(@"verifyProgress-Params:%@",params);
    
   return  [self POST:url parameters:params completionHandler:^(id responseObj, NSError *error) {
        
       if ([responseObj isKindOfClass:[NSData class]]) {
           NSLog(@"verifyProgress-response:%@",[NSJSONSerialization JSONObjectWithData:(NSData *)responseObj options:NSJSONReadingMutableLeaves error:nil]);
       }else{
           NSLog(@"verifyProgress-response:%@",responseObj);
       }
       
       if (error) {
           NSLog(@"verifyProgress-error%@",error);
       }
        
        if (error) {
            complete(nil,error);
        }else{
            complete([SSRecordModel mj_objectWithKeyValues:responseObj],error);
        }
        
    }];
    
}
@end
