mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-13 04:46:50 +08:00
课程查询和课件查询,所属组织id用in查询
This commit is contained in:
@@ -8,12 +8,14 @@ import java.io.InputStream;
|
|||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.net.URLEncoder;
|
import java.net.URLEncoder;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import com.xboe.common.utils.StringUtil;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.orm.ObjectOptimisticLockingFailureException;
|
import org.springframework.orm.ObjectOptimisticLockingFailureException;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
@@ -135,6 +137,15 @@ public class CourseFileApi extends ApiBaseController {
|
|||||||
if (cfile.getResType() != null) {
|
if (cfile.getResType() != null) {
|
||||||
filters.add(FieldFilters.eq("resType", cfile.getResType()));
|
filters.add(FieldFilters.eq("resType", cfile.getResType()));
|
||||||
}
|
}
|
||||||
|
if(StringUtil.isNotBlank(cfile.getOrgId())){
|
||||||
|
if(cfile.getOrgId().contains(",")){
|
||||||
|
String[] split = cfile.getOrgId().split(",");
|
||||||
|
List<String> strings = Arrays.asList(split);
|
||||||
|
filters.add(FieldFilters.in("orgId",strings));
|
||||||
|
}else {
|
||||||
|
filters.add(FieldFilters.eq("orgId",cfile.getOrgId()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//默认是查询自己的课件。
|
//默认是查询自己的课件。
|
||||||
if (self == null) {
|
if (self == null) {
|
||||||
|
|||||||
@@ -96,4 +96,9 @@ public class CourseQueryDto {
|
|||||||
* 是否公开课,0表非公开课,1表公开课
|
* 是否公开课,0表非公开课,1表公开课
|
||||||
*/
|
*/
|
||||||
private Integer openCourse;
|
private Integer openCourse;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 表资源归属的in查询
|
||||||
|
* */
|
||||||
|
private String orgId;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import java.time.LocalDate;
|
|||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
@@ -202,6 +203,15 @@ public class CourseServiceImpl implements ICourseService {
|
|||||||
if(dto.getPublish()!=null){
|
if(dto.getPublish()!=null){
|
||||||
filters.add(FieldFilters.eq("published",dto.getPublish()));
|
filters.add(FieldFilters.eq("published",dto.getPublish()));
|
||||||
}
|
}
|
||||||
|
if(StringUtil.isNotBlank(dto.getOrgId())){
|
||||||
|
if(dto.getOrgId().contains(",")){
|
||||||
|
String[] split = dto.getOrgId().split(",");
|
||||||
|
List<String> strings = Arrays.asList(split);
|
||||||
|
filters.add(FieldFilters.in("orgId",strings));
|
||||||
|
}else {
|
||||||
|
filters.add(FieldFilters.eq("orgId",dto.getOrgId()));
|
||||||
|
}
|
||||||
|
}
|
||||||
return filters;
|
return filters;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user