SettlementTypeModel.m 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. //
  2. // SettlementTypeModel.m
  3. // IBOSS
  4. //
  5. // Created by apple on 16/1/15.
  6. // Copyright © 2017年 沈阳东科云信软件有限公司. All rights reserved.
  7. //
  8. // 功能描述:收款方式模型
  9. #import "SettlementTypeModel.h"
  10. @implementation SettlementTypeModel
  11. #pragma mark - 公有函数
  12. /**
  13. 初始化
  14. @return <#return value description#>
  15. */
  16. - (id)init
  17. {
  18. self = [super init];
  19. if(self){
  20. self.arrSettlement = [[NSMutableArray alloc]init];
  21. }
  22. return self;
  23. }
  24. #pragma mark - 私有函数
  25. /**
  26. 解析字典
  27. @param dic <#dic description#>
  28. */
  29. - (void)parseDic:(NSDictionary *)dic{
  30. if(dic != nil){
  31. self.settlementId = [[dic objectForKey:@"SettlementType"]stringValue];;
  32. self.settlementName = [dic objectForKey:@"SettlementTypeName"];
  33. self.receivables = [[dic objectForKey:@"ReceivableSum"]stringValue];
  34. BOOL ishand = [[dic objectForKey:@"ExistsHandlingFee"] boolValue];
  35. if (ishand) {
  36. self.isNotHand = @"是";
  37. }else{
  38. self.isNotHand = @"否";
  39. }
  40. self.handAmount = [[dic objectForKey:@"EarnestFee"]stringValue];
  41. self.remark = [dic objectForKey:@"Remarks"];
  42. }
  43. }
  44. /**
  45. 解析收款方式数组
  46. @param arr <#arr description#>
  47. */
  48. - (void)parseSettlementArr:(NSArray *)arr{
  49. if(arr != nil){
  50. [self.arrSettlement removeAllObjects];
  51. for(int i = 0;i < arr.count;i++)
  52. {
  53. SettlementTypeModel * info = [SettlementTypeModel new];
  54. NSDictionary * dic = arr[i];
  55. [info parseDic:dic];
  56. [self.arrSettlement addObject:info];
  57. }
  58. }
  59. }
  60. @end