// // SingleProfitAnalyseListModel.m // IBOSS // // Created by 关宏厚 on 2019/4/11. // Copyright © 2019 elongtian. All rights reserved. // #import "SingleProfitAnalyseListModel.h" @implementation SingleProfitAnalyseListModel + (nullable NSDictionary *)modelCustomPropertyMapper{ return @{ @"invoiceTypeName":@"InvoiceTypeName", @"organizationName":@"OrganizationName", @"organizationCode":@"OrganizationCode", @"amount":@"Amount", @"costAmount":@"CostAmount", @"marginAmount":@"MarginAmount", @"staffAmount":@"StaffAmount", @"serviceAmount":@"ServiceAmount", @"customerAmount":@"CustomerRebateAmount", @"feeAmount":@"FeeAmount", @"profitAmount":@"ProfitAmount", @"rebatesSum":@"RebatesSum", @"rateOfMargin":@"RateOfMargin" }; } /*! * 2. 下面的两个方法 `字典里值`与`模型的值`类型不一样`需要转换`而重写的方法 * NSDate *time dic[@"t"]是double类型的的秒数 */ /// Dic -> model - (BOOL)modelCustomTransformFromDictionary:(NSDictionary *)dic { double amountValue= [[dic objectForKey:@"Amount"]doubleValue]; _amount=[NSString stringWithFormat:@"%.2f",amountValue]; double costAmountValue=[[dic objectForKey:@"CostAmount"]doubleValue]; _costAmount=[NSString stringWithFormat:@"%.2f",costAmountValue]; double marginAmountValue=[[dic objectForKey:@"MarginAmount"]doubleValue]; _marginAmount=[NSString stringWithFormat:@"%.2f",marginAmountValue]; double staffAmountValue=[[dic objectForKey:@"StaffAmount"]doubleValue]; _staffAmount=[NSString stringWithFormat:@"%.2f",staffAmountValue]; double serviceAmountValue=[[dic objectForKey:@"ServiceAmount"]doubleValue]; _serviceAmount=[NSString stringWithFormat:@"%.2f",serviceAmountValue]; double customerAmountValue=[[dic objectForKey:@"CustomerAmount"]doubleValue]; _customerAmount=[NSString stringWithFormat:@"%.2f",customerAmountValue]; double feeAmountValue=[[dic objectForKey:@"FeeAmount"]doubleValue]; _feeAmount=[NSString stringWithFormat:@"%.2f",feeAmountValue]; double profitAmountValue=[[dic objectForKey:@"ProfitAmount"]doubleValue]; _profitAmount=[NSString stringWithFormat:@"%.2f",profitAmountValue]; double rebatesSumValue=[[dic objectForKey:@"RebatesSum"]doubleValue]; _rebatesSum=[NSString stringWithFormat:@"%.2f",rebatesSumValue]; double rateOfMarginValue=[[dic objectForKey:@"RateOfMargin"]doubleValue]; _rateOfMargin=[NSString stringWithFormat:@"%.2f",rateOfMarginValue]; return YES; } @end