From d20feb9fdf60b09d9ecb27d73091e2257c76d663 Mon Sep 17 00:00:00 2001 From: Vinjor Date: Tue, 21 Jan 2025 00:12:53 +0800 Subject: [PATCH] 1 --- .../admin/DlDriveSchoolStudentController.java | 16 +++- .../mapper/DlDriveSchoolStudentMapper.java | 9 ++ .../service/DlDriveSchoolStudentService.java | 20 ++++ .../impl/DlDriveSchoolStudentServiceImpl.java | 37 ++++++++ .../yudao/module/course/entity/Process.java | 4 +- .../module/course/mapper/ProcessMapper.java | 18 +++- .../module/course/service/ProcessService.java | 1 - .../controller/admin/ExamBatchController.java | 43 +++++++++ .../yudao/module/exam/entity/ExamBatch.java | 95 +++++++++++++++++++ .../module/exam/entity/ExamBatchItem.java | 56 +++++++++++ .../exam/mapper/ExamBatchItemMapper.java | 15 +++ .../module/exam/mapper/ExamBatchMapper.java | 23 +++++ .../exam/service/ExamBatchItemService.java | 14 +++ .../module/exam/service/ExamBatchService.java | 32 +++++++ .../impl/ExamBatchItemServiceImpl.java | 19 ++++ .../service/impl/ExamBatchServiceImpl.java | 65 +++++++++++++ .../yudao/module/exam/vo/ExamBatchVO.java | 15 +++ .../admin/ReservationCourseController.java | 2 - .../yudao/module/train/entity/Train.java | 2 +- .../impl/ReservationCourseServiceImpl.java | 6 +- .../module/train/vo/ReservationCourseVO.java | 17 ++++ .../base/DlDriveSchoolStudentMapper.xml | 20 ++++ .../resources/mapper/course/ProcessMapper.xml | 14 +++ .../mapper/exam/ExamBatchItemMapper.xml | 7 ++ .../resources/mapper/exam/ExamBatchMapper.xml | 24 +++++ .../mapper/train/ReservationCourseMapper.xml | 16 +++- 26 files changed, 573 insertions(+), 17 deletions(-) create mode 100644 dl-module-jx/src/main/java/cn/iocoder/yudao/module/exam/controller/admin/ExamBatchController.java create mode 100644 dl-module-jx/src/main/java/cn/iocoder/yudao/module/exam/entity/ExamBatch.java create mode 100644 dl-module-jx/src/main/java/cn/iocoder/yudao/module/exam/entity/ExamBatchItem.java create mode 100644 dl-module-jx/src/main/java/cn/iocoder/yudao/module/exam/mapper/ExamBatchItemMapper.java create mode 100644 dl-module-jx/src/main/java/cn/iocoder/yudao/module/exam/mapper/ExamBatchMapper.java create mode 100644 dl-module-jx/src/main/java/cn/iocoder/yudao/module/exam/service/ExamBatchItemService.java create mode 100644 dl-module-jx/src/main/java/cn/iocoder/yudao/module/exam/service/ExamBatchService.java create mode 100644 dl-module-jx/src/main/java/cn/iocoder/yudao/module/exam/service/impl/ExamBatchItemServiceImpl.java create mode 100644 dl-module-jx/src/main/java/cn/iocoder/yudao/module/exam/service/impl/ExamBatchServiceImpl.java create mode 100644 dl-module-jx/src/main/java/cn/iocoder/yudao/module/exam/vo/ExamBatchVO.java create mode 100644 dl-module-jx/src/main/resources/mapper/exam/ExamBatchItemMapper.xml create mode 100644 dl-module-jx/src/main/resources/mapper/exam/ExamBatchMapper.xml diff --git a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/base/controller/admin/DlDriveSchoolStudentController.java b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/base/controller/admin/DlDriveSchoolStudentController.java index 59d2cf41..af0efbbd 100644 --- a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/base/controller/admin/DlDriveSchoolStudentController.java +++ b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/base/controller/admin/DlDriveSchoolStudentController.java @@ -1,7 +1,6 @@ package cn.iocoder.yudao.module.base.controller.admin; import cn.iocoder.yudao.framework.common.pojo.CommonResult; -import cn.iocoder.yudao.framework.common.util.object.BeanUtils; import cn.iocoder.yudao.module.base.entity.DlDriveSchoolStudent; import cn.iocoder.yudao.module.base.service.DlDriveSchoolStudentService; import cn.iocoder.yudao.module.base.vo.DlDriveSchoolStudentVO; @@ -10,7 +9,6 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.tags.Tag; -import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -76,5 +74,17 @@ public class DlDriveSchoolStudentController { return success(schoolStudentService.queryListPage(pageReqVO, page)); } - + /** + * 获取可以考试的学员列表 + * @author vinjor-M + * @date 23:16 2025/1/20 + * @param courseId 课程ID + * @param subject 科目 + * @return List + **/ + @GetMapping("/getCanExamStudentList") + @Operation(summary = "获取可以考试的学员列表") + public CommonResult getCanExamStudentList(String courseId,Integer subject) { + return success(schoolStudentService.getCanExamStudentList(courseId, subject)); + } } \ No newline at end of file diff --git a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/base/mapper/DlDriveSchoolStudentMapper.java b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/base/mapper/DlDriveSchoolStudentMapper.java index 84dca99f..c7413c4b 100644 --- a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/base/mapper/DlDriveSchoolStudentMapper.java +++ b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/base/mapper/DlDriveSchoolStudentMapper.java @@ -8,6 +8,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import java.util.List; + /** * 驾校学员 Mapper * @@ -26,4 +28,11 @@ public interface DlDriveSchoolStudentMapper extends BaseMapper queryListPage(@Param("entity") DlDriveSchoolStudentVO entity, Page page); + + /** + * 获取可以考试的学员列表 + * @author vinjor-M + * @date 23:19 2025/1/20 + **/ + List selectCanExamStudentList(@Param("courseId")String courseId,@Param("coachId")Long coachId,@Param("subject")Integer subject); } \ No newline at end of file diff --git a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/base/service/DlDriveSchoolStudentService.java b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/base/service/DlDriveSchoolStudentService.java index 59559265..63f642c6 100644 --- a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/base/service/DlDriveSchoolStudentService.java +++ b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/base/service/DlDriveSchoolStudentService.java @@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.IService; import javax.validation.Valid; +import java.util.List; /** * 驾校学员 Service 接口 @@ -45,6 +46,15 @@ public interface DlDriveSchoolStudentService extends IService queryListPage(DlDriveSchoolStudentVO pageReqVO, Page page); + + /** + * 获取可以考试的学员列表 + * @author vinjor-M + * @date 23:16 2025/1/20 + * @param courseId 课程ID + * @param subject 科目 + * @return List + **/ + List getCanExamStudentList(String courseId, Integer subject); } \ No newline at end of file diff --git a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/base/service/impl/DlDriveSchoolStudentServiceImpl.java b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/base/service/impl/DlDriveSchoolStudentServiceImpl.java index 6f804c3a..d8755aa8 100644 --- a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/base/service/impl/DlDriveSchoolStudentServiceImpl.java +++ b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/base/service/impl/DlDriveSchoolStudentServiceImpl.java @@ -1,10 +1,13 @@ package cn.iocoder.yudao.module.base.service.impl; import cn.iocoder.yudao.framework.common.util.object.BeanUtils; +import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; +import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; import cn.iocoder.yudao.module.base.entity.DlDriveSchoolStudent; import cn.iocoder.yudao.module.base.mapper.DlDriveSchoolStudentMapper; import cn.iocoder.yudao.module.base.service.DlDriveSchoolStudentService; import cn.iocoder.yudao.module.base.vo.DlDriveSchoolStudentVO; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; @@ -12,6 +15,7 @@ import org.springframework.stereotype.Service; import org.springframework.validation.annotation.Validated; import javax.annotation.Resource; +import java.util.List; /** * 驾校学员 Service 实现类 @@ -54,6 +58,23 @@ public class DlDriveSchoolStudentServiceImpl extends ServiceImpl queryWrapper = new LambdaQueryWrapper() + .eq(DlDriveSchoolStudent::getUserId,userId) + .orderByDesc(BaseDO::getCreateTime); + List list = this.list(queryWrapper); + return list.isEmpty()?null:list.get(0); + } + /** * 分页查询学生列表 * @@ -68,5 +89,21 @@ public class DlDriveSchoolStudentServiceImpl extends ServiceImpl + * @author vinjor-M + * @date 23:16 2025/1/20 + **/ + @Override + public List getCanExamStudentList(String courseId, Integer subject) { + //教练ID + Long userId = SecurityFrameworkUtils.getLoginUserId(); + return dlDriveSchoolStudentMapper.selectCanExamStudentList(courseId,userId,subject); + } + } \ No newline at end of file diff --git a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/course/entity/Process.java b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/course/entity/Process.java index ae162cd9..3751c50a 100644 --- a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/course/entity/Process.java +++ b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/course/entity/Process.java @@ -68,9 +68,9 @@ public class Process extends TenantBaseDO { */ private String status; /** - * 考试是否合格(0未通过;1已通过;null 未考试) + * 考试状态(0未通过;1已通过;9已送考;null未送考) */ - private Boolean ifPass; + private String examStatus; /** * 考试分数 */ diff --git a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/course/mapper/ProcessMapper.java b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/course/mapper/ProcessMapper.java index a1f3615f..4b351a12 100644 --- a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/course/mapper/ProcessMapper.java +++ b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/course/mapper/ProcessMapper.java @@ -3,6 +3,9 @@ package cn.iocoder.yudao.module.course.mapper; import cn.iocoder.yudao.module.course.entity.Process; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 驾校-学员课程进度 Mapper @@ -12,5 +15,18 @@ import org.apache.ibatis.annotations.Mapper; @Mapper public interface ProcessMapper extends BaseMapper { - + /** + * 更新学生考试的状态为已送考状态 + * @author vinjor-M + * @date 23:59 2025/1/20 + * @param userIdList 学生Id集和 + * @param courseId 课程ID + * @param subject 科目 + * @param coachId 教练 + * @return int + **/ + int updateProcessBatch(@Param("userIdList")List userIdList, + @Param("courseId")String courseId, + @Param("subject")Integer subject, + @Param("coachId")Long coachId); } \ No newline at end of file diff --git a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/course/service/ProcessService.java b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/course/service/ProcessService.java index 6d34b3be..c3c9c4fd 100644 --- a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/course/service/ProcessService.java +++ b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/course/service/ProcessService.java @@ -41,5 +41,4 @@ public interface ProcessService extends IService { * @return cn.iocoder.yudao.module.course.entity.Process **/ Process getByStudentAndCourse(Integer userId,String courseId,Integer subject,Long coachId); - } diff --git a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/exam/controller/admin/ExamBatchController.java b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/exam/controller/admin/ExamBatchController.java new file mode 100644 index 00000000..45a446f5 --- /dev/null +++ b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/exam/controller/admin/ExamBatchController.java @@ -0,0 +1,43 @@ +package cn.iocoder.yudao.module.exam.controller.admin; + +import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import cn.iocoder.yudao.module.exam.service.ExamBatchService; +import cn.iocoder.yudao.module.exam.vo.ExamBatchVO; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; + +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; + +@Tag(name = "管理后台 - 考试批次") +@RestController +@RequestMapping("/examBatch") +@Validated +public class ExamBatchController { + + @Resource + private ExamBatchService examBatchService; + + + @GetMapping("/page") + @Operation(summary = "获得考试批次分页") + public CommonResult> getPage(ExamBatchVO pageReqVO, + @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { + Page page = new Page<>(pageNo,pageSize); + return success(examBatchService.queryListPage(pageReqVO,page)); + } + + @PostMapping("/create") + @Operation(summary = "送考") + public CommonResult createObj( @RequestBody ExamBatchVO examBatchVO) { + examBatchService.createObj(examBatchVO); + return success(true); + } + +} \ No newline at end of file diff --git a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/exam/entity/ExamBatch.java b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/exam/entity/ExamBatch.java new file mode 100644 index 00000000..ccf3a2b5 --- /dev/null +++ b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/exam/entity/ExamBatch.java @@ -0,0 +1,95 @@ +package cn.iocoder.yudao.module.exam.entity; + +import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.*; + +import java.util.Date; + +/** + * 驾校-考试批次 DO + * + * @author 若依 + */ +@TableName("drive_school_exam_batch") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class ExamBatch extends TenantBaseDO { + /** + * id + */ + @TableId(type = IdType.ASSIGN_UUID) + private String id; + /** + * 课程ID + */ + private String courseId; + /** + * 课程名称 + */ + private String courseName; + /** + * 教练ID + */ + private Long coachId; + /** + * 教练姓名 + */ + private String coachName; + /** + * 考试开始时间 + */ + private Date startTime; + /** + * 考试结束时间 + */ + private Date endTime; + /** + * 科目(1-科目一;2-科目二;3科目三;4科目四) + */ + private Integer subject; + /** + * 考试地址id + */ + private String addrId; + /** + * 考试地址 + */ + private String addr; + + /** + * 用户(学员)ID + */ + private Long userId; + /** + * 用户(学员)姓名 + */ + private String userName; + /** + * 学员手机号 + */ + private String userMobile; + /** + * 通过率 + */ + private Double passRate; + /** + * 交通方式(字典:school_transport_way) + */ + private String transWay; + /** + * 备注 + */ + private String remark; + /** + * 图片,多个英文逗号隔开 + */ + private String images; + +} \ No newline at end of file diff --git a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/exam/entity/ExamBatchItem.java b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/exam/entity/ExamBatchItem.java new file mode 100644 index 00000000..8a115d97 --- /dev/null +++ b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/exam/entity/ExamBatchItem.java @@ -0,0 +1,56 @@ +package cn.iocoder.yudao.module.exam.entity; + +import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.*; + +/** + * 驾校-考试批次明细表 DO + * + * @author 若依 + */ +@TableName("drive_school_exam_batch_item") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class ExamBatchItem extends TenantBaseDO { + /** + * id + */ + @TableId(type = IdType.ASSIGN_UUID) + private String id; + /** + * 批次ID + */ + private String batchId; + /** + * 学员ID + */ + private Long userId; + /** + * 学员姓名 + */ + private String userName; + /** + * 考试分数 + */ + private Double fraction; + /** + * 图片,多个英文逗号隔开 + */ + private String images; + /** + * 是否已评价(0未评价|1已评价) + */ + private Boolean ifEvaluate; + /** + * 评价ID + */ + private String evaluateId; + +} \ No newline at end of file diff --git a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/exam/mapper/ExamBatchItemMapper.java b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/exam/mapper/ExamBatchItemMapper.java new file mode 100644 index 00000000..f0b6cea4 --- /dev/null +++ b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/exam/mapper/ExamBatchItemMapper.java @@ -0,0 +1,15 @@ +package cn.iocoder.yudao.module.exam.mapper; + +import cn.iocoder.yudao.module.exam.entity.ExamBatchItem; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + * 考试批次明细表 Mapper + * + * @author 若依 + */ +@Mapper +public interface ExamBatchItemMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/exam/mapper/ExamBatchMapper.java b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/exam/mapper/ExamBatchMapper.java new file mode 100644 index 00000000..b7e8561a --- /dev/null +++ b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/exam/mapper/ExamBatchMapper.java @@ -0,0 +1,23 @@ +package cn.iocoder.yudao.module.exam.mapper; + +import cn.iocoder.yudao.module.exam.entity.ExamBatch; +import cn.iocoder.yudao.module.exam.vo.ExamBatchVO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 考试批次主表 Mapper + * + * @author 若依 + */ +@Mapper +public interface ExamBatchMapper extends BaseMapper { + + IPage queryListPage(@Param("entity") ExamBatchVO entity, Page page); + + + +} \ No newline at end of file diff --git a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/exam/service/ExamBatchItemService.java b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/exam/service/ExamBatchItemService.java new file mode 100644 index 00000000..e088ace5 --- /dev/null +++ b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/exam/service/ExamBatchItemService.java @@ -0,0 +1,14 @@ +package cn.iocoder.yudao.module.exam.service; + +import cn.iocoder.yudao.module.exam.entity.ExamBatchItem; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * 考试批次明细表 Service 接口 + * + * @author lzt + */ +public interface ExamBatchItemService extends IService { + + +} diff --git a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/exam/service/ExamBatchService.java b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/exam/service/ExamBatchService.java new file mode 100644 index 00000000..5ffccb7a --- /dev/null +++ b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/exam/service/ExamBatchService.java @@ -0,0 +1,32 @@ +package cn.iocoder.yudao.module.exam.service; + +import cn.iocoder.yudao.module.exam.entity.ExamBatch; +import cn.iocoder.yudao.module.exam.vo.ExamBatchVO; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * 考试批次主表 Service 接口 + * + * @author lzt + */ +public interface ExamBatchService extends IService { + + /** + * 分页查询 + * @author vinjor-M + * @date 15:05 2025/1/14 + * @param pageReqVO TODO + * @param page TODO + **/ + IPage queryListPage(ExamBatchVO pageReqVO, Page page); + + /** + * 送考 + * @author vinjor-M + * @date 23:11 2025/1/20 + * @param examBatchVO + **/ + void createObj(ExamBatchVO examBatchVO); +} diff --git a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/exam/service/impl/ExamBatchItemServiceImpl.java b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/exam/service/impl/ExamBatchItemServiceImpl.java new file mode 100644 index 00000000..c2708f80 --- /dev/null +++ b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/exam/service/impl/ExamBatchItemServiceImpl.java @@ -0,0 +1,19 @@ +package cn.iocoder.yudao.module.exam.service.impl; + +import cn.iocoder.yudao.module.exam.entity.ExamBatchItem; +import cn.iocoder.yudao.module.exam.mapper.ExamBatchItemMapper; +import cn.iocoder.yudao.module.exam.service.ExamBatchItemService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * 考试批次明细表 Service 实现类 + * + * @author 若依 + */ +@Service +public class ExamBatchItemServiceImpl extends ServiceImpl implements ExamBatchItemService { + @Autowired + private ExamBatchItemMapper examBatchItemMapper; +} diff --git a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/exam/service/impl/ExamBatchServiceImpl.java b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/exam/service/impl/ExamBatchServiceImpl.java new file mode 100644 index 00000000..5ab574ab --- /dev/null +++ b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/exam/service/impl/ExamBatchServiceImpl.java @@ -0,0 +1,65 @@ +package cn.iocoder.yudao.module.exam.service.impl; + +import cn.iocoder.yudao.module.course.mapper.ProcessMapper; +import cn.iocoder.yudao.module.exam.entity.ExamBatch; +import cn.iocoder.yudao.module.exam.entity.ExamBatchItem; +import cn.iocoder.yudao.module.exam.mapper.ExamBatchMapper; +import cn.iocoder.yudao.module.exam.service.ExamBatchItemService; +import cn.iocoder.yudao.module.exam.service.ExamBatchService; +import cn.iocoder.yudao.module.exam.vo.ExamBatchVO; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.stream.Collectors; + + +/** + * 考试批次主表 Service 实现类 + * + * @author 若依 + */ +@Service +public class ExamBatchServiceImpl extends ServiceImpl implements ExamBatchService { + @Autowired + private ExamBatchMapper examBatchMapper; + @Autowired + private ProcessMapper processMapper; + @Autowired + private ExamBatchItemService examBatchItemService; + + /** + * 分页查询 + * + * @param pageReqVO TODO + * @param page TODO + * @author vinjor-M + * @date 15:03 2025/1/14 + **/ + @Override + public IPage queryListPage(ExamBatchVO pageReqVO, Page page) { + IPage rtnList = examBatchMapper.queryListPage(pageReqVO, page); + return rtnList; + } + + /** + * 送考 + * + * @param examBatchVO + * @author vinjor-M + * @date 23:11 2025/1/20 + **/ + @Override + public void createObj(ExamBatchVO examBatchVO) { + this.save(examBatchVO); + //存子表数据 + examBatchItemService.saveBatch(examBatchVO.getItemList()); + //更新每个学生对应学习进度表考试的状态,设置为 已送考 + List userIdList = examBatchVO.getItemList().stream().map(ExamBatchItem::getUserId).collect(Collectors.toList()); + processMapper.updateProcessBatch(userIdList,examBatchVO.getCourseId(),examBatchVO.getSubject(),examBatchVO.getCoachId()); + } + +} \ No newline at end of file diff --git a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/exam/vo/ExamBatchVO.java b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/exam/vo/ExamBatchVO.java new file mode 100644 index 00000000..9af23230 --- /dev/null +++ b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/exam/vo/ExamBatchVO.java @@ -0,0 +1,15 @@ +package cn.iocoder.yudao.module.exam.vo; + +import cn.iocoder.yudao.module.exam.entity.ExamBatch; +import cn.iocoder.yudao.module.exam.entity.ExamBatchItem; +import lombok.Data; + +import java.util.List; + +@Data +public class ExamBatchVO extends ExamBatch { + /** + * 明细子表数据 + */ + private List itemList; +} diff --git a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/train/controller/admin/ReservationCourseController.java b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/train/controller/admin/ReservationCourseController.java index af0a22c2..1952b4a8 100644 --- a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/train/controller/admin/ReservationCourseController.java +++ b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/train/controller/admin/ReservationCourseController.java @@ -31,7 +31,6 @@ public class ReservationCourseController { @GetMapping("/page") @Operation(summary = "获得预约练车分页") - @PreAuthorize("@ss.hasPermission('train:reservation-course:query')") public CommonResult> getPage(ReservationCourseVO pageReqVO, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { @@ -49,7 +48,6 @@ public class ReservationCourseController { @PutMapping("/update") @Operation(summary = "审核预约练车") - @PreAuthorize("@ss.hasPermission('train:reservation-course:update')") public CommonResult updateReservationCourse(@Valid @RequestBody ReservationCourseVO updateReqVO) { reservationCourseService.updateById(updateReqVO); return success(true); diff --git a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/train/entity/Train.java b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/train/entity/Train.java index 2a15637e..52d0eded 100644 --- a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/train/entity/Train.java +++ b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/train/entity/Train.java @@ -121,6 +121,6 @@ public class Train extends TenantBaseDO { /** * 评价ID */ - private Integer evaluateId; + private String evaluateId; } \ No newline at end of file diff --git a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/train/service/impl/ReservationCourseServiceImpl.java b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/train/service/impl/ReservationCourseServiceImpl.java index 41bae294..dfa08c07 100644 --- a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/train/service/impl/ReservationCourseServiceImpl.java +++ b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/train/service/impl/ReservationCourseServiceImpl.java @@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.train.service.impl; import cn.hutool.core.date.DateUtil; import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; +import cn.iocoder.yudao.module.base.service.DlDriveSchoolStudentService; import cn.iocoder.yudao.module.course.entity.Process; import cn.iocoder.yudao.module.course.service.ProcessService; import cn.iocoder.yudao.module.train.entity.ReservationCourse; @@ -37,6 +38,8 @@ public class ReservationCourseServiceImpl extends ServiceImpl order by main.create_time desc + \ No newline at end of file diff --git a/dl-module-jx/src/main/resources/mapper/course/ProcessMapper.xml b/dl-module-jx/src/main/resources/mapper/course/ProcessMapper.xml index df6fa254..84e0a1e7 100644 --- a/dl-module-jx/src/main/resources/mapper/course/ProcessMapper.xml +++ b/dl-module-jx/src/main/resources/mapper/course/ProcessMapper.xml @@ -4,4 +4,18 @@ "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> + + UPDATE drive_school_process + SET exam_status = '9' + WHERE + user_id IN + + #{item} + + AND course_id = #{courseId} + AND `subject` = #{subject} + AND coach_id = #{coachId} + AND exam_status IS NULL + AND deleted =0 + diff --git a/dl-module-jx/src/main/resources/mapper/exam/ExamBatchItemMapper.xml b/dl-module-jx/src/main/resources/mapper/exam/ExamBatchItemMapper.xml new file mode 100644 index 00000000..8eac961e --- /dev/null +++ b/dl-module-jx/src/main/resources/mapper/exam/ExamBatchItemMapper.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/dl-module-jx/src/main/resources/mapper/exam/ExamBatchMapper.xml b/dl-module-jx/src/main/resources/mapper/exam/ExamBatchMapper.xml new file mode 100644 index 00000000..87c74771 --- /dev/null +++ b/dl-module-jx/src/main/resources/mapper/exam/ExamBatchMapper.xml @@ -0,0 +1,24 @@ + + + + + + diff --git a/dl-module-jx/src/main/resources/mapper/train/ReservationCourseMapper.xml b/dl-module-jx/src/main/resources/mapper/train/ReservationCourseMapper.xml index e3ca6c29..f3eda1dc 100644 --- a/dl-module-jx/src/main/resources/mapper/train/ReservationCourseMapper.xml +++ b/dl-module-jx/src/main/resources/mapper/train/ReservationCourseMapper.xml @@ -6,9 +6,15 @@