OrderDetailModel.m 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. //
  2. // OrderDetailModel.m
  3. // IBOSS
  4. //
  5. // Created by 关宏厚 on 2018/11/19.
  6. // Copyright © 2018 elongtian. All rights reserved.
  7. //
  8. #import "OrderDetailModel.h"
  9. @implementation OrderDetailModel
  10. - (void)parseDic:(NSDictionary *)dic
  11. {
  12. if(dic!=nil){
  13. _salesDetailTypeName=[dic objectForKey:@"SalesDetailTypeName"];
  14. _priceDecimal=[[dic objectForKey:@"PriceDecimal"]intValue];
  15. _weightDecimal=[[dic objectForKey:@"WeightDecimal"]intValue];
  16. _decimalPlaces=[[dic objectForKey:@"DecimalPlaces"]intValue];
  17. NSString *priceDecimalPlaces = [NSString stringWithFormat:@"%@%d%@",@"%.",_priceDecimal,@"f"];
  18. NSString *weightDecimalPlaces = [NSString stringWithFormat:@"%@%d%@",@"%.",_weightDecimal,@"f"];
  19. NSString *decimalPlacesStr = [NSString stringWithFormat:@"%@%d%@",@"%.",_decimalPlaces,@"f"];
  20. _onlyCode=[dic objectForKey:@"OnlyCode"];
  21. _code=[dic objectForKey:@"Code"];
  22. _ceaseFlag=[[dic objectForKey:@"CeaseFlag"]intValue];;
  23. _brandName=[dic objectForKey:@"BrandName"];
  24. _kindName=[dic objectForKey:@"KindName"];
  25. _varietyName=[dic objectForKey:@"VarietyName"];
  26. _seriesName=[dic objectForKey:@"SeriesName"];
  27. _unitName=[dic objectForKey:@"UnitName"];
  28. _goodsCirculateTypeName=[dic objectForKey:@"GoodsCirculateTypeName"];
  29. _specification=[dic objectForKey:@"Specification"];
  30. _gradeName=[dic objectForKey:@"GradeName"];
  31. _goodsName=[dic objectForKey:@"GoodsName"];
  32. _colorNumber=[dic objectForKey:@"ColorNumber"];
  33. double orderQuantityValue= [[dic objectForKey:@"OrderQuantity"]doubleValue];
  34. _orderQuantity=[NSString stringWithFormat:decimalPlacesStr,orderQuantityValue];
  35. double m3Value= [[dic objectForKey:@"M3"]doubleValue];
  36. _M3=[NSString stringWithFormat:@"%.6f",m3Value];
  37. double factOrderQuantiyValue=[[dic objectForKey:@"FactOrderQuantity"]doubleValue];
  38. _factOrderQuantiy=[NSString stringWithFormat:decimalPlacesStr,factOrderQuantiyValue];
  39. double toSalesQuantityValue=[[dic objectForKey:@"ToSalesQuantity"]doubleValue];
  40. _toSalesQuantity=[NSString stringWithFormat:decimalPlacesStr,toSalesQuantityValue];
  41. double factOccupyQuantityValue=[[dic objectForKey:@"FactOccupyQuantity"]doubleValue];
  42. _factOccupyQuantity=[NSString stringWithFormat:decimalPlacesStr,factOccupyQuantityValue];
  43. double factToSalesQuantityValue=[[dic objectForKey:@"FactToSalesQuantity"]doubleValue];
  44. _factToSalesQuantity=[NSString stringWithFormat:decimalPlacesStr,factToSalesQuantityValue];
  45. double goodsAmountValue=[[dic objectForKey:@"GoodsAmount"]doubleValue];
  46. _goodsAmount=[NSString stringWithFormat:priceDecimalPlaces,goodsAmountValue];
  47. double factGoodsAmountValue=[[dic objectForKey:@"FactGoodsAmount"]doubleValue];
  48. _factGoodsAmount=[NSString stringWithFormat:priceDecimalPlaces,factGoodsAmountValue];
  49. _warehouseCode=[dic objectForKey:@"WarehouseCode"];
  50. _warehouseName=[dic objectForKey:@"WarehouseName"];
  51. _positionNumber=[dic objectForKey:@"PositionNumber"];
  52. double weightValue=[[dic objectForKey:@"Weight"]doubleValue];
  53. _weight=[NSString stringWithFormat:weightDecimalPlaces,weightValue];
  54. double volumeValue=[[dic objectForKey:@"Volume"]doubleValue];
  55. _volume=[NSString stringWithFormat:@"%.6f",volumeValue];
  56. _supplierName=[dic objectForKey:@"SupplierName"];
  57. double orderPriceValue=[[dic objectForKey:@"OrderPrice"]doubleValue];
  58. _orderPrice=[NSString stringWithFormat:priceDecimalPlaces,orderPriceValue];
  59. double markedPriceValue=[[dic objectForKey:@"MarkedPrice"]doubleValue];
  60. _markedPrice=[NSString stringWithFormat:priceDecimalPlaces,markedPriceValue];
  61. double discountValue=[[dic objectForKey:@"Discount"]doubleValue];
  62. _discount=[NSString stringWithFormat:@"%.2f",discountValue];
  63. double costPriceValue=[[dic objectForKey:@"CostPrice"]doubleValue];
  64. _costPrice=[NSString stringWithFormat:priceDecimalPlaces,costPriceValue];
  65. _usePositionName=[dic objectForKey:@"UsePositionName"];
  66. _existPromotionFlagDetail=[[dic objectForKey:@"ExistPromotionFlagDetail"]intValue];
  67. _manuFlag=[[dic objectForKey:@"ManuFlag"]intValue];
  68. _manufactureStatus=[[dic objectForKey:@"ManufactureStatus"]boolValue];
  69. _deliveryFlag=[[dic objectForKey:@"DeliveryFlag"]intValue];
  70. _installationFlag=[[dic objectForKey:@"InstallationFlag"]intValue];
  71. _expandAttribute=[dic objectForKey:@"ExpandAttribute"];
  72. _expandAttribute2=[dic objectForKey:@"ExpandAttribute2"];
  73. _codeRemarks=[dic objectForKey:@"CodeRemarks"];
  74. _remarks=[dic objectForKey:@"Remarks"];
  75. }
  76. }
  77. @end