|
@@ -1,37 +1,26 @@
|
|
|
package com.ym.mec.teacher.controller;
|
|
|
|
|
|
import com.ym.mec.biz.dal.dao.StudentPaymentOrderDao;
|
|
|
-import com.ym.mec.biz.dal.dto.BasicUserDto;
|
|
|
-import com.ym.mec.biz.dal.dto.PageInfoReg;
|
|
|
-import com.ym.mec.biz.dal.dto.RegisterDto;
|
|
|
-import com.ym.mec.biz.dal.dto.TeacherMusicStudentOverViewDto;
|
|
|
+import com.ym.mec.biz.dal.dao.SubjectDao;
|
|
|
+import com.ym.mec.biz.dal.dto.*;
|
|
|
+import com.ym.mec.biz.dal.entity.Teacher;
|
|
|
import com.ym.mec.biz.dal.page.*;
|
|
|
import com.ym.mec.biz.service.*;
|
|
|
+import com.ym.mec.common.controller.BaseController;
|
|
|
import com.ym.mec.common.entity.HttpResponseResult;
|
|
|
import com.ym.mec.common.page.PageInfo;
|
|
|
import com.ym.mec.common.page.QueryInfo;
|
|
|
-import io.swagger.annotations.Api;
|
|
|
-import io.swagger.annotations.ApiImplicitParam;
|
|
|
-import io.swagger.annotations.ApiImplicitParams;
|
|
|
-import io.swagger.annotations.ApiOperation;
|
|
|
-import io.swagger.annotations.ApiParam;
|
|
|
-import java.util.Date;
|
|
|
-import java.util.List;
|
|
|
-import java.util.stream.Collectors;
|
|
|
-
|
|
|
+import io.swagger.annotations.*;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.http.HttpStatus;
|
|
|
-import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
-import com.ym.mec.auth.api.client.SysUserFeignService;
|
|
|
-import com.ym.mec.auth.api.entity.SysUser;
|
|
|
-import com.ym.mec.biz.dal.dao.SubjectDao;
|
|
|
-import com.ym.mec.biz.dal.entity.Teacher;
|
|
|
-import com.ym.mec.common.controller.BaseController;
|
|
|
+
|
|
|
+import java.util.Date;
|
|
|
+import java.util.List;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
@RequestMapping("teacher")
|
|
|
@Api(tags = "教师服务")
|
|
@@ -47,12 +36,10 @@ public class TeacherController extends BaseController {
|
|
|
@Autowired
|
|
|
private ClassGroupService classGroupService;
|
|
|
@Autowired
|
|
|
- private SysUserFeignService sysUserFeignService;
|
|
|
+ private SysUserService sysUserService;
|
|
|
@Autowired
|
|
|
private SubjectDao subjectDao;
|
|
|
@Autowired
|
|
|
- private EmployeeService employeeService;
|
|
|
- @Autowired
|
|
|
private StudentPaymentOrderDao studentPaymentOrderDao;
|
|
|
@Autowired
|
|
|
private StudentRegistrationService studentRegistrationService;
|
|
@@ -60,24 +47,22 @@ public class TeacherController extends BaseController {
|
|
|
@ApiOperation(value = "修改教师个人中心信息")
|
|
|
@PostMapping("/update")
|
|
|
public Object update(Teacher teacher) {
|
|
|
- SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
- if(sysUser == null){
|
|
|
- return failed("获取用户信息失败");
|
|
|
- }
|
|
|
teacher.setUpdateTime(new Date());
|
|
|
- teacher.setId(sysUser.getId());
|
|
|
+ teacher.setId(sysUserService.getUserId());
|
|
|
teacherService.updateTea1(teacher);
|
|
|
return succeed();
|
|
|
}
|
|
|
|
|
|
+ @ApiOperation(value = "获取老师分部列表(包含流动分部)")
|
|
|
+ @GetMapping("/queryOrganList")
|
|
|
+ public HttpResponseResult<List<BaseMapDto<Integer,String>>> queryOrganList() {
|
|
|
+ return succeed(teacherService.queryOrganList(sysUserService.getUserId()));
|
|
|
+ }
|
|
|
+
|
|
|
@ApiOperation(value = "根据教师编号查询教师基本信息")
|
|
|
@GetMapping("/queryUserInfo")
|
|
|
public Object queryUserInfo() {
|
|
|
- SysUser user = sysUserFeignService.queryUserInfo();
|
|
|
- if (user == null) {
|
|
|
- return failed(HttpStatus.FORBIDDEN, "请登录");
|
|
|
- }
|
|
|
- Teacher teacher = teacherService.get(user.getId());
|
|
|
+ Teacher teacher = teacherService.get(sysUserService.getUserId());
|
|
|
//专业技能
|
|
|
if(StringUtils.isNotEmpty(teacher.getSubjectId())){
|
|
|
teacher.setSubjectName(subjectDao.findBySubIds(teacher.getSubjectId()));
|
|
@@ -115,31 +100,19 @@ public class TeacherController extends BaseController {
|
|
|
@ApiOperation(value = "获取教师所有聊天群组")
|
|
|
@GetMapping("/queryTeacherGroups")
|
|
|
public Object queryTeacherGroups(String search){
|
|
|
- SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
- if(sysUser == null){
|
|
|
- return failed("获取用户信息失败");
|
|
|
- }
|
|
|
- return succeed(teacherService.queryTeacherGroups(sysUser.getId(),search));
|
|
|
+ return succeed(teacherService.queryTeacherGroups(sysUserService.getUserId(),search));
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "获取当前教师通讯录列表")
|
|
|
@GetMapping("/queryGroupStudents")
|
|
|
public Object queryGroupStudents(String search){
|
|
|
- SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
- if(sysUser == null){
|
|
|
- return failed("获取用户信息失败");
|
|
|
- }
|
|
|
- return succeed(teacherService.queryGroupStudents(sysUser.getId(),search));
|
|
|
+ return succeed(teacherService.queryGroupStudents(sysUserService.getUserId(),search));
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "获取当前教师通讯录学员列表")
|
|
|
@GetMapping("/queryGroupStudentList")
|
|
|
public Object queryGroupStudentList(String search){
|
|
|
- SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
- if(sysUser == null){
|
|
|
- return failed("获取用户信息失败");
|
|
|
- }
|
|
|
- return succeed(teacherService.queryGroupStudentList(sysUser.getId(),search));
|
|
|
+ return succeed(teacherService.queryGroupStudentList(sysUserService.getUserId(),search));
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "分页查询群公告列表")
|
|
@@ -181,32 +154,10 @@ public class TeacherController extends BaseController {
|
|
|
@ApiImplicitParam(name = "idcardBackImg", value = "身份证背面", required = true, dataType = "String"),
|
|
|
@ApiImplicitParam(name = "idcardHandImg", value = "手持身份证照", required = true, dataType = "String") })
|
|
|
public Object realNameAuthentication(String realName, String idcardNo, String idcardFrontImg, String idcardBackImg, String idcardHandImg) {
|
|
|
- SysUser user = sysUserFeignService.queryUserInfo();
|
|
|
- if (user == null || user.getId() == null) {
|
|
|
- return failed(HttpStatus.FORBIDDEN, "请登录");
|
|
|
- }
|
|
|
- teacherService.realNameAuthentication(user.getId(), realName, idcardNo, idcardFrontImg, idcardBackImg, idcardHandImg);
|
|
|
+ teacherService.realNameAuthentication(sysUserService.getUserId(), realName, idcardNo, idcardFrontImg, idcardBackImg, idcardHandImg);
|
|
|
return succeed();
|
|
|
}
|
|
|
|
|
|
- /*@ApiOperation(value = "获取教务人员")
|
|
|
- @GetMapping("/findEducationUsers")
|
|
|
- public HttpResponseResult findEducationUsers(){
|
|
|
- SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
- if (sysUser == null) {
|
|
|
- return failed(HttpStatus.FORBIDDEN, "请登录");
|
|
|
- }
|
|
|
- String organIds = new String();
|
|
|
- Teacher teacher = teacherService.get(sysUser.getId());
|
|
|
- if (StringUtils.isEmpty(organIds)) {
|
|
|
- organIds = teacher.getTeacherOrganId() + "";
|
|
|
- }
|
|
|
- if(StringUtils.isNotBlank(teacher.getFlowOrganRange())){
|
|
|
- organIds = organIds + "," + teacher.getFlowOrganRange();
|
|
|
- }
|
|
|
- return succeed(employeeService.findByRole("4,5",organIds));
|
|
|
- }*/
|
|
|
-
|
|
|
|
|
|
@ApiOperation(value = "获取报名/预报名列表")
|
|
|
@GetMapping("/getRegisterOrPreList")
|
|
@@ -224,11 +175,7 @@ public class TeacherController extends BaseController {
|
|
|
@ApiOperation(value = "查询教师关联的乐团预览信息")
|
|
|
@GetMapping("/queryTeacherMusicStudentOverView")
|
|
|
public HttpResponseResult<PageInfo<TeacherMusicStudentOverViewDto>> queryTeacherMusicStudentOverView(TeacherServeQueryInfo queryInfo){
|
|
|
- SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
- if (sysUser == null) {
|
|
|
- return failed(HttpStatus.FORBIDDEN, "请登录");
|
|
|
- }
|
|
|
- queryInfo.setTeacherId(sysUser.getId());
|
|
|
+ queryInfo.setTeacherId(sysUserService.getUserId());
|
|
|
return succeed(teacherService.queryTeacherMusicStudentOverView(queryInfo));
|
|
|
}
|
|
|
}
|