mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-09 19:06:49 +08:00
课程受众判断
This commit is contained in:
@@ -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