OrderSalesApproveListModel.m 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. //
  2. // OrderSalesApproveListModel.m
  3. // IBOSS
  4. //
  5. // Created by 关宏厚 on 2019/4/13.
  6. // Copyright © 2019 elongtian. All rights reserved.
  7. //
  8. #import "OrderSalesApproveListModel.h"
  9. @implementation OrderSalesApproveListModel
  10. + (nullable NSDictionary<NSString *, id> *)modelCustomPropertyMapper{
  11. return @{
  12. @"invoiceId":@"InvoiceID",
  13. @"invoiceNo":@"InvoiceNo",
  14. @"businessType":@"SalesFunctionTypeName",
  15. @"organizationName":@"OrganizationName",
  16. @"invoiceStatusName":@"InvoiceStatusName",
  17. @"createUser":@"CreateUser",
  18. @"auditReason":@"AuditReason",
  19. @"auditResult":@"Result",
  20. @"customerName":@"CustomerName",
  21. @"goodsAmount":@"GoodsAmount",
  22. @"feeAmount":@"FeeAmount",
  23. @"discount":@"Discount",
  24. @"createTime":@"CreateTime"
  25. };
  26. }
  27. /*!
  28. * 2. 下面的两个方法 `字典里值`与`模型的值`类型不一样`需要转换`而重写的方法
  29. * NSDate *time dic[@"t"]是double类型的的秒数
  30. */
  31. /// Dic -> model
  32. - (BOOL)modelCustomTransformFromDictionary:(NSDictionary *)dic {
  33. double goodsAmountValue= [[dic objectForKey:@"GoodsAmount"]doubleValue];
  34. _goodsAmount=[NSString stringWithFormat:@"%.2f",goodsAmountValue];
  35. double feesAmountValue=[[dic objectForKey:@"FeeAmount"]doubleValue];
  36. _feeAmount=[NSString stringWithFormat:@"%.2f",feesAmountValue];
  37. double discountValue=[[dic objectForKey:@"Discount"]doubleValue];
  38. _discount=[NSString stringWithFormat:@"%.2f",discountValue];
  39. return YES;
  40. }
  41. @end