ProcurementApplyListModel.m 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. //
  2. // ProcurementApplyListModel.m
  3. // IBOSS
  4. //
  5. // Created by guan hong hou on 2018/7/23.
  6. // Copyright © 2018年 elongtian. All rights reserved.
  7. //
  8. #import "ProcurementApplyListModel.h"
  9. @implementation ProcurementApplyListModel
  10. /*!
  11. * 1.该方法是 `字典里的属性Key` 和 `要转化为模型里的属性名` 不一样 而重写的
  12. * 前:模型的属性 后:字典里的属性
  13. */
  14. + (nullable NSDictionary<NSString *, id> *)modelCustomPropertyMapper{
  15. return @{@"applyNo":@"ApplyNo",
  16. @"applyId":@"ApplyID",
  17. @"invoiceStatusName":@"InvoiceStatusName",
  18. @"orderNo":@"OrderNo",
  19. @"customerCode":@"CustomerCode",
  20. @"customerName":@"CustomerName",
  21. @"accountDate":@"AccountDate",
  22. @"arrivalDate":@"ArrivalDate",
  23. @"organizationName":@"OrganizationName",
  24. @"applicant":@"ApplicantName",
  25. @"applyTitle":@"ApplyTitle",
  26. @"contractNumber":@"ContractNumber",
  27. @"remarks":@"Remarks",
  28. @"reviewerName":@"ReviewerName",
  29. @"reversedApply":@"ReversedApply",
  30. @"createUser":@"CreateUser",
  31. @"createTime":@"CreateTime",
  32. @"updateUser":@"UpdateUser",
  33. @"updateTime":@"UpdateTime",
  34. @"districtName":@"DistrictName",
  35. @"sourceNo":@"SourceNo"
  36. };
  37. }
  38. /*!
  39. * 2. 下面的两个方法 `字典里值`与`模型的值`类型不一样`需要转换`而重写的方法
  40. * NSDate *time dic[@"t"]是double类型的的秒数
  41. */
  42. /// Dic -> model
  43. - (BOOL)modelCustomTransformFromDictionary:(NSDictionary *)dic {
  44. DateFormat *d = [[DateFormat alloc] init];
  45. self.accountDate = [d dateFormat:[dic objectForKey:@"AccountDate"]];
  46. self.arrivalDate=[d dateFormat:[dic objectForKey:@"ArrivalDate"]];
  47. return YES;
  48. }
  49. @end