GoodsSearchItemModel.m 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. //
  2. // GoodsItemModel.m
  3. // IBOSSIPAD
  4. //
  5. // Created by iHope on 14-7-24.
  6. // Copyright (c) 2014年 elongtian. All rights reserved.
  7. //
  8. #import "GoodsSearchItemModel.h"
  9. #import "OrderQuantity.h"
  10. @implementation GoodsSearchItemModel
  11. -(void)parseDic:(NSDictionary *)dic
  12. {
  13. if(dic!=nil){
  14. _code=[dic objectForKey:@"Code"];
  15. _onlyCode=[dic objectForKey:@"OnlyCode"];
  16. _brandName=[dic objectForKey:@"BrandName"];
  17. _gradeName=[dic objectForKey:@"GradeName"];
  18. _specification=[dic objectForKey:@"Specification"];
  19. _colorNumber=[dic objectForKey:@"ColorNumber"];
  20. _warehouseName=[dic objectForKey:@"WarehouseName"];
  21. _positionNumber=[dic objectForKey:@"PositionNumber"];
  22. _inventoryQuantity=[NSString stringWithFormat:@"%.2f",[[dic objectForKey:@"InventoryQuantity"] doubleValue]];
  23. _balanceQuantity=[NSString stringWithFormat:@"%.2f",[[dic objectForKey:@"BalanceQuantity"]doubleValue]];
  24. NSInteger inventoryIdValue= [[dic objectForKey:@"InventoryID"]integerValue];
  25. _inventoryID=[NSString stringWithFormat:@"%ld",(long)inventoryIdValue];
  26. _photo=[dic objectForKey:@"Photo"];
  27. _decimalPlaces=[[dic objectForKey:@"DecimalPlaces"]integerValue];
  28. _circulateType=[[dic objectForKey:@"CirculateType" ]integerValue];
  29. _acreage=[[dic objectForKey:@"Acreage" ] doubleValue];
  30. OrderQuantity *quantity=[OrderQuantity new];
  31. NSString *salesQuantity=@"1";
  32. NSString *calculateQuantity= [quantity calculateOrderQuantity:_circulateType decimalPlaces:[NSString stringWithFormat:@"%ld",(long)_decimalPlaces] quantity:salesQuantity acreage:_acreage];
  33. _salesPrice=@"0";
  34. _salesQuantity=calculateQuantity;
  35. _markedPrice=@"0";
  36. _remarks=@"";
  37. _isChecked=NO;
  38. }
  39. }
  40. - (id)copyWithZone:(nullable NSZone *)zone{
  41. GoodsSearchItemModel *searchItemModel = [[self class] allocWithZone:zone];
  42. searchItemModel.code=_code;
  43. searchItemModel.onlyCode=_onlyCode;
  44. searchItemModel.brandName=_brandName;
  45. searchItemModel.gradeName=_gradeName;
  46. searchItemModel.specification=_specification;
  47. searchItemModel.colorNumber=_colorNumber;
  48. searchItemModel.warehouseName=_warehouseName;
  49. searchItemModel.positionNumber=_positionNumber;
  50. searchItemModel.balanceQuantity=_balanceQuantity;
  51. searchItemModel.inventoryQuantity=_inventoryQuantity;
  52. searchItemModel.inventoryID=_inventoryID;
  53. searchItemModel.salesQuantity=_salesQuantity;
  54. searchItemModel.salesPrice=_salesPrice;
  55. searchItemModel.remarks=_remarks;
  56. searchItemModel.markedPrice=_markedPrice;
  57. searchItemModel.photo=_photo;
  58. searchItemModel.isChecked=_isChecked;
  59. searchItemModel.circulateType=_circulateType;
  60. searchItemModel.acreage=_acreage;
  61. searchItemModel.decimalPlaces=_decimalPlaces;
  62. return searchItemModel;
  63. }
  64. @end