SPSBRedDotModel.m 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. //
  2. // SPSBRedDotModel.m
  3. // 我的社保
  4. //
  5. // Created by shanp on 2021/4/25.
  6. //
  7. #import "SPSBRedDotModel.h"
  8. #import "SPSBPurchasersModel.h"
  9. #import "SPSBBusinessManager.h"
  10. @implementation SPSBRedDotSbuIdModel
  11. @end
  12. @implementation SPSBRedDotModel
  13. - (instancetype)init {
  14. self = [super init];
  15. if (!self) return nil;
  16. _spsb_buy = @"0";
  17. _spsb_msg = @"0";
  18. _spsb_wage = @"0";
  19. _spsb_added = @"0";
  20. _spsb_material_flow = @"0";
  21. _spsba_all = @"0";
  22. _spsb_sbuids = SPSBRedDotSbuIdModel.new;
  23. return self;
  24. }
  25. - (id)GETspsb_sbuidsWithDictionary:(nullable NSDictionary *)dic key:(NSString *)key {
  26. SPSBRedDotSbuIdModel *model = SPSBRedDotSbuIdModel.new;
  27. NSArray *arr = @[];
  28. if ([dic[key] isKindOfClass:[NSArray class]]) {
  29. arr = dic[key];
  30. }
  31. for (id i in arr) {
  32. for (SPSBPurchasersModel *purchasers in spsb_purchasersArray()) {
  33. if ([purchasers.spsb_id isEqualToString:[NSString stringWithFormat:@"%@", i]]) {
  34. model.spsb_tips = [NSString stringWithFormat:@"请添加 %@ 的银行卡,否则会影响流水费返还。", purchasers.spsb_user_name];
  35. model.spsb_purchasers = purchasers;
  36. return model;
  37. }
  38. }
  39. }
  40. return model;
  41. }
  42. - (bool)handleAdditionalProperty {
  43. [super handleAdditionalProperty];
  44. NSInteger all = _spsb_buy.integerValue + _spsb_msg.integerValue + _spsb_wage.integerValue + _spsb_added.integerValue + _spsb_material_flow.integerValue;
  45. _spsba_all = [NSString stringWithFormat:@"%ld", (long)all];
  46. return true;
  47. }
  48. @end