| | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.hankcs.hanlp.corpus.tag.Nature; |
| | | import com.qxueyou.scc.sdk.MTCloud; |
| | | import io.swagger.models.auth.In; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | options.put("robotNumber", 1); |
| | | options.put("robotType", 1); |
| | | options.put("pptDisplay", 1); |
| | | options.put("modetype", 6); |
| | | //将long类型转换为String类型 |
| | | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | simpleDateFormat.setTimeZone(TimeZone.getTimeZone("GMT+00:00")); |
| | |
| | | return new Result(true,"开启成功",protocol); |
| | | } |
| | | |
| | | @ApiOperation(value = "在线时长") |
| | | @GetMapping(value = "onlineCommunication") |
| | | public Result onlineCommunication(String courseId,Integer page, Integer size) throws Exception { |
| | | MTCloud client = new MTCloud(); |
| | | HashMap<Object,Object> options = new HashMap<Object, Object>(); |
| | | options.put("ssl", false); |
| | | String res = client.courseVisitorList("3360573",10,1,options); |
| | | return new Result(true,"开启成功",res); |
| | | } |
| | | /** |
| | | * 查询直播详情 |
| | | * |
| | |
| | | if(StringUtils.isEmpty(password)) { |
| | | return new Result(false, "用户密码不能为空"); |
| | | } |
| | | hql = "from User where deleteFlag is false and account = ? and password = ?"; |
| | | params = CollectionUtils.newList(account,password); |
| | | hql = "from User where deleteFlag is false and account = ?"; |
| | | params = CollectionUtils.newList(account); |
| | | } |
| | | |
| | | if(StringUtils.isNotEmpty(organizationId)){ |
| | |
| | | String salt = user.getSalt(); |
| | | String newPassword= DigestUtils.md5DigestAsHex((salt+password).getBytes()); |
| | | //比较用户输入的密码加密后的字符串是否跟注册时填写的加密密码相同 |
| | | if("study".equals(logType) || "portal".equals(logType)){ |
| | | if("study".equals(logType) || "portal".equals(logType) || "adminis".equals(logType)){ |
| | | if (!newPassword.equals(user.getPassword())) { |
| | | return new Result(false, "用户账户、密码错误或缺少凭证"); |
| | | } |
| | |
| | | @ApiOperation(value = "修改密码", notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "usedPass", value = "老密码", required = false, paramType="query", dataType = "String"), |
| | | @ApiImplicitParam(name = "pass", value = "新密码", required = false, paramType="query", dataType = "String"), |
| | | @ApiImplicitParam(name = "pass", value = "新密码", required = false, paramType=" query", dataType = "String"), |
| | | }) |
| | | @RequestMapping(value = "updatePassword", method = RequestMethod.POST) |
| | | @ResponseBody |
| | |
| | | import cn.hutool.core.date.LocalDateTimeUtil; |
| | | import cn.hutool.core.util.RandomUtil; |
| | | import com.qxueyou.scc.admin.classes.model.ClsClass; |
| | | import com.qxueyou.scc.base.dao.CommonDAO; |
| | | import com.qxueyou.scc.exam.model.ExamResultV; |
| | | import com.qxueyou.scc.exercise.model.ExerciseCompleteInfo; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | |
| | | @Autowired |
| | | StudentDAO dao; |
| | | |
| | | @Autowired |
| | | CommonDAO commonDAO; |
| | | |
| | | @Override |
| | | public Result insertStudent(String classId, String name, String studentNo, boolean sex, String phoneNo, String orgId) { |
| | |
| | | public Result doActivateStudent(String[] studentIds) { |
| | | for (String studentId : studentIds) { |
| | | activateStudent(studentId, StuStudent.STATUS_ACTIVE); |
| | | ModeUpdate(studentId,StuStudent.STATUS_ACTIVE); |
| | | } |
| | | return new Result(true); |
| | | } |
| | |
| | | public Result doDeActivateStudent(String[] studentIds) { |
| | | for (String studentId : studentIds) { |
| | | activateStudent(studentId, StuStudent.STATUS_DEACTIVE); |
| | | ModeUpdate(studentId,StuStudent.STATUS_DEACTIVE); |
| | | } |
| | | return new Result(true); |
| | | } |
| | | |
| | | private Result ModeUpdate(String studentId,String status){ |
| | | if(status.equals(StuStudent.STATUS_ACTIVE)){ |
| | | String hql = "from ExerciseCompleteInfo where studentId=? and deleteFlag is false"; |
| | | List<Object> Params = CollectionUtils.newList(studentId); |
| | | ExerciseCompleteInfo unique = findUnique(hql, Params, ExerciseCompleteInfo.class); |
| | | unique.setDeleteFlag(false); |
| | | commonDAO.update(unique); |
| | | }else { |
| | | String hql = "from ExerciseCompleteInfo where studentId=? and deleteFlag is false"; |
| | | List<Object> Params = CollectionUtils.newList(studentId); |
| | | ExerciseCompleteInfo unique = findUnique(hql, Params, ExerciseCompleteInfo.class); |
| | | unique.setDeleteFlag(true); |
| | | commonDAO.update(unique); |
| | | } |
| | | return new Result(true); |
| | | } |
| | |
| | | } |
| | | |
| | | TraceUtils.setUpdateTrace(student); |
| | | String currentTime = LocalDateTimeUtil.format(LocalDateTime.now(), "yyMMddHHmmssSSS"); |
| | | |
| | | String examCardNo = currentTime.concat(RandomUtil.randomNumbers(1)); |
| | | |
| | | student.setStudentNumber(examCardNo); |
| | | // String currentTime = LocalDateTimeUtil.format(LocalDateTime.now(), "yyMMddHHmmssSSS"); |
| | | // |
| | | // String examCardNo = currentTime.concat(RandomUtil.randomNumbers(1)); |
| | | // |
| | | // student.setStudentNumber(examCardNo); |
| | | student.setStatus(status); |
| | | save(student); |
| | | commonDAO.update(student); |
| | | |
| | | clsService.addStudent(student.getClassId(), StuStudent.STATUS_DEACTIVE.equals(status) ? -1 : 1); |
| | | |