RepairUnReceiptModel.m 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. //
  2. // RepairUnReceiptModel.m
  3. // IBOSS
  4. //
  5. // Created by guan hong hou on 16/4/15.
  6. // Copyright © 2017年 沈阳东科云信软件有限公司. All rights reserved.
  7. //
  8. // 功能描述:维修未回执模型类
  9. #import "RepairUnReceiptModel.h"
  10. @implementation RepairUnReceiptModel
  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. @"customerCode":@"CustomerCode",
  22. @"customerName":@"CustomerName",
  23. @"contacts":@"Contacts",
  24. @"telephone":@"Telephone",
  25. @"repairDate":@"RepairDate",
  26. @"customerAddress":@"Address",
  27. @"accountDate":@"AccountDate",
  28. @"organizationName":@"OrganizationName",
  29. @"staffName":@"StaffName",
  30. @"questionDesc":@"Question"
  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. return YES;
  42. }
  43. @end