|
@@ -1,18 +1,16 @@
|
|
|
package com.ssj.api.controller;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
-import com.ssj.api.domain.vo.merchant.ServiceVo;
|
|
|
-import com.ssj.api.domain.vo.teacher.teacherAddReq;
|
|
|
-import com.ssj.api.domain.vo.teacher.teacherDelReq;
|
|
|
-import com.ssj.api.domain.vo.teacher.teacherReq;
|
|
|
-import com.ssj.api.security.annotation.IgnoreSecurity;
|
|
|
-import com.ssj.bean.sys.fx.domain.Merchant;
|
|
|
+import com.ssj.api.domain.vo.teacher.TeacherAddReq;
|
|
|
+import com.ssj.api.domain.vo.teacher.TeacherChangeReq;
|
|
|
+import com.ssj.api.domain.vo.teacher.TeacherDelReq;
|
|
|
+import com.ssj.api.domain.vo.teacher.TeacherReq;
|
|
|
import com.ssj.bean.sys.imlibuser.TbClassTeacherTemp;
|
|
|
import com.ssj.bean.weixin.libmy.domain.TbLibManager;
|
|
|
import com.ssj.framework.core.common.controller.BaseController;
|
|
|
+import com.ssj.framework.core.util.Constant;
|
|
|
import com.ssj.framework.core.util.ResponseConstant;
|
|
|
import com.ssj.framework.core.util.ResponseEntity;
|
|
|
-import com.ssj.service.sys.fx.service.MerchantService;
|
|
|
import com.ssj.service.sys.homework.service.HomeworkPictureService;
|
|
|
import com.ssj.service.sys.imlibuser.service.TbClassTeacherTempService;
|
|
|
import com.ssj.service.weixin.library.service.IBookManagerService;
|
|
@@ -23,8 +21,6 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.data.domain.Page;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
-import java.text.DateFormat;
|
|
|
-import java.text.SimpleDateFormat;
|
|
|
import java.util.*;
|
|
|
|
|
|
@Api(value = "平台批改老师相关", tags = "平台批改老师相关")
|
|
@@ -47,7 +43,7 @@ public class ApiManagerTeacherController extends BaseController {
|
|
|
|
|
|
@RequestMapping(value = "/list", method = RequestMethod.POST)
|
|
|
@ApiOperation(value = "获取平台批改老师列表接口", notes = "获取平台批改老师列表接口")
|
|
|
- public ResponseEntity list(@RequestParam(name = "accessToken") String accessToken,@RequestBody teacherReq req) {
|
|
|
+ public ResponseEntity list(@RequestParam(name = "accessToken") String accessToken,@RequestBody TeacherReq req) {
|
|
|
ResponseEntity responseEntity = new ResponseEntity();
|
|
|
Map<String,Object> data=new HashMap<>(2);
|
|
|
Map<String,Object> params=new HashMap<>(2);
|
|
@@ -70,7 +66,7 @@ public class ApiManagerTeacherController extends BaseController {
|
|
|
|
|
|
@RequestMapping(value = "/delTeacher", method = RequestMethod.POST)
|
|
|
@ApiOperation(value = "注销平台批改老师接口", notes = "注销平台批改老师接口")
|
|
|
- public ResponseEntity delTeacher(@RequestParam(name = "accessToken") String accessToken,@RequestBody teacherDelReq req) {
|
|
|
+ public ResponseEntity delTeacher(@RequestParam(name = "accessToken") String accessToken,@RequestBody TeacherDelReq req) {
|
|
|
ResponseEntity responseEntity = new ResponseEntity();
|
|
|
try {
|
|
|
//查询老师是否有作业未批改
|
|
@@ -115,7 +111,7 @@ public class ApiManagerTeacherController extends BaseController {
|
|
|
|
|
|
@RequestMapping(value = "/addTeacher", method = RequestMethod.POST)
|
|
|
@ApiOperation(value = "添加平台批改老师接口", notes = "添加平台批改老师接口")
|
|
|
- public ResponseEntity addTeacher(@RequestParam(name = "accessToken") String accessToken,@RequestBody teacherAddReq req) {
|
|
|
+ public ResponseEntity addTeacher(@RequestParam(name = "accessToken") String accessToken,@RequestBody TeacherAddReq req) {
|
|
|
ResponseEntity responseEntity = new ResponseEntity();
|
|
|
|
|
|
String userId = tokenManager.getUserId(accessToken);
|
|
@@ -132,6 +128,7 @@ public class ApiManagerTeacherController extends BaseController {
|
|
|
tbLibImTeacherTemp.setTeacherName(req.getName());
|
|
|
tbLibImTeacherTemp.setTeacherPhone(req.getMobile());
|
|
|
tbLibImTeacherTemp.setSubject(req.getCourseName());
|
|
|
+ tbLibImTeacherTemp.setInspectorId(req.getTeacherId());
|
|
|
tbLibImTeacherTemp.setIsCorrect(1);
|
|
|
List<TbClassTeacherTemp> list = new ArrayList<>();
|
|
|
list.add(tbLibImTeacherTemp);
|
|
@@ -149,4 +146,48 @@ public class ApiManagerTeacherController extends BaseController {
|
|
|
return responseEntity;
|
|
|
}
|
|
|
|
|
|
+ @RequestMapping(value = "/checkList", method = RequestMethod.POST)
|
|
|
+ @ApiOperation(value = "获取质检员老师列表接口", notes = "获取质检员老师列表接口")
|
|
|
+ public ResponseEntity checkList(@RequestParam(name = "accessToken") String accessToken) {
|
|
|
+ ResponseEntity responseEntity = new ResponseEntity();
|
|
|
+ Map<String,Object> data=new HashMap<>(2);
|
|
|
+ try {
|
|
|
+ List<TbLibManager> managerList = managerService.findByType(Constant.ALL_TEACHER_TYPE);
|
|
|
+ List<Map<String, Object>> list = new ArrayList<>();
|
|
|
+ managerList.forEach(o->{
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
+ map.put("teacherId",o.getUserId());
|
|
|
+ map.put("teacherName",o.getName());
|
|
|
+ list.add(map);
|
|
|
+ });
|
|
|
+ data.put("list",list);
|
|
|
+ responseEntity.success(data,"获取平台批改老师列表成功!");
|
|
|
+ } catch (Exception e) {
|
|
|
+ logger.error("获取质检员老师列表接口异常", e);
|
|
|
+ responseEntity.failure(ResponseConstant.CODE_500, "系统繁忙,请稍后重试");
|
|
|
+ }
|
|
|
+ return responseEntity;
|
|
|
+ }
|
|
|
+ @RequestMapping(value = "/changeInspector", method = RequestMethod.POST)
|
|
|
+ @ApiOperation(value = "更改老师所属质检员", notes = "更改老师所属质检员")
|
|
|
+ public ResponseEntity changeInspector(@RequestParam(name = "accessToken") String accessToken,@RequestBody TeacherChangeReq req) {
|
|
|
+ ResponseEntity responseEntity = new ResponseEntity();
|
|
|
+ Map<String,Object> data=new HashMap<>(2);
|
|
|
+ try {
|
|
|
+ TbLibManager manager = managerService.getById(req.getId());
|
|
|
+ if(Objects.isNull(manager)){
|
|
|
+ responseEntity.failure(ResponseConstant.CODE_000, "老师数据不存在!");
|
|
|
+ return responseEntity;
|
|
|
+ }
|
|
|
+ manager.setInspectorId(req.getTeacherId());
|
|
|
+ managerService.save(manager);
|
|
|
+ responseEntity.success(data,"更改成功!");
|
|
|
+ } catch (Exception e) {
|
|
|
+ logger.error("更改老师所属质检员异常", e);
|
|
|
+ responseEntity.failure(ResponseConstant.CODE_500, "系统繁忙,请稍后重试");
|
|
|
+ }
|
|
|
+ logger.info("第三方调用接口【/open/api/teacher/changeInspector】,接收参数:"+JSONObject.toJSONString(req));
|
|
|
+ return responseEntity;
|
|
|
+ }
|
|
|
+
|
|
|
}
|