diff --git a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/base/service/impl/DataViewServiceImpl.java b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/base/service/impl/DataViewServiceImpl.java index d87a2b72..18684503 100644 --- a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/base/service/impl/DataViewServiceImpl.java +++ b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/base/service/impl/DataViewServiceImpl.java @@ -69,6 +69,64 @@ public class DataViewServiceImpl implements DataViewService { @Override public StudentInfoVO selectStudentInfo(Long id,Long coachId) { StudentInfoVO studentInfoVO = new StudentInfoVO(); + + // 学员主信息 + DlDriveSchoolStudent student = studentService.getStudentByUserId(id); + studentInfoVO.setStudentInfo(student); + + // 查询学员订单信息 + SchoolCourseOrder orderInfo = courseOrderMapper.getOrderInfo(id); + studentInfoVO.setStudentOrderInfo(orderInfo); + + // 当前学习进度 + Process process = processService.selectByUserId(id, coachId); + studentInfoVO.setProcess(process); + + // 学习进度列表 + String courseId = ""; + if (orderInfo != null && orderInfo.getCourseId() != null) { + courseId = orderInfo.getCourseId(); + } + List processList = processMapper.getProcessList(id, courseId); + studentInfoVO.setProcessList(processList != null ? processList : new ArrayList<>()); + + // 查这个课程累计总训练时长 + if (process != null && process.getCourseId() != null) { + studentInfoVO.setTrainTime(processService.getAllTrainTime(id, process.getCourseId())); + } else { + studentInfoVO.setTrainTime(0.0); + } + + // 查归属教练信息 + if (process != null && process.getCoachId() != null) { + DlDriveSchoolCoachRespVO coachRespVO = coachService.getDlDriveSchoolCoachByUserId(process.getCoachId()); + if (coachRespVO != null) { + coachRespVO.setDataMap(processService.selectByCoachId(coachRespVO.getUserId())); + studentInfoVO.setCoachInfo(coachRespVO); + } + } + + // 查该学生的培训记录 + List trainList = trainService.selectByUserIdAndCoachId(id, coachId); + if (trainList != null) { + trainList.forEach(item -> item.setShowMore(false)); + studentInfoVO.setTrainList(trainList); + } else { + studentInfoVO.setTrainList(new ArrayList<>()); + } + + // 查该学生的考试记录 + List examList = examBatchItemService.selectByUserIdAndCoachId(id, coachId); + if (examList != null) { + examList.forEach(item -> item.setShowMore(false)); + studentInfoVO.setExamList(examList); + } else { + studentInfoVO.setExamList(new ArrayList<>()); + } + + return studentInfoVO; + + /*StudentInfoVO studentInfoVO = new StudentInfoVO(); //学员主信息 DlDriveSchoolStudent student = studentService.getStudentByUserId(id); studentInfoVO.setStudentInfo(student); @@ -106,7 +164,7 @@ public class DataViewServiceImpl implements DataViewService { List examList = examBatchItemService.selectByUserIdAndCoachId(id, coachId); examList.forEach(item->item.setShowMore(false)); studentInfoVO.setExamList(examList); - return studentInfoVO; + return studentInfoVO;*/ } /** diff --git a/dl-module-jx/src/main/resources/mapper/base/DlDriveSchoolStudentMapper.xml b/dl-module-jx/src/main/resources/mapper/base/DlDriveSchoolStudentMapper.xml index 4c61753c..b9b8d99b 100644 --- a/dl-module-jx/src/main/resources/mapper/base/DlDriveSchoolStudentMapper.xml +++ b/dl-module-jx/src/main/resources/mapper/base/DlDriveSchoolStudentMapper.xml @@ -103,7 +103,6 @@ dsco.create_time DESC -