WANG 6 жил өмнө
parent
commit
fa7a57f7d4

+ 11 - 1
examcloud-core-basic-api-provider/src/main/java/cn/com/qmth/examcloud/core/basic/api/controller/StudentController.java

@@ -28,6 +28,7 @@ import com.google.common.collect.Lists;
 
 import cn.com.qmth.examcloud.commons.base.exception.StatusException;
 import cn.com.qmth.examcloud.commons.base.util.PropertiesUtil;
+import cn.com.qmth.examcloud.commons.web.enums.BooleanSelect;
 import cn.com.qmth.examcloud.commons.web.helpers.page.PageInfo;
 import cn.com.qmth.examcloud.commons.web.security.bean.User;
 import cn.com.qmth.examcloud.commons.web.support.ControllerSupport;
@@ -84,7 +85,8 @@ public class StudentController extends ControllerSupport {
 	public PageInfo<StudentDomain> getStudentPage(@PathVariable Integer curPage,
 			@PathVariable Integer pageSize, @RequestParam String name,
 			@RequestParam String studentCode, @RequestParam String identityNumber,
-			@RequestParam(required = false) Long rootOrgId) {
+			@RequestParam(required = false) Long rootOrgId,
+			@RequestParam(required = false) BooleanSelect hasPhoto) {
 
 		User accessUser = getAccessUser();
 		if (null == rootOrgId) {
@@ -109,6 +111,14 @@ public class StudentController extends ControllerSupport {
 				predicates.add(
 						cb.like(root.get("identityNumber"), toSqlSearchPattern(identityNumber)));
 			}
+			if (null != hasPhoto) {
+				Boolean hasPhotoBoolean = hasPhoto.getBoolean();
+				if (hasPhotoBoolean) {
+					predicates.add(cb.isNotEmpty(root.get("photoPath")));
+				} else {
+					predicates.add(cb.isEmpty(root.get("photoPath")));
+				}
+			}
 			return cb.and(predicates.toArray(new Predicate[predicates.size()]));
 		};