1
This commit is contained in:
parent
4a9e99f69e
commit
026b39b061
@ -9,11 +9,15 @@ import cn.iocoder.yudao.module.base.vo.StudentInfoVO;
|
|||||||
import cn.iocoder.yudao.module.course.entity.Process;
|
import cn.iocoder.yudao.module.course.entity.Process;
|
||||||
import cn.iocoder.yudao.module.course.service.ProcessService;
|
import cn.iocoder.yudao.module.course.service.ProcessService;
|
||||||
import cn.iocoder.yudao.module.exam.service.ExamBatchItemService;
|
import cn.iocoder.yudao.module.exam.service.ExamBatchItemService;
|
||||||
|
import cn.iocoder.yudao.module.exam.vo.ExamBatchItemVO;
|
||||||
|
import cn.iocoder.yudao.module.train.entity.Train;
|
||||||
import cn.iocoder.yudao.module.train.service.TrainService;
|
import cn.iocoder.yudao.module.train.service.TrainService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
@Validated
|
@Validated
|
||||||
public class DataViewServiceImpl implements DataViewService {
|
public class DataViewServiceImpl implements DataViewService {
|
||||||
@ -45,6 +49,8 @@ public class DataViewServiceImpl implements DataViewService {
|
|||||||
//当前学习进度
|
//当前学习进度
|
||||||
Process process = processService.selectByUserId(id,coachId);
|
Process process = processService.selectByUserId(id,coachId);
|
||||||
studentInfoVO.setProcess(process);
|
studentInfoVO.setProcess(process);
|
||||||
|
//查这个课程累计总训练时长
|
||||||
|
studentInfoVO.setTrainTime(processService.getAllTrainTime(id,process.getCourseId()));
|
||||||
//查归属教练信息
|
//查归属教练信息
|
||||||
DlDriveSchoolCoachRespVO coachRespVO = coachService.getDlDriveSchoolCoachByUserId(process.getCoachId());
|
DlDriveSchoolCoachRespVO coachRespVO = coachService.getDlDriveSchoolCoachByUserId(process.getCoachId());
|
||||||
if(null!=coachRespVO){
|
if(null!=coachRespVO){
|
||||||
@ -53,9 +59,13 @@ public class DataViewServiceImpl implements DataViewService {
|
|||||||
studentInfoVO.setCoachInfo(coachRespVO);
|
studentInfoVO.setCoachInfo(coachRespVO);
|
||||||
}
|
}
|
||||||
//查该学生的培训记录
|
//查该学生的培训记录
|
||||||
studentInfoVO.setTrainList(trainService.selectByUserIdAndCoachId(id,coachId));
|
List<Train> trainList = trainService.selectByUserIdAndCoachId(id,coachId);
|
||||||
|
trainList.forEach(item-> item.setShowMore(false));
|
||||||
|
studentInfoVO.setTrainList(trainList);
|
||||||
//查该学生的考试记录
|
//查该学生的考试记录
|
||||||
studentInfoVO.setExamList(examBatchItemService.selectByUserIdAndCoachId(id, coachId));
|
List<ExamBatchItemVO> examList = examBatchItemService.selectByUserIdAndCoachId(id, coachId);
|
||||||
|
examList.forEach(item->item.setShowMore(false));
|
||||||
|
studentInfoVO.setExamList(examList);
|
||||||
return studentInfoVO;
|
return studentInfoVO;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -14,6 +14,8 @@ public class StudentInfoVO {
|
|||||||
private DlDriveSchoolStudent studentInfo;
|
private DlDriveSchoolStudent studentInfo;
|
||||||
/**学习进度*/
|
/**学习进度*/
|
||||||
private Process process;
|
private Process process;
|
||||||
|
/**训练总时长*/
|
||||||
|
private Double trainTime;
|
||||||
/**教练信息*/
|
/**教练信息*/
|
||||||
private DlDriveSchoolCoachRespVO coachInfo;
|
private DlDriveSchoolCoachRespVO coachInfo;
|
||||||
/**训练记录*/
|
/**训练记录*/
|
||||||
|
@ -54,4 +54,6 @@ public interface ProcessMapper extends BaseMapper<Process> {
|
|||||||
* @return cn.iocoder.yudao.module.course.entity.Process
|
* @return cn.iocoder.yudao.module.course.entity.Process
|
||||||
**/
|
**/
|
||||||
Process selectNewMaxByUserId(@Param("userId") Long userId,@Param("coachId") Long coachId);
|
Process selectNewMaxByUserId(@Param("userId") Long userId,@Param("coachId") Long coachId);
|
||||||
|
|
||||||
|
Double selectAllTrainTime(@Param("userId") Long userId,@Param("courseId") String courseId);
|
||||||
}
|
}
|
@ -62,4 +62,14 @@ public interface ProcessService extends IService<Process> {
|
|||||||
**/
|
**/
|
||||||
Map<String,Integer> selectByCoachId(Long coachId);
|
Map<String,Integer> selectByCoachId(Long coachId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查某学生某课程累计总训练时长
|
||||||
|
* @author vinjor-M
|
||||||
|
* @date 14:17 2025/2/11
|
||||||
|
* @param userId 学生ID
|
||||||
|
* @param courseId 课程ID
|
||||||
|
* @return java.lang.Double
|
||||||
|
**/
|
||||||
|
Double getAllTrainTime(Long userId,String courseId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -170,4 +170,18 @@ public class ProcessServiceImpl extends ServiceImpl<ProcessMapper, Process> impl
|
|||||||
return rtnMap;
|
return rtnMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查某学生某课程累计总训练时长
|
||||||
|
*
|
||||||
|
* @param userId 学生ID
|
||||||
|
* @param courseId 课程ID
|
||||||
|
* @return java.lang.Double
|
||||||
|
* @author vinjor-M
|
||||||
|
* @date 14:17 2025/2/11
|
||||||
|
**/
|
||||||
|
@Override
|
||||||
|
public Double getAllTrainTime(Long userId, String courseId) {
|
||||||
|
return processMapper.selectAllTrainTime(userId, courseId);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -1,6 +1,7 @@
|
|||||||
package cn.iocoder.yudao.module.exam.vo;
|
package cn.iocoder.yudao.module.exam.vo;
|
||||||
|
|
||||||
import cn.iocoder.yudao.module.exam.entity.ExamBatchItem;
|
import cn.iocoder.yudao.module.exam.entity.ExamBatchItem;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
@ -48,4 +49,9 @@ public class ExamBatchItemVO extends ExamBatchItem {
|
|||||||
* 考试交通方式
|
* 考试交通方式
|
||||||
*/
|
*/
|
||||||
private String transWay;
|
private String transWay;
|
||||||
|
/**
|
||||||
|
* 是否展示更多
|
||||||
|
*/
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Boolean showMore;
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.train.entity;
|
|||||||
|
|
||||||
import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO;
|
import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO;
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
@ -123,4 +124,10 @@ public class Train extends TenantBaseDO {
|
|||||||
*/
|
*/
|
||||||
private String evaluateId;
|
private String evaluateId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否展示更多
|
||||||
|
*/
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Boolean showMore;
|
||||||
|
|
||||||
}
|
}
|
@ -31,4 +31,15 @@
|
|||||||
</if>
|
</if>
|
||||||
ORDER BY dsp.`subject` DESC, dsp.create_time DESC LIMIT 1
|
ORDER BY dsp.`subject` DESC, dsp.create_time DESC LIMIT 1
|
||||||
</select>
|
</select>
|
||||||
|
<select id="selectAllTrainTime" resultType="java.lang.Double">
|
||||||
|
SELECT
|
||||||
|
SUM(dsp.train_time)
|
||||||
|
FROM
|
||||||
|
drive_school_process dsp
|
||||||
|
WHERE
|
||||||
|
dsp.user_id = #{userId}
|
||||||
|
AND dsp.deleted = 0
|
||||||
|
AND dsp.course_id = #{courseId}
|
||||||
|
AND (( dsp.`status` = '2' AND dsp.exam_status = '1' ) OR dsp.`status` = '1' )
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
Loading…
Reference in New Issue
Block a user