SalesOrderModel.m 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. //
  2. // SalesOrderModel.m
  3. // IBOSSmini
  4. //
  5. // Created by guan hong hou on 2018/1/20.
  6. // Copyright © 2018年 elongtian. All rights reserved.
  7. //
  8. #import "SalesOrderModel.h"
  9. #import "DateFormat.h"
  10. @implementation SalesOrderModel
  11. -(void)ParseDic:(NSDictionary *)dic
  12. {
  13. if(dic!=nil){
  14. _status = [[dic objectForKey:@"Status"]integerValue];
  15. _invoiceStatusName= [dic objectForKey:@"InvoiceStatusName"];
  16. _customerName=[dic objectForKey:@"CustomerName"];
  17. _contractNumber=[dic objectForKey:@"ContractNumber"];
  18. double toSalesAmountValue=[[dic objectForKey:@"ToSalesAmount"]doubleValue ];
  19. _toSalesAmount=[NSString stringWithFormat:@"%.4f",toSalesAmountValue];
  20. double markedPriceAmountValue=[[dic objectForKey:@"MarkedPriceAmount"]doubleValue];
  21. _markedPriceAmount=[NSString stringWithFormat:@"%.4f",markedPriceAmountValue];
  22. _otherContact=[dic objectForKey:@"OtherContact"];
  23. _intermediateCustomersName=[dic objectForKey:@"IntermediateCustomersName"];
  24. _customerCode=[dic objectForKey:@"CustomerCode"];
  25. double totalAmountValue= [[dic objectForKey:@"TotalAmount"]doubleValue];
  26. _totalAmount=[NSString stringWithFormat:@"%.4f",totalAmountValue];
  27. int orderIdValue= [[dic objectForKey:@"OrderID"]intValue];
  28. _orderId=[NSString stringWithFormat:@"%d",orderIdValue];
  29. _channelName=[dic objectForKey:@"ChannelName"];
  30. _deliveryFlag= [[dic objectForKey:@"DeliveryFlag"]boolValue];
  31. _installationFlag=[[dic objectForKey:@"InstallationFlag"]boolValue];
  32. _customerID = [[dic objectForKey:@"CustomerID"]stringValue];
  33. NSString *estimateDeliveryDateStr= [dic objectForKey:@"EstimateDeliveryDate"];
  34. _estimateDeliveryDate=[DateFormat dateFormatSplit:estimateDeliveryDateStr];
  35. _estimateInstallationDate=[DateFormat dateFormatSplit: [dic objectForKey:@"EstimateInstallationDate"]];
  36. _deliveryAreaName=[dic objectForKey:@"DeliveryAreaName"];
  37. _floorsName=[dic objectForKey:@"FloorsName"];
  38. _setReversedOrderNo=[dic objectForKey:@"setReversedOrderNo"];
  39. _createUser=[dic objectForKey:@"CreateUser"];
  40. _updateUser=[dic objectForKey:@"UpdateUser"];
  41. _createTime=[DateFormat dateFormatSplit:[dic objectForKey:@"CreateTime"]];
  42. _updateTime=[DateFormat dateFormatSplit:[dic objectForKey:@"UpdateTime"]];
  43. _remarks=[dic objectForKey:@"Remarks"];
  44. double weightValue= [[dic objectForKey:@"Weight"]doubleValue];
  45. _weight=[NSString stringWithFormat:@"%.6f",weightValue];;
  46. double totalVolumeValue=[[dic objectForKey:@"TotalVolume"]doubleValue];
  47. _totalVolume=[NSString stringWithFormat:@"%.6f",totalVolumeValue];
  48. _contacts=[dic objectForKey:@"Contacts"];
  49. _orderTypeName=[dic objectForKey:@"OrderTypeName"];
  50. _orderType=[[dic objectForKey:@"OrderType"]integerValue];
  51. _telephone=[dic objectForKey:@"Telephone"];
  52. _customerTypeName=[dic objectForKey:@"CustomerTypeName"];
  53. _orderNo=[dic objectForKey:@"OrderNo"];
  54. double orderEarnestSumValue=[[dic objectForKey:@"OrderEarnestSum"]doubleValue];
  55. _orderEarnestSum= [NSString stringWithFormat:@"%.4f",orderEarnestSumValue];
  56. _channelName=[dic objectForKey:@"ChannelName"];
  57. double goodsAmountValue=[[dic objectForKey:@"GoodsAmount"]doubleValue];
  58. _goodsAmount= [NSString stringWithFormat:@"%.2f",goodsAmountValue];
  59. double discountAmountValue=[[dic objectForKey:@"DiscountAmount"]doubleValue];
  60. _discountAmount=[NSString stringWithFormat:@"%.4f",discountAmountValue];
  61. double earnestAmountValue= [[dic objectForKey:@"EarnestAmount"]doubleValue];
  62. _earnestAmount=[NSString stringWithFormat:@"%.2f",earnestAmountValue];
  63. double totalEarnestAmountValue= [[dic objectForKey:@"TotalEarnestAmount"]doubleValue];
  64. _totalEarnestAmount= [NSString stringWithFormat:@"%.4f",totalEarnestAmountValue];
  65. double earnestRateValue= [[dic objectForKey:@"EarnestRate"]doubleValue];
  66. _earnestRate=[NSString stringWithFormat:@"%.2f%@",earnestRateValue,@"%"];
  67. double totalEarnestRateValue=[[dic objectForKey:@"TotalEarnestRate"]doubleValue];
  68. _totalEarnestRate=[NSString stringWithFormat:@"%.2f%@",totalEarnestRateValue,@"%"];
  69. double discountValue= [[dic objectForKey:@"Discount"]doubleValue];
  70. _discount=[NSString stringWithFormat:@"%.2f",discountValue];
  71. _goodsCount=[dic objectForKey:@"GoodsCount"];
  72. _organizationName=[dic objectForKey:@"OrganizationName"];
  73. _staffName=[dic objectForKey:@"StaffName"];
  74. _createUser=[dic objectForKey:@"CreateUser"];
  75. _accountDate=[DateFormat dateFormatSplit:[dic objectForKey:@"AccountDate"]];
  76. _address=[dic objectForKey:@"Address"];
  77. }
  78. }
  79. @end