This commit is contained in:
2026-08-13 16:53:39 +08:00
parent 5210ad34f3
commit ed48da0a78
27 changed files with 392 additions and 313 deletions
@@ -9,7 +9,6 @@ import com.yunhai.bschclassmanage.model.dto.SchTeacherDTO;
import com.yunhai.bschclassmanage.model.dto.TeaTransferGroupDTO;
import com.yunhai.bschclassmanage.model.dto.TeaTransferInGroupDTO;
import com.yunhai.bschclassmanage.model.excel.TeacherExcelColumn;
import com.yunhai.bschclassmanage.model.tool.UserSysRole;
import com.yunhai.bschclassmanage.model.vo.PageVO;
import com.yunhai.bschclassmanage.model.vo.SchTeacherTOutVO;
import com.yunhai.bschclassmanage.model.vo.SchTeacherVO;
@@ -18,7 +17,6 @@ import com.yunhai.bschclassmanage.service.IComSchTreeService;
import com.yunhai.bschclassmanage.service.ISchTeacherService;
import com.yunhai.bschclassmanage.utils.EasyPoiUtils;
import com.yunhai.bschclassmanage.utils.UserContext;
import com.yunhai.platform.utils.model.BoaUser;
import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Pageable;
@@ -43,11 +41,10 @@ public class SchTeacherController extends BaseController {
private IComSchTreeService comSchTreeService; // 使用接口
@GetMapping("search")
public PageVO<SchTeacherVO> searchSchTeacher(UserSysRole curRole,
@RequestParam(required = false) Integer groupId,
public PageVO<SchTeacherVO> searchSchTeacher(@RequestParam(required = false) Integer groupId,
@RequestParam(required = false) String keyword,
Pageable pageable) {
return schTeacherService.searchSchTeacher(curRole.getSchId(),groupId,keyword,pageable);
return schTeacherService.searchSchTeacher(UserContext.getSchId(),groupId,keyword,pageable);
}
@GetMapping("searchTransferOut")
@@ -59,29 +56,29 @@ public class SchTeacherController extends BaseController {
}
@PostMapping("save")
public void saveTeacher(BoaUser authUserWithDept, UserSysRole curRole, @Valid @RequestBody SchTeacherDTO model) {
schTeacherService.saveTeacher(UserContext.getCurrentUserInfo(),model);
public void saveTeacher(@Valid @RequestBody SchTeacherDTO model) {
schTeacherService.saveTeacher(UserContext.getCurrentUser(),model);
}
@PostMapping("delete/{ids}")
public void deleteTeacher(BoaUser authUserWithDept, UserSysRole curRole,@PathVariable String ids ) {
schTeacherService.deleteTeacher(UserContext.getCurrentUserInfo(),ids);
public void deleteTeacher(@PathVariable String ids ) {
schTeacherService.deleteTeacher(UserContext.getCurrentUser(),ids);
}
@PostMapping("moveGroup")
public void moveGroup(BoaUser authUserWithDept, UserSysRole curRole,@Valid @RequestBody TeaTransferGroupDTO model) {
schTeacherService.moveGroup(UserContext.getCurrentUserInfo(),model);
public void moveGroup(@Valid @RequestBody TeaTransferGroupDTO model) {
schTeacherService.moveGroup(UserContext.getCurrentUser(),model);
}
@PostMapping("setStatus")
public void setTeacherStatus(BoaUser authUserWithDept, UserSysRole curRole, String ids,Integer status){
schTeacherService.setTeacherStatus(UserContext.getCurrentUserInfo(),ids,status);
public void setTeacherStatus(String ids,Integer status){
schTeacherService.setTeacherStatus(UserContext.getCurrentUser(),ids,status);
}
@GetMapping("groupSelect") // 当前用户
public List<SelectIntVO> toTeacherGroupSelect(UserSysRole curRole) {
return schTeacherService.toTeacherGroupSelect(curRole.getSchId());
public List<SelectIntVO> toTeacherGroupSelect() {
return schTeacherService.toTeacherGroupSelect(UserContext.getSchId());
}
@GetMapping("groupSelectBySchId")
@@ -90,8 +87,8 @@ public class SchTeacherController extends BaseController {
}
@GetMapping("select")
public List<SelectIntVO> toIdAndNameSelect(UserSysRole curRole,@RequestParam(required = false) Integer groupId) {
return schTeacherService.toIdAndNameSelect(groupId,curRole.getSchId());
public List<SelectIntVO> toIdAndNameSelect(@RequestParam(required = false) Integer groupId) {
return schTeacherService.toIdAndNameSelect(groupId,UserContext.getSchId());
}
@GetMapping("transferOutSchSelect")
@@ -101,22 +98,22 @@ public class SchTeacherController extends BaseController {
@PostMapping("setTransferOut/{ids}")
public void setTransferOut(BoaUser authUserWithDept, UserSysRole curRole,@PathVariable String ids){
schTeacherService.setTransferOut(UserContext.getCurrentUserInfo(),ids);
public void setTransferOut(@PathVariable String ids){
schTeacherService.setTransferOut(UserContext.getCurrentUser(),ids);
}
@PostMapping("setTransferIn")
public void setTransferIn(BoaUser authUserWithDept, UserSysRole curRole,@Valid @RequestBody TeaTransferInGroupDTO model) {
schTeacherService.setTransferIn(UserContext.getCurrentUserInfo(),model);
public void setTransferIn(@Valid @RequestBody TeaTransferInGroupDTO model) {
schTeacherService.setTransferIn(UserContext.getCurrentUser(),model);
}
@GetMapping("downloadTemplate")
public void downloadTemplate(UserSysRole curRole,HttpServletResponse response) {
public void downloadTemplate(HttpServletResponse response) {
List<TeacherExcelColumn> list=new ArrayList<>();
String fileName="教师导入模板";
String titleName ="教师信息导入" ;
ExportParams exportParams = new ExportParams(titleName, "");
List<SelectIntVO> teaGroupNameList = comSchTreeService.getTeaGroupNameList(curRole.getSchId(),null);
List<SelectIntVO> teaGroupNameList = comSchTreeService.getTeaGroupNameList(UserContext.getSchId(),null);
for (SelectIntVO group:teaGroupNameList)
{
TeacherExcelColumn column=new TeacherExcelColumn();
@@ -134,8 +131,8 @@ public class SchTeacherController extends BaseController {
}
@PostMapping("importTeachers")
public void importTeachers(BoaUser authUserWithDept, UserSysRole curRole,@RequestPart("file") MultipartFile file) {
schTeacherService.importTeachers(UserContext.getCurrentUserInfo(),file);
public void importTeachers(@RequestPart("file") MultipartFile file) {
schTeacherService.importTeachers(UserContext.getCurrentUser(),file);
}