UnInstallationInfoModel.m 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. //
  2. // UnInstallationInfoModel.m
  3. // IBOSS
  4. //
  5. // Created by guan hong hou on 16/4/15.
  6. // Copyright © 2017年 沈阳东科云信软件有限公司. All rights reserved.
  7. // 功能描述:安装未回执模型
  8. #import "UnInstallationInfoModel.h"
  9. @implementation UnInstallationInfoModel
  10. #pragma mark - 私有函数
  11. /*!
  12. * 1.该方法是 `字典里的属性Key` 和 `要转化为模型里的属性名` 不一样 而重写的
  13. * 前:模型的属性 后:字典里的属性
  14. */
  15. + (nullable NSDictionary<NSString *, id> *)modelCustomPropertyMapper{
  16. return @{@"installationId":@"InstallationID",
  17. @"installationNo":@"InstallationNo",
  18. @"arrangementId":@"ArrangementID",
  19. @"arrangementNo":@"ArrangementNo",
  20. @"customerCode":@"CustomerCode",
  21. @"customerName":@"CustomerName",
  22. @"contacts":@"Contacts",
  23. @"telephone":@"Telephone",
  24. @"installationDate":@"InstallationDate",
  25. @"customerAddress":@"Address",
  26. @"accountDate":@"AccountDate",
  27. @"organizationName":@"OrganizationName",
  28. @"staffName":@"StaffName"
  29. };
  30. }
  31. /*!
  32. * 2. 下面的两个方法 `字典里值`与`模型的值`类型不一样`需要转换`而重写的方法
  33. * NSDate *time dic[@"t"]是double类型的的秒数
  34. * Dic -> model
  35. */
  36. - (BOOL)modelCustomTransformFromDictionary:(NSDictionary *)dic {
  37. _installationId = [[dic objectForKey:@"InstallationID"] stringValue];
  38. _arrangementId = [[dic objectForKey:@"ArrangementID"]stringValue];
  39. return YES;
  40. }
  41. @end