OrderSalesApproveListModel.m 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. @"staffName":@"StaffName",
  26. @"suggestion":@"Suggestion",
  27. @"customerAddress":@"Address"
  28. };
  29. }
  30. /*!
  31. * 2. 下面的两个方法 `字典里值`与`模型的值`类型不一样`需要转换`而重写的方法
  32. * NSDate *time dic[@"t"]是double类型的的秒数
  33. */
  34. /// Dic -> model
  35. - (BOOL)modelCustomTransformFromDictionary:(NSDictionary *)dic {
  36. double goodsAmountValue= [[dic objectForKey:@"GoodsAmount"]doubleValue];
  37. _goodsAmount=[NSString stringWithFormat:@"%.2f",goodsAmountValue];
  38. double feesAmountValue=[[dic objectForKey:@"FeeAmount"]doubleValue];
  39. _feeAmount=[NSString stringWithFormat:@"%.2f",feesAmountValue];
  40. double discountValue=[[dic objectForKey:@"Discount"]doubleValue];
  41. _discount=[NSString stringWithFormat:@"%.2f",discountValue];
  42. NSString *createTimeStr=[dic objectForKey:@"CreateTime"];
  43. _createTime=[DateFormat dateFormatSplit:createTimeStr];
  44. return YES;
  45. }
  46. @end