From 0ad2f07a292895eeb3b9618eb1e275568c63a59e Mon Sep 17 00:00:00 2001 From: EricsHu <hrr145632> Date: 星期五, 24 十一月 2023 18:09:23 +0800 Subject: [PATCH] 优化直播、添加班级 --- src/main/java/com/qxueyou/scc/teach/student/service/impl/StudentService.java | 39 ++++ src/main/java/com/qxueyou/scc/teach/student/service/IStudentService.java | 11 + src/main/java/com/qxueyou/scc/teach/live/service/impl/MediaLiveService.java | 66 +++++--- src/main/java/com/qxueyou/scc/controller/VideoLiveController.java | 36 ++++ src/main/java/com/qxueyou/scc/teach/res/model/ResFile.java | 2 src/main/java/com/qxueyou/scc/controller/ClassController.java | 290 ++++++++++++++++++----------------- 6 files changed, 272 insertions(+), 172 deletions(-) diff --git a/src/main/java/com/qxueyou/scc/controller/ClassController.java b/src/main/java/com/qxueyou/scc/controller/ClassController.java index 8964ccf..54fcd38 100644 --- a/src/main/java/com/qxueyou/scc/controller/ClassController.java +++ b/src/main/java/com/qxueyou/scc/controller/ClassController.java @@ -40,7 +40,7 @@ * * @author chenjunliang */ -@Api(tags="鐝骇绠$悊鎺ュ彛") +@Api(tags = "鐝骇绠$悊鎺ュ彛") @RestController @CrossOrigin @RequestMapping("/admin/class") @@ -60,10 +60,11 @@ @Autowired ITeacherService teacherService; - @Autowired - IClassLectureService clsLectureService; + @Autowired + IClassLectureService clsLectureService; //---------------------------------------------------------------------------------app鎺ュ彛--------------------------------------------------------------------------------------------------------------------/ + /** * 鑾峰彇姝e父鐝骇鍒楄〃 * @@ -73,7 +74,7 @@ * @return */ @ApiOperation(value = "鑾峰彇姝e父鐝骇鍒楄〃", notes = "") - @GetMapping(value = "/app/classList") + @GetMapping(value = "/app/classList") public Result classList(@RequestParam(defaultValue = "") String keyword, Pager pager) { return this.classService.classList(keyword, pager, 1); } @@ -87,7 +88,7 @@ * @return */ @ApiOperation(value = "鑾峰彇鍘嗗彶鐝骇鍒楄〃", notes = "") - @GetMapping(value = "/app/historyClassList") + @GetMapping(value = "/app/historyClassList") public Result historyClassList(@RequestParam(defaultValue = "") String keyword, Pager pager) { return this.classService.classList(keyword, pager, 2); } @@ -101,13 +102,13 @@ */ @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); - } + @GetMapping(value = "/app/studentInfo") + public Result studentInfo(String classId, String studentId) { + return this.studentService.queryStudent(classId, studentId); + } /** * 瀛﹀憳璇︽儏 @@ -118,93 +119,89 @@ */ @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/studentProgress") - public Result studentProgress(String classId, String studentId) { - return this.studentService.studentProgress(classId, studentId); - } + @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"), + }) + @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) { + @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))); - } + 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()))); - } + @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"), + @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鍙傛暟涓嶈兘涓虹┖"); - } + 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); + //鑾峰彇鎵�鏈夎浠� + 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")))); + return new Result(true, "success", CollectionUtils.newObjectMap("count", clsLectureService.stuLectureCountBySubject(subjectId, classId), "listData", QBeanUtils.listBean2ListMap(chapterLst, + CollectionUtils.newStringMap("name", "name", "chapterId", "chapterId", "lectures", "lectures")))); } /** @@ -216,13 +213,13 @@ * @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"), - }) + @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); @@ -242,18 +239,20 @@ */ @PostMapping(value = "add") public Result add(String className, String classNumber, String startTime, String endTime, String subjectId, - String teacherId,String chargeClassName ) { + String teacherId, String chargeClassName) { try { - return classService.insertClass(className, classNumber, DateUtils.convertStringToDate(startTime), - DateUtils.convertStringToDate(endTime), subjectId, teacherId,chargeClassName); + 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, "鏃ユ湡鍙傛暟閿欒"); } } + /** * 鏂板琛ヨ�冨垎缁� + * * @param className 鐝骇鍚嶇О * @param classNumber 鐝骇缂栫爜 * @param startTime 寮�鐝椂闂� @@ -262,17 +261,17 @@ */ @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, "鏃ユ湡鍙傛暟閿欒"); @@ -285,7 +284,7 @@ @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"))); @@ -300,10 +299,10 @@ * @return */ @ApiOperation(value = "鑾峰彇鐝骇鍒楄〃", notes = "") - @SuppressWarnings({ "unchecked", "rawtypes" }) - @GetMapping(value = "list") + @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) { String teacherId = ClientUtils.isAdmin() ? null : teacherService.getTeacherIdByUserId(ClientUtils.getUserId()); // 鑾峰彇鏁版嵁 @@ -311,24 +310,24 @@ // 鑾峰彇鐝骇鎬绘暟 int count = classService.getClassLstCount(keyword, teacherId, pageType); // 杞垚鍓嶇鎵�闇�瀛楁鍜岀粨鏋� - 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","chargeClassName","chargeClassName","chargeClassId","chargeClassId")); + "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"); } @@ -337,20 +336,20 @@ } - 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; } @@ -362,7 +361,7 @@ */ @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) { @@ -371,10 +370,10 @@ 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","chargeClassName","chargeClassName"))); + "canMultiExer", "needForum", "needForum", "teacherId", "teacherId", "chargeClassName", "chargeClassName"))); } /** @@ -437,11 +436,11 @@ @RequestParam(defaultValue = "false") Boolean showAnalysisAfterExer, @RequestParam(defaultValue = "false") Boolean canMultiExer, @RequestParam(defaultValue = "false") Boolean needForum, - String chargeClassName) { + String chargeClassName) { try { return classService.updateClass(classId, className, classNumber, DateUtils.convertStringToDate(startTime), DateUtils.convertStringToDate(endTime), subjectId, needJoinAudit, needQuitAudit, - showAnalysisAfterExer, canMultiExer, needForum, teacherId,chargeClassName); + showAnalysisAfterExer, canMultiExer, needForum, teacherId, chargeClassName); } catch (ParseException e) { log.error(e, e); return new Result(false, "鏃ユ湡鍙傛暟閿欒"); @@ -459,7 +458,7 @@ */ @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, @@ -492,9 +491,15 @@ * @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); } @@ -508,12 +513,17 @@ * @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); } - /** @@ -548,41 +558,43 @@ /** * 娣诲姞鐝骇璇剧▼ + * * @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杩囨护 * @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(); + } /** * 鑾峰彇瀛﹀憳璇︾粏淇℃伅 diff --git a/src/main/java/com/qxueyou/scc/controller/VideoLiveController.java b/src/main/java/com/qxueyou/scc/controller/VideoLiveController.java index 2caa80a..4b3ddd0 100644 --- a/src/main/java/com/qxueyou/scc/controller/VideoLiveController.java +++ b/src/main/java/com/qxueyou/scc/controller/VideoLiveController.java @@ -9,6 +9,7 @@ import com.alibaba.fastjson.JSONObject; import com.hankcs.hanlp.corpus.tag.Nature; import com.qxueyou.scc.base.dao.CommonDAO; +import com.qxueyou.scc.base.util.UUIDUtils; import com.qxueyou.scc.config.IpUtils; import com.qxueyou.scc.sdk.MTCloud; import com.qxueyou.scc.teach.live.model.AccessLog; @@ -70,6 +71,41 @@ @Autowired private RedisCache redisCache; + + /** + * 鑾峰彇鐩存挱鍥炴斁鍦板潃 + * + * @param videoLiveId + * 鐩存挱id锛堟洿鏂扮殑鏃跺�欐墠闇�瑕佷紶锛� + */ + @ApiOperation(value = "鑾峰彇鐩存挱鍥炴斁鍦板潃") + @GetMapping(value = "livePlaybackURL") + public Result livePlaybackURL(String videoLiveId,String nickname) throws Exception { + if (StringUtils.isEmpty(videoLiveId)) { + return new Result(false,"videoLiveId涓嶈兘涓虹┖"); + } + if (StringUtils.isEmpty(nickname)) { + return new Result(false,"nickname涓嶈兘涓虹┖"); + } + MTCloud client = new MTCloud(); + HashMap<Object,Object> options = new HashMap<Object,Object>(); + options.put("ssl", true); + //鑾峰彇鐩存挱瀵硅薄 + MediaVideoLive mediaVideoLive = liveService.read(videoLiveId); + //璋冪敤绗笁鏂圭洿鎾帴鍙� 4028815c8c0063f0018c006e083d0001 + String uuid = UUIDUtils.generateUUID(); + String courseAccess = client.courseAccessPlayback(String.valueOf(mediaVideoLive.getCourseId()),uuid,nickname,"user",3600,options); + + //json杞崲鎷垮埌courseId + JSONObject jsonObject = JSON.parseObject(courseAccess); + JSONObject data = jsonObject.getJSONObject("data"); + if(jsonObject.getString("code").equals("0")) { + String playbackUrl = (String) data.get("playbackUrl");//甯﹁亰澶╁尯鍦板潃 +// String playbackOutUrl = (String) data.get("playbackOutUrl");//绾棰戝湴鍧� + return new Result(true, "鎴愬姛", playbackUrl); + } + return new Result(false,jsonObject.getString("msg")); + } /** * 鑾峰彇鐩存挱鍒楄〃 * diff --git a/src/main/java/com/qxueyou/scc/teach/live/service/impl/MediaLiveService.java b/src/main/java/com/qxueyou/scc/teach/live/service/impl/MediaLiveService.java index da26763..07e2c27 100644 --- a/src/main/java/com/qxueyou/scc/teach/live/service/impl/MediaLiveService.java +++ b/src/main/java/com/qxueyou/scc/teach/live/service/impl/MediaLiveService.java @@ -80,7 +80,8 @@ live.setSubjectId(subjectId); live.setSubjectName(subjectName); - + live.setCreateId(teacher.getTeacherId()); + live.setCreateTime(new Date()); String uuid = UUIDUtils.UUID(); live.setWyLiveNumber(uuid); live.setPushUrl(cfg.getRtmpService().concat(uuid)); @@ -109,7 +110,7 @@ live.setEndTime(endTime); live.setSubjectId(subjectId); live.setSubjectName(subjectName); - + live.setCreateTime(new Date()); save(live); //鏇存柊鐝骇璇剧▼鍏宠仈鍏崇郴 @@ -195,26 +196,26 @@ } } - @Scheduled(cron = " 0 0/5 * * * ?") - protected void doTimer() { -// System.out.println("鎵ц鐩存挱鎻愰啋瀹氭椂鍣�"); - Calendar cal = Calendar.getInstance(); - cal.add(Calendar.HOUR, 1); - Date beginDate = cal.getTime(); - - cal.add(Calendar.MINUTE, 5); - Date endDate = cal.getTime(); - - //鏌ヨ1灏忔椂鍐呭皢寮�濮嬬殑鐩存挱 - List<MediaVideoLive> lstLives = this.find("from MediaVideoLive where startTime>=? and startTime<? and status=? and deleteFlag is false ", - CollectionUtils.newList(beginDate,endDate,MediaVideoLive.STATUS_LIVE_REVIEW), MediaVideoLive.class); - - if(lstLives!=null && lstLives.size()>0){ - for(MediaVideoLive live:lstLives){ - this.doLiveRemindMsg(live.getVideoLiveId(),MsgInfo.TYPE_REMIND, "鐩存挱椹笂寮�濮嬩簡锛岃鍋氬ソ鐩存挱鍑嗗"); - } - } - } +// @Scheduled(cron = " 0 0/5 * * * ?") +// protected void doTimer() { +//// System.out.println("鎵ц鐩存挱鎻愰啋瀹氭椂鍣�"); +// Calendar cal = Calendar.getInstance(); +// cal.add(Calendar.HOUR, 1); +// Date beginDate = cal.getTime(); +// +// cal.add(Calendar.MINUTE, 5); +// Date endDate = cal.getTime(); +// +// //鏌ヨ1灏忔椂鍐呭皢寮�濮嬬殑鐩存挱 +// List<MediaVideoLive> lstLives = this.find("from MediaVideoLive where startTime>=? and startTime<? and status=? and deleteFlag is false ", +// CollectionUtils.newList(beginDate,endDate,MediaVideoLive.STATUS_LIVE_REVIEW), MediaVideoLive.class); +// +// if(lstLives!=null && lstLives.size()>0){ +// for(MediaVideoLive live:lstLives){ +// this.doLiveRemindMsg(live.getVideoLiveId(),MsgInfo.TYPE_REMIND, "鐩存挱椹笂寮�濮嬩簡锛岃鍋氬ソ鐩存挱鍑嗗"); +// } +// } +// } private void doLiveRemindMsg(String liveId,short type,String msg){ MediaVideoLive liveInfo = this.read(liveId); @@ -336,22 +337,35 @@ @Override public List<MediaVideoLive> listvideo(String status) { - - String hql = "from MediaVideoLive where deleteFlag is false and status=? order by createTime desc"; + //鏄惁鏄�佸笀 + String teacherId = ClientUtils.isAdmin() ? null : teacherService.getTeacherIdByUserId(ClientUtils.getUserId()); + String hql = "from MediaVideoLive where deleteFlag is false and status=? "; + List<Object> args =CollectionUtils.newList(status); + if (StringUtils.isNotBlank(teacherId)) { + hql.concat(" and createId=?"); + args.add(teacherId); + } + hql.concat(" order by createTime desc"); - return find(hql, CollectionUtils.newList(status), MediaVideoLive.class); + + return find(hql, args, MediaVideoLive.class); } @Override public List<MediaVideoLive> listOfMine(String keyword,String portalStatus, Integer pageNum, Integer pageSize) { - + //鏄惁鏄�佸笀 + String teacherId = ClientUtils.isAdmin() ? null : teacherService.getTeacherIdByUserId(ClientUtils.getUserId()); StringBuffer hql = new StringBuffer("from MediaVideoLive where deleteFlag is false and name like ? "); List<Object> args =CollectionUtils.newList(keyword + "%"); if(portalStatus != ""){ hql.append(" and portalStatus = ?"); args.add(portalStatus); } + if (StringUtils.isNotBlank(teacherId)) { + hql.append(" and createId=?"); + args.add(teacherId); + } hql.append(" order by createTime desc"); return findList(hql.toString(), new Pager(pageSize, pageNum),args , MediaVideoLive.class); } diff --git a/src/main/java/com/qxueyou/scc/teach/res/model/ResFile.java b/src/main/java/com/qxueyou/scc/teach/res/model/ResFile.java index b0e3b2c..fc3e980 100644 --- a/src/main/java/com/qxueyou/scc/teach/res/model/ResFile.java +++ b/src/main/java/com/qxueyou/scc/teach/res/model/ResFile.java @@ -107,7 +107,7 @@ this.path = path; } - @Column(name = "FILE_TYPE", length = 16) + @Column(name = "FILE_TYPE", length = 255) public String getFileType() { return this.fileType; } diff --git a/src/main/java/com/qxueyou/scc/teach/student/service/IStudentService.java b/src/main/java/com/qxueyou/scc/teach/student/service/IStudentService.java index 081bb48..f1f6b86 100644 --- a/src/main/java/com/qxueyou/scc/teach/student/service/IStudentService.java +++ b/src/main/java/com/qxueyou/scc/teach/student/service/IStudentService.java @@ -19,7 +19,10 @@ */ Result insertStudent(String classId,String name, String studentNo, boolean sex,String phoneNo, String orgId); - Result insertStudent(String classId,String name, String studentNo, boolean sex,String phoneNo, String orgId,String comName); + Result insertStudent(String classId,String name, String studentNo, boolean sex,String phoneNo, String orgId, 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); /** * 鑾峰彇瀛﹀憳鍒楄〃 @@ -30,6 +33,7 @@ * @return */ List<Map<String, Object>> getStudentLst(String classId,String keyword, Pager pager); + Result updateImgStudent(String studentId); /** @@ -89,7 +93,10 @@ * @param phoneNo * @return */ - Result updateStudent(String studentId, String name, String password, String studentNo, boolean sex, String phoneNo); + Result updateStudent(String studentId, String name, String password, String studentNo, boolean sex, String phoneNo + , 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); /** * 閫氳繃鐢ㄦ埛鑾峰彇瀛︾敓淇℃伅 diff --git a/src/main/java/com/qxueyou/scc/teach/student/service/impl/StudentService.java b/src/main/java/com/qxueyou/scc/teach/student/service/impl/StudentService.java index 19b3f81..6c2b654 100644 --- a/src/main/java/com/qxueyou/scc/teach/student/service/impl/StudentService.java +++ b/src/main/java/com/qxueyou/scc/teach/student/service/impl/StudentService.java @@ -83,7 +83,10 @@ @Override - public Result insertStudent(String classId, String name, String studentNo, boolean sex, String phoneNo, String orgId,String comName) { + public Result insertStudent(String classId, String name, String studentNo, boolean sex, String phoneNo, String orgId, 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) { if (dao.exists(studentNo, orgId)) { return new Result(false, "韬唤璇佸凡瀛樺湪"); @@ -108,7 +111,18 @@ student.setMobilePhone(phoneNo); //鍏徃鍚嶇О student.setSubjectId(comName); - + student.setPhoto(photo); + student.setPassporName(passporName); + student.setNationality(nationality); + student.setAncestralHome(ancestralHome); + student.setBirthday(birthday); + student.setBirthplace(birthplace); + student.setChinaStatus(chinaStatus); + student.setRegisteredAddress(registeredAddress); + student.setHomeAddress(homeAddress); + student.setReligiousBelief(religiousBelief); + student.setEmail(email); + student.setWorkUnit(workUnit); if(StringUtils.isNoneBlank(classId)) { bulkUpdate("update ClsClass set studentCount = studentCount + 1 where deleteFlag is false and classId = ?", new Object[]{classId}); } @@ -126,7 +140,10 @@ return new Result(true, "success"); } @Override - public Result updateStudent(String studentId, String name,String password, String studentNo, boolean sex, String phoneNo) { + public Result updateStudent(String studentId, String name,String password, String studentNo, boolean sex, String phoneNo + , 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) { //鏍规嵁瀛﹀鍛業D锛岃幏鍙栫敤鎴蜂俊鎭� StuStudent stu = this.read(StuStudent.class, studentId); if(stu.getStudentNo() != null){ @@ -139,6 +156,18 @@ stu.setStudentNo(studentNo); stu.setMobilePhone(phoneNo); TraceUtils.setUpdateTrace(stu); + stu.setPhoto(photo); + stu.setPassporName(passporName); + stu.setNationality(nationality); + stu.setAncestralHome(ancestralHome); + stu.setBirthday(birthday); + stu.setBirthplace(birthplace); + stu.setChinaStatus(chinaStatus); + stu.setRegisteredAddress(registeredAddress); + stu.setHomeAddress(homeAddress); + stu.setReligiousBelief(religiousBelief); + stu.setEmail(email); + stu.setWorkUnit(workUnit); save(stu); User user = this.read(User.class, stu.getUserId()); @@ -165,7 +194,9 @@ QUser qUser = QUser.user; QStuStudent qStuStudent = QStuStudent.stuStudent; return this.getQueryFactory() - .select(qStuStudent.studentId, qStuStudent.name, qStuStudent.studentNo, qStuStudent.sex, + .select(qStuStudent.photo,qStuStudent.passporName,qStuStudent.nationality,qStuStudent.ancestralHome,qStuStudent.birthday,qStuStudent.birthplace,qStuStudent.chinaStatus, + qStuStudent.registeredAddress,qStuStudent.homeAddress,qStuStudent.religiousBelief,qStuStudent.email,qStuStudent.workUnit,qStuStudent.graduationDestination, + qStuStudent.studentId, qStuStudent.name, qStuStudent.studentNo, qStuStudent.sex, qStuStudent.mobilePhone, qStuStudent.status, qStuStudent.studyDuration, qStuStudent.tenantId, qStuStudent.score, qStuStudent.graduationText, qUser.imgPath) .from(qUser, qStuStudent) -- Gitblit v1.8.0