From 1da190e7f267bcd3501884f3aeaac7476850fec7 Mon Sep 17 00:00:00 2001
From: EricsHu <hrr145632>
Date: 星期日, 26 十一月 2023 17:53:03 +0800
Subject: [PATCH] 优化菜单查询

---
 src/main/java/com/qxueyou/scc/controller/ClassController.java |  624 +++++++++++++++++++++++++++++---------------------------
 1 files changed, 322 insertions(+), 302 deletions(-)

diff --git a/src/main/java/com/qxueyou/scc/controller/ClassController.java b/src/main/java/com/qxueyou/scc/controller/ClassController.java
index 0a8d67c..e755e93 100644
--- a/src/main/java/com/qxueyou/scc/controller/ClassController.java
+++ b/src/main/java/com/qxueyou/scc/controller/ClassController.java
@@ -8,17 +8,12 @@
 import java.util.List;
 import java.util.Map;
 
+import com.qxueyou.scc.teach.student.model.StuStudent;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
 import org.springframework.beans.factory.annotation.Autowired;
-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.RequestMethod;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.ResponseBody;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 import com.qxueyou.scc.admin.classes.model.ClsClass;
 import com.qxueyou.scc.admin.classes.model.ClsSubjectChapter;
@@ -42,12 +37,13 @@
 import io.swagger.annotations.ApiOperation;
 
 /**
- * 班级管理控制器
+ * 鐝骇绠$悊鎺у埗鍣�
  *
  * @author chenjunliang
  */
-@Api(tags="班级管理接口")
+@Api(tags = "鐝骇绠$悊鎺ュ彛")
 @RestController
