DispatchRequirementListDetailModel.m 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. //
  2. // DeliveryRequirementListDetailModel.m
  3. // IBOSSHSH
  4. //
  5. // Created by ssl on 2018/1/16.
  6. // Copyright © 2018年 elongtian. All rights reserved.
  7. //
  8. #import "DispatchRequirementListDetailModel.h"
  9. @implementation DispatchRequirementListDetailModel
  10. /*!
  11. * 1.该方法是 `字典里的属性Key` 和 `要转化为模型里的属性名` 不一样 而重写的
  12. * 前:模型的属性 后:字典里的属性
  13. */
  14. + (nullable NSDictionary<NSString *, id> *)modelCustomPropertyMapper{
  15. return @{@"detailID":@"DetailID",
  16. @"receiptID":@"ReceiptID",
  17. @"deliveryID":@"DeliveryID",
  18. @"deliveryNo":@"DeliveryNo",
  19. @"sourceFrom":@"SourceFrom",
  20. @"sourceFromName":@"SourceFromName",
  21. @"invoiceID":@"InvoiceID",
  22. @"invoiceNo":@"InvoiceNo",
  23. @"invoiceDetailID":@"InvoiceDetailID",
  24. @"deliveryDetailID":@"DeliveryDetailID",
  25. @"deliveryQuantity":@"DeliveryQuantity",
  26. @"outQuantity":@"OutQuantity",
  27. @"deliveryReceiptQuantity":@"DeliveryReceiptQuantity",
  28. @"deliveryReceiptFlag":@"DeliveryReceiptFlag",
  29. @"deliveryReceiptType":@"DeliveryReceiptType",
  30. @"deliveryReceiptTypeName":@"DeliveryReceiptTypeName",
  31. @"installationQuantity":@"InstallationQuantity",
  32. @"installationReceiptQuantity":@"InstallationReceiptQuantity",
  33. @"installationReceiptFlag":@"InstallationReceiptFlag",
  34. @"installationReceiptType":@"InstallationReceiptType",
  35. @"recoverQuantity":@"RecoverQuantity",
  36. @"returnQuantity":@"ReturnQuantity",
  37. @"accountID":@"AccountID",
  38. @"valueFlag":@"ValueFlag",
  39. @"codeID":@"CodeID",
  40. @"code":@"Code",
  41. @"onlyCode":@"OnlyCode",
  42. @"brandID":@"BrandID",
  43. @"brandName":@"BrandName",
  44. @"kindID":@"KindID",
  45. @"kindName":@"KindName",
  46. @"varietyID":@"VarietyID",
  47. @"varietyName":@"VarietyName",
  48. @"seriesID":@"SeriesID",
  49. @"seriesName":@"SeriesName",
  50. @"unitID":@"UnitID",
  51. @"unitName":@"UnitName",
  52. @"decimalPlaces":@"DecimalPlaces",
  53. @"package":@"Package",
  54. @"weight":@"Weight",
  55. @"acreage":@"Acreage",
  56. @"gradeID":@"GradeID",
  57. @"gradeName":@"GradeName",
  58. @"specification":@"Specification" ,
  59. @"colorNumber":@"ColorNumber",
  60. @"warehouseID":@"WarehouseID",
  61. @"warehouseName":@"WarehouseName",
  62. @"positionNumber":@"PositionNumber",
  63. @"detailDeliveryReceiptTypeName":@"DetailDeliveryReceiptTpeName",@"detailInstallationReceiptTypeName":@"DetailInstallationReceiptTyeName",
  64. @"customerName":@"CustomerName",
  65. @"contacts":@"Contacts",
  66. @"telephone":@"Telephone",
  67. @"deliveryAddress":@"DeliveryAddress",
  68. @"goodsName":@"GoodsName",
  69. @"circulateType":@"CirculateType",
  70. @"specification":@"Specification",
  71. @"requirementTypeName":@"RequirementTypeName"
  72. };
  73. }
  74. /*!
  75. * 2. 下面的两个方法 `字典里值`与`模型的值`类型不一样`需要转换`而重写的方法
  76. * NSDate *time dic[@"t"]是double类型的的秒数
  77. */
  78. - (BOOL)modelCustomTransformFromDictionary:(NSDictionary *)dic {
  79. int decimalPlaces = [[dic objectForKey:@"DecimalPlaces"] intValue];
  80. NSString *str = [NSString stringWithFormat:@"%@%d%@",@"%.",decimalPlaces,@"f"];
  81. return YES;
  82. }
  83. /**
  84. model -> Dic
  85. @param dic <#dic description#>
  86. @return <#return value description#>
  87. */
  88. - (BOOL)modelCustomTransformToDictionary:(NSMutableDictionary *)dic {
  89. //dic[@"t"] = @([self.time timeIntervalSince1970] * 1000).description;
  90. return YES;
  91. }
  92. @end