派生自 projectDept/qhighschool

胡仁荣
2023-05-09 d5c7f485091d29c3f469ad82847ed93b315b22a1
新增作业分类
3个文件已修改
53 ■■■■ 已修改文件
src/main/java/com/qxueyou/scc/controller/VideoLiveController.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/qxueyou/scc/sys/action/LoginController.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/qxueyou/scc/teach/student/service/impl/StudentService.java 36 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/qxueyou/scc/controller/VideoLiveController.java
@@ -8,6 +8,7 @@
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.*;
@@ -122,6 +123,7 @@
        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"));
@@ -157,6 +159,15 @@
        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);
    }
    /**
     * 查询直播详情
     * 
src/main/java/com/qxueyou/scc/sys/action/LoginController.java
@@ -390,8 +390,8 @@
            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)){
@@ -421,7 +421,7 @@
        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, "用户账户、密码错误或缺少凭证");
            }
src/main/java/com/qxueyou/scc/teach/student/service/impl/StudentService.java
@@ -10,7 +10,9 @@
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;
@@ -47,6 +49,9 @@
    @Autowired
    StudentDAO dao;
    @Autowired
    CommonDAO commonDAO;
    @Override
    public Result insertStudent(String classId, String name, String studentNo, boolean sex, String phoneNo, String orgId) {
@@ -224,6 +229,7 @@
    public Result doActivateStudent(String[] studentIds) {
        for (String studentId : studentIds) {
            activateStudent(studentId, StuStudent.STATUS_ACTIVE);
            ModeUpdate(studentId,StuStudent.STATUS_ACTIVE);
        }
        return new Result(true);
    }
@@ -232,6 +238,24 @@
    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);
    }
@@ -244,13 +268,13 @@
        }
        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);