+@CrossOrigin
 @RequestMapping("/admin/class")
 public class ClassController {
 
@@ -65,280 +61,289 @@
     @Autowired
     ITeacherService teacherService;
 
-	@Autowired
-	IClassLectureService clsLectureService;
+    @Autowired
+    IClassLectureService clsLectureService;
 
-    //---------------------------------------------------------------------------------app接口--------------------------------------------------------------------------------------------------------------------/
     /**
-     * 获取正常班级列表
+     * 鑾峰彇姝e父鐝骇鍒楄〃
      *
      * @param keyword
      * @param limit
      * @param pageNum
      * @return
      */
-    @ApiOperation(value = "获取正常班级列表", notes = "")
-	@GetMapping(value = "/app/classList")
+    @ApiOperation(value = "鑾峰彇瀛︾敓璇︽儏鎺ュ彛", notes = "")
+    @GetMapping(value = "/student/getStudentDetails")
+    public Result getStudentDetails() {
+
+        StuStudent stu = this.studentService.getStudentDetails(ClientUtils.getUserId());
+        return new Result(true, "success", stu);
+    }
+    //---------------------------------------------------------------------------------app鎺ュ彛--------------------------------------------------------------------------------------------------------------------/
+
+    /**
+     * 鑾峰彇姝e父鐝骇鍒楄〃
+     *
+     * @param keyword
+     * @param limit
+     * @param pageNum
+     * @return
+     */
+    @ApiOperation(value = "鑾峰彇姝e父鐝骇鍒楄〃", notes = "")
+    @GetMapping(value = "/app/classList")
     public Result classList(@RequestParam(defaultValue = "") String keyword, Pager pager) {
         return this.classService.classList(keyword, pager, 1);
     }
 
     /**
-     * 获取历史班级列表
+     * 鑾峰彇鍘嗗彶鐝骇鍒楄〃
      *
      * @param keyword
      * @param limit
      * @param pageNum
      * @return
      */
-    @ApiOperation(value = "获取历史班级列表", notes = "")
-	@GetMapping(value = "/app/historyClassList")
+    @ApiOperation(value = "鑾峰彇鍘嗗彶鐝骇鍒楄〃", notes = "")
+    @GetMapping(value = "/app/historyClassList")
     public Result historyClassList(@RequestParam(defaultValue = "") String keyword, Pager pager) {
         return this.classService.classList(keyword, pager, 2);
     }
 
     /**
-     * 学员详情
+     * 瀛﹀憳璇︽儏
      *
      * @param classId
      * @param studentId
      * @return
      */
-    @ApiOperation(value = "学员详情", notes = "")
+    @ApiOperation(value = "瀛﹀憳璇︽儏", notes = "")
     @ApiImplicitParams({
-        @ApiImplicitParam(name = "studentId", value = "学员id", required = true, paramType="query", dataType = "String"),
-        @ApiImplicitParam(name = "classId", value = "班级id", required = true, paramType="query", dataType = "String"),
+            @ApiImplicitParam(name = "studentId", value = "瀛﹀憳id", required = true, paramType = "query", dataType = "String"),
+            @ApiImplicitParam(name = "classId", value = "鐝骇id", required = true, paramType = "query", dataType = "String"),
     })
-   	@GetMapping(value = "/app/studentInfo")
-   	public Result studentInfo(String classId, String studentId) {
-   		return this.studentService.queryStudent(classId, studentId);
-   	}
-
-    /**
-     * 学员详情
-     *
-     * @param classId
-     * @param studentId
-     * @return
-     */
-    @ApiOperation(value = "学员学习进度", notes = "")
-    @ApiImplicitParams({
-        @ApiImplicitParam(name = "studentId", value = "学员id", required = true, paramType="query", dataType = "String"),
-        @ApiImplicitParam(name = "classId", value = "班级id", required = true, paramType="query", dataType = "String"),
-    })
-   	@GetMapping(value = "/app/studentProgress")
-   	public Result studentProgress(String classId, String studentId) {
-   		return this.studentService.studentProgress(classId, studentId);
-   	}
-
-   	/**
-   	 * 获取首页数据排行
-   	 *
-   	 *
-   	 * @param subjectId
-   	 */
-       @ApiOperation(value = "班级排行榜", notes = "")
-       @ApiImplicitParams({
-           @ApiImplicitParam(name = "classId", value = "班级id", required = true, paramType="query", dataType = "String"),
-       })
-   	@GetMapping(value = "/app/getDataDesc")
-   	public Result getDataDesc(String classId, String subjectId) {
-   		return subjectService.getDataDesc(classId, subjectId);
-   	}
-
-    /**
-     * 学员课程进度
-     *
-     *
-     * @param subjectId
-    */
-    @ApiOperation(value = "学员课程进度", notes = "")
-   	@ApiImplicitParams({
-	   	@ApiImplicitParam(name = "classId", value = "班级id", required = true, paramType="query", dataType = "String"),
-	   	@ApiImplicitParam(name = "subjectId", value = "课程id", required = true, paramType="query", dataType = "String"),
-	   	@ApiImplicitParam(name = "studentId", value = "学员id", required = true, paramType="query", dataType = "String"),
-   	})
-   	@GetMapping(value = "/app/studentSubjectProgress")
-   	public Result studentSubjectProgress(String classId, String subjectId, String studentId) {
-
-	   	return new Result(true, "success", CollectionUtils.newObjectMap("homework", this.subjectService.studentSubjectHomeworkProgress(classId, subjectId, studentId),
-	   			"exam", this.subjectService.studentSubjectExamProgress(classId, subjectId, studentId)));
-   	}
-
-    /**
-     * 班级学员课程总体进度
-     *
-     *
-     * @param classId
-    */
-    @ApiOperation(value = "班级学员课程总体进度", notes = "")
-   	@ApiImplicitParams({
-	   	@ApiImplicitParam(name = "classId", value = "班级id", required = true, paramType="query", dataType = "String"),
-   	})
-   	@GetMapping(value = "/app/studentAllSubjectProgress")
-   	public Result studentSubjectProgress(String classId) {
-    	if(StringUtils.isEmpty(classId)) {
-    		return new Result(false, "班级id参数不能为空");
-    	}
-	   	return new Result(true, "success", CollectionUtils.newObjectMap("subjectList", this.subjectService.studentSubjectProgress(classId, new Pager())));
-   	}
-
-    /**
-     * 班级学员课件总体进度
-     *
-     *
-     * @param classId
-     */
-    @ApiOperation(value = "班级学员课件总体进度", notes = "")
-    @ApiImplicitParams({
-    	@ApiImplicitParam(name = "classId", value = "班级id", required = true, paramType="query", dataType = "String"),
-    	@ApiImplicitParam(name = "subjectId", value = "课程id", required = true, paramType="query", dataType = "String"),
-    })
-    @GetMapping(value = "/app/studentSubjectLectureProgress")
-    public Result studentSubjectLectureProgress(String classId, String subjectId) {
-    	if(StringUtils.isEmpty(classId)) {
-    		return new Result(false, "班级id参数不能为空");
-    	}
-    	if(StringUtils.isEmpty(subjectId)) {
-    		return new Result(false, "课程id参数不能为空");
-    	}
-
-    	//获取所有课件
-		List<Map<String, Object>> lectures = this.subjectService.studentSubjectLectureProgress(subjectId, classId);
-		//获取所以章节
-		List<ClsSubjectChapter> chapterLst = clsLectureService.getChapterLectures(clsLectureService.getListChapter(classId, subjectId, null), lectures);
-
-		return new Result(true, "success", CollectionUtils.newObjectMap("count",clsLectureService.stuLectureCountBySubject(subjectId, classId), "listData", QBeanUtils.listBean2ListMap(chapterLst,
-				CollectionUtils.newStringMap("name", "name", "chapterId", "chapterId", "lectures", "lectures"))));
+    @GetMapping(value = "/app/studentInfo")
+    public Result studentInfo(String classId, String studentId) {
+        return this.studentService.queryStudent(classId, studentId);
     }
 
     /**
-     * 学员注册
+     * 瀛﹀憳璇︽儏
      *
-     * @param name          学员名称
-     * @param studentNumber 学号
-     * @param sex           性别
-     * @param mobilePhone   手机号
+     * @param classId
+     * @param studentId
+     * @return
      */
-    @ApiOperation(value = "app端学员注册接口", notes = "")
-   	@ApiImplicitParams({
-	   	@ApiImplicitParam(name = "name", value = "名称", required = true, paramType="query", dataType = "String"),
-	   	@ApiImplicitParam(name = "studentNumber", value = "学号", required = true, paramType="query", dataType = "String"),
-	   	@ApiImplicitParam(name = "sex", value = "性别(0女,1男)", required = true, paramType="query", dataType = "String"),
-	   	@ApiImplicitParam(name = "mobilePhone", value = "手机号", required = false, paramType="query", dataType = "String"),
-	   	@ApiImplicitParam(name = "orgId", value = "机构", required = true, paramType="query", dataType = "String"),
-   	})
+    @ApiOperation(value = "瀛﹀憳瀛︿範杩涘害", notes = "")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "studentId", value = "瀛﹀憳id", required = true, paramType = "query", dataType = "String"),
+            @ApiImplicitParam(name = "classId", value = "鐝骇id", required = true, paramType = "query", dataType = "String"),
+    })
+    @GetMapping(value = "/app/studentProgress")
+    public Result studentProgress(String classId, String studentId) {
+        return this.studentService.studentProgress(classId, studentId);
+    }
+
+    /**
+     * 鑾峰彇棣栭〉鏁版嵁鎺掕
+     *
+     * @param subjectId
+     */
+    @ApiOperation(value = "鐝骇鎺掕姒�", notes = "")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "classId", value = "鐝骇id", required = true, paramType = "query", dataType = "String"),
+    })
+    @GetMapping(value = "/app/getDataDesc")
+    public Result getDataDesc(String classId, String subjectId) {
+        return subjectService.getDataDesc(classId, subjectId);
+    }
+
+    /**
+     * 瀛﹀憳璇剧▼杩涘害
+     *
+     * @param subjectId
+     */
+    @ApiOperation(value = "瀛﹀憳璇剧▼杩涘害", notes = "")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "classId", value = "鐝骇id", required = true, paramType = "query", dataType = "String"),
+            @ApiImplicitParam(name = "subjectId", value = "璇剧▼id", required = true, paramType = "query", dataType = "String"),
+            @ApiImplicitParam(name = "studentId", value = "瀛﹀憳id", required = true, paramType = "query", dataType = "String"),
+    })
+    @GetMapping(value = "/app/studentSubjectProgress")
+    public Result studentSubjectProgress(String classId, String subjectId, String studentId) {
+
+        return new Result(true, "success", CollectionUtils.newObjectMap("homework", this.subjectService.studentSubjectHomeworkProgress(classId, subjectId, studentId),
+                "exam", this.subjectService.studentSubjectExamProgress(classId, subjectId, studentId)));
+    }
+
+    /**
+     * 鐝骇瀛﹀憳璇剧▼鎬讳綋杩涘害
+     *
+     * @param classId
+     */
+    @ApiOperation(value = "鐝骇瀛﹀憳璇剧▼鎬讳綋杩涘害", notes = "")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "classId", value = "鐝骇id", required = true, paramType = "query", dataType = "String"),
+    })
+    @GetMapping(value = "/app/studentAllSubjectProgress")
+    public Result studentSubjectProgress(String classId) {
+        if (StringUtils.isEmpty(classId)) {
+            return new Result(false, "鐝骇id鍙傛暟涓嶈兘涓虹┖");
+        }
+        return new Result(true, "success", CollectionUtils.newObjectMap("subjectList", this.subjectService.studentSubjectProgress(classId, new Pager())));
+    }
+
+    /**
+     * 鐝骇瀛﹀憳璇句欢鎬讳綋杩涘害
+     *
+     * @param classId
+     */
+    @ApiOperation(value = "鐝骇瀛﹀憳璇句欢鎬讳綋杩涘害", notes = "")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "classId", value = "鐝骇id", required = true, paramType = "query", dataType = "String"),
+            @ApiImplicitParam(name = "subjectId", value = "璇剧▼id", required = true, paramType = "query", dataType = "String"),
+    })
+    @GetMapping(value = "/app/studentSubjectLectureProgress")
+    public Result studentSubjectLectureProgress(String classId, String subjectId) {
+        if (StringUtils.isEmpty(classId)) {
+            return new Result(false, "鐝骇id鍙傛暟涓嶈兘涓虹┖");
+        }
+        if (StringUtils.isEmpty(subjectId)) {
+            return new Result(false, "璇剧▼id鍙傛暟涓嶈兘涓虹┖");
+        }
+
+        //鑾峰彇鎵�鏈夎浠�
+        List<Map<String, Object>> lectures = this.subjectService.studentSubjectLectureProgress(subjectId, classId);
+        //鑾峰彇鎵�浠ョ珷鑺�
+        List<ClsSubjectChapter> chapterLst = clsLectureService.getChapterLectures(clsLectureService.getListChapter(classId, subjectId, null), lectures);
+
+        return new Result(true, "success", CollectionUtils.newObjectMap("count", clsLectureService.stuLectureCountBySubject(subjectId, classId), "listData", QBeanUtils.listBean2ListMap(chapterLst,
+                CollectionUtils.newStringMap("name", "name", "chapterId", "chapterId", "lectures", "lectures"))));
+    }
+
+    /**
+     * 瀛﹀憳娉ㄥ唽
+     *
+     * @param name          瀛﹀憳鍚嶇О
+     * @param studentNumber 瀛﹀彿
+     * @param sex           鎬у埆
+     * @param mobilePhone   鎵嬫満鍙�
+     */
+    @ApiOperation(value = "app绔鍛樻敞鍐屾帴鍙�", notes = "")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "name", value = "鍚嶇О", required = true, paramType = "query", dataType = "String"),
+            @ApiImplicitParam(name = "studentNumber", value = "瀛﹀彿", required = true, paramType = "query", dataType = "String"),
+            @ApiImplicitParam(name = "sex", value = "鎬у埆(0濂筹紝1鐢�)", required = true, paramType = "query", dataType = "String"),
+            @ApiImplicitParam(name = "mobilePhone", value = "鎵嬫満鍙�", required = false, paramType = "query", dataType = "String"),
+            @ApiImplicitParam(name = "orgId", value = "鏈烘瀯", required = true, paramType = "query", dataType = "String"),
+    })
     @PostMapping(value = "/app/studentRegister")
     public Result studentRegister(String name, String studentNumber, Boolean sex, String mobilePhone, String orgId) {
         return studentService.insertStudent(null, name, studentNumber, sex, mobilePhone, orgId);
     }
 
