RepairReceiptListModel.m 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. //
  2. // RepairReceiptListModel.m
  3. // IBOSS
  4. //
  5. // Created by apple on 16/1/19.
  6. // Copyright © 2017年 沈阳东科云信软件有限公司. All rights reserved.
  7. //
  8. // 功能描述:维修已回执模型类
  9. #import "RepairReceiptListModel.h"
  10. @implementation RepairReceiptListModel
  11. #pragma 私有函数
  12. /*!
  13. * 1.该方法是 `字典里的属性Key` 和 `要转化为模型里的属性名` 不一样 而重写的
  14. * 前:模型的属性 后:字典里的属性
  15. */
  16. + (nullable NSDictionary<NSString *, id> *)modelCustomPropertyMapper{
  17. return @{@"repairId":@"RepairID",
  18. @"repairNo":@"RepairNo",
  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. @"recReceiptType":@"recReceiptType",
  29. @"delayDate":@"NextRepairDate",
  30. @"serviceStaffName":@"ServiceStaffName"
  31. };
  32. }
  33. /*!
  34. * 2. 下面的两个方法 `字典里值`与`模型的值`类型不一样`需要转换`而重写的方法
  35. * NSDate *time dic[@"t"]是double类型的的秒数
  36. * Dic -> model
  37. */
  38. - (BOOL)modelCustomTransformFromDictionary:(NSDictionary *)dic {
  39. self.repairId = [[dic objectForKey:@"RepairID"] stringValue];
  40. self.arrangementId = [[dic objectForKey:@"ArrangementID"]stringValue];
  41. self.receiptType = [[dic objectForKey:@"ReceiptType"] stringValue];
  42. self.recReceiptType = [[dic objectForKey:@"recReceiptType"] stringValue];
  43. return YES;
  44. }
  45. @end