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