ManufactureDetailModel.m 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. //
  2. // ManufactureDetailModel.m
  3. // IBOSS
  4. //
  5. // Created by 关宏厚 on 2018/11/19.
  6. // Copyright © 2018 elongtian. All rights reserved.
  7. //
  8. #import "ManufactureDetailModel.h"
  9. @implementation ManufactureDetailModel
  10. - (void)parseDic:(NSDictionary *)dic
  11. {
  12. if(dic!=nil){
  13. _onlyCode=[dic objectForKey:@"AfterOnlyCode"];
  14. _decimalPlaces=[[dic objectForKey:@"DecimalPlaces"]intValue];
  15. _priceDecimal=[[dic objectForKey:@"PriceDecimal"]intValue];
  16. _weightDecimal=[[dic objectForKey:@"WeightDecimal"]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. _code=[dic objectForKey:@"AfterCode"];
  21. _brandName=[dic objectForKey:@"AfterBrandName"];
  22. _kindName=[dic objectForKey:@"AfterKindName"];
  23. _varietyName=[dic objectForKey:@"AfterVarietyName"];
  24. _seriesName=[dic objectForKey:@"AfterSeriesName"];
  25. _unitName=[dic objectForKey:@"AfterUnitName"];
  26. int packageValue=[[dic objectForKey:@"AfterPackage"]intValue];
  27. _package=[NSString stringWithFormat:@"%d",packageValue];
  28. double weightValue=[[dic objectForKey:@"AfterWeight"]doubleValue];
  29. _weight=[NSString stringWithFormat:weightDecimalPlaces,weightValue];
  30. _gradeName=[dic objectForKey:@"AfterGradeName"];
  31. _specification=[dic objectForKey:@"AfterSpecification"];
  32. _colorNumber=[dic objectForKey:@"AfterColorNumber"];
  33. _warehouseName=[dic objectForKey:@"AfterWarehouseName"];
  34. _positionNumber=[dic objectForKey:@"AfterPositionNumber"];
  35. double acreageValue=[[dic objectForKey:@"AfterAcreage"]doubleValue];
  36. _acreage=[NSString stringWithFormat:@"%.6f",acreageValue];
  37. double volumeValue=[[dic objectForKey:@"AfterVolume"]doubleValue];
  38. _volume=[NSString stringWithFormat:@"%.6f",volumeValue];
  39. double estimateQuantityValue=[[dic objectForKey:@"EstimateAfterQuantity"]doubleValue];
  40. _estimateQuantity=[NSString stringWithFormat:decimalPlacesStr,estimateQuantityValue];
  41. double factQuantityValue=[[dic objectForKey:@"FactAfterQuantity"]doubleValue];
  42. _factQuantity=[NSString stringWithFormat:decimalPlacesStr,factQuantityValue];
  43. _manufactureItem=[dic objectForKey:@"ManufactureItemName"];
  44. double manufactureQuantityValue=[[dic objectForKey:@"ManufactureQuantity"]doubleValue];
  45. _manufactureQuantity=[NSString stringWithFormat:decimalPlacesStr,manufactureQuantityValue];
  46. double manufactureSumValue=[[dic objectForKey:@"ManufactureSum"]doubleValue];
  47. _manufactureSum=[NSString stringWithFormat:priceDecimalPlaces,manufactureSumValue];
  48. double sellingSumValue=[[dic objectForKey:@"SellingSum"]doubleValue];
  49. _sellingSum=[NSString stringWithFormat:priceDecimalPlaces,sellingSumValue];
  50. _goodsName=[dic objectForKey:@"AfterGoodsName"];
  51. _expandAttribute=[dic objectForKey:@"AfterExpandAttribute"];
  52. _expandAttribute2=[dic objectForKey:@"AfterExpandAttribute2"];
  53. _remarks=[dic objectForKey:@"AfterRemarks"];
  54. }
  55. }
  56. @end