@@ -9,6 +9,7 @@ import com.yunhai.bschclassmanage.model.vo.oa.SchInfoVO;
|
|||||||
import com.yunhai.bschclassmanage.service.IComSchTreeService;
|
import com.yunhai.bschclassmanage.service.IComSchTreeService;
|
||||||
import com.yunhai.bschclassmanage.service.ISchInfoService;
|
import com.yunhai.bschclassmanage.service.ISchInfoService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
@@ -28,26 +29,26 @@ public class SchGroupController {
|
|||||||
|
|
||||||
@GetMapping("GetTeaTree")
|
@GetMapping("GetTeaTree")
|
||||||
@Operation(summary = "获取学校教师组树(toUser 默认 true 带教师,false 仅返回组骨架;SchSerID 与 schId 二选一)")
|
@Operation(summary = "获取学校教师组树(toUser 默认 true 带教师,false 仅返回组骨架;SchSerID 与 schId 二选一)")
|
||||||
public List<TeaTreeVO> getTeaTree(@RequestParam(value = "SchSerID", required = false) String SchSerID,
|
public ResponseEntity<List<TeaTreeVO>> getTeaTree(@RequestParam(value = "SchSerID", required = false) String SchSerID,
|
||||||
@RequestParam(value = "schId", required = false) Integer schId,
|
@RequestParam(value = "schId", required = false) Integer schId,
|
||||||
@RequestParam(value = "toUser", required = false, defaultValue = "true") boolean toUser) {
|
@RequestParam(value = "toUser", required = false, defaultValue = "true") boolean toUser) {
|
||||||
Integer resolvedSchId = resolveSchId(schId, SchSerID);
|
Integer resolvedSchId = resolveSchId(schId, SchSerID);
|
||||||
if (resolvedSchId == null) {
|
if (resolvedSchId == null) {
|
||||||
return Collections.emptyList();
|
return ResponseEntity.ok(Collections.emptyList());
|
||||||
}
|
}
|
||||||
return comSchTreeService.getSchTeaTree(resolvedSchId, toUser);
|
return ResponseEntity.ok(comSchTreeService.getSchTeaTree(resolvedSchId, toUser));
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("GetStuTree")
|
@GetMapping("GetStuTree")
|
||||||
@Operation(summary = "获取学校学生树:学校→学段→年级→班级→学生(toUser 默认 true 带学生,false 仅返回组织骨架;SchSerID 与 schId 二选一)")
|
@Operation(summary = "获取学校学生树:学校→学段→年级→班级→学生(toUser 默认 true 带学生,false 仅返回组织骨架;SchSerID 与 schId 二选一)")
|
||||||
public List<TeaTreeVO> getStuTree(@RequestParam(value = "SchSerID", required = false) String SchSerID,
|
public ResponseEntity<List<TeaTreeVO>> getStuTree(@RequestParam(value = "SchSerID", required = false) String SchSerID,
|
||||||
@RequestParam(value = "schId", required = false) Integer schId,
|
@RequestParam(value = "schId", required = false) Integer schId,
|
||||||
@RequestParam(value = "toUser", required = false, defaultValue = "true") boolean toUser) {
|
@RequestParam(value = "toUser", required = false, defaultValue = "true") boolean toUser) {
|
||||||
Integer resolvedSchId = resolveSchId(schId, SchSerID);
|
Integer resolvedSchId = resolveSchId(schId, SchSerID);
|
||||||
if (resolvedSchId == null) {
|
if (resolvedSchId == null) {
|
||||||
return Collections.emptyList();
|
return ResponseEntity.ok(Collections.emptyList());
|
||||||
}
|
}
|
||||||
return comSchTreeService.getSchStuTree(resolvedSchId, toUser);
|
return ResponseEntity.ok(comSchTreeService.getSchStuTree(resolvedSchId, toUser));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user