更新
This commit is contained in:
parent
925191a753
commit
61f6b9dbb4
@ -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<IPage<?>> list(DriveSchoolReservationCourse driveSchoolReservationCourse)
|
||||
{
|
||||
Page<DriveSchoolReservationCourse> page = new Page<>(driveSchoolReservationCourse.getPageNum(), driveSchoolReservationCourse.getPageSize());
|
||||
//获取当前登陆人
|
||||
// driveSchoolReservationCourse.setUserId(SecurityFrameworkUtils.getLoginUserId());
|
||||
IPage<DriveSchoolReservationCourse> driveSchoolReservationCourseIPage = driveSchoolReservationCourseService.queryUserRecord(driveSchoolReservationCourse, page);
|
||||
return CommonResult.success(driveSchoolReservationCourseIPage);
|
||||
}
|
||||
|
||||
@GetMapping("/listUser")
|
||||
public CommonResult listUser(DriveSchoolReservationCourse driveSchoolReservationCourse)
|
||||
{
|
||||
Page<DriveSchoolReservationCourse> page = new Page<>(driveSchoolReservationCourse.getPageNum(), 9999);
|
||||
driveSchoolReservationCourse.setUserId(SecurityFrameworkUtils.getLoginUserId());
|
||||
IPage<DriveSchoolReservationCourse> driveSchoolReservationCourseIPage = driveSchoolReservationCourseService.selectDriveSchoolReservationCourseList(driveSchoolReservationCourse, page);
|
||||
List<DriveSchoolReservationCourse> records = driveSchoolReservationCourseIPage.getRecords();
|
||||
return CommonResult.success(records);
|
||||
}
|
||||
|
||||
@GetMapping("/getListUser")
|
||||
public CommonResult getListUser(DriveSchoolReservationCourse driveSchoolReservationCourse)
|
||||
{
|
||||
List<DriveSchoolReservationCourse> 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));
|
||||
}
|
||||
}
|
@ -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;
|
||||
|
||||
}
|
||||
|
@ -97,4 +97,12 @@ public interface DriveSchoolReservationCourseMapper
|
||||
List<DriveSchoolReservationCourse> getAppReservationCourseListByUserIds(DriveSchoolReservationCourse driveSchoolReservationCourse);
|
||||
|
||||
int updateDriveSchoolReservationCourseByCoach(DriveSchoolReservationCourse driveSchoolReservationCourse);
|
||||
|
||||
/**
|
||||
* 分页查询用户的预约记录
|
||||
* @param driveSchoolReservationCourse
|
||||
* @param page
|
||||
* @return
|
||||
*/
|
||||
IPage<DriveSchoolReservationCourse> queryUserRecord(@Param("entity") DriveSchoolReservationCourse driveSchoolReservationCourse, @Param("page") Page<DriveSchoolReservationCourse> page);
|
||||
}
|
||||
|
@ -84,4 +84,12 @@ public interface IDriveSchoolReservationCourseService
|
||||
List<DriveSchoolReservationCourse> getAppReservationCourseListByUserIds(DriveSchoolReservationCourse driveSchoolReservationCourse);
|
||||
|
||||
int updateDriveSchoolReservationCourseByCoach(DriveSchoolReservationCourse driveSchoolReservationCourse);
|
||||
|
||||
/**
|
||||
* 查询用户预约记录
|
||||
* @param driveSchoolReservationCourse
|
||||
* @param page
|
||||
* @return
|
||||
*/
|
||||
IPage<DriveSchoolReservationCourse> queryUserRecord(DriveSchoolReservationCourse driveSchoolReservationCourse, Page<DriveSchoolReservationCourse> page);
|
||||
}
|
||||
|
@ -653,4 +653,16 @@ public class DriveSchoolReservationCourseServiceImpl implements IDriveSchoolRese
|
||||
return driveSchoolReservationCourseMapper.updateDriveSchoolReservationCourseByCoach(driveSchoolReservationCourse);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询用户预约记录
|
||||
*
|
||||
* @param driveSchoolReservationCourse
|
||||
* @param page
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public IPage<DriveSchoolReservationCourse> queryUserRecord(DriveSchoolReservationCourse driveSchoolReservationCourse, Page<DriveSchoolReservationCourse> page) {
|
||||
return driveSchoolReservationCourseMapper.queryUserRecord(driveSchoolReservationCourse, page);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -252,6 +252,26 @@ order by create_time desc
|
||||
<select id="getReservationNumberByUserId" resultType="Integer">
|
||||
select distinct count(1) number from drive_school_reservation_course where deleted = 0 and coach_id = #{userId} and stu_sign_state !='2' or coach_id = #{userId} and coach_sign_state !='2'
|
||||
</select>
|
||||
<select id="queryUserRecord" resultType="cn.iocoder.yudao.module.jx.domain.DriveSchoolReservationCourse">
|
||||
SELECT *,
|
||||
CASE status
|
||||
WHEN 0 THEN '已拒绝'
|
||||
WHEN 1 THEN '已审核'
|
||||
ELSE '待审核'
|
||||
END AS statusStr,
|
||||
CASE subject
|
||||
WHEN 1 THEN '科目一'
|
||||
WHEN 2 THEN '科目二'
|
||||
WHEN 3 THEN '科目三'
|
||||
WHEN 4 THEN '科目四'
|
||||
ELSE '未知'
|
||||
END AS subjectStr
|
||||
FROM drive_school_reservation_course
|
||||
<where>
|
||||
deleted = 0
|
||||
<if test="entity.userId != null ">and user_id = #{entity.userId}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<update id="updateDriveSchoolReservationCourseByCoach" parameterType="cn.iocoder.yudao.module.jx.domain.DriveSchoolReservationCourse">
|
||||
|
Loading…
Reference in New Issue
Block a user