1
This commit is contained in:
parent
15a297a465
commit
d20feb9fdf
@ -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<DlDriveSchoolStudent>
|
||||
**/
|
||||
@GetMapping("/getCanExamStudentList")
|
||||
@Operation(summary = "获取可以考试的学员列表")
|
||||
public CommonResult<?> getCanExamStudentList(String courseId,Integer subject) {
|
||||
return success(schoolStudentService.getCanExamStudentList(courseId, subject));
|
||||
}
|
||||
}
|
@ -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<DlDriveSchoolStud
|
||||
* @date 10:44 2025/1/18
|
||||
**/
|
||||
IPage<DlDriveSchoolStudentVO> queryListPage(@Param("entity") DlDriveSchoolStudentVO entity, Page<DlDriveSchoolStudentVO> page);
|
||||
|
||||
/**
|
||||
* 获取可以考试的学员列表
|
||||
* @author vinjor-M
|
||||
* @date 23:19 2025/1/20
|
||||
**/
|
||||
List<DlDriveSchoolStudent> selectCanExamStudentList(@Param("courseId")String courseId,@Param("coachId")Long coachId,@Param("subject")Integer subject);
|
||||
}
|
@ -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<DlDriveSchoolStude
|
||||
*/
|
||||
DlDriveSchoolStudent getDlDriveSchoolStudent(String id);
|
||||
|
||||
/**
|
||||
* 根据userID查学员详情
|
||||
* @author vinjor-M
|
||||
* @date 22:17 2025/1/20
|
||||
* @param userId 用户ID
|
||||
* @return cn.iocoder.yudao.module.base.entity.DlDriveSchoolStudent
|
||||
**/
|
||||
DlDriveSchoolStudent getStudentByUserId(Integer userId);
|
||||
|
||||
/**
|
||||
* 分页查询学生列表
|
||||
*
|
||||
@ -55,4 +65,14 @@ public interface DlDriveSchoolStudentService extends IService<DlDriveSchoolStude
|
||||
* @date 10:41 2025/1/18
|
||||
**/
|
||||
IPage<DlDriveSchoolStudentVO> queryListPage(DlDriveSchoolStudentVO pageReqVO, Page<DlDriveSchoolStudentVO> page);
|
||||
|
||||
/**
|
||||
* 获取可以考试的学员列表
|
||||
* @author vinjor-M
|
||||
* @date 23:16 2025/1/20
|
||||
* @param courseId 课程ID
|
||||
* @param subject 科目
|
||||
* @return List<DlDriveSchoolStudent>
|
||||
**/
|
||||
List<DlDriveSchoolStudent> getCanExamStudentList(String courseId, Integer subject);
|
||||
}
|
@ -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<DlDriveSchoolSt
|
||||
return dlDriveSchoolStudentMapper.selectById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据userID查学员详情
|
||||
*
|
||||
* @param userId 用户ID
|
||||
* @return cn.iocoder.yudao.module.base.entity.DlDriveSchoolStudent
|
||||
* @author vinjor-M
|
||||
* @date 22:17 2025/1/20
|
||||
**/
|
||||
@Override
|
||||
public DlDriveSchoolStudent getStudentByUserId(Integer userId) {
|
||||
LambdaQueryWrapper<DlDriveSchoolStudent> queryWrapper = new LambdaQueryWrapper<DlDriveSchoolStudent>()
|
||||
.eq(DlDriveSchoolStudent::getUserId,userId)
|
||||
.orderByDesc(BaseDO::getCreateTime);
|
||||
List<DlDriveSchoolStudent> list = this.list(queryWrapper);
|
||||
return list.isEmpty()?null:list.get(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询学生列表
|
||||
*
|
||||
@ -68,5 +89,21 @@ public class DlDriveSchoolStudentServiceImpl extends ServiceImpl<DlDriveSchoolSt
|
||||
return dlDriveSchoolStudentMapper.queryListPage(pageReqVO,page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取可以考试的学员列表
|
||||
*
|
||||
* @param courseId 课程ID
|
||||
* @param subject 科目
|
||||
* @return List<DlDriveSchoolStudent>
|
||||
* @author vinjor-M
|
||||
* @date 23:16 2025/1/20
|
||||
**/
|
||||
@Override
|
||||
public List<DlDriveSchoolStudent> getCanExamStudentList(String courseId, Integer subject) {
|
||||
//教练ID
|
||||
Long userId = SecurityFrameworkUtils.getLoginUserId();
|
||||
return dlDriveSchoolStudentMapper.selectCanExamStudentList(courseId,userId,subject);
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -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;
|
||||
/**
|
||||
* 考试分数
|
||||
*/
|
||||
|
@ -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<Process> {
|
||||
|
||||
|
||||
/**
|
||||
* 更新学生考试的状态为已送考状态
|
||||
* @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<Long> userIdList,
|
||||
@Param("courseId")String courseId,
|
||||
@Param("subject")Integer subject,
|
||||
@Param("coachId")Long coachId);
|
||||
}
|
@ -41,5 +41,4 @@ public interface ProcessService extends IService<Process> {
|
||||
* @return cn.iocoder.yudao.module.course.entity.Process
|
||||
**/
|
||||
Process getByStudentAndCourse(Integer userId,String courseId,Integer subject,Long coachId);
|
||||
|
||||
}
|
||||
|
@ -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<IPage<?>> getPage(ExamBatchVO pageReqVO,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
|
||||
Page<ExamBatchVO> 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);
|
||||
}
|
||||
|
||||
}
|
@ -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;
|
||||
|
||||
}
|
@ -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;
|
||||
|
||||
}
|
@ -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<ExamBatchItem> {
|
||||
|
||||
}
|
@ -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<ExamBatch> {
|
||||
|
||||
IPage<ExamBatchVO> queryListPage(@Param("entity") ExamBatchVO entity, Page<ExamBatchVO> page);
|
||||
|
||||
|
||||
|
||||
}
|
@ -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<ExamBatchItem> {
|
||||
|
||||
|
||||
}
|
@ -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<ExamBatch> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @author vinjor-M
|
||||
* @date 15:05 2025/1/14
|
||||
* @param pageReqVO TODO
|
||||
* @param page TODO
|
||||
**/
|
||||
IPage<ExamBatchVO> queryListPage(ExamBatchVO pageReqVO, Page<ExamBatchVO> page);
|
||||
|
||||
/**
|
||||
* 送考
|
||||
* @author vinjor-M
|
||||
* @date 23:11 2025/1/20
|
||||
* @param examBatchVO
|
||||
**/
|
||||
void createObj(ExamBatchVO examBatchVO);
|
||||
}
|
@ -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<ExamBatchItemMapper, ExamBatchItem> implements ExamBatchItemService {
|
||||
@Autowired
|
||||
private ExamBatchItemMapper examBatchItemMapper;
|
||||
}
|
@ -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<ExamBatchMapper, ExamBatch> 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<ExamBatchVO> queryListPage(ExamBatchVO pageReqVO, Page<ExamBatchVO> page) {
|
||||
IPage<ExamBatchVO> 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<Long> userIdList = examBatchVO.getItemList().stream().map(ExamBatchItem::getUserId).collect(Collectors.toList());
|
||||
processMapper.updateProcessBatch(userIdList,examBatchVO.getCourseId(),examBatchVO.getSubject(),examBatchVO.getCoachId());
|
||||
}
|
||||
|
||||
}
|
@ -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<ExamBatchItem> itemList;
|
||||
}
|
@ -31,7 +31,6 @@ public class ReservationCourseController {
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得预约练车分页")
|
||||
@PreAuthorize("@ss.hasPermission('train:reservation-course:query')")
|
||||
public CommonResult<IPage<?>> 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<Boolean> updateReservationCourse(@Valid @RequestBody ReservationCourseVO updateReqVO) {
|
||||
reservationCourseService.updateById(updateReqVO);
|
||||
return success(true);
|
||||
|
@ -121,6 +121,6 @@ public class Train extends TenantBaseDO {
|
||||
/**
|
||||
* 评价ID
|
||||
*/
|
||||
private Integer evaluateId;
|
||||
private String evaluateId;
|
||||
|
||||
}
|
@ -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<ReservationCourseM
|
||||
private ProcessService processService;
|
||||
@Autowired
|
||||
private TrainService trainService;
|
||||
@Autowired
|
||||
private DlDriveSchoolStudentService studentService;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
@ -90,8 +93,7 @@ public class ReservationCourseServiceImpl extends ServiceImpl<ReservationCourseM
|
||||
//查当天训练记录--未签退的
|
||||
rtnMap.put("train",trainService.getUserTrainData(userId,courseId,subject,nowDayStr));
|
||||
rtnMap.put("process",process);
|
||||
//TODO 学员表接口对接
|
||||
rtnMap.put("userInfo",null);
|
||||
rtnMap.put("userInfo",studentService.getStudentByUserId(userId));
|
||||
return rtnMap;
|
||||
}
|
||||
}
|
@ -9,4 +9,21 @@ public class ReservationCourseVO extends ReservationCourse {
|
||||
* selectType(my-当前用户的|all所有的)
|
||||
*/
|
||||
private String selectType;
|
||||
/**
|
||||
* 累计训练总时长
|
||||
*/
|
||||
private Double trainTime;
|
||||
|
||||
/**
|
||||
* 用户姓名-学员
|
||||
*/
|
||||
private String userName;
|
||||
/**
|
||||
* 用户手机号-学员
|
||||
*/
|
||||
private String userMobile;
|
||||
/**
|
||||
* 用户性别-学员
|
||||
*/
|
||||
private String userSex;
|
||||
}
|
||||
|
@ -20,4 +20,24 @@
|
||||
</where>
|
||||
order by main.create_time desc
|
||||
</select>
|
||||
<select id="selectCanExamStudentList"
|
||||
resultType="cn.iocoder.yudao.module.base.entity.DlDriveSchoolStudent">
|
||||
SELECT
|
||||
dss.*
|
||||
FROM
|
||||
drive_school_process dsp
|
||||
LEFT JOIN drive_school_student dss ON dsp.user_id = dss.user_id
|
||||
AND dss.deleted = 0
|
||||
WHERE
|
||||
dsp.deleted = 0
|
||||
AND dsp.coach_id = #{coachId}
|
||||
AND dsp.course_id = #{courseId}
|
||||
AND dsp.`subject` = #{subject}
|
||||
AND dsp.`status` = '1'
|
||||
AND dsp.exam_status IS NULL
|
||||
GROUP BY
|
||||
dss.id
|
||||
ORDER BY
|
||||
dss.create_time DESC
|
||||
</select>
|
||||
</mapper>
|
@ -4,4 +4,18 @@
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.iocoder.yudao.module.course.mapper.ProcessMapper">
|
||||
|
||||
<update id="updateProcessBatch">
|
||||
UPDATE drive_school_process
|
||||
SET exam_status = '9'
|
||||
WHERE
|
||||
user_id IN
|
||||
<foreach collection="userIdList" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
AND course_id = #{courseId}
|
||||
AND `subject` = #{subject}
|
||||
AND coach_id = #{coachId}
|
||||
AND exam_status IS NULL
|
||||
AND deleted =0
|
||||
</update>
|
||||
</mapper>
|
||||
|
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.iocoder.yudao.module.exam.mapper.ExamBatchItemMapper">
|
||||
|
||||
</mapper>
|
@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.iocoder.yudao.module.exam.mapper.ExamBatchMapper">
|
||||
|
||||
<select id="queryListPage" resultType="cn.iocoder.yudao.module.exam.vo.ExamBatchVO">
|
||||
SELECT
|
||||
dseb.*
|
||||
FROM
|
||||
drive_school_exam_batch dseb
|
||||
WHERE dseb.deleted=0
|
||||
<if test="entity.coachId != null and entity.coachId != ''">
|
||||
and dsrc.coach_id =#{entity.coachId}
|
||||
</if>
|
||||
<if test="entity.courseId != null and entity.courseId != ''">
|
||||
and dsrc.course_id =#{entity.courseId}
|
||||
</if>
|
||||
<if test="entity.subject != null and entity.subject != ''">
|
||||
and dsrc.subject =#{entity.subject}
|
||||
</if>
|
||||
ORDER BY dseb.create_time
|
||||
</select>
|
||||
</mapper>
|
@ -6,9 +6,15 @@
|
||||
|
||||
<select id="queryListPage" resultType="cn.iocoder.yudao.module.train.vo.ReservationCourseVO">
|
||||
SELECT
|
||||
dsrc.*
|
||||
dsrc.*,dsp.train_time,dss.name AS userName,dss.phone AS userMobile,dss.sex AS userSex
|
||||
FROM
|
||||
drive_school_reservation_course dsrc
|
||||
LEFT JOIN drive_school_process dsp ON dsrc.user_id = dsp.user_id
|
||||
AND dsrc.course_id = dsp.course_id
|
||||
AND dsrc.coach_id = dsp.coach_id
|
||||
AND dsrc.`subject` = dsp.`subject`
|
||||
AND dsp.`status`='1'
|
||||
LEFT JOIN drive_school_student dss ON dsrc.user_id = dss.user_id
|
||||
where
|
||||
dsrc.deleted = 0
|
||||
<if test="entity.userId != null and entity.userId != ''">
|
||||
@ -20,15 +26,15 @@
|
||||
<if test="entity.courseId != null and entity.courseId != ''">
|
||||
and dsrc.course_id =#{entity.courseId}
|
||||
</if>
|
||||
<if test="entity.reservDay != null and entity.reservDay != ''">
|
||||
and dsrc.reserv_day =#{entity.reservDay}
|
||||
</if>
|
||||
<if test="entity.subject != null and entity.subject != ''">
|
||||
and dsrc.subject =#{entity.subject}
|
||||
</if>
|
||||
<if test="entity.ifCancel != null">
|
||||
and dsrc.if_cancel =#{entity.ifCancel}
|
||||
</if>
|
||||
<if test="entity.reservDay != null and entity.reservDay != ''">
|
||||
and dsrc.reserv_day LIKE CONCAT(#{entity.reservDay},'%')
|
||||
</if>
|
||||
order by dsrc.create_time desc
|
||||
order by dsrc.create_time desc,dsp.create_time desc
|
||||
</select>
|
||||
</mapper>
|
||||
|
Loading…
Reference in New Issue
Block a user