| | |
| | | IClassLectureService clsLectureService; |
| | | |
| | | //---------------------------------------------------------------------------------app接口--------------------------------------------------------------------------------------------------------------------/ |
| | | |
| | | /** |
| | | * 获取正常班级列表 |
| | | * |
| | |
| | | /** |
| | | * 获取首页数据排行 |
| | | * |
| | | * |
| | | * @param subjectId |
| | | */ |
| | | @ApiOperation(value = "班级排行榜", notes = "") |
| | |
| | | |
| | | /** |
| | | * 学员课程进度 |
| | | * |
| | | * |
| | | * @param subjectId |
| | | */ |
| | |
| | | /** |
| | | * 班级学员课程总体进度 |
| | | * |
| | | * |
| | | * @param classId |
| | | */ |
| | | @ApiOperation(value = "班级学员课程总体进度", notes = "") |
| | |
| | | |
| | | /** |
| | | * 班级学员课件总体进度 |
| | | * |
| | | * |
| | | * @param classId |
| | | */ |
| | |
| | | return new Result(false, "日期参数错误"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 新增补考分组 |
| | | * |
| | | * @param className 班级名称 |
| | | * @param classNumber 班级编码 |
| | | * @param startTime 开班时间 |
| | |
| | | * @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 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); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | |
| | | /** |
| | | * 添加班级课程 |
| | | * |
| | | * @throws InvocationTargetException |
| | | * @throws IllegalAccessException |
| | | * |
| | | */ |
| | | @PostMapping(value = "addClsSubject") |
| | | public Result addClsSubject(String classId, String origSubjectId,String teacherId,Integer schoolYear ,Integer term) throws IllegalAccessException, InvocationTargetException { |
| | |
| | | |
| | | /** |
| | | * 所有班级列表 |
| | | * |
| | | * @param subjectId 根据subjectId过滤 |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/selectlist", method = RequestMethod.GET) |
| | | public @ResponseBody List<Map<String,Object>> classList() { |
| | | public @ResponseBody |
| | | List<Map<String, Object>> classList() { |
| | | return classService.queryAllClassIdAndName(); |
| | | } |
| | | |
| | |
| | | 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; |
| | |
| | | |
| | | @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")); |
| | | } |
| | | /** |
| | | * 获取直播列表 |
| | | * |
| | |
| | | |
| | | 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)); |
| | |
| | | live.setEndTime(endTime); |
| | | live.setSubjectId(subjectId); |
| | | live.setSubjectName(subjectName); |
| | | |
| | | live.setCreateTime(new Date()); |
| | | save(live); |
| | | |
| | | //更新班级课程关联关系 |
| | |
| | | } |
| | | } |
| | | |
| | | @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); |
| | |
| | | |
| | | @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); |
| | | } |
| | |
| | | this.path = path; |
| | | } |
| | | |
| | | @Column(name = "FILE_TYPE", length = 16) |
| | | @Column(name = "FILE_TYPE", length = 255) |
| | | public String getFileType() { |
| | | return this.fileType; |
| | | } |
| | |
| | | */ |
| | | 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); |
| | | |
| | | /** |
| | | * 获取学员列表 |
| | |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> getStudentLst(String classId,String keyword, Pager pager); |
| | | |
| | | Result updateImgStudent(String studentId); |
| | | |
| | | /** |
| | |
| | | * @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); |
| | | |
| | | /** |
| | | * 通过用户获取学生信息 |
| | |
| | | |
| | | |
| | | @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, "身份证已存在"); |
| | |
| | | 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}); |
| | | } |
| | |
| | | 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) { |
| | | //根据学学员ID,获取用户信息 |
| | | StuStudent stu = this.read(StuStudent.class, studentId); |
| | | if(stu.getStudentNo() != null){ |
| | |
| | | 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()); |
| | |
| | | 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) |