-    //---------------------------------------------------------------------------------app接口--------------------------------------------------------------------------------------------------------------------/
+    //---------------------------------------------------------------------------------app鎺ュ彛--------------------------------------------------------------------------------------------------------------------/
 
 
     /**
-     * 新增班级
+     * 鏂板鐝骇
      *
-     * @param className   班级名称
-     * @param classNumber 班级编码
-     * @param startTime   开班时间
-     * @param endTime     结束时间
-     * @param subjectId   课程id
+     * @param className   鐝骇鍚嶇О
+     * @param classNumber 鐝骇缂栫爜
+     * @param startTime   寮�鐝椂闂�
+     * @param endTime     缁撴潫鏃堕棿
+     * @param subjectId   璇剧▼id
      */
     @PostMapping(value = "add")
     public Result add(String className, String classNumber, String startTime, String endTime, String subjectId,
-                      String teacherId) {
+                      String teacherId, String chargeClassName) {
         try {
-        	return classService.insertClass(className, classNumber, DateUtils.convertStringToDate(startTime),
-                    DateUtils.convertStringToDate(endTime), subjectId, teacherId);
+            return classService.insertClass(className, classNumber, DateUtils.convertStringToDate(startTime),
+                    DateUtils.convertStringToDate(endTime), subjectId, teacherId, chargeClassName);
 
         } catch (ParseException e) {
             log.error(e, e);
-            return new Result(false, "日期参数错误");
+            return new Result(false, "鏃ユ湡鍙傛暟閿欒");
         }
     }
