|
|
@@ -59,8 +59,6 @@ public class MemberPriceSettingsServiceImpl extends ServiceImpl<MemberPriceSetti
|
|
|
|
|
|
@Autowired
|
|
|
private SysUserFeignService sysUserFeignService;
|
|
|
- @Autowired
|
|
|
- private SysConfigService sysConfigService;
|
|
|
|
|
|
@Autowired
|
|
|
private ActivityPlanService activityPlanService;
|
|
|
@@ -181,15 +179,21 @@ public class MemberPriceSettingsServiceImpl extends ServiceImpl<MemberPriceSetti
|
|
|
|
|
|
@Override
|
|
|
public ShareProfitVo shareVipProfit(SysUser sysUser, Long vipId) {
|
|
|
+
|
|
|
ShareProfitVo result = new ShareProfitVo();
|
|
|
- MemberPriceSettingsVo detail = detail(vipId);
|
|
|
- result.setVip(detail);
|
|
|
- result.setAvatar(sysUser.getAvatar());
|
|
|
- result.setName(sysUser.getUsername());
|
|
|
- result.setTeacherId(sysUser.getId());
|
|
|
-
|
|
|
- String teacherVipShareProfitUrl = sysConfigService.findConfigValue(SysConfigConstant.TEACHER_VIP_SHARE_PROFIT_URL);
|
|
|
- result.setUrl(MessageFormatter.arrayFormat(teacherVipShareProfitUrl, detail.getId(), sysUser.getId()));
|
|
|
+
|
|
|
+ MemberPriceSettingsSearch memberPriceSettingsSearch = new MemberPriceSettingsSearch();
|
|
|
+ YesOrNoEnum discount = YesOrNoEnum.NO;
|
|
|
+ ActivityPlanVo activityPlanVo = activityPlanService.activityShare(ActivityShareEnum.VIP, sysUser.getId());
|
|
|
+ if (activityPlanVo != null) {
|
|
|
+ result.setActivityId(activityPlanVo.getId());
|
|
|
+ discount = YesOrNoEnum.YES;
|
|
|
+ memberPriceSettingsSearch.setActivityId(activityPlanVo.getId());
|
|
|
+ }
|
|
|
+ memberPriceSettingsSearch.setUserId(sysUser.getId());
|
|
|
+ MemberPriceVo vipShare = getVipShare(memberPriceSettingsSearch);
|
|
|
+ result.setDiscount(discount);
|
|
|
+ result.setVip(vipShare.getList());
|
|
|
return result;
|
|
|
}
|
|
|
|