Commit a66009c3 authored by liuyang's avatar liuyang

fixed bug

parent b328bbc9
...@@ -140,19 +140,22 @@ public class SysUserService extends BaseServiceImpl<SysUserMapper, SysUserPO> { ...@@ -140,19 +140,22 @@ 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);
List<SysRoleModel> roleModels = sysRoleService.getUserRoles(userInfo.getId()); if (userInfo != null){
for (SysRoleModel role : roleModels){ List<SysRoleModel> roleModels = sysRoleService.getUserRoles(userInfo.getId());
if (role.getCode().equals(BizConstants.ROLE_ENTERPRISE_ADMIN)){ for (SysRoleModel role : roleModels){
userInfo.setEnterpriesMgr(true); if (role.getCode().equals(BizConstants.ROLE_ENTERPRISE_ADMIN)){
break; userInfo.setEnterpriesMgr(true);
break;
}
} }
} if (userInfo.getEnterpriseId() != null){
if (userInfo.getEnterpriseId() != null){ OrganizationPO orgPo = orgService.getById(userInfo.getEnterpriseId());
OrganizationPO orgPo = orgService.getById(userInfo.getEnterpriseId()); if (orgPo != null){
if (orgPo != null){ 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();
if (!(now.isAfter(userInfo.getVipStartTime()) && now.isBefore(userInfo.getVipEndTime()))){
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("您的会员已过期,请续费后再观看");
}
} }
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