更新
This commit is contained in:
parent
faf46d49c7
commit
13bfeabaa9
@ -0,0 +1,51 @@
|
||||
package cn.iocoder.yudao.module.base.constant;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 驾校常量
|
||||
* @Author: 86187
|
||||
* @Date: 2025/04/01 14:02
|
||||
* @Version: 1.0
|
||||
*/
|
||||
public interface SchoolBaseConstants {
|
||||
|
||||
// ======================== 通用常量 ========================
|
||||
/**
|
||||
* 通用状态(布尔):是
|
||||
*/
|
||||
public static final Boolean COMMON_YES = true;
|
||||
|
||||
/**
|
||||
* 通用状态(布尔):否
|
||||
*/
|
||||
public static final Boolean COMMON_NO = false;
|
||||
|
||||
|
||||
// ======================== 驾校课程报名订单 ========================
|
||||
|
||||
/**
|
||||
* 驾校课程报名订单-未分配教练
|
||||
*/
|
||||
public static final Integer SCHOOL_COURSE_ORDER_IS_ASSIGN_COACH = 0;
|
||||
|
||||
/**
|
||||
* 驾校课程报名订单-已分配教练
|
||||
*/
|
||||
public static final Integer SCHOOL_COURSE_ORDER_IS_NOT_ASSIGN_COACH = 1;
|
||||
|
||||
// ======================== 学员课程进度 ========================
|
||||
/**
|
||||
* 学员课程进度状态:未开始
|
||||
*/
|
||||
public static final String PROCESS_STATUS_NOT_START = "0";
|
||||
|
||||
/**
|
||||
* 学员课程进度状态:进行中
|
||||
*/
|
||||
public static final String PROCESS_STATUS_IN_PROGRESS = "1";
|
||||
|
||||
/**
|
||||
* 学员课程进度状态:已完成
|
||||
*/
|
||||
public static final String PROCESS_STATUS_COMPLETE = "2";
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
package cn.iocoder.yudao.module.base.controller.admin;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.module.base.service.DlDriveSchoolCoachCourseService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
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;
|
||||
|
||||
/**
|
||||
* @Description: 教练与课程绑定
|
||||
* @Author: 86187
|
||||
* @Date: 2025/04/01 9:56
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@Tag(name = "教练与课程绑定")
|
||||
@RestController
|
||||
@RequestMapping("/base/dl-drive-school-coach-course")
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
public class DlDriveSchoolCoachCourseController {
|
||||
|
||||
private final DlDriveSchoolCoachCourseService coachCourseService;
|
||||
|
||||
/**
|
||||
* 根据课程id获取教练信息
|
||||
* @param courseId 课程id
|
||||
* @return 教练信息
|
||||
*/
|
||||
@GetMapping("/getCoachByCourseId")
|
||||
@Operation(summary = "根据课程id获取教练信息")
|
||||
public CommonResult<?> getCoachByCourseId(@RequestParam("courseId") String courseId) {
|
||||
return success(coachCourseService.queryByCourseId(courseId));
|
||||
}
|
||||
}
|
@ -4,6 +4,7 @@ import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.course.entity.Process;
|
||||
import cn.iocoder.yudao.module.course.service.ProcessService;
|
||||
import cn.iocoder.yudao.module.course.vo.ProcessAddVO;
|
||||
import cn.iocoder.yudao.module.course.vo.ProcessVO;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
@ -16,6 +17,8 @@ import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "管理后台 - 学员课程进度")
|
||||
@ -106,4 +109,17 @@ public class ProcessController {
|
||||
return success(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存学员课程进度
|
||||
*
|
||||
* @param request {@link ProcessAddVO}
|
||||
* @return cn.iocoder.yudao.framework.common.pojo.CommonResult<java.lang.Boolean>
|
||||
*/
|
||||
@PostMapping("/saveProcess")
|
||||
@Operation(summary = "保存学员课程进度")
|
||||
public CommonResult<Boolean> saveProcess(@RequestBody ProcessAddVO request) {
|
||||
processService.saveProcess(request);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
}
|
@ -79,4 +79,20 @@ public class SchoolCourseOrderController {
|
||||
return success(schoolCourseOrderService.queryPage(page, pageReqVO));
|
||||
}
|
||||
|
||||
/**
|
||||
* 终止订单
|
||||
*
|
||||
* @param pageReqVO {@link SchoolCourseOrderVO}
|
||||
* @return cn.iocoder.yudao.framework.common.pojo.CommonResult<java.lang.Boolean>
|
||||
*/
|
||||
@PutMapping("/endOrder")
|
||||
public CommonResult<?> endOrder(@RequestBody SchoolCourseOrderVO pageReqVO) {
|
||||
// 校验订单号和结束时间
|
||||
if (pageReqVO.getOrderNo() == null || pageReqVO.getEndReason() == null || pageReqVO.getEndTime() == null) {
|
||||
throw new RuntimeException("订单号和结束时间不能为空");
|
||||
}
|
||||
schoolCourseOrderService.endOrder(pageReqVO.getOrderNo(), pageReqVO.getEndReason(), pageReqVO.getEndTime());
|
||||
return success(true);
|
||||
}
|
||||
|
||||
}
|
@ -104,6 +104,10 @@ public class SchoolCourseOrder extends TenantBaseDO {
|
||||
* 支付类型 1:定金 2:全款
|
||||
*/
|
||||
private String payType;
|
||||
/**
|
||||
* 是否分配教练 0:否 1:是
|
||||
*/
|
||||
private Integer ifAssignmentCoach;
|
||||
|
||||
|
||||
}
|
@ -1,6 +1,7 @@
|
||||
package cn.iocoder.yudao.module.course.service;
|
||||
|
||||
import cn.iocoder.yudao.module.course.entity.Process;
|
||||
import cn.iocoder.yudao.module.course.vo.ProcessAddVO;
|
||||
import cn.iocoder.yudao.module.course.vo.ProcessVO;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
@ -98,4 +99,11 @@ public interface ProcessService extends IService<Process> {
|
||||
* @date 15:24 2025/2/18
|
||||
**/
|
||||
void checkProcess(Process process);
|
||||
|
||||
/**
|
||||
* 保存学员课程进度
|
||||
*
|
||||
* @param processes {@link Process}
|
||||
*/
|
||||
void saveProcess(ProcessAddVO request);
|
||||
}
|
||||
|
@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 驾照报名订单 Service 接口
|
||||
@ -59,4 +60,12 @@ public interface SchoolCourseOrderService extends IService<SchoolCourseOrder> {
|
||||
* @date 10:10 2025/2/25
|
||||
**/
|
||||
IPage<SchoolCourseOrderVO> queryPage(Page<SchoolCommissionVO> page, SchoolCourseOrderVO pageReqVO);
|
||||
|
||||
/**
|
||||
* 终止订单
|
||||
* @param orderNo 订单号
|
||||
* @param endReason 终止原因
|
||||
* @param endTime 终止时间
|
||||
*/
|
||||
void endOrder(String orderNo, String endReason, LocalDateTime endTime);
|
||||
}
|
@ -1,13 +1,19 @@
|
||||
package cn.iocoder.yudao.module.course.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
import cn.iocoder.yudao.framework.security.core.LoginUser;
|
||||
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
||||
import cn.iocoder.yudao.module.base.constant.SchoolBaseConstants;
|
||||
import cn.iocoder.yudao.module.course.entity.Process;
|
||||
import cn.iocoder.yudao.module.course.entity.SchoolCommission;
|
||||
import cn.iocoder.yudao.module.course.entity.SchoolCourseOrder;
|
||||
import cn.iocoder.yudao.module.course.mapper.ProcessMapper;
|
||||
import cn.iocoder.yudao.module.course.service.ProcessService;
|
||||
import cn.iocoder.yudao.module.course.service.SchoolCommissionService;
|
||||
import cn.iocoder.yudao.module.course.service.SchoolCourseOrderService;
|
||||
import cn.iocoder.yudao.module.course.vo.ProcessAddVO;
|
||||
import cn.iocoder.yudao.module.course.vo.ProcessVO;
|
||||
import cn.iocoder.yudao.module.jx.domain.DriveSchoolDeduct;
|
||||
import cn.iocoder.yudao.module.jx.service.IDriveSchoolDeductService;
|
||||
@ -16,6 +22,7 @@ import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
|
||||
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
@ -44,6 +51,9 @@ public class ProcessServiceImpl extends ServiceImpl<ProcessMapper, Process> impl
|
||||
@Resource
|
||||
private SchoolCommissionService schoolCommissionService;
|
||||
|
||||
@Resource
|
||||
private SchoolCourseOrderService schoolCourseOrderService;
|
||||
|
||||
|
||||
/**
|
||||
* 教练查自己带教的课程和科目
|
||||
@ -264,4 +274,58 @@ public class ProcessServiceImpl extends ServiceImpl<ProcessMapper, Process> impl
|
||||
updateById(process);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存学员课程进度
|
||||
*
|
||||
* @param request {@link ProcessAddVO}
|
||||
*/
|
||||
@Override
|
||||
public void saveProcess(ProcessAddVO request) {
|
||||
List<Process> processes = BeanUtil.copyToList(request.getProcessList(), Process.class);
|
||||
// 校验详细信息
|
||||
verify(processes);
|
||||
// 保存信息
|
||||
this.saveBatch(processes);
|
||||
|
||||
// 修改订单信息中的是否分配教练状态
|
||||
schoolCourseOrderService.update(Wrappers.lambdaUpdate(SchoolCourseOrder.class)
|
||||
.eq(SchoolCourseOrder::getId, request.getOrderId())
|
||||
.set(SchoolCourseOrder::getIfAssignmentCoach, SchoolBaseConstants.SCHOOL_COURSE_ORDER_IS_NOT_ASSIGN_COACH));
|
||||
|
||||
}
|
||||
|
||||
private static void verify(List<Process> processes) {
|
||||
for (Process process : processes) {
|
||||
// 校验状态
|
||||
if (StrUtil.isBlank(process.getStatus())) {
|
||||
throw new RuntimeException("状态不能为空");
|
||||
}
|
||||
// 校验科目
|
||||
if (null == process.getSubject()) {
|
||||
throw new RuntimeException("科目不能为空");
|
||||
}
|
||||
if (StrUtil.isBlank(process.getCourseId())) {
|
||||
throw new RuntimeException("课程ID不能为空");
|
||||
}
|
||||
if (StrUtil.isBlank(process.getCourseName())) {
|
||||
throw new RuntimeException("课程名称不能为空");
|
||||
}
|
||||
if (null == process.getUserId()) {
|
||||
throw new RuntimeException("用户ID不能为空");
|
||||
}
|
||||
if (StrUtil.isBlank(process.getUserName())) {
|
||||
throw new RuntimeException("用户名称不能为空");
|
||||
}
|
||||
if (StrUtil.isBlank(process.getUserMobile())) {
|
||||
throw new RuntimeException("用户手机号不能为空");
|
||||
}
|
||||
if (null == process.getCoachId()) {
|
||||
throw new RuntimeException("教练ID不能为空");
|
||||
}
|
||||
if (StrUtil.isBlank(process.getCoachName())) {
|
||||
throw new RuntimeException("教练名称不能为空");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -2,18 +2,24 @@ package cn.iocoder.yudao.module.course.service.impl;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.base.constant.SchoolBaseConstants;
|
||||
import cn.iocoder.yudao.module.course.entity.Process;
|
||||
import cn.iocoder.yudao.module.course.entity.SchoolCourseOrder;
|
||||
import cn.iocoder.yudao.module.course.mapper.SchoolCourseOrderMapper;
|
||||
import cn.iocoder.yudao.module.course.service.ProcessService;
|
||||
import cn.iocoder.yudao.module.course.service.SchoolCourseOrderService;
|
||||
import cn.iocoder.yudao.module.course.vo.SchoolCommissionVO;
|
||||
import cn.iocoder.yudao.module.course.vo.SchoolCourseOrderVO;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 驾照报名订单 Service 实现类
|
||||
@ -27,6 +33,9 @@ public class SchoolCourseOrderServiceImpl extends ServiceImpl<SchoolCourseOrderM
|
||||
@Resource
|
||||
private SchoolCourseOrderMapper schoolCourseOrderMapper;
|
||||
|
||||
@Resource
|
||||
private ProcessService processService;
|
||||
|
||||
@Override
|
||||
public String createSchoolCourseOrder(SchoolCourseOrderVO createReqVO) {
|
||||
// 插入
|
||||
@ -70,4 +79,35 @@ public class SchoolCourseOrderServiceImpl extends ServiceImpl<SchoolCourseOrderM
|
||||
return schoolCourseOrderMapper.queryPage(pageReqVO,page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 终止订单
|
||||
*
|
||||
* @param orderNo 订单号
|
||||
* @param endReason 终止原因
|
||||
* @param endTime 终止时间
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public void endOrder(String orderNo, String endReason, LocalDateTime endTime) {
|
||||
// 修改订单表
|
||||
baseMapper.update(Wrappers.lambdaUpdate(SchoolCourseOrder.class)
|
||||
.eq(SchoolCourseOrder::getOrderNo, orderNo)
|
||||
.set(SchoolCourseOrder::getEndReason, endReason)
|
||||
.set(SchoolCourseOrder::getEndTime, endTime)
|
||||
.set(SchoolCourseOrder::getIfEnd, SchoolBaseConstants.COMMON_YES));
|
||||
|
||||
// 查询学员信息
|
||||
SchoolCourseOrder schoolCourseOrder = baseMapper.selectOne(Wrappers.lambdaQuery(SchoolCourseOrder.class)
|
||||
.eq(SchoolCourseOrder::getOrderNo, orderNo));
|
||||
|
||||
// 删除学员未开始和训练中的科目
|
||||
processService.remove(Wrappers.lambdaQuery(Process.class)
|
||||
.eq(Process::getUserId, schoolCourseOrder.getUserId())
|
||||
.and(q -> q.eq(Process::getStatus, SchoolBaseConstants.PROCESS_STATUS_NOT_START)
|
||||
.or()
|
||||
.eq(Process::getStatus, SchoolBaseConstants.PROCESS_STATUS_IN_PROGRESS))
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package cn.iocoder.yudao.module.course.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 保存学生进度vo
|
||||
* @Author: 86187
|
||||
* @Date: 2025/04/01 15:15
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@Data
|
||||
public class ProcessAddVO {
|
||||
/**
|
||||
* 订单id
|
||||
*/
|
||||
private String orderId;
|
||||
/**
|
||||
* 进度信息
|
||||
*/
|
||||
private List<ProcessVO> processList;
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package cn.iocoder.yudao.module.exam.controller.app;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.module.exam.service.ExamBatchService;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* @Description: 小程序-考试批次
|
||||
* @Author: 86187
|
||||
* @Date: 2025/03/31 10:54
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@Tag(name = "小程序 - 考试批次")
|
||||
@RestController
|
||||
@RequestMapping("/examBatch")
|
||||
@Validated
|
||||
public class AppExamBatchController {
|
||||
|
||||
@Resource
|
||||
private ExamBatchService examBatchService;
|
||||
}
|
@ -78,10 +78,9 @@ public class AppDriveSchoolReservationCourseController extends BaseController
|
||||
/**
|
||||
* 新增预约练车
|
||||
*/
|
||||
//@Log(title = "预约练车", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public CommonResult add(@RequestBody DriveSchoolReservationCourse driveSchoolReservationCourse) throws Exception {
|
||||
return CommonResult.success(driveSchoolReservationCourseService.insertDriveSchoolReservationCourse(driveSchoolReservationCourse));
|
||||
return CommonResult.success(driveSchoolReservationCourseService.insertAppReservationCourse(driveSchoolReservationCourse));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -119,13 +119,27 @@ public class DriveSchoolReservationCourse extends TenantBaDO {
|
||||
//课程名字
|
||||
private String courseName;
|
||||
|
||||
//课程id
|
||||
private String courseId;
|
||||
|
||||
//预约类型 1:正常预约 2:立即练车
|
||||
private String type;
|
||||
|
||||
//练车时长
|
||||
private double driveTime;
|
||||
|
||||
//预约日期
|
||||
private String reservDay;
|
||||
|
||||
//预约时间段
|
||||
private String reservTime;
|
||||
|
||||
private String currentDate;
|
||||
// 科目
|
||||
private String subject;
|
||||
|
||||
// 是否取消预约
|
||||
private boolean ifCancel;
|
||||
//练车总时长
|
||||
@TableField(exist = false)
|
||||
private double allDriveTime;
|
||||
|
@ -40,6 +40,13 @@ public interface IDriveSchoolReservationCourseService
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDriveSchoolReservationCourse(DriveSchoolReservationCourse driveSchoolReservationCourse) throws Exception;
|
||||
/**
|
||||
* 小程序新增预约练车
|
||||
*
|
||||
* @param driveSchoolReservationCourse 预约练车
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertAppReservationCourse(DriveSchoolReservationCourse driveSchoolReservationCourse) throws Exception;
|
||||
|
||||
/**
|
||||
* 修改预约练车
|
||||
|
@ -1,6 +1,8 @@
|
||||
package cn.iocoder.yudao.module.jx.service.impl;
|
||||
|
||||
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
||||
import cn.iocoder.yudao.module.exam.entity.ExamBatchItem;
|
||||
import cn.iocoder.yudao.module.exam.service.ExamBatchItemService;
|
||||
import cn.iocoder.yudao.module.jx.domain.*;
|
||||
import cn.iocoder.yudao.module.jx.payment.entity.DriveSchoolPay;
|
||||
import cn.iocoder.yudao.module.jx.payment.mapper.DrivePayMapper;
|
||||
@ -17,6 +19,7 @@ import cn.iocoder.yudao.module.jx.vo.StatisticsVo;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
|
||||
import cn.iocoder.yudao.module.system.service.user.AdminUserService;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.thoughtworks.xstream.core.SecurityUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
@ -66,6 +69,9 @@ public class DriveSchoolReservationCourseServiceImpl implements IDriveSchoolRese
|
||||
@Resource
|
||||
private DriveSchoolInfoMapper driveSchoolInfoMapper;
|
||||
|
||||
@Resource
|
||||
private ExamBatchItemService examBatchItemService;
|
||||
|
||||
/**
|
||||
* 查询预约练车
|
||||
*
|
||||
@ -253,6 +259,38 @@ public class DriveSchoolReservationCourseServiceImpl implements IDriveSchoolRese
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* 小程序新增预约练车
|
||||
*
|
||||
* @param driveSchoolReservationCourse 预约练车
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertAppReservationCourse(DriveSchoolReservationCourse driveSchoolReservationCourse) throws Exception {
|
||||
// 查询科目一是否合格
|
||||
ExamBatchItem one = examBatchItemService.getOne(Wrappers.<ExamBatchItem>lambdaQuery()
|
||||
.eq(ExamBatchItem::getUserId, driveSchoolReservationCourse.getUserId())
|
||||
.eq(ExamBatchItem::getIfPass, true)
|
||||
.last("limit 1"));
|
||||
if (ObjectUtils.isNotEmpty(one)) {
|
||||
throw new Exception("科目一未通过,无法预约");
|
||||
}
|
||||
|
||||
// 添加预约记录
|
||||
DriveSchoolReservationCourse records = new DriveSchoolReservationCourse();
|
||||
records.setUserId(driveSchoolReservationCourse.getUserId()); // 学员id
|
||||
records.setUserName(driveSchoolReservationCourse.getUserName()); // 学员姓名
|
||||
records.setCoachId(driveSchoolReservationCourse.getCoachId()); // 教练id
|
||||
records.setCoachName(driveSchoolReservationCourse.getCoachName()); // 教练姓名
|
||||
records.setCourseId(driveSchoolReservationCourse.getCourseId()); // 课程id
|
||||
records.setCourseName(driveSchoolReservationCourse.getCourseName()); // 课程名称
|
||||
records.setTenantId(driveSchoolReservationCourse.getTenantId()); // 手动设置租户id
|
||||
records.setReservDay(driveSchoolReservationCourse.getReservDay()); // 预约日期
|
||||
records.setReservTime(driveSchoolReservationCourse.getReservTime()); // 预约时间段
|
||||
records.setSubject(driveSchoolReservationCourse.getSubject()); // 科目类型
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改预约练车
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user