123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105 |
- //
- // SPSBMyPurchaseOrder.m
- // 我的社保
- //
- // Created by shanp on 2021/4/22.
- //
- #import "SPSBMyPurchaseOrder.h"
- #import <objc/runtime.h>
- @implementation SPSBMyPurchasers
- @end
- @implementation SPSBMyPurchasersImage
- @end
- @implementation SPSBMyPurchaseOrder
- - (instancetype)init {
- self = [super init];
- if (!self) return nil;
- _spsb_payFor = @"";
- _spsb_pack = false;
- _spsb_SSCard = 0;
- _spsb_accountType = 1;
- _spsb_accumulationFund = 0.0;
- _spsb_salary = 0;
- _spsb_isNeedSalary = false;
- _spsb_isInOffice = false;
- _spsb_wageBase = 0;
-
- _spsb_purchaseFundWay = SPSBPurchaseFundWaySum;
- _spsb_isNewPurchasers = false;
- _spsb_NewPurchasersData = [SPSBMyPurchasers getModelWithDictionary:@{}];
- _spsb_NewPurchasersImageDict = SPSBMyPurchasersImage.new;
- _spsb_purchasersData = [SPSBMyPurchasers getModelWithDictionary:@{}];
- _spsb_timeInterval = 1;
- _spsb_isSupplementaryPay = false;
- _spsb_isFirstBuyShebao = false;
- _spsb_isFirstBuyFund = false;
- return self;
- }
- - (void)setSpsb_pack:(bool)spsb_pack {
- _spsb_pack = spsb_pack;
- if (_spsb_pack) {
- if (_spsb_purchaseType == SPSBPurchaseSocialInsurance) {
- _spsb_purchaseType = SPSBPurchaseSocialInsurancePackage;
- } else if (_spsb_purchaseType == SPSBPurchaseAccumulationFund) {
- _spsb_purchaseType = SPSBPurchaseAccumulationFundPackage;
- }
- } else {
- if (_spsb_purchaseType == SPSBPurchaseSocialInsurancePackage) {
- _spsb_purchaseType = SPSBPurchaseSocialInsurance;
- _spsb_isFirstBuyFund = false;
- } else if (_spsb_purchaseType == SPSBPurchaseAccumulationFundPackage) {
- _spsb_purchaseType = SPSBPurchaseAccumulationFund;
- _spsb_SSCard = 0;
- _spsb_isFirstBuyShebao = false;
- }
- }
- }
- - (id)copyWithZone:(NSZone *)zone {
- Class class = [self class];
- id new = class.new;
-
- while ([NSStringFromClass(class) hasPrefix:@"SPSB"]) {
- unsigned int count;
- objc_property_t *properties = class_copyPropertyList(class, &count);
- for(int i = 0; i < count; i++) {
- objc_property_t property = properties[i];
- NSString *key = [[NSString alloc] initWithCString:property_getName(property) encoding:NSUTF8StringEncoding];
- if ([key hasPrefix:@"spsb"]) {
- id value = [self valueForKey:key];
- if ([value respondsToSelector:@selector(copyWithZone:)]) {
- value = [value copy];
- }
- [new setValue:value forKey:key];
- }
- }
- free(properties);
- class = class_getSuperclass(class);
- }
-
- return new;
- }
- - (NSString *)description {
- NSMutableString *desc = [NSMutableString stringWithString:@""];
- unsigned int count;
- objc_property_t *properties = class_copyPropertyList([self class], &count);
- for(int i = 0; i < count; i++) {
- objc_property_t property = properties[i];
- NSString *key = [[NSString alloc] initWithCString:property_getName(property) encoding:NSUTF8StringEncoding];
- if ([key hasPrefix:@"spsb"]) {
- [desc appendFormat:@"%@ : %@\n", key, [self valueForKey:key]];
- }
- }
- return desc;
- }
- @end
|