|
@@ -2,16 +2,28 @@ package com.rf.psychological.scale.rest;
|
|
|
|
|
|
import com.rf.psychological.base.rest.BaseController;
|
|
|
import com.rf.psychological.dao.model.*;
|
|
|
+import com.rf.psychological.institution.model.InstitutionEntity;
|
|
|
+import com.rf.psychological.scale.dao.model.SubjectEntity;
|
|
|
+import com.rf.psychological.scale.service.CategorySubjectService;
|
|
|
import com.rf.psychological.scale.service.ScaleService;
|
|
|
+import com.rf.psychological.scale.service.SubjectService;
|
|
|
import com.rf.psychological.service.*;
|
|
|
+import com.rf.psychological.user.dao.model.UserEntity;
|
|
|
import com.rf.psychological.utils.Constant;
|
|
|
+import com.rf.psychological.utils.PageRequestUtil;
|
|
|
import com.rf.psychological.utils.Result;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.apache.commons.collections4.CollectionUtils;
|
|
|
+import org.apache.commons.lang.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.data.domain.Page;
|
|
|
+import org.springframework.data.jpa.domain.Specification;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
+import javax.persistence.criteria.Predicate;
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
@@ -40,6 +52,12 @@ public class SubjectController extends BaseController {
|
|
|
@Autowired
|
|
|
private CattellService cattellService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private CategorySubjectService categorySubjectService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private SubjectService subjectService;
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 查询全量检测列表
|
|
@@ -68,4 +86,21 @@ public class SubjectController extends BaseController {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ @GetMapping("/getSubjectByCategory")
|
|
|
+ @ApiOperation("根据类型获取")
|
|
|
+ public Result getSubjectByCategory(int pageNum,int pageSize, String category){
|
|
|
+ try {
|
|
|
+ //先获取到该类型下量表FLAG
|
|
|
+ List<String> listFlag = categorySubjectService.findByEName(category);
|
|
|
+ if (CollectionUtils.isEmpty(listFlag)){
|
|
|
+ return success(null);
|
|
|
+ }
|
|
|
+ return success( subjectService.findSubjectByPage(pageNum,pageSize,listFlag));
|
|
|
+ }catch (Exception e){
|
|
|
+ log.error(e.getMessage());
|
|
|
+ return fail();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|