//
//  socialAssistant.m
//  socialSecurity
//
//  Created by 看看智能 on 2017/9/4.
//  Copyright © 2017年 黄江涛 . All rights reserved.
//

#import "socialAssistant.h"

@implementation socialAssistant

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

-(void)setSocModel:(socialResultModel *)socModel
{
    _socModel =socModel;
    
    
    switch (self.record ) {
 
           case 1:
                [self records:socModel];
            break;
          case 2:
               [self record_1_s:socModel];
            break;
            default:
            break;
    }
    
    
    
    
    
    
    
}


//当为社保采集的时候
-(void)record_1_s:(socialResultModel *)socModel{
    NSLog(@"%@",socModel.data_state );
    if ([socModel.data_state isEqualToString:@"0"]) {

        self.AAReccord.text =@"审核成功";
        self.AAImage.image= [UIImage imageNamed:@"认证成功9.4"];
        self.AAName.text = [EnercryTool desA:socModel.names];
      
        NSString *numberString = [[EnercryTool desA:socModel.identityNumber] stringByReplacingCharactersInRange:NSMakeRange(10, 4) withString:@"****"];
          self.AAId.text = numberString;
        
        self.AATime.text =socModel.createTime;
        self.KKHide.text =@"";
    }else if([socModel.data_state isEqualToString:@"2"])
    {

        self.AAReccord.text =@"审核失败";
        self.AAImage.image= [UIImage imageNamed:@"认证失败9.4"];
        self.AAName.text = [EnercryTool desA:socModel.names];
        NSString *numberString = [[EnercryTool desA:socModel.identityNumber] stringByReplacingCharactersInRange:NSMakeRange(10, 4) withString:@"****"];
        self.AAId.text = numberString;
        self.AATime.text =socModel.createTime;
        self.KKHide.text =@"";
    }else if([socModel.data_state isEqualToString:@"1"])
    {

        self.AAReccord.text =@"审核中";
        self.AAImage.image= [UIImage imageNamed:@"采集成功9.4"];
        self.AAName.text = [EnercryTool desA:socModel.names];
        NSString *numberString = [[EnercryTool desA:socModel.identityNumber] stringByReplacingCharactersInRange:NSMakeRange(10, 4) withString:@"****"];
        self.AAId.text = numberString;
        self.AATime.text =socModel.createTime;
        self.KKHide.text =@"";
    }else if([socModel.data_state isEqualToString:@"3"]){
        self.AAReccord.text =@"未获取信息";
        self.AAImage.image= [UIImage imageNamed:@"采集成功9.4"];
        self.AAName.text = [EnercryTool desA:socModel.names];
        NSString *numberString = [[EnercryTool desA:socModel.identityNumber] stringByReplacingCharactersInRange:NSMakeRange(10, 4) withString:@"****"];
        self.AAId.text = numberString;
        self.AATime.text =socModel.createTime;
        self.KKHide.text =@"";
    
    }else if([socModel.data_state isEqualToString:@"4"]){
    
        self.AAReccord.text =@"停止发放";
        self.AAImage.image= [UIImage imageNamed:@"认证失败9.4"];
        self.AAName.text = [EnercryTool desA:socModel.names];
        NSString *numberString = [[EnercryTool desA:socModel.identityNumber] stringByReplacingCharactersInRange:NSMakeRange(10, 4) withString:@"****"];
        self.AAId.text = numberString;
        self.AATime.text =socModel.createTime;
        self.KKHide.text =@"";
    }else if([socModel.data_state isEqualToString:@"5"]){
        
        self.AAReccord.text =@"死亡";
        self.AAImage.image= [UIImage imageNamed:@"认证失败9.4"];
        self.AAName.text = [EnercryTool desA:socModel.names];
        NSString *numberString = [[EnercryTool desA:socModel.identityNumber] stringByReplacingCharactersInRange:NSMakeRange(10, 4) withString:@"****"];
        self.AAId.text = numberString;
        self.AATime.text =socModel.createTime;
        self.KKHide.text =@"";
        
    }else
    {
        self.AAReccord.text =@"";
        self.AAImage.image= nil;
     
        self.AAName.text =@"";
        self.AAId.text = @"";
        self.AATime.text =@"";
        self.KKHide.text =@"足不出户,安全认证,放心领钱";

    }

}

-(void)records:(socialResultModel *)socModel{
    
    
    
    if ([socModel.match_state isEqualToString:@"0"]) {
        self.AAReccord.text =@"认证成功";
        self.AAImage.image= [UIImage imageNamed:@"认证成功9.4"];
    }else if([socModel.match_state isEqualToString:@"2"])
    {
        self.AAReccord.text =@"认证失败";
        self.AAImage.image= [UIImage imageNamed:@"认证失败9.4"];
    }else if([socModel.match_state isEqualToString:@"1"])
    {
        
        self.AAReccord.text =@"认证中";
        self.AAImage.image= [UIImage imageNamed:@"采集成功9.4"];
    }else
    {
        self.AAReccord.text =@"人工审核中";
        self.AAImage.image= [UIImage imageNamed:@"采集成功9.4"];
    }
    
    
    self.AAName.text = [EnercryTool desA:socModel.personName];
            NSString *numberString = [[EnercryTool desA:socModel.identityNumber] stringByReplacingCharactersInRange:NSMakeRange(3, 13) withString:@"*************"];
    self.AAId.text = numberString;
    self.AATime.text =socModel.createTime;
    self.KKHide.text =@"";
}



@end
