InstallReceiptListModel.m 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. //
  2. // InstallReceiptListModel.m
  3. // IBOSS
  4. //
  5. // Created by apple on 16/1/8.
  6. // Copyright © 2017年 沈阳东科云信软件有限公司. All rights reserved.
  7. //
  8. // 功能描述:安装已回执模型
  9. #import "InstallReceiptListModel.h"
  10. @implementation InstallReceiptListModel
  11. #pragma mark - 私有函数
  12. /*!
  13. * 1.该方法是 `字典里的属性Key` 和 `要转化为模型里的属性名` 不一样 而重写的
  14. * 前:模型的属性 后:字典里的属性
  15. */
  16. + (nullable NSDictionary<NSString *, id> *)modelCustomPropertyMapper{
  17. return @{@"installationId":@"InstallationID",
  18. @"installationNo":@"InstallationNo",
  19. @"arrangementId":@"ArrangementID",
  20. @"arrangementNo":@"ArrangementNo",
  21. @"receiptNo":@"ReceiptNo",
  22. @"receiptType":@"ReceiptType",
  23. @"customerName":@"CustomerName",
  24. @"customerAddress":@"address",
  25. @"customerTelephone":@"Telephone",
  26. @"receiptDate":@"ReceiptTime",
  27. @"receiptFlag":@"ReceiptFlag",
  28. @"reReceiptType":@"recReceiptType",
  29. @"delayDate":@"NextInstalllDate"};
  30. }
  31. /*!
  32. * 2. 下面的两个方法 `字典里值`与`模型的值`类型不一样`需要转换`而重写的方法
  33. * NSDate *time dic[@"t"]是double类型的的秒数
  34. * Dic -> model
  35. */
  36. - (BOOL)modelCustomTransformFromDictionary:(NSDictionary *)dic {
  37. self.installationId = [[dic objectForKey:@"InstallationID"] stringValue];
  38. self.arrangementId = [[dic objectForKey:@"ArrangementID"]stringValue];
  39. self.receiptType = [[dic objectForKey:@"ReceiptType"] stringValue];
  40. self.reReceiptType = [[dic objectForKey:@"recReceiptType"] stringValue];
  41. return YES;
  42. }
  43. @end