+
     /**
-     * 新增补考分组
-     * @param className   班级名称
-     * @param classNumber 班级编码
-     * @param startTime   开班时间
-     * @param endTime     结束时间
-     * @param subjectId   课程id
+     * 鏂板琛ヨ�冨垎缁�
+     *
+     * @param className   鐝骇鍚嶇О
+     * @param classNumber 鐝骇缂栫爜
+     * @param startTime   寮�鐝椂闂�
+     * @param endTime     缁撴潫鏃堕棿
+     * @param subjectId   璇剧▼id
      */
     @PostMapping(value = "addRe")
     public Result addRe(String className, String classNumber, String startTime, String endTime, String subjectId,
-                      String teacherId,String classTypes) {
+                        String teacherId, String classTypes) {
         try {
-			ClsClass reClass = classService.getReClass("1");
-        	//如果补考类型分组不存在,新增
-			if (reClass==null){
-				return classService.insertReClass(className, classNumber, DateUtils.convertStringToDate(startTime),
-						DateUtils.convertStringToDate(endTime), subjectId, teacherId,classTypes);
-			}else {
-				//存在返回false
-				return new Result(false, "补考分组已存在");
-			}
+            ClsClass reClass = classService.getReClass("1");
+            //濡傛灉琛ヨ�冪被鍨嬪垎缁勪笉瀛樺湪锛屾柊澧�
+            if (reClass == null) {
+                return classService.insertReClass(className, classNumber, DateUtils.convertStringToDate(startTime),
+                        DateUtils.convertStringToDate(endTime), subjectId, teacherId, classTypes);
+            } else {
+                //瀛樺湪杩斿洖false
+                return new Result(false, "琛ヨ�冨垎缁勫凡瀛樺湪");
+            }
         } catch (ParseException e) {
             log.error(e, e);
-            return new Result(false, "日期参数错误");
+            return new Result(false, "鏃ユ湡鍙傛暟閿欒");
         }
     }
 
     /**
-     * 新增班级获取课程列表
+     * 鏂板鐝骇鑾峰彇璇剧▼鍒楄〃
      */
     @GetMapping(value = "getSubjectLst")
     public Result getSubjectlst() {
 
-        List<Subject> subjectLst = subjectService.list("", null, "",Subject.TYPE_ORG_SUBJECT, 1000, 1);
+        List<Subject> subjectLst = subjectService.list("", null, "", Subject.TYPE_ORG_SUBJECT, 1000, 1);
 
         return new Result(true, "success", QBeanUtils.listBean2ListMap(subjectLst,
                 CollectionUtils.newStringMap("name", "subjectName", "subjectId", "subjectId")));
     }
 
     /**
-     * 获取班级列表
+     * 鑾峰彇鐝骇鍒楄〃
      *
      * @param keyword
      * @param limit
      * @param pageNum
      * @return
      */
