| | |
| | | VipSettingDto vipSettingDto = new VipSettingDto(); |
| | | BeanUtils.copyProperties(vipSetting.getData(),vipSettingDto); |
| | | agentApplication.setVipSettingDto(vipSettingDto); |
| | | agentApplication.setVipId(agentApplication.getApplicationVipId()); |
| | | agentApplication.setVipId(agentApplication.getVipId()); |
| | | return R.ok(agentApplication); |
| | | } |
| | | |
| | |
| | | byId.setStatus(status); |
| | | byId.setRemark(remark); |
| | | agentApplicationService.updateById(byId); |
| | | AppUser byId1 = appUserService.getById(byId.getAppUserId()); |
| | | //插入等级变化数据 |
| | | UserChangeLog userChangeLog = new UserChangeLog(); |
| | | userChangeLog.setCreateTime(LocalDateTime.now()); |
| | | userChangeLog.setAppUserId(byId.getAppUserId()); |
| | | userChangeLog.setBeforeVipId(byId1.getVipId()); |
| | | userChangeLog.setAfterVipId(byId.getApplicationVipId()); |
| | | if (userChangeLog.getBeforeVipId()>userChangeLog.getAfterVipId()) { |
| | | userChangeLog.setChangeType(0); |
| | | }else { |
| | | userChangeLog.setChangeType(1); |
| | | } |
| | | userChangeLogService.save(userChangeLog); |
| | | //变更会员等级 |
| | | byId1.setVipId(byId.getApplicationVipId()); |
| | | |
| | | // 当用户为合伙人时,计算合伙人积分和培育积分 |
| | | Integer vipId = byId1.getVipId(); |
| | | if (vipId == 7){ |
| | | R<BaseSetting> baseSetting = baseSettingClient.getBaseSetting(1); |
| | | BaseSetting data = baseSetting.getData(); |
| | | int basePoint = Integer.parseInt(data.getContent()); |
| | | // 当前用户计算合伙人积分 |
| | | R<VipSetting> vipSetting = vipSettingClient.getVipSetting(vipId); |
| | | Integer point = getPoint(vipSetting, byId1, basePoint); |
| | | byId1.setPartPoint(point); |
| | | // 上级计算培育积分 |
| | | R<BaseSetting> baseSetting2 = baseSettingClient.getBaseSetting(1); |
| | | BaseSetting data2 = baseSetting2.getData(); |
| | | int basePoint2 = Integer.parseInt(data2.getContent()); |
| | | Long inviteUserId = byId1.getInviteUserId(); |
| | | AppUser byId2 = appUserService.getById(inviteUserId); |
| | | if (byId2 != null){ |
| | | Integer point1 = getPoint(vipSetting, byId2, basePoint2); |
| | | byId2.setPartGrowPoint(point1); |
| | | if(2 == status){ |
| | | AppUser byId1 = appUserService.getById(byId.getAppUserId()); |
| | | //插入等级变化数据 |
| | | UserChangeLog userChangeLog = new UserChangeLog(); |
| | | userChangeLog.setCreateTime(LocalDateTime.now()); |
| | | userChangeLog.setAppUserId(byId.getAppUserId()); |
| | | userChangeLog.setBeforeVipId(byId1.getVipId()); |
| | | userChangeLog.setAfterVipId(byId.getApplicationVipId()); |
| | | if (userChangeLog.getBeforeVipId()>userChangeLog.getAfterVipId()) { |
| | | userChangeLog.setChangeType(0); |
| | | }else { |
| | | userChangeLog.setChangeType(1); |
| | | } |
| | | userChangeLogService.save(userChangeLog); |
| | | //变更会员等级 |
| | | byId1.setVipId(byId.getApplicationVipId()); |
| | | |
| | | // 当用户为合伙人时,计算合伙人积分和培育积分 |
| | | Integer vipId = byId1.getVipId(); |
| | | if (vipId == 7){ |
| | | R<BaseSetting> baseSetting = baseSettingClient.getBaseSetting(1); |
| | | BaseSetting data = baseSetting.getData(); |
| | | int basePoint = Integer.parseInt(data.getContent()); |
| | | // 当前用户计算合伙人积分 |
| | | R<VipSetting> vipSetting = vipSettingClient.getVipSetting(vipId); |
| | | Integer point = getPoint(vipSetting, byId1, basePoint); |
| | | byId1.setPartPoint(point); |
| | | // 上级计算培育积分 |
| | | R<BaseSetting> baseSetting2 = baseSettingClient.getBaseSetting(2); |
| | | BaseSetting data2 = baseSetting2.getData(); |
| | | int basePoint2 = Integer.parseInt(data2.getContent()); |
| | | Long inviteUserId = byId1.getInviteUserId(); |
| | | AppUser byId2 = appUserService.getById(inviteUserId); |
| | | if (byId2 != null){ |
| | | Integer point1 = getPoint(vipSetting, byId1, basePoint2); |
| | | byId2.setPartGrowPoint(point1); |
| | | appUserService.updateById(byId2); |
| | | } |
| | | } |
| | | |
| | | appUserService.updateById(byId1); |
| | | } |
| | | |
| | | appUserService.updateById(byId1); |
| | | return R.ok(byId); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | if (vipCenterService.checkReadyToBePartner(appUser.getId())){ |
| | | if (vipCenterService.isEligibleForGlobalPartner(appUser.getId())){ |
| | | return basePoint * i; |
| | | } |
| | | return 0; |