InventoryGoodsModel.m 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. //
  2. // InventoryGoodsModel.m
  3. // IBOSS
  4. //
  5. // Created by 关宏厚 on 2020/4/29.
  6. // Copyright © 2020 elongtian. All rights reserved.
  7. //
  8. #import "InventoryGoodsModel.h"
  9. @implementation InventoryGoodsModel
  10. /*!
  11. * 1.该方法是 `字典里的属性Key` 和 `要转化为模型里的属性名` 不一样 而重写的
  12. * 前:模型的属性 后:字典里的属性
  13. */
  14. + (nullable NSDictionary<NSString *, id> *)modelCustomPropertyMapper{
  15. return @{
  16. @"codeId":@"CodeID",
  17. @"code":@"Code",
  18. @"onlyCode":@"OnlyCode",
  19. @"code":@"Code",
  20. @"brandId":@"BrandID",
  21. @"brandName":@"BrandName",
  22. @"colorNumber":@"ColorNumber",
  23. @"specification":@"Specification",
  24. @"gradeId":@"GradeID",
  25. @"gradeName":@"GradeName",
  26. @"kindId":@"KindID",
  27. @"kindName":@"KindName",
  28. @"varietyId":@"VarietyID",
  29. @"varietyName":@"VarietyName",
  30. @"seriesId":@"SeriesID",
  31. @"seriesName":@"SeriesName",
  32. @"warehouseId":@"WarehouseID",
  33. @"warehouseName":@"WarehouseName",
  34. @"positionNumber":@"PositionNumber",
  35. @"unitId":@"UnitID",
  36. @"unitName":@"UnitName",
  37. @"package":@"Package",
  38. @"weight":@"Weight",
  39. @"circulateType":@"CirculateType",
  40. @"decimalPlaces":@"DecimalPlaces",
  41. @"acreage":@"Acreage",
  42. @"volume":@"Volume",
  43. @"inventoryId":@"InventoryID",
  44. @"inventoryQuantity":@"InventoryQuantity",
  45. @"balanceQuantity":@"BalanceQuantity",
  46. @"freezeQuantity":@"FreezeQuantity"
  47. };
  48. }
  49. /*!
  50. * 2. 下面的两个方法 `字典里值`与`模型的值`类型不一样`需要转换`而重写的方法
  51. * NSDate *time dic[@"t"]是double类型的的秒数
  52. */
  53. /// Dic -> model
  54. - (BOOL)modelCustomTransformFromDictionary:(NSDictionary *)dic {
  55. return YES;
  56. }
  57. @end