InventoryUnfreezeGoodsModel.m 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. //
  2. // InventoryUnfreezeGoodsModel.m
  3. // IBOSS
  4. //
  5. // Created by 关宏厚 on 2020/5/22.
  6. // Copyright © 2020 elongtian. All rights reserved.
  7. //
  8. #import "InventoryUnfreezeGoodsModel.h"
  9. @implementation InventoryUnfreezeGoodsModel
  10. /*!
  11. * 1.该方法是 `字典里的属性Key` 和 `要转化为模型里的属性名` 不一样 而重写的
  12. * 前:模型的属性 后:字典里的属性
  13. */
  14. + (nullable NSDictionary<NSString *, id> *)modelCustomPropertyMapper{
  15. return @{
  16. @"code":@"Code",
  17. @"onlyCode":@"OnlyCode",
  18. @"brandName":@"BrandName",
  19. @"kindName":@"KindName",
  20. @"varietyName":@"VarietyName",
  21. @"seriesName":@"SeriesName",
  22. @"unitName":@"UnitName",
  23. @"colorNumber":@"ColorNumber",
  24. @"package":@"Package",
  25. @"weight":@"Weight",
  26. @"volume":@"Volume",
  27. @"circulateType":@"CirculateType",
  28. @"circulateTypeName":@"GoodsCirculateTypeName",
  29. @"gradeName":@"GradeName",
  30. @"specification":@"Specification",
  31. @"freezeQuantity":@"FreezeQuantity",
  32. @"unfreezeQuantity":@"UnFreezeQuantity",
  33. @"allUnfreezeQuantity":@"ALLUnFreezeQuantity",
  34. @"decimalPlaces":@"DecimalPlaces",
  35. @"acreage":@"Acreage",
  36. @"expandAttribute":@"ExpandAttribute",
  37. @"expandAttribute2":@"ExpandAttribute2",
  38. @"remarks":@"Remarks"
  39. };
  40. }
  41. /*!
  42. * 2. 下面的两个方法 `字典里值`与`模型的值`类型不一样`需要转换`而重写的方法
  43. * NSDate *time dic[@"t"]是double类型的的秒数
  44. */
  45. /// Dic -> model
  46. - (BOOL)modelCustomTransformFromDictionary:(NSDictionary *)dic {
  47. double volumeValue= [[dic objectForKey:@"Volume"]doubleValue];
  48. _volume=[NSString stringWithFormat:@"%.6f",volumeValue];
  49. return YES;
  50. }
  51. @end