-    @ApiOperation(value = "获取班级列表", notes = "")
-    @SuppressWarnings({ "unchecked", "rawtypes" })
-	@GetMapping(value = "list")
+    @ApiOperation(value = "鑾峰彇鐝骇鍒楄〃", notes = "")
+    @SuppressWarnings({"unchecked", "rawtypes"})
+    @GetMapping(value = "list")
     public Result list(@RequestParam(defaultValue = "") String keyword,
-                       @RequestParam(defaultValue = "10") Integer limit, @RequestParam(defaultValue = "1") Integer pageNum, @RequestParam(defaultValue = "1")Integer pageType) {
+                       @RequestParam(defaultValue = "10") Integer limit, @RequestParam(defaultValue = "1") Integer pageNum, @RequestParam(defaultValue = "1") Integer pageType) {
 
-//        System.out.println(ClientUtils.getUserId());
-//        System.out.println(ClientUtils.isAdmin());
         String teacherId = ClientUtils.isAdmin() ? null : teacherService.getTeacherIdByUserId(ClientUtils.getUserId());
-//        System.out.println("aaa"+teacherId);
-        // 获取数据
+        // 鑾峰彇鏁版嵁
         List<ClsClass> clsLst = classService.getClassLst(keyword, teacherId, limit, pageNum, pageType);
-//        System.out.println(clsLst);
-        // 获取班级总数
+        // 鑾峰彇鐝骇鎬绘暟
         int count = classService.getClassLstCount(keyword, teacherId, pageType);
-//        System.out.println(count);
-        // 转成前端所需字段和结构
-       List<Map<String, Object>> lstResult = QBeanUtils.listBean2ListMap(clsLst,
-                CollectionUtils.newStringMap("name", "className", "classId", "classId", "classNumber", "classNumber","classTypes","classTypes",
+        // 杞垚鍓嶇鎵�闇�瀛楁鍜岀粨鏋�
+        List<Map<String, Object>> lstResult = QBeanUtils.listBean2ListMap(clsLst,
+                CollectionUtils.newStringMap("name", "className", "classId", "classId", "classNumber", "classNumber", "classTypes", "classTypes",
                         "studentCount", "studentCount", "createTime", "createTime", "startTime", "startTime", "endTime",
-                        "endTime", "subjects", "sbjLst"));
+                        "endTime", "subjects", "sbjLst", "chargeClassName", "chargeClassName", "chargeClassId", "chargeClassId"));
 
-        // 单独处理课程的字段和结构
+        // 鍗曠嫭澶勭悊璇剧▼鐨勫瓧娈靛拰缁撴瀯
         for (Map<String, Object> item : lstResult) {
 
-        	if(item.get("sbjLst")==null){
-        		continue;
+            if (item.get("sbjLst") == null) {
+                continue;
 
-        	}
+            }
 
-        	 item.put("subjectLst",
-                   QBeanUtils.listBean2ListMap(
-                		   this.filtCurrTeacherSubjects((List<Subject>) item.get("sbjLst"),teacherId),
-                           CollectionUtils.newStringMap("subjectId", "subjectId", "name", "subjectName",
-                           		"teacherId","teacherId","teacherName","teacherName","schoolYear","schoolYear","term","term")));
+            item.put("subjectLst",
+                    QBeanUtils.listBean2ListMap(
+                            this.filtCurrTeacherSubjects((List<Subject>) item.get("sbjLst"), teacherId),
+                            CollectionUtils.newStringMap("subjectId", "subjectId", "name", "subjectName",
+                                    "teacherId", "teacherId", "teacherName", "teacherName", "schoolYear", "schoolYear", "term", "term")));
 
             item.remove("sbjLst");
         }
@@ -347,32 +352,32 @@
     }
 
 
-    private List<Subject> filtCurrTeacherSubjects(List<Subject> subjects,String teacherId){
-    	if(StringUtils.isEmpty(teacherId) || subjects==null || subjects.size()==0){
-    		return subjects;
-    	}
+    private List<Subject> filtCurrTeacherSubjects(List<Subject> subjects, String teacherId) {
+        if (StringUtils.isEmpty(teacherId) || subjects == null || subjects.size() == 0) {
+            return subjects;
+        }
 
-    	List<Subject> newSubjects = new ArrayList<Subject>(subjects.size());
+        List<Subject> newSubjects = new ArrayList<Subject>(subjects.size());
 
-    	for(Subject subject:subjects){
-    		if(teacherId.equals(subject.getTeacherId())){
-    			newSubjects.add(subject);
-    		}
-    	}
+        for (Subject subject : subjects) {
+            if (teacherId.equals(subject.getTeacherId())) {
+                newSubjects.add(subject);
+            }
+        }
 
-    	return newSubjects;
+        return newSubjects;
     }
 
 
     /**
-     * 查询班级基本信息
+     * 鏌ヨ鐝骇鍩烘湰淇℃伅
      *
-     * @param classId 班级id
+     * @param classId 鐝骇id
      * @return
      */
-    @ApiOperation(value = "查询班级基本信息", notes = "")
+    @ApiOperation(value = "鏌ヨ鐝骇鍩烘湰淇℃伅", notes = "")
     @ApiImplicitParams({
-        @ApiImplicitParam(name = "classId", value = "班级id", required = true, paramType="query", dataType = "String"),
+            @ApiImplicitParam(name = "classId", value = "鐝骇id", required = true, paramType = "query", dataType = "String"),
     })
     @GetMapping(value = "queryClass")
     public Result findClass(String classId) {
@@ -381,16 +386,16 @@
 
         return new Result(true, "success", QBeanUtils.bean2Map(cls,
                 CollectionUtils.newStringMap("name", "className", "classId", "classId", "classNumber", "classNumber",
-                        "studentCount", "studentCount", "createTime", "createTime", "startTime", "startTime", "endTime","endTime","classTypes",
+                        "studentCount", "studentCount", "createTime", "createTime", "startTime", "startTime", "endTime", "endTime", "classTypes",
                         "classTypes", "subjects", "subjectLst", "needJoinAudit", "needJoinAudit", "needQuitAudit",
                         "needQuitAudit", "showAnalysisAfterExer", "showAnalysisAfterExer", "canMultiExer",
-                        "canMultiExer", "needForum", "needForum", "teacherId", "teacherId")));
+                        "canMultiExer", "needForum", "needForum", "teacherId", "teacherId", "chargeClassName", "chargeClassName")));
     }
 
     /**
-     * 删除班级
+     * 鍒犻櫎鐝骇
      *
-     * @param classId 班级id
+     * @param classId 鐝骇id
      * @return
      */
     @GetMapping("delete")
@@ -401,19 +406,19 @@
     }
 
     /**
-     * 复制班级
+     * 澶嶅埗鐝骇
      *
-     * @param classId               班级id
-     * @param className             班级名称
-     * @param classNumber           班级编码
-     * @param startTime             开班时间
-     * @param endTime               结束时间
+     * @param classId               鐝骇id
+     * @param className             鐝骇鍚嶇О
+     * @param classNumber           鐝骇缂栫爜
+     * @param startTime             寮�鐝椂闂�
+     * @param endTime               缁撴潫鏃堕棿
      * @param subjectId
-     * @param needJoinAudit         是否加班审批
-     * @param needQuitAudit         是否退班审批
-     * @param showAnalysisAfterExer 完成练习后是否显示答案
-     * @param canMultiExer          是否允许重复学习
-     * @param needForum             是否开通论坛
+     * @param needJoinAudit         鏄惁鍔犵彮瀹℃壒
+     * @param needQuitAudit         鏄惁閫�鐝鎵�
+     * @param showAnalysisAfterExer 瀹屾垚缁冧範鍚庢槸鍚︽樉绀虹瓟妗�
+     * @param canMultiExer          鏄惁鍏佽閲嶅瀛︿範
+     * @param needForum             鏄惁寮�閫氳鍧�
      * @return
      */
     @PostMapping(value = "copy")
