NewCustomerModel.m 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. // NewCustomerModel
  2. // IOBSS 2.0
  3. //
  4. // Created by 刘瀚璘 on 2017.7.14
  5. // Copyright 2017 沈阳东科云信软件有限公司. All rights reserved.
  6. //
  7. // 系统名称:
  8. // 功能描述:新增定制品列表Model
  9. #import "NewCustomerModel.h"
  10. @implementation NewCustomerModel
  11. /*!
  12. * 1.该方法是 `字典里的属性Key` 和 `要转化为模型里的属性名` 不一样 而重写的
  13. * 前:模型的属性 后:字典里的属性
  14. */
  15. + (nullable NSDictionary<NSString *, id> *)modelCustomPropertyMapper{
  16. return @{@"detailID":@"DetailID",
  17. @"fixedID":@"FixedID",
  18. @"orderDetailID":@"OrderDetailID",
  19. @"codeID":@"CodeID",
  20. @"code":@"Code",
  21. @"onlyCode":@"OnlyCode",
  22. @"brandID":@"BrandID",
  23. @"brandName":@"BrandName",
  24. @"kindID":@"KindID",
  25. @"kindName":@"KindName",
  26. @"varietyID":@"VarietyID",
  27. @"varietyName":@"VarietyName",
  28. @"seriesID":@"SeriesID",
  29. @"seriesName":@"SeriesName",
  30. @"unitID":@"UnitID",
  31. @"unitName":@"UnitName",
  32. @"mPackage":@"Package",
  33. @"weight":@"Weight",
  34. @"goodsName":@"GoodsName",
  35. @"receiptSpecification":@"ReceiptSpecification",
  36. @"expandAttribute":@"ExpandAttribute",
  37. @"expandAttribute2":@"ExpandAttribute2",
  38. @"receiptRemarks":@"Receipt"
  39. };
  40. }
  41. /*!
  42. * 2. 下面的两个方法 `字典里值`与`模型的值`类型不一样`需要转换`而重写的方法
  43. * NSDate *time dic[@"t"]是double类型的的秒数
  44. */
  45. /// Dic -> model
  46. - (BOOL)modelCustomTransformFromDictionary:(NSDictionary *)dic {
  47. self.acreage = [NSString stringWithFormat:@"%f",
  48. [[dic objectForKey:@"Acreage"] doubleValue]];
  49. return YES;
  50. }
  51. @end