mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-09 10:56:50 +08:00
Merge branch 'master' of https://codeup.aliyun.com/648097ddb583fece2f059e59/boe/java-servers into zcwy-dev
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);
|
||||
|
||||
@@ -6,6 +6,8 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.xboe.module.usergroup.entity.UserGroupItem;
|
||||
import com.xboe.module.usergroup.service.IUserGroupService;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@@ -77,6 +79,9 @@ public class StudyCourseApi extends ApiBaseController{
|
||||
|
||||
@Autowired
|
||||
IStudySignupService signupService;
|
||||
|
||||
@Autowired
|
||||
private IUserGroupService userGroupService;
|
||||
|
||||
/**
|
||||
* 用于查询课程的学习记录
|
||||
@@ -153,6 +158,19 @@ public class StudyCourseApi extends ApiBaseController{
|
||||
if(crowd!=null && crowd) {
|
||||
rs.put("crowds",courseCrowdList);
|
||||
}
|
||||
|
||||
boolean pass = false;
|
||||
if (!courseCrowdList.isEmpty()) {
|
||||
for (CourseCrowd c : courseCrowdList) {
|
||||
//同一个受众,同一个只会有一条记录,所以这里就直接查询了
|
||||
List<UserGroupItem> hasItem = userGroupService.findByGroupIdAndAid(c.getGroupId(),aid);
|
||||
if (hasItem != null && !hasItem.isEmpty()) {
|
||||
pass = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
List<CourseContent> cclist=contentService.getByCourseId(cid);
|
||||
List<CourseSection> sectionlist=sectionService.getByCourseId(cid);
|
||||
List<CourseTeacher> teachers=courseService.findTeachersByCourseId(cid);
|
||||
@@ -165,8 +183,8 @@ public class StudyCourseApi 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