| 1234567891011121314151617181920212223242526272829303132333435363738394041 |
- //
- // PerformanceRankListModel.m
- // IBOSS
- //
- // Created by guan hong hou on 2018/6/4.
- // Copyright © 2018年 elongtian. All rights reserved.
- //
- #import "PerformanceRankListModel.h"
- @implementation PerformanceRankListModel
- + (nullable NSDictionary<NSString *, id> *)modelCustomPropertyMapper{
-
- return @{
- @"staffName":@"StaffName",
- @"salesAmount":@"StaffComplete",
- @"currentMonthTaskAmount":@"StaffTask",
- @"completePercent":@"StaffTax",
- @"staffId":@"StaffID"
- };
- }
- /*!
- * 2. 下面的两个方法 `字典里值`与`模型的值`类型不一样`需要转换`而重写的方法
- * NSDate *time dic[@"t"]是double类型的的秒数
- * Dic -> model
- */
- - (BOOL)modelCustomTransformFromDictionary:(NSDictionary *)dic {
- double salesAmountValue= [[dic objectForKey:@"StaffComplete"]doubleValue];
- _salesAmount= [NSString stringWithFormat:@"%.2f",salesAmountValue];
- double staffTaskValue= [[dic objectForKey:@"StaffTask"]doubleValue];
- _currentMonthTaskAmount=[NSString stringWithFormat:@"%.2f",staffTaskValue];
- double completePercent= [[dic objectForKey:@"StaffTax"]doubleValue];
- _completePercent=[NSString stringWithFormat:@"%.2f",completePercent];
- return YES;
- }
- @end
|