DispatchNoReceiptModel.m 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. //
  2. // RequirementNoReceiptModel.m
  3. // IBOSSHSH
  4. //
  5. // Created by ssl on 2018/1/12.
  6. // Copyright © 2018年 elongtian. All rights reserved.
  7. //
  8. #import "DispatchNoReceiptModel.h"
  9. #import "DateFormat.h"
  10. @implementation DispatchNoReceiptModel
  11. #pragma mark - 私有函数
  12. /*!
  13. * 1.该方法是 `字典里的属性Key` 和 `要转化为模型里的属性名` 不一样 而重写的
  14. * 前:模型的属性 后:字典里的属性
  15. */
  16. + (nullable NSDictionary<NSString *, id> *)modelCustomPropertyMapper{
  17. return @{
  18. @"arrangementId":@"ArrangementID",
  19. @"arrangementNo":@"ArrangementNo",
  20. @"customerId":@"CustomerID",
  21. @"customerCode":@"CustomerCode",
  22. @"customerName":@"CustomerName",
  23. @"contacts":@"Contacts",
  24. @"telephone":@"TelePhone",
  25. @"deliveryDate":@"DeliveryDate",
  26. @"deliveryAddress":@"DeliveryAddress",
  27. @"collectDetailId":@"CollectDetailID",
  28. @"truckName":@"TruckNumber",
  29. @"receivables":@"Receivables",
  30. @"deliveryReceiptFlag":@"DeliveryReceiptFlag",
  31. @"installReceiptFlag":@"InstallationReceiptFlag",
  32. @"acreage":@"Acreage",
  33. @"remainingReceivables":@"LAmount",
  34. @"receiptAmount":@"ReceiptAmount",
  35. @"requirementType":@"RequirementType",
  36. @"organizationId":@"OrganizationID",
  37. @"organizationCode":@"OrganizationCode",
  38. @"installDate":@"InstallationDate",
  39. @"serviceStaffName":@"StaffNames"
  40. };
  41. }
  42. /*!
  43. * 2. 下面的两个方法 `字典里值`与`模型的值`类型不一样`需要转换`而重写的方法
  44. * NSDate *time dic[@"t"]是double类型的的秒数
  45. * Dic -> model
  46. */
  47. - (BOOL)modelCustomTransformFromDictionary:(NSDictionary *)dic {
  48. _deliveryDate = [dic objectForKey:@"DeliveryDate"];
  49. _deliveryDate=[DateFormat dateFormatSplit:_deliveryDate];
  50. _installDate = [dic objectForKey:@"InstallationDate"];
  51. _installDate=[DateFormat dateFormatSplit:_installDate];
  52. return YES;
  53. }
  54. @end