@@ -424,19 +429,20 @@
     }
 
     /**
-     * 更新班级
+     * 鏇存柊鐝骇
      *
-     * @param classId               班级id
-     * @param className             班级名称
-     * @param classNumber           班级编码
-     * @param startTime             开班时间
-     * @param endTime               结束时间
+     * @param classId               鐝骇id
+     * @param className             鐝骇鍚嶇О
+     * @param classNumber           鐝骇缂栫爜
+     * @param startTime             寮�鐝椂闂�
+     * @param endTime               缁撴潫鏃堕棿
      * @param subjectId
-     * @param needJoinAudit         是否加班审批
-     * @param needQuitAudit         是否退班审批
-     * @param showAnalysisAfterExer 完成练习后是否显示答案
-     * @param canMultiExer          是否允许重复学习
-     * @param needForum             是否开通论坛
+     * @param needJoinAudit         鏄惁鍔犵彮瀹℃壒
+     * @param needQuitAudit         鏄惁閫�鐝鎵�
+     * @param showAnalysisAfterExer 瀹屾垚缁冧範鍚庢槸鍚︽樉绀虹瓟妗�
+     * @param canMultiExer          鏄惁鍏佽閲嶅瀛︿範
+     * @param needForum             鏄惁寮�閫氳鍧�
+     * @param chargeClassName       鐝富浠诲悕绉�
      * @return
      */
     @PostMapping(value = "update")
@@ -445,29 +451,30 @@
                          @RequestParam(defaultValue = "false") Boolean needQuitAudit,
                          @RequestParam(defaultValue = "false") Boolean showAnalysisAfterExer,
                          @RequestParam(defaultValue = "false") Boolean canMultiExer,
-                         @RequestParam(defaultValue = "false") Boolean needForum) {
+                         @RequestParam(defaultValue = "false") Boolean needForum,
+                         String chargeClassName) {
         try {
             return classService.updateClass(classId, className, classNumber, DateUtils.convertStringToDate(startTime),
                     DateUtils.convertStringToDate(endTime), subjectId, needJoinAudit, needQuitAudit,
-                    showAnalysisAfterExer, canMultiExer, needForum, teacherId);
+                    showAnalysisAfterExer, canMultiExer, needForum, teacherId, chargeClassName);
         } catch (ParseException e) {
             log.error(e, e);
-            return new Result(false, "日期参数错误");
+            return new Result(false, "鏃ユ湡鍙傛暟閿欒");
         }
     }
 
     /**
-     * 班级管理 学员管理 获取学员列表
+     * 鐝骇绠$悊 瀛﹀憳绠$悊 鑾峰彇瀛﹀憳鍒楄〃
      *
-     * @param classId 班级id
-     * @param limit   每页显示几条
-     * @param pageNum 页码
-     * @param keyword 搜索关键字
-     * @return 学习状态说明(0, 未开始 。 1, 学习中 。 2, 已结束, 3, 待激活 。 4, 已冻结)
+     * @param classId 鐝骇id
+     * @param limit   姣忛〉鏄剧ず鍑犳潯
+     * @param pageNum 椤电爜
+     * @param keyword 鎼滅储鍏抽敭瀛�
+     * @return 瀛︿範鐘舵�佽鏄�(0, 鏈紑濮� 銆� 1, 瀛︿範涓� 銆� 2, 宸茬粨鏉�, 3, 寰呮縺娲� 銆� 4, 宸插喕缁�)
      */
-    @ApiOperation(value = "获取学员列表", notes = "学习状态说明(0, 未开始 。 1, 学习中 。 2, 已结束, 3, 待激活 。 4, 已冻结)")
+    @ApiOperation(value = "鑾峰彇瀛﹀憳鍒楄〃", notes = "瀛︿範鐘舵�佽鏄�(0, 鏈紑濮� 銆� 1, 瀛︿範涓� 銆� 2, 宸茬粨鏉�, 3, 寰呮縺娲� 銆� 4, 宸插喕缁�)")
     @ApiImplicitParams({
-        @ApiImplicitParam(name = "classId", value = "班级id", required = true, paramType="query", dataType = "String"),
+            @ApiImplicitParam(name = "classId", value = "鐝骇id", required = true, paramType = "query", dataType = "String"),
     })
     @GetMapping(value = "lstStudent4Class")
     public Result lstStudent4Class(String classId, @RequestParam(defaultValue = "10") Integer limit,
@@ -481,9 +488,9 @@
     }
 
     /**
-     * 导入学员
+     * 瀵煎叆瀛﹀憳
      *
-     * @param classId 班级id
+     * @param classId 鐝骇id
      */
     @GetMapping(value = "importStudent")
     public Result importStudent(String classId) {
@@ -491,43 +498,54 @@
     }
 
     /**
-     * 新增学员
+     * 鏂板瀛﹀憳
      *
-     * @param name          学员名称
-     * @param studentNumber 学号
-     * @param classId       班级id
-     * @param sex           性别
-     * @param mobilePhone   手机号
+     * @param name          瀛﹀憳鍚嶇О
+     * @param studentNumber 瀛﹀彿
+     * @param classId       鐝骇id
+     * @param sex           鎬у埆
+     * @param mobilePhone   鎵嬫満鍙�
      */
     @PostMapping(value = "addStudent")
