mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-07 01:46:47 +08:00
课程受众
This commit is contained in:
@@ -7,6 +7,8 @@ import java.util.Map;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import com.xboe.core.JsonResponseStatus;
|
||||
import com.xboe.module.usergroup.entity.UserGroupItem;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@@ -250,25 +252,27 @@ public class CoursePortalApi extends ApiBaseController{
|
||||
if(preview==null) {
|
||||
preview=true;
|
||||
}
|
||||
|
||||
|
||||
boolean pass = false;
|
||||
if(!preview) {
|
||||
if (!courseCrowdList.isEmpty()) {
|
||||
// boolean pass = false;
|
||||
// for (CourseCrowd c : courseCrowdList) {
|
||||
// //同一个受众,同一个只会有一条记录,所以这里就直接查询了
|
||||
// List<UserGroupItem> hasItem = userGroupService.findByGroupIdAndAid(c.getGroupId(),aid);
|
||||
// if (hasItem != null && !hasItem.isEmpty()) {
|
||||
// pass = true;
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
for (CourseCrowd c : courseCrowdList) {
|
||||
//同一个受众,同一个只会有一条记录,所以这里就直接查询了
|
||||
List<UserGroupItem> hasItem = userGroupService.findByGroupIdAndAid(c.getGroupId(),aid);
|
||||
if (hasItem != null && !hasItem.isEmpty()) {
|
||||
pass = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// if (!pass) {
|
||||
// //return badRequest("您无学习此课程的权限,请与管理员联系");
|
||||
// return wrap(JsonResponseStatus.NO_CONTENT, "您无学习此课程的权限,请与管理员联系",rs);
|
||||
// }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
List<CourseContent> cclist=contentService.getByCourseId(id);
|
||||
List<CourseSection> sectionlist=sectionService.getByCourseId(id);
|
||||
List<CourseTeacher> teachers=courseService.findTeachersByCourseId(id);
|
||||
@@ -282,8 +286,8 @@ public class CoursePortalApi extends ApiBaseController{
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
rs.put("isCrowd",pass);
|
||||
rs.put("contents",cclist);
|
||||
rs.put("sections",sectionlist);
|
||||
rs.put("teachers",teachers);
|
||||
|
||||
Reference in New Issue
Block a user