| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- //
- // RequirementReceiptModel.m
- // IBOSSHSH
- //
- // Created by ssl on 2018/1/12.
- // Copyright © 2018年 elongtian. All rights reserved.
- //
- #import "RequirementReceiptModel.h"
- @implementation RequirementReceiptModel
- #pragma mark - 私有函数
- /*!
- * 1.该方法是 `字典里的属性Key` 和 `要转化为模型里的属性名` 不一样 而重写的
- * 前:模型的属性 后:字典里的属性
- */
- + (nullable NSDictionary<NSString *, id> *)modelCustomPropertyMapper{
-
- return @{ @"deliveryNo":@"DeliveryNo",
- @"recReceiptNo":@"ReceiptNo",
- @"customerName":@"CustomerName",
- @"contacts":@"Contacts",
- @"telephone":@"Telephone",
- @"deliveryDate":@"DeliveryDate",
- @"receiptTime":@"ReceiptTime",
- @"arrangementNo":@"ArrangementNo",
- @"receiptType":@"DeliveryReceiptType",
- @"receivables":@"Receivables",
- @"completeReceivables":@"CompleteReceivables",
- @"nextDeliveryDate":@"NextDeliveryDate",
- @"deliveryAddress":@"DeliveryAddress",
- @"accountDate":@"AccountDate",
- @"receiptID":@"ReceiptID",
- @"receiptFlag":@"ReceiptFlag"};
- }
- /*!
- * 2. 下面的两个方法 `字典里值`与`模型的值`类型不一样`需要转换`而重写的方法
- * NSDate *time dic[@"t"]是double类型的的秒数
- * Dic -> model
- */
- - (BOOL)modelCustomTransformFromDictionary:(NSDictionary *)dic {
- _deliveryId = [[dic objectForKey:@"DeliveryID"] stringValue];
- _arrangementId = [[dic objectForKey:@"ArrangementID"]stringValue];
- _recReceiptType = [[dic objectForKey:@"recReceiptType"]stringValue];
- return YES;
- }
- @end
|