This commit is contained in:
PQZ 2025-02-10 11:57:03 +08:00
commit 2a23b9ecd9
11 changed files with 151 additions and 3 deletions

View File

@ -0,0 +1,38 @@
package cn.iocoder.yudao.module.base.controller.admin;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.base.service.DataViewService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
@Tag(name = "管理后台 - 数据查询统一方法")
@RestController
@RequestMapping("/base/dataView")
@Validated
public class DataViewController {
@Autowired
private DataViewService dataViewService;
/**
* 查询学员详情
* @author vinjor-M
* @date 14:32 2025/2/8
* @param id 学员id
* @return cn.iocoder.yudao.framework.common.pojo.CommonResult<?>
**/
@GetMapping("/getStudentInfo")
@Operation(summary = "查询学员详情")
public CommonResult<?> selectStudentInfo(@RequestParam("id") Long id) {
return success(dataViewService.selectStudentInfo(id));
}
}

View File

@ -0,0 +1,20 @@
package cn.iocoder.yudao.module.base.service;
import cn.iocoder.yudao.module.base.vo.StudentInfoVO;
/**
* 数据查询统一方法
*
*/
public interface DataViewService {
/**
* 查询学员详情
* @author vinjor-M
* @date 14:37 2025/2/8
* @param id 学生id
* @return cn.iocoder.yudao.module.base.vo.StudentInfoVO
**/
StudentInfoVO selectStudentInfo(Long id);
}

View File

@ -0,0 +1,37 @@
package cn.iocoder.yudao.module.base.service.impl;
import cn.iocoder.yudao.module.base.entity.DlDriveSchoolStudent;
import cn.iocoder.yudao.module.base.service.DataViewService;
import cn.iocoder.yudao.module.base.service.DlDriveSchoolStudentService;
import cn.iocoder.yudao.module.base.vo.StudentInfoVO;
import cn.iocoder.yudao.module.course.entity.Process;
import cn.iocoder.yudao.module.course.service.ProcessService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
@Service
@Validated
public class DataViewServiceImpl implements DataViewService {
@Autowired
private DlDriveSchoolStudentService studentService;
@Autowired
private ProcessService processService;
/**
* 查询学员详情
*
* @param id 学生id
* @return cn.iocoder.yudao.module.base.vo.StudentInfoVO
* @author vinjor-M
* @date 14:37 2025/2/8
**/
@Override
public StudentInfoVO selectStudentInfo(Long id) {
//学员主信息
DlDriveSchoolStudent student = studentService.getStudentByUserId(id);
//当前学习进度
Process process = processService.selectByUserId(id);
return null;
}
}

View File

@ -0,0 +1,10 @@
package cn.iocoder.yudao.module.base.vo;
import cn.iocoder.yudao.module.base.entity.DlDriveSchoolStudent;
import lombok.Data;
@Data
public class StudentInfoVO {
/**学生基本信息*/
private DlDriveSchoolStudent studentInfo;
}

View File

@ -45,4 +45,13 @@ public interface ProcessMapper extends BaseMapper<Process> {
@Param("examScore")Double examScore,
@Param("images")String images,
@Param("examTime")String examTime);
/**
* 查用户最新的一条且科目最大的一条学习记录
* @author vinjor-M
* @date 15:58 2025/2/8
* @param userId 用户id
* @return cn.iocoder.yudao.module.course.entity.Process
**/
Process selectNewMaxByUserId(@Param("userId") Long userId);
}

View File

@ -41,4 +41,14 @@ public interface ProcessService extends IService<Process> {
* @return cn.iocoder.yudao.module.course.entity.Process
**/
Process getByStudentAndCourse(Long userId,String courseId,Integer subject,Long coachId,String examStatus);
/**
* 查学生当下正在学习中的学习进度
* @author vinjor-M
* @date 16:39 2025/2/8
* @param userId TODO
* @return cn.iocoder.yudao.module.course.entity.Process
**/
Process selectByUserId(Long userId);
}

View File

@ -99,4 +99,18 @@ public class ProcessServiceImpl extends ServiceImpl<ProcessMapper, Process> impl
return processList.isEmpty()?null:processList.get(0);
}
/**
* 查学生当下正在学习中的学习进度
*
* @param userId TODO
* @return cn.iocoder.yudao.module.course.entity.Process
* @author vinjor-M
* @date 15:18 2025/2/8
**/
@Override
public Process selectByUserId(Long userId) {
return null;
}
}

View File

@ -43,8 +43,7 @@ public class ExamBatchController {
@GetMapping("/getById")
@Operation(summary = "查某一批次详情")
public CommonResult<?> getById(String id) {
examBatchService.selectOneById(id);
return success(true);
return success(examBatchService.selectOneById(id));
}

View File

@ -1,6 +1,7 @@
package cn.iocoder.yudao.module.exam.service.impl;
import cn.hutool.core.date.DateUtil;
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import cn.iocoder.yudao.module.course.mapper.ProcessMapper;
import cn.iocoder.yudao.module.exam.entity.ExamBatch;
import cn.iocoder.yudao.module.exam.entity.ExamBatchItem;
@ -47,6 +48,9 @@ public class ExamBatchServiceImpl extends ServiceImpl<ExamBatchMapper, ExamBatch
**/
@Override
public IPage<ExamBatchVO> queryListPage(ExamBatchVO pageReqVO, Page<ExamBatchVO> page) {
//教练ID
Long userId = SecurityFrameworkUtils.getLoginUserId();
pageReqVO.setCoachId(userId);
IPage<ExamBatchVO> rtnList = examBatchMapper.queryListPage(pageReqVO, page);
return rtnList;
}

View File

@ -21,4 +21,11 @@
<update id="updateProcessExamResult">
</update>
<select id="selectNewMaxByUserId" resultType="cn.iocoder.yudao.module.course.entity.Process">
SELECT
dsp.* FROM drive_school_process dsp
WHERE
dsp.user_id = #{userId}
ORDER BY dsp.`subject` DESC, dsp.create_time DESC LIMIT 1
</select>
</mapper>

View File

@ -19,6 +19,6 @@
<if test="entity.subject != null and entity.subject != ''">
and dseb.subject =#{entity.subject}
</if>
ORDER BY dseb.create_time
ORDER BY dseb.create_time DESC
</select>
</mapper>