Commit a66009c3 authored by liuyang's avatar liuyang

fixed bug

parent b328bbc9
...@@ -140,6 +140,7 @@ public class SysUserService extends BaseServiceImpl<SysUserMapper, SysUserPO> { ...@@ -140,6 +140,7 @@ public class SysUserService extends BaseServiceImpl<SysUserMapper, SysUserPO> {
public FullUserInfo findFullUserInfo(String username) { public FullUserInfo findFullUserInfo(String username) {
FullUserInfo userInfo = baseMapper.selectFullUserInfo(username); FullUserInfo userInfo = baseMapper.selectFullUserInfo(username);
if (userInfo != null){
List<SysRoleModel> roleModels = sysRoleService.getUserRoles(userInfo.getId()); List<SysRoleModel> roleModels = sysRoleService.getUserRoles(userInfo.getId());
for (SysRoleModel role : roleModels){ for (SysRoleModel role : roleModels){
if (role.getCode().equals(BizConstants.ROLE_ENTERPRISE_ADMIN)){ if (role.getCode().equals(BizConstants.ROLE_ENTERPRISE_ADMIN)){
...@@ -153,6 +154,8 @@ public class SysUserService extends BaseServiceImpl<SysUserMapper, SysUserPO> { ...@@ -153,6 +154,8 @@ public class SysUserService extends BaseServiceImpl<SysUserMapper, SysUserPO> {
userInfo.setEnterpriseName(orgPo.getName()); userInfo.setEnterpriseName(orgPo.getName());
} }
} }
}
return userInfo; return userInfo;
} }
......
...@@ -75,11 +75,22 @@ public class UserCenterService { ...@@ -75,11 +75,22 @@ public class UserCenterService {
}else if (course.getChargeModel() == CourseChargeModelEnum.VIP_FREE){ }else if (course.getChargeModel() == CourseChargeModelEnum.VIP_FREE){
if (userInfo.getType() == AccountTypeEnum.USER){ if (userInfo.getType() == AccountTypeEnum.USER){
throw new BusinessException("您还不是会员,请先成为会员再观看"); throw new BusinessException("您还不是会员,请先成为会员再观看");
}else if (userInfo.getType() == AccountTypeEnum.ENTERPRISE_VIP){
if(userInfo.getVipStartTime() == null || userInfo.getVipEndTime() == null){
throw new BusinessException("您是企业会员,尚未领取包月时长");
} }
LocalDateTime now = LocalDateTime.now(); LocalDateTime now = LocalDateTime.now();
if (!(now.isAfter(userInfo.getVipStartTime()) && now.isBefore(userInfo.getVipEndTime()))){ if (!(now.isAfter(userInfo.getVipStartTime()) && now.isBefore(userInfo.getVipEndTime()))){
throw new BusinessException("您的会员已过期,请续费后再观看"); throw new BusinessException("您的会员已过期,请续费后再观看");
} }
}else if (userInfo.getType() == AccountTypeEnum.VIP){
LocalDateTime now = LocalDateTime.now();
if (!(now.isAfter(userInfo.getVipStartTime()) && now.isBefore(userInfo.getVipEndTime()))){
throw new BusinessException("您的会员已过期,请续费后再观看");
}
}
}else if (course.getChargeModel() == CourseChargeModelEnum.PAY){ }else if (course.getChargeModel() == CourseChargeModelEnum.PAY){
UserCourseAuthPO authPO = userCourseAuthService.getOne(Wrappers.<UserCourseAuthPO>lambdaQuery().eq(UserCourseAuthPO::getUserId,userId).eq(UserCourseAuthPO::getCourseId,courseId)); UserCourseAuthPO authPO = userCourseAuthService.getOne(Wrappers.<UserCourseAuthPO>lambdaQuery().eq(UserCourseAuthPO::getUserId,userId).eq(UserCourseAuthPO::getCourseId,courseId));
if (authPO == null){ if (authPO == null){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment