diff --git a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/jx/controller/app/AppDriveSchoolReservationCourseController.java b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/jx/controller/app/AppDriveSchoolReservationCourseController.java new file mode 100644 index 00000000..0830bf8f --- /dev/null +++ b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/jx/controller/app/AppDriveSchoolReservationCourseController.java @@ -0,0 +1,101 @@ +package cn.iocoder.yudao.module.jx.controller.app; + +import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import cn.iocoder.yudao.framework.security.core.LoginUser; +import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; +import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore; +import cn.iocoder.yudao.module.jx.core.controller.BaseController; +import cn.iocoder.yudao.module.jx.domain.DriveSchoolCoach; +import cn.iocoder.yudao.module.jx.domain.DriveSchoolReservationCourse; +import cn.iocoder.yudao.module.jx.mapper.DriveSchoolCoachMapper; +import cn.iocoder.yudao.module.jx.service.IDriveSchoolInfoService; +import cn.iocoder.yudao.module.jx.service.IDriveSchoolReservationCourseService; +import cn.iocoder.yudao.module.system.api.user.AdminUserApi; +import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import org.apache.commons.lang3.ObjectUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; + +/** + * 预约练车Controller - 小程序 + * + * @author ruoyi + * @date 2024-04-08 + */ +@RestController +@RequestMapping("/drivingSchool/system/reservationCourse") +public class AppDriveSchoolReservationCourseController extends BaseController +{ + @Resource + private IDriveSchoolReservationCourseService driveSchoolReservationCourseService; + + + /** + * 查询预约练车列表 + */ + @GetMapping("/list") + @TenantIgnore + public CommonResult> list(DriveSchoolReservationCourse driveSchoolReservationCourse) + { + Page page = new Page<>(driveSchoolReservationCourse.getPageNum(), driveSchoolReservationCourse.getPageSize()); + //获取当前登陆人 +// driveSchoolReservationCourse.setUserId(SecurityFrameworkUtils.getLoginUserId()); + IPage driveSchoolReservationCourseIPage = driveSchoolReservationCourseService.queryUserRecord(driveSchoolReservationCourse, page); + return CommonResult.success(driveSchoolReservationCourseIPage); + } + + @GetMapping("/listUser") + public CommonResult listUser(DriveSchoolReservationCourse driveSchoolReservationCourse) + { + Page page = new Page<>(driveSchoolReservationCourse.getPageNum(), 9999); + driveSchoolReservationCourse.setUserId(SecurityFrameworkUtils.getLoginUserId()); + IPage driveSchoolReservationCourseIPage = driveSchoolReservationCourseService.selectDriveSchoolReservationCourseList(driveSchoolReservationCourse, page); + List records = driveSchoolReservationCourseIPage.getRecords(); + return CommonResult.success(records); + } + + @GetMapping("/getListUser") + public CommonResult getListUser(DriveSchoolReservationCourse driveSchoolReservationCourse) + { + List list = driveSchoolReservationCourseService.selectDriveSchoolReservationGetListUser(driveSchoolReservationCourse); + + return CommonResult.success(list); + } + /** + * 获取预约练车详细信息 + */ + @GetMapping(value = "/{id}") + public CommonResult getInfo(@PathVariable("id") Long id) + { + return success(driveSchoolReservationCourseService.selectDriveSchoolReservationCourseById(id)); + } + + /** + * 新增预约练车 + */ + //@Log(title = "预约练车", businessType = BusinessType.INSERT) + @PostMapping + public CommonResult add(@RequestBody DriveSchoolReservationCourse driveSchoolReservationCourse) throws Exception { + return CommonResult.success(driveSchoolReservationCourseService.insertDriveSchoolReservationCourse(driveSchoolReservationCourse)); + } + + /** + * 修改预约练车 + */ + //@Log(title = "预约练车", businessType = BusinessType.UPDATE) + @PutMapping + public CommonResult edit(@RequestBody DriveSchoolReservationCourse driveSchoolReservationCourse) + { + return toAjax(driveSchoolReservationCourseService.updateDriveSchoolReservationCourse(driveSchoolReservationCourse)); + } + @DeleteMapping("/{ids}") + public CommonResult remove(@PathVariable Long[] ids) + { + return toAjax(driveSchoolReservationCourseService.deleteDriveSchoolReservationCourseByIds(ids)); + } +} diff --git a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/jx/domain/DriveSchoolReservationCourse.java b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/jx/domain/DriveSchoolReservationCourse.java index bf399a71..6a74af07 100644 --- a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/jx/domain/DriveSchoolReservationCourse.java +++ b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/jx/domain/DriveSchoolReservationCourse.java @@ -17,26 +17,33 @@ import java.util.Date; * @date 2024-04-08 */ @Data -public class DriveSchoolReservationCourse extends TenantBaDO -{ +public class DriveSchoolReservationCourse extends TenantBaDO { private static final long serialVersionUID = 1L; - /** 主键id */ + /** + * 主键id + */ private Long id; - /** 机构id */ + /** + * 机构id + */ @Excel(name = "机构id") private Long deptId; - /** 用户id */ + /** + * 用户id + */ @Excel(name = "用户id") private Long userId; - /** 用户姓名 */ + /** + * 用户姓名 + */ @Excel(name = "用户姓名") private String userName; - // 审核状态 0:待审核 1:通过 2 :拒绝 + // 审核状态 0:待审核 1:通过 2 :拒绝 private String auditStatus; //拒绝原因 private String refuseReason; @@ -45,51 +52,68 @@ public class DriveSchoolReservationCourse extends TenantBaDO private String stuSignState; - //教练签到状态 0 :只能签到 1:只能签退 2:都不能 private String coachSignState; - /** 学员签到时间 */ + /** + * 学员签到时间 + */ @JsonFormat(pattern = "yyyy-MM-dd") @Excel(name = "学员签到时间", width = 30, dateFormat = "yyyy-MM-dd") private Date stuSigninTime; - /** 学员签退时间 */ + /** + * 学员签退时间 + */ @JsonFormat(pattern = "yyyy-MM-dd") @Excel(name = "学员签退时间", width = 30, dateFormat = "yyyy-MM-dd") private Date stuSignoutTime; - /** 教练签到时间 */ + /** + * 教练签到时间 + */ @JsonFormat(pattern = "yyyy-MM-dd") @Excel(name = "教练签到时间", width = 30, dateFormat = "yyyy-MM-dd") private Date coachSigninTime; - /** 教练签退时间 */ + /** + * 教练签退时间 + */ @JsonFormat(pattern = "yyyy-MM-dd") @Excel(name = "教练签退时间", width = 30, dateFormat = "yyyy-MM-dd") private Date coachSignoutTime; - /** 预约日期 */ + /** + * 预约日期 + */ @JsonFormat(pattern = "yyyy-MM-dd") @Excel(name = "预约日期", width = 30, dateFormat = "yyyy-MM-dd") private Date orderTime; - /** 时间段 1:上午 2:下午 */ + /** + * 时间段 1:上午 2:下午 + */ @Excel(name = "时间段 1:上午 2:下午") private String timePeriod; - /** 教练id */ + /** + * 教练id + */ @Excel(name = "教练id") private Long coachId; - /** 教练名字 */ + /** + * 教练名字 + */ @Excel(name = "教练名字") private String coachName; //手机号 private String phone; - /** 科目类型 2:科目二 3:科目三 5:科目五 */ + /** + * 科目类型 2:科目二 3:科目三 5:科目五 + */ @Excel(name = "科目类型 2:科目二 3:科目三 5:科目五") private String accountType; //课程名字 @@ -115,4 +139,17 @@ public class DriveSchoolReservationCourse extends TenantBaDO @TableField(exist = false) private DriveSchoolCourse driveSchoolCourse; + /** + * 状态字符串 + */ + @TableField(exist = false) + private String statusStr; + + + /** + * 科目字符串 + */ + @TableField(exist = false) + private String subjectStr; + } diff --git a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/jx/mapper/DriveSchoolReservationCourseMapper.java b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/jx/mapper/DriveSchoolReservationCourseMapper.java index d62641b5..f1ecc713 100644 --- a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/jx/mapper/DriveSchoolReservationCourseMapper.java +++ b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/jx/mapper/DriveSchoolReservationCourseMapper.java @@ -97,4 +97,12 @@ public interface DriveSchoolReservationCourseMapper List getAppReservationCourseListByUserIds(DriveSchoolReservationCourse driveSchoolReservationCourse); int updateDriveSchoolReservationCourseByCoach(DriveSchoolReservationCourse driveSchoolReservationCourse); + + /** + * 分页查询用户的预约记录 + * @param driveSchoolReservationCourse + * @param page + * @return + */ + IPage queryUserRecord(@Param("entity") DriveSchoolReservationCourse driveSchoolReservationCourse, @Param("page") Page page); } diff --git a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/jx/service/IDriveSchoolReservationCourseService.java b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/jx/service/IDriveSchoolReservationCourseService.java index 1abd7f6f..19e13389 100644 --- a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/jx/service/IDriveSchoolReservationCourseService.java +++ b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/jx/service/IDriveSchoolReservationCourseService.java @@ -84,4 +84,12 @@ public interface IDriveSchoolReservationCourseService List getAppReservationCourseListByUserIds(DriveSchoolReservationCourse driveSchoolReservationCourse); int updateDriveSchoolReservationCourseByCoach(DriveSchoolReservationCourse driveSchoolReservationCourse); + + /** + * 查询用户预约记录 + * @param driveSchoolReservationCourse + * @param page + * @return + */ + IPage queryUserRecord(DriveSchoolReservationCourse driveSchoolReservationCourse, Page page); } diff --git a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/jx/service/impl/DriveSchoolReservationCourseServiceImpl.java b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/jx/service/impl/DriveSchoolReservationCourseServiceImpl.java index 2a5c5e74..42e6c85f 100644 --- a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/jx/service/impl/DriveSchoolReservationCourseServiceImpl.java +++ b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/jx/service/impl/DriveSchoolReservationCourseServiceImpl.java @@ -653,4 +653,16 @@ public class DriveSchoolReservationCourseServiceImpl implements IDriveSchoolRese return driveSchoolReservationCourseMapper.updateDriveSchoolReservationCourseByCoach(driveSchoolReservationCourse); } + /** + * 查询用户预约记录 + * + * @param driveSchoolReservationCourse + * @param page + * @return + */ + @Override + public IPage queryUserRecord(DriveSchoolReservationCourse driveSchoolReservationCourse, Page page) { + return driveSchoolReservationCourseMapper.queryUserRecord(driveSchoolReservationCourse, page); + } + } diff --git a/dl-module-jx/src/main/resources/mapper/jx/DriveSchoolReservationCourseMapper.xml b/dl-module-jx/src/main/resources/mapper/jx/DriveSchoolReservationCourseMapper.xml index 4391edfe..1bcc4bfe 100644 --- a/dl-module-jx/src/main/resources/mapper/jx/DriveSchoolReservationCourseMapper.xml +++ b/dl-module-jx/src/main/resources/mapper/jx/DriveSchoolReservationCourseMapper.xml @@ -252,6 +252,26 @@ order by create_time desc +