// // OrderSalesApproveListModel.m // IBOSS // // Created by 关宏厚 on 2019/4/13. // Copyright © 2019 elongtian. All rights reserved. // #import "OrderSalesApproveListModel.h" @implementation OrderSalesApproveListModel + (nullable NSDictionary *)modelCustomPropertyMapper{ return @{ @"invoiceId":@"InvoiceID", @"invoiceNo":@"InvoiceNo", @"businessType":@"SalesFunctionTypeName", @"organizationName":@"OrganizationName", @"invoiceStatusName":@"InvoiceStatusName", @"createUser":@"CreateUser", @"auditReason":@"AuditReason", @"auditResult":@"Result", @"customerName":@"CustomerName", @"goodsAmount":@"GoodsAmount", @"feeAmount":@"FeeAmount", @"discount":@"Discount", @"createTime":@"CreateTime", @"staffName":@"StaffName", @"suggestion":@"Suggestion", @"customerAddress":@"Address" }; } /*! * 2. 下面的两个方法 `字典里值`与`模型的值`类型不一样`需要转换`而重写的方法 * NSDate *time dic[@"t"]是double类型的的秒数 */ /// Dic -> model - (BOOL)modelCustomTransformFromDictionary:(NSDictionary *)dic { double goodsAmountValue= [[dic objectForKey:@"GoodsAmount"]doubleValue]; _goodsAmount=[NSString stringWithFormat:@"%.2f",goodsAmountValue]; double feesAmountValue=[[dic objectForKey:@"FeeAmount"]doubleValue]; _feeAmount=[NSString stringWithFormat:@"%.2f",feesAmountValue]; double discountValue=[[dic objectForKey:@"Discount"]doubleValue]; _discount=[NSString stringWithFormat:@"%.2f",discountValue]; NSString *createTimeStr=[dic objectForKey:@"CreateTime"]; _createTime=[DateFormat dateFormatSplit:createTimeStr]; return YES; } @end