-    public Result addStudent(String classId, String name, String studentNumber, Boolean sex, String mobilePhone,String comName) {
+    public Result addStudent(String classId, String name, String studentNumber, Boolean sex, String mobilePhone, String comName,
+                             String photo, String passporName, String nationality, String ancestralHome, String birthday, String birthplace,
+                             String chinaStatus, String registeredAddress, String homeAddress, String religiousBelief, String email,
+                             String workUnit) {
 
-        return studentService.insertStudent(classId, name, studentNumber, sex, mobilePhone, ClientUtils.getOrgId(),comName);
+        return studentService.insertStudent(classId, name, studentNumber, sex, mobilePhone, ClientUtils.getOrgId(), comName,
+                photo,  passporName,  nationality,  ancestralHome,  birthday,  birthplace,
+                chinaStatus,  registeredAddress,  homeAddress,  religiousBelief,  email,
+                workUnit);
 
     }
 
     /**
-     * 更新学员
+     * 鏇存柊瀛﹀憳
      *
-     * @param name          学员名称
-     * @param studentNumber 学号
-     * @param classId       班级id
-     * @param sex           性别
-     * @param mobilePhone   手机号
+     * @param name          瀛﹀憳鍚嶇О
+     * @param studentNumber 瀛﹀彿
+     * @param classId       鐝骇id
+     * @param sex           鎬у埆
+     * @param mobilePhone   鎵嬫満鍙�
      */
     @PostMapping(value = "updateStudent")
-    public Result updateStudent(String studentId, String name,String password, String studentNumber, Boolean sex, String mobilePhone) {
+    public Result updateStudent(String studentId, String name, String password, String studentNumber, Boolean sex, String mobilePhone,
+                                String photo, String passporName, String nationality, String ancestralHome, String birthday, String birthplace,
+                                String chinaStatus, String registeredAddress, String homeAddress, String religiousBelief, String email,
+                                String workUnit, String graduationDestination) {
 
-        return studentService.updateStudent(studentId, name,password, studentNumber, sex, mobilePhone);
+        return studentService.updateStudent(studentId, name, password, studentNumber, sex, mobilePhone,
+                 photo,  passporName,  nationality,  ancestralHome,  birthday,  birthplace,
+                 chinaStatus,  registeredAddress,  homeAddress,  religiousBelief,  email,
+                 workUnit,  graduationDestination);
 
     }
 
 
-
     /**
-     * 激活学员
+     * 婵�娲诲鍛�
      *
-     * @param studentIds 学员Ids
+     * @param studentIds 瀛﹀憳Ids
      */
     @GetMapping(value = "activateStudent")
     public Result activate(String studentIds) {
@@ -535,9 +553,9 @@
     }
 
     /**
-     * 冻结学员
+     * 鍐荤粨瀛﹀憳
      *
-     * @param studentIds 学员Ids
+     * @param studentIds 瀛﹀憳Ids
      */
     @GetMapping(value = "blockStudent")
     public Result block(String studentIds) {
@@ -545,9 +563,9 @@
     }
 
     /**
-     * 删除学员
+     * 鍒犻櫎瀛﹀憳
      *
-     * @param studentIds 学员Ids
+     * @param studentIds 瀛﹀憳Ids
      */
     @GetMapping(value = "deleteStudent")
     public Result deleteStudent(String classId, String studentIds) {
@@ -555,73 +573,75 @@
     }
 
     /**
-     * 添加班级课程
+     * 娣诲姞鐝骇璇剧▼
+     *
      * @throws InvocationTargetException
      * @throws IllegalAccessException
-     *
      */
     @PostMapping(value = "addClsSubject")
-    public Result addClsSubject(String classId, String origSubjectId,String teacherId,Integer schoolYear ,Integer term) throws IllegalAccessException, InvocationTargetException {
-    	return  this.subjectService.addClsSubject(classId,origSubjectId,teacherId,schoolYear,term);
+    public Result addClsSubject(String classId, String origSubjectId, String teacherId, Integer schoolYear, Integer term) throws IllegalAccessException, InvocationTargetException {
+        return this.subjectService.addClsSubject(classId, origSubjectId, teacherId, schoolYear, term);
     }
 
     /**
-     * 更新班级课程
+     * 鏇存柊鐝骇璇剧▼
      */
     @PostMapping(value = "updateClsSubject")
-    public Result updateClsSubject(String classId,String subjectId, String origSubjectId,String teacherId,Integer schoolYear ,Integer term) {
-    	return this.subjectService.updateClsSubject(classId,subjectId,origSubjectId,teacherId,schoolYear,term);
+    public Result updateClsSubject(String classId, String subjectId, String origSubjectId, String teacherId, Integer schoolYear, Integer term) {
+        return this.subjectService.updateClsSubject(classId, subjectId, origSubjectId, teacherId, schoolYear, term);
     }
 
     /**
-     * 删除班级课程
+     * 鍒犻櫎鐝骇璇剧▼
      */
     @GetMapping(value = "deleteClsSubject")
-    public Result deleteClsSubject(String classId,String subjectIds){
-    	//删除课程及课程班级关联关系
-    	return subjectService.deleteClsSubject(classId,subjectIds.split(","));
+    public Result deleteClsSubject(String classId, String subjectIds) {
+        //鍒犻櫎璇剧▼鍙婅绋嬬彮绾у叧鑱斿叧绯�
+        return subjectService.deleteClsSubject(classId, subjectIds.split(","));
     }
 
     /**
-     * 所有班级列表
-     * @param subjectId 根据subjectId过滤
+     * 鎵�鏈夌彮绾у垪琛�
+     *
+     * @param subjectId 鏍规嵁subjectId杩囨护
      * @return
      */
-	@RequestMapping(value = "/selectlist", method = RequestMethod.GET)
-	public @ResponseBody List<Map<String,Object>> classList() {
-		return classService.queryAllClassIdAndName();
-	}
+    @RequestMapping(value = "/selectlist", method = RequestMethod.GET)
+    public @ResponseBody
+    List<Map<String, Object>> classList() {
+        return classService.queryAllClassIdAndName();
+    }
 
     /**
-     * 获取学员详细信息
+     * 鑾峰彇瀛﹀憳璇︾粏淇℃伅
      *
-     * @param studentId 学员id
-     * @return percent (状态说明:0,未开始。1,学习中。2,已结束。) status (0,未提交。1,已提交)
+     * @param studentId 瀛﹀憳id
+     * @return percent (鐘舵�佽鏄庯細0,鏈紑濮嬨��1,瀛︿範涓��2,宸茬粨鏉熴��) status (0,鏈彁浜ゃ��1,宸叉彁浜�)
      */
     @GetMapping(value = "getStudentDetail")
     public Result getStudentDetail(String studentId) {
-        // 学员信息
-        Map<String, Object> studentDetail = CollectionUtils.newObjectMap("studentName", "李刚", "classNumber", "123456",
+        // 瀛﹀憳淇℃伅
+        Map<String, Object> studentDetail = CollectionUtils.newObjectMap("studentName", "鏉庡垰", "classNumber", "123456",
                 "sex", 1, "registerTime", new Date(), "email", "12345676@qq.com", "mobilePhone", "13611111123",
                 "stuSubjects", 3, "commitExerInfo", 3, "examCount", 3, "releaseTopic", 3, "commentCount", 2);
-        // 学习档案
-        Map<String, Object> subjectOne = CollectionUtils.newObjectMap("subjectName", "物流科学与工程", "percent", 2,
+        // 瀛︿範妗f
+        Map<String, Object> subjectOne = CollectionUtils.newObjectMap("subjectName", "鐗╂祦绉戝涓庡伐绋�", "percent", 2,
                 "studyDuration", 18, "endStudyTime", new Date(), "score", 96.2);
-        Map<String, Object> subjectTwo = CollectionUtils.newObjectMap("subjectName", "物流工程基础", "percent", 1,
+        Map<String, Object> subjectTwo = CollectionUtils.newObjectMap("subjectName", "鐗╂祦宸ョ▼鍩虹", "percent", 1,
                 "studyDuration", 18, "endStudyTime", new Date(), "score", "");
-        Map<String, Object> subjectThree = CollectionUtils.newObjectMap("subjectName", "物流工程基础2", "percent", 0,
+        Map<String, Object> subjectThree = CollectionUtils.newObjectMap("subjectName", "鐗╂祦宸ョ▼鍩虹2", "percent", 0,
                 "studyDuration", "", "endStudyTime", "", "score", "");
-        // 作业记录
-        Map<String, Object> exerOne = CollectionUtils.newObjectMap("exerciseName", "物流科学与工程", "subjectName", "物流科学与工程",
+        // 浣滀笟璁板綍
+        Map<String, Object> exerOne = CollectionUtils.newObjectMap("exerciseName", "鐗╂祦绉戝涓庡伐绋�", "subjectName", "鐗╂祦绉戝涓庡伐绋�",
                 "status", 1, "commitTime", new Date(), "score", 96.2);
-        Map<String, Object> exerTwo = CollectionUtils.newObjectMap("exerciseName", "物流工程基础", "subjectName", "物流工程基础",
+        Map<String, Object> exerTwo = CollectionUtils.newObjectMap("exerciseName", "鐗╂祦宸ョ▼鍩虹", "subjectName", "鐗╂祦宸ョ▼鍩虹",
                 "status", 0, "commitTime", "", "score", "");
-        Map<String, Object> exerThree = CollectionUtils.newObjectMap("exerciseName", "物流工程基础2", "subjectName",
-                "物流工程基础2", "status", 0, "commitTime", "", "score", "");
-        // 考试记录
-        Map<String, Object> examOne = CollectionUtils.newObjectMap("examName", "物流科学与工程", "subjectName", "物流科学与工程",
+        Map<String, Object> exerThree = CollectionUtils.newObjectMap("exerciseName", "鐗╂祦宸ョ▼鍩虹2", "subjectName",
+                "鐗╂祦宸ョ▼鍩虹2", "status", 0, "commitTime", "", "score", "");
+        // 鑰冭瘯璁板綍
+        Map<String, Object> examOne = CollectionUtils.newObjectMap("examName", "鐗╂祦绉戝涓庡伐绋�", "subjectName", "鐗╂祦绉戝涓庡伐绋�",
                 "status", 1, "commintTime", new Date(), "score", 90.6);
-        Map<String, Object> examTwo = CollectionUtils.newObjectMap("examName", "物流科学与工程", "subjectName", "物流科学与工程",
+        Map<String, Object> examTwo = CollectionUtils.newObjectMap("examName", "鐗╂祦绉戝涓庡伐绋�", "subjectName", "鐗╂祦绉戝涓庡伐绋�",
                 "status", 0, "commintTime", new Date(), "score", "");
         return new Result(true, "success",
                 CollectionUtils.newObjectMap("studentDetail", studentDetail, "subjectLst",

--
Gitblit v1.8.0