更新
This commit is contained in:
parent
8d6a160434
commit
a59ec6f8e2
@ -1,6 +1,7 @@
|
||||
package cn.iocoder.yudao.module.appBase.controller;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
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.DriveSchoolSwiper;
|
||||
import cn.iocoder.yudao.module.jx.service.IDriveSchoolSwiperService;
|
||||
@ -28,6 +29,7 @@ public class DriveSchoolSwiperAppletController extends BaseController
|
||||
/**
|
||||
* 查询驾校-轮播图列表
|
||||
*/
|
||||
@TenantIgnore
|
||||
@GetMapping("/list")
|
||||
public CommonResult list(DriveSchoolSwiper driveSchoolSwiper)
|
||||
{
|
||||
|
@ -26,12 +26,12 @@ public interface SchoolBaseConstants {
|
||||
/**
|
||||
* 驾校课程报名订单-未分配教练
|
||||
*/
|
||||
public static final Integer SCHOOL_COURSE_ORDER_IS_ASSIGN_COACH = 0;
|
||||
public static final Integer SCHOOL_COURSE_ORDER_IS_NOT_ASSIGN_COACH = 0;
|
||||
|
||||
/**
|
||||
* 驾校课程报名订单-已分配教练
|
||||
*/
|
||||
public static final Integer SCHOOL_COURSE_ORDER_IS_NOT_ASSIGN_COACH = 1;
|
||||
public static final Integer SCHOOL_COURSE_ORDER_IS_ASSIGN_COACH = 1;
|
||||
|
||||
// ======================== 学员课程进度 ========================
|
||||
/**
|
||||
@ -48,4 +48,15 @@ public interface SchoolBaseConstants {
|
||||
* 学员课程进度状态:已完成
|
||||
*/
|
||||
public static final String PROCESS_STATUS_COMPLETE = "2";
|
||||
|
||||
// ======================== 驾校评价 ========================
|
||||
/**
|
||||
* 驾校评价类型:训练
|
||||
*/
|
||||
public static final String EVALUATE_TYPE_TRAIN = "0";
|
||||
|
||||
/**
|
||||
* 驾校评价类型:考试
|
||||
*/
|
||||
public static final String EVALUATE_TYPE_EXAM = "1";
|
||||
}
|
||||
|
@ -24,15 +24,16 @@ public class DriveSchoolAddressController {
|
||||
|
||||
/**
|
||||
* 查满足条件的所有地址
|
||||
* @author vinjor-M
|
||||
* @date 18:38 2025/2/6
|
||||
*
|
||||
* @param type 地点类型(0-训练|1-考试)
|
||||
* @return cn.iocoder.yudao.framework.common.pojo.CommonResult<?>
|
||||
**/
|
||||
* @author vinjor-M
|
||||
* @date 18:38 2025/2/6
|
||||
**/
|
||||
@GetMapping("/getList")
|
||||
@Operation(summary = "查满足条件的所有地址")
|
||||
public CommonResult<?> getList(Integer type,String subject) {
|
||||
return success(addressService.getList(type,subject));
|
||||
public CommonResult<?> getList(Integer type, String subject) {
|
||||
return success(addressService.getList(type, subject, null));
|
||||
}
|
||||
|
||||
|
||||
|
@ -0,0 +1,41 @@
|
||||
package cn.iocoder.yudao.module.base.controller.app;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
|
||||
import cn.iocoder.yudao.module.base.service.DriveSchoolAddressService;
|
||||
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.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "小程序 - 地址管理")
|
||||
@RestController
|
||||
@RequestMapping("/small/address")
|
||||
@Validated
|
||||
public class DriveSchoolAddressSmallProgramController {
|
||||
|
||||
@Resource
|
||||
private DriveSchoolAddressService addressService;
|
||||
|
||||
/**
|
||||
* 查满足条件的所有地址
|
||||
* @author vinjor-M
|
||||
* @date 18:38 2025/2/6
|
||||
* @param type 地点类型(0-训练|1-考试)
|
||||
* @return cn.iocoder.yudao.framework.common.pojo.CommonResult<?>
|
||||
**/
|
||||
@GetMapping("/getList")
|
||||
@Operation(summary = "查满足条件的所有地址")
|
||||
@TenantIgnore
|
||||
public CommonResult<?> getList(Integer type,String subject, Long tenantId) {
|
||||
return success(addressService.getList(type,subject,tenantId));
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.base.controller.app;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
||||
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
|
||||
import cn.iocoder.yudao.module.course.entity.SchoolCourseOrder;
|
||||
import cn.iocoder.yudao.module.course.service.SchoolCourseOrderService;
|
||||
@ -72,6 +73,21 @@ public class SchoolCourseOrderSmallProgramController {
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
|
||||
Page<SchoolCommissionVO> page = new Page<>(pageNo, pageSize);
|
||||
return success(schoolCourseOrderService.queryPage(page,pageReqVO));
|
||||
return success(schoolCourseOrderService.queryPage(page, pageReqVO));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户已报名的课程
|
||||
*
|
||||
* @return cn.iocoder.yudao.framework.common.pojo.CommonResult<java.util.List<cn.iocoder.yudao.module.course.vo.SchoolCourseOrderVO>>
|
||||
*/
|
||||
@TenantIgnore
|
||||
@GetMapping("/getCourseByLoginUser")
|
||||
@PermitAll
|
||||
public CommonResult<?> getCourseByLoginUser() {
|
||||
// SecurityFrameworkUtils.getLoginUserId()
|
||||
// TODO 写死了
|
||||
//获取当前登陆人
|
||||
return success(schoolCourseOrderService.getCourseByLoginUser(SecurityFrameworkUtils.getLoginUserId()));
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,47 @@
|
||||
package cn.iocoder.yudao.module.base.entity;
|
||||
|
||||
import cn.iocoder.yudao.annotation.Excel;
|
||||
import cn.iocoder.yudao.module.jx.core.page.TenantBaDO;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Description: 评价
|
||||
* @Author: 86187
|
||||
* @Date: 2025/04/03 14:13
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@TableName("drive_school_feedback")
|
||||
@Data
|
||||
public class SchoolFeedBack extends TenantBaDO {
|
||||
/** 主键 */
|
||||
private Long id;
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Long userId;
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
private String userName;
|
||||
/**
|
||||
* 业务id
|
||||
*/
|
||||
private String busiId;
|
||||
/**
|
||||
* 评分
|
||||
*/
|
||||
private Double rate;
|
||||
/**
|
||||
* 评价类型 business
|
||||
*/
|
||||
private String evaluateType;
|
||||
/**
|
||||
* 教学评价内容
|
||||
*/
|
||||
private String teachContent;
|
||||
/**
|
||||
* 服务评价内容
|
||||
*/
|
||||
private String serviceContent;
|
||||
}
|
@ -14,10 +14,11 @@ public interface DriveSchoolAddressService extends IService<DriveSchoolAddress>
|
||||
|
||||
/**
|
||||
* 查满足条件的所有地址
|
||||
* @author vinjor-M
|
||||
* @date 18:39 2025/2/6
|
||||
*
|
||||
* @param type 地点类型(0-训练|1-考试)
|
||||
* @return java.util.List<cn.iocoder.yudao.module.base.entity.DriveSchoolAddress>
|
||||
**/
|
||||
List<DriveSchoolAddress> getList(Integer type,String subject);
|
||||
* @author vinjor-M
|
||||
* @date 18:39 2025/2/6
|
||||
**/
|
||||
List<DriveSchoolAddress> getList(Integer type, String subject, Long tenantId);
|
||||
}
|
||||
|
@ -0,0 +1,28 @@
|
||||
package cn.iocoder.yudao.module.base.service;
|
||||
|
||||
|
||||
import cn.iocoder.yudao.module.base.entity.SchoolFeedBack;
|
||||
import cn.iocoder.yudao.module.course.vo.SchoolFeedBackVO;
|
||||
import cn.iocoder.yudao.module.jx.domain.DriveSchoolFeedback;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 反馈Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-04-27
|
||||
*/
|
||||
public interface SchoolFeedbackService extends IService<SchoolFeedBack> {
|
||||
|
||||
/**
|
||||
* 新增评论
|
||||
*
|
||||
* @param request 请求
|
||||
*/
|
||||
void add(SchoolFeedBackVO request);
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
package cn.iocoder.yudao.module.base.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.iocoder.yudao.module.base.entity.DriveSchoolAddress;
|
||||
import cn.iocoder.yudao.module.base.mapper.DriveSchoolAddressMapper;
|
||||
import cn.iocoder.yudao.module.base.service.DriveSchoolAddressService;
|
||||
@ -27,14 +28,11 @@ public class DriveSchoolAddressServiceImpl extends ServiceImpl<DriveSchoolAddres
|
||||
* @date 18:39 2025/2/6
|
||||
**/
|
||||
@Override
|
||||
public List<DriveSchoolAddress> getList(Integer type,String subject) {
|
||||
public List<DriveSchoolAddress> getList(Integer type, String subject, Long tenantId) {
|
||||
LambdaQueryWrapper<DriveSchoolAddress> queryWrapper = new LambdaQueryWrapper<DriveSchoolAddress>();
|
||||
if(null!=type){
|
||||
queryWrapper.eq(DriveSchoolAddress::getType,type);
|
||||
}
|
||||
if(null!=subject){
|
||||
queryWrapper.like(DriveSchoolAddress::getSubjects,subject);
|
||||
}
|
||||
queryWrapper.eq(ObjectUtil.isNotEmpty(tenantId), DriveSchoolAddress::getTenantId, tenantId);
|
||||
queryWrapper.eq(ObjectUtil.isNotEmpty(type), DriveSchoolAddress::getType, type);
|
||||
queryWrapper.eq(ObjectUtil.isNotEmpty(subject), DriveSchoolAddress::getSubjects, subject);
|
||||
queryWrapper.orderByAsc(DriveSchoolAddress::getSort);
|
||||
return this.list(queryWrapper);
|
||||
}
|
||||
|
@ -0,0 +1,70 @@
|
||||
package cn.iocoder.yudao.module.course.controller.app;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
||||
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
|
||||
import cn.iocoder.yudao.module.base.constant.SchoolBaseConstants;
|
||||
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.core.toolkit.Wrappers;
|
||||
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.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "小程序 - 学员课程进度")
|
||||
@RestController
|
||||
@RequestMapping("/process")
|
||||
@Validated
|
||||
public class AppProcessController {
|
||||
|
||||
@Resource
|
||||
private ProcessService processService;
|
||||
|
||||
|
||||
/**
|
||||
* 学员课程进度分页查询
|
||||
*
|
||||
* @param pageReqVO {@link ProcessVO}
|
||||
* @param pageNo 分页参数
|
||||
* @param pageSize 分页参数
|
||||
* @return cn.iocoder.yudao.framework.common.pojo.CommonResult<com.baomidou.mybatisplus.core.metadata.IPage < ?>>
|
||||
* @author PQZ
|
||||
* @date 15:33 2025/2/17
|
||||
**/
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "学员课程进度分页")
|
||||
public CommonResult<IPage<?>> getDlDriveSchoolCoachPage(ProcessVO pageReqVO,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
|
||||
Page<ProcessVO> page = new Page<>(pageNo, pageSize);
|
||||
return success(processService.pageProcess(page, pageReqVO));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过学员id和课程id查询学员课程进度
|
||||
*
|
||||
* @param courseId 课程id
|
||||
* @return cn.iocoder.yudao.framework.common.pojo.CommonResult<java.util.List < cn.iocoder.yudao.module.course.vo.ProcessVO>>
|
||||
*/
|
||||
@TenantIgnore
|
||||
@GetMapping("/getAllByCourseId")
|
||||
public CommonResult<?> getAllByCourseId(String courseId) {
|
||||
Long loginUserId = SecurityFrameworkUtils.getLoginUserId();
|
||||
return success(processService.list(Wrappers.lambdaQuery(Process.class)
|
||||
.eq(Process::getUserId, loginUserId)
|
||||
.eq(Process::getCourseId, courseId)));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
package cn.iocoder.yudao.module.course.controller.app;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
|
||||
import cn.iocoder.yudao.module.base.service.SchoolFeedbackService;
|
||||
import cn.iocoder.yudao.module.course.vo.SchoolFeedBackVO;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @Description: 评价
|
||||
* @Author: 86187
|
||||
* @Date: 2025/04/03 14:25
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@Tag(name = "小程序 - 评价")
|
||||
@RestController
|
||||
@RequestMapping("/feed-back")
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
public class AppSchoolFeedBackController {
|
||||
|
||||
private final SchoolFeedbackService schoolFeedbackService;
|
||||
|
||||
/**
|
||||
* 评价
|
||||
*
|
||||
* @param request 请求
|
||||
* @return
|
||||
*/
|
||||
@TenantIgnore
|
||||
@PostMapping
|
||||
public CommonResult<?> add(@RequestBody @Validated SchoolFeedBackVO request) {
|
||||
// 判断租户id是否为空
|
||||
if (request.getTenantId() == null) {
|
||||
throw new RuntimeException("租户id不能为空");
|
||||
}
|
||||
schoolFeedbackService.add(request);
|
||||
return CommonResult.success(true);
|
||||
}
|
||||
}
|
@ -0,0 +1,75 @@
|
||||
package cn.iocoder.yudao.module.course.mapper;
|
||||
|
||||
import cn.iocoder.yudao.module.base.entity.SchoolFeedBack;
|
||||
import cn.iocoder.yudao.module.jx.domain.DriveSchoolFeedback;
|
||||
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;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 反馈Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-04-27
|
||||
*/
|
||||
@Mapper
|
||||
public interface SchoolFeedbackMapper extends BaseMapper<SchoolFeedBack>
|
||||
{
|
||||
/**
|
||||
* 查询反馈
|
||||
*
|
||||
* @param id 反馈主键
|
||||
* @return 反馈
|
||||
*/
|
||||
public DriveSchoolFeedback selectDriveSchoolFeedbackById(Long id);
|
||||
|
||||
/**
|
||||
* 查询反馈列表
|
||||
*
|
||||
* @param driveSchoolFeedback 反馈
|
||||
* @return 反馈集合
|
||||
*/
|
||||
public IPage<DriveSchoolFeedback> selectDriveSchoolFeedbackList(@Param("entity") DriveSchoolFeedback driveSchoolFeedback, Page<DriveSchoolFeedback> page);
|
||||
public List<DriveSchoolFeedback> selectDriveSchoolFeedbackListAll(@Param("entity") DriveSchoolFeedback driveSchoolFeedback);
|
||||
public Integer likeOne(DriveSchoolFeedback driveSchoolFeedback);
|
||||
public Integer likeTwo(DriveSchoolFeedback driveSchoolFeedback);
|
||||
public Integer likeThree(DriveSchoolFeedback driveSchoolFeedback);
|
||||
|
||||
/**
|
||||
* 新增反馈
|
||||
*
|
||||
* @param driveSchoolFeedback 反馈
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDriveSchoolFeedback(DriveSchoolFeedback driveSchoolFeedback);
|
||||
|
||||
/**
|
||||
* 修改反馈
|
||||
*
|
||||
* @param driveSchoolFeedback 反馈
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDriveSchoolFeedback(DriveSchoolFeedback driveSchoolFeedback);
|
||||
|
||||
/**
|
||||
* 删除反馈
|
||||
*
|
||||
* @param id 反馈主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDriveSchoolFeedbackById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除反馈
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDriveSchoolFeedbackByIds(Long[] ids);
|
||||
|
||||
void insertData(@Param("userId") Long userId, @Param("content") String content);
|
||||
}
|
@ -11,6 +11,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 驾照报名订单 Service 接口
|
||||
@ -77,4 +78,12 @@ public interface SchoolCourseOrderService extends IService<SchoolCourseOrder> {
|
||||
* @return 编号
|
||||
*/
|
||||
String fastCreateSchoolCourseOrder(SchoolCourseOrderVO createReqVO);
|
||||
|
||||
/**
|
||||
* 根据用户id获取订单信息
|
||||
*
|
||||
* @param loginUserId 用户id
|
||||
* @return List<SchoolCourseOrderVO>
|
||||
*/
|
||||
List<SchoolCourseOrderVO> getCourseByLoginUser(Long loginUserId);
|
||||
}
|
@ -21,6 +21,7 @@ import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
@ -149,7 +150,7 @@ public class SchoolCourseOrderServiceImpl extends ServiceImpl<SchoolCourseOrderM
|
||||
schoolCourseOrder.setCreateTime(null);
|
||||
schoolCourseOrder.setUpdateTime(null);
|
||||
schoolCourseOrder.setDeleted(SchoolBaseConstants.COMMON_NO);
|
||||
schoolCourseOrder.setIfAssignmentCoach(SchoolBaseConstants.SCHOOL_COURSE_ORDER_IS_ASSIGN_COACH);
|
||||
schoolCourseOrder.setIfAssignmentCoach(SchoolBaseConstants.SCHOOL_COURSE_ORDER_IS_NOT_ASSIGN_COACH);
|
||||
schoolCourseOrder.setIfEnd(SchoolBaseConstants.COMMON_NO);
|
||||
schoolCourseOrder.setEndReason(null);
|
||||
schoolCourseOrder.setEndTime(null);
|
||||
@ -157,6 +158,22 @@ public class SchoolCourseOrderServiceImpl extends ServiceImpl<SchoolCourseOrderM
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据用户id获取订单信息
|
||||
*
|
||||
* @param loginUserId 用户id
|
||||
* @return List<SchoolCourseOrderVO>
|
||||
*/
|
||||
@Override
|
||||
public List<SchoolCourseOrderVO> getCourseByLoginUser(Long loginUserId) {
|
||||
List<SchoolCourseOrder> list = list(Wrappers.lambdaQuery(SchoolCourseOrder.class)
|
||||
.eq(SchoolCourseOrder::getUserId, loginUserId)
|
||||
.eq(SchoolCourseOrder::getIfEnd, SchoolBaseConstants.COMMON_NO)
|
||||
.eq(SchoolCourseOrder::getIfAssignmentCoach, SchoolBaseConstants.SCHOOL_COURSE_ORDER_IS_ASSIGN_COACH)
|
||||
.eq(SchoolCourseOrder::getDeleted, SchoolBaseConstants.COMMON_NO));
|
||||
return BeanUtil.copyToList(list, SchoolCourseOrderVO.class);
|
||||
}
|
||||
|
||||
public String generateOrderNumber() {
|
||||
return "ORDER" + UUID.randomUUID().toString().replace("-", "").substring(0, 10);
|
||||
}
|
||||
|
@ -0,0 +1,75 @@
|
||||
package cn.iocoder.yudao.module.course.service.impl;
|
||||
|
||||
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
||||
import cn.iocoder.yudao.module.base.constant.SchoolBaseConstants;
|
||||
import cn.iocoder.yudao.module.base.entity.SchoolFeedBack;
|
||||
import cn.iocoder.yudao.module.base.service.SchoolFeedbackService;
|
||||
import cn.iocoder.yudao.module.course.mapper.SchoolFeedbackMapper;
|
||||
import cn.iocoder.yudao.module.course.vo.SchoolFeedBackVO;
|
||||
import cn.iocoder.yudao.module.exam.entity.ExamBatchItem;
|
||||
import cn.iocoder.yudao.module.exam.service.ExamBatchItemService;
|
||||
import cn.iocoder.yudao.module.jx.domain.DriveSchoolFeedback;
|
||||
import cn.iocoder.yudao.module.jx.domain.DriveSchoolInfo;
|
||||
import cn.iocoder.yudao.module.jx.mapper.DriveSchoolFeedbackMapper;
|
||||
import cn.iocoder.yudao.module.jx.mapper.DriveSchoolInfoMapper;
|
||||
import cn.iocoder.yudao.module.jx.payment.entity.DriveSchoolPay;
|
||||
import cn.iocoder.yudao.module.jx.payment.service.DriveSchoolPayService;
|
||||
import cn.iocoder.yudao.module.jx.service.IDriveSchoolFeedbackService;
|
||||
import cn.iocoder.yudao.module.jx.vo.DriveSchoolInfoVO;
|
||||
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
|
||||
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
|
||||
import cn.iocoder.yudao.module.train.entity.Train;
|
||||
import cn.iocoder.yudao.module.train.service.TrainService;
|
||||
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 lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 反馈Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-04-27
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class SchoolFeedbackServiceImpl extends ServiceImpl<SchoolFeedbackMapper, SchoolFeedBack> implements SchoolFeedbackService
|
||||
{
|
||||
private final TrainService trainService;
|
||||
|
||||
private final ExamBatchItemService examBatchItemService;
|
||||
/**
|
||||
* 新增评论
|
||||
*
|
||||
* @param request 请求
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void add(SchoolFeedBackVO request) {
|
||||
boolean save = save(request);
|
||||
// 判断评价类型修改训练表或考试表
|
||||
if (SchoolBaseConstants.EVALUATE_TYPE_TRAIN.equals(request.getEvaluateType())) {
|
||||
// 训练表
|
||||
trainService.update(Wrappers.<Train>lambdaUpdate()
|
||||
.eq(Train::getId, request.getBusiId())
|
||||
.set(Train::getIfEvaluate, SchoolBaseConstants.COMMON_YES)
|
||||
.set(Train::getEvaluateId, request.getId()));
|
||||
} else if (SchoolBaseConstants.EVALUATE_TYPE_EXAM.equals(request.getEvaluateType())) {
|
||||
// 考试表
|
||||
examBatchItemService.update(Wrappers.<ExamBatchItem>lambdaUpdate()
|
||||
.eq(ExamBatchItem::getId, request.getBusiId())
|
||||
.set(ExamBatchItem::getIfEvaluate, SchoolBaseConstants.COMMON_YES)
|
||||
.set(ExamBatchItem::getEvaluateId, request.getId()));
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
package cn.iocoder.yudao.module.course.vo;
|
||||
|
||||
import cn.iocoder.yudao.module.base.entity.SchoolFeedBack;
|
||||
|
||||
/**
|
||||
* @Description: 评价vo
|
||||
* @Author: 86187
|
||||
* @Date: 2025/04/03 14:28
|
||||
* @Version: 1.0
|
||||
*/
|
||||
public class SchoolFeedBackVO extends SchoolFeedBack {
|
||||
}
|
@ -44,7 +44,7 @@ public class AppDriveSchoolReservationCourseController extends BaseController
|
||||
{
|
||||
Page<DriveSchoolReservationCourse> page = new Page<>(driveSchoolReservationCourse.getPageNum(), driveSchoolReservationCourse.getPageSize());
|
||||
//获取当前登陆人
|
||||
// driveSchoolReservationCourse.setUserId(SecurityFrameworkUtils.getLoginUserId());
|
||||
driveSchoolReservationCourse.setUserId(SecurityFrameworkUtils.getLoginUserId());
|
||||
IPage<DriveSchoolReservationCourse> driveSchoolReservationCourseIPage = driveSchoolReservationCourseService.queryUserRecord(driveSchoolReservationCourse, page);
|
||||
return CommonResult.success(driveSchoolReservationCourseIPage);
|
||||
}
|
||||
@ -79,7 +79,9 @@ public class AppDriveSchoolReservationCourseController extends BaseController
|
||||
* 新增预约练车
|
||||
*/
|
||||
@PostMapping
|
||||
@TenantIgnore
|
||||
public CommonResult add(@RequestBody DriveSchoolReservationCourse driveSchoolReservationCourse) throws Exception {
|
||||
driveSchoolReservationCourse.setUserId(SecurityFrameworkUtils.getLoginUserId());
|
||||
return CommonResult.success(driveSchoolReservationCourseService.insertAppReservationCourse(driveSchoolReservationCourse));
|
||||
}
|
||||
|
||||
|
@ -4,7 +4,9 @@ import cn.iocoder.yudao.annotation.Excel;
|
||||
import cn.iocoder.yudao.module.jx.core.page.TenantBaDO;
|
||||
import cn.iocoder.yudao.module.jx.payment.entity.DriveSchoolPay;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
@ -23,6 +25,7 @@ public class DriveSchoolReservationCourse extends TenantBaDO {
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
@ -45,6 +48,7 @@ public class DriveSchoolReservationCourse extends TenantBaDO {
|
||||
|
||||
// 审核状态 0:待审核 1:通过 2 :拒绝
|
||||
private String auditStatus;
|
||||
private Boolean status;
|
||||
//拒绝原因
|
||||
private String refuseReason;
|
||||
|
||||
@ -126,7 +130,7 @@ public class DriveSchoolReservationCourse extends TenantBaDO {
|
||||
private String type;
|
||||
|
||||
//练车时长
|
||||
private double driveTime;
|
||||
// private double driveTime;
|
||||
|
||||
//预约日期
|
||||
private String reservDay;
|
||||
@ -134,7 +138,7 @@ public class DriveSchoolReservationCourse extends TenantBaDO {
|
||||
//预约时间段
|
||||
private String reservTime;
|
||||
|
||||
private String currentDate;
|
||||
// private String currentDate;
|
||||
// 科目
|
||||
private String subject;
|
||||
|
||||
@ -166,4 +170,10 @@ public class DriveSchoolReservationCourse extends TenantBaDO {
|
||||
@TableField(exist = false)
|
||||
private String subjectStr;
|
||||
|
||||
/**
|
||||
* 课程类型
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String courseType;
|
||||
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.jx.mapper;
|
||||
|
||||
|
||||
import cn.iocoder.yudao.module.jx.domain.DriveSchoolReservationCourse;
|
||||
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;
|
||||
@ -16,7 +17,7 @@ import java.util.List;
|
||||
* @date 2024-04-08
|
||||
*/
|
||||
@Mapper
|
||||
public interface DriveSchoolReservationCourseMapper
|
||||
public interface DriveSchoolReservationCourseMapper extends BaseMapper<DriveSchoolReservationCourse>
|
||||
{
|
||||
/**
|
||||
* 查询预约练车
|
||||
|
@ -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.course.entity.SchoolCourseOrder;
|
||||
import cn.iocoder.yudao.module.course.mapper.SchoolCourseOrderMapper;
|
||||
import cn.iocoder.yudao.module.exam.entity.ExamBatchItem;
|
||||
import cn.iocoder.yudao.module.exam.service.ExamBatchItemService;
|
||||
import cn.iocoder.yudao.module.jx.domain.*;
|
||||
@ -21,6 +23,7 @@ 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.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.thoughtworks.xstream.core.SecurityUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
@ -46,7 +49,7 @@ import java.util.stream.Collectors;
|
||||
* @date 2024-04-08
|
||||
*/
|
||||
@Service
|
||||
public class DriveSchoolReservationCourseServiceImpl implements IDriveSchoolReservationCourseService
|
||||
public class DriveSchoolReservationCourseServiceImpl extends ServiceImpl<DriveSchoolReservationCourseMapper, DriveSchoolReservationCourse> implements IDriveSchoolReservationCourseService
|
||||
{
|
||||
@Resource
|
||||
private DriveSchoolReservationCourseMapper driveSchoolReservationCourseMapper;
|
||||
@ -224,12 +227,12 @@ public class DriveSchoolReservationCourseServiceImpl implements IDriveSchoolRese
|
||||
}
|
||||
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
String currentDate = driveSchoolReservationCourse.getCurrentDate();
|
||||
String[] parts = currentDate.split("-");
|
||||
int month = Integer.parseInt(parts[0]);
|
||||
int day = Integer.parseInt(parts[1]);
|
||||
// String currentDate = driveSchoolReservationCourse.getCurrentDate();
|
||||
// String[] parts = currentDate.split("-");
|
||||
// int month = Integer.parseInt(parts[0]);
|
||||
// int day = Integer.parseInt(parts[1]);
|
||||
|
||||
currentDate = LocalDate.of(calendar.get(Calendar.YEAR), month, day).format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
|
||||
// currentDate = LocalDate.of(calendar.get(Calendar.YEAR), month, day).format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
|
||||
|
||||
// DriveSchoolCoach selfJl = driveSchoolCoachMapper.findSelfJl(SecurityFrameworkUtils.getLoginUserId());
|
||||
// SysUser user = userService.getById(userId);
|
||||
@ -254,7 +257,7 @@ public class DriveSchoolReservationCourseServiceImpl implements IDriveSchoolRese
|
||||
driveSchoolReservationCourseMapper.insertDriveSchoolReservationCourse(driveSchoolReservationCourse);
|
||||
//发送短信
|
||||
if (PhoneValidator.isValid(driveSchoolCoach.getPhone())) {
|
||||
SendSmsUtil.sendMsgCommon(new String[]{user.getNickname()+" "+user.getNickname(),currentDate+" "+(Integer.parseInt(driveSchoolReservationCourse.getTimePeriod())==1?"上午":"下午")}, driveSchoolCoach.getPhone(),"1400852709","蓝安汽车小程序","2143603");
|
||||
// SendSmsUtil.sendMsgCommon(new String[]{user.getNickname()+" "+user.getNickname(),currentDate+" "+(Integer.parseInt(driveSchoolReservationCourse.getTimePeriod())==1?"上午":"下午")}, driveSchoolCoach.getPhone(),"1400852709","蓝安汽车小程序","2143603");
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
@ -267,15 +270,6 @@ public class DriveSchoolReservationCourseServiceImpl implements IDriveSchoolRese
|
||||
*/
|
||||
@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
|
||||
@ -288,6 +282,8 @@ public class DriveSchoolReservationCourseServiceImpl implements IDriveSchoolRese
|
||||
records.setReservDay(driveSchoolReservationCourse.getReservDay()); // 预约日期
|
||||
records.setReservTime(driveSchoolReservationCourse.getReservTime()); // 预约时间段
|
||||
records.setSubject(driveSchoolReservationCourse.getSubject()); // 科目类型
|
||||
records.setType("1");
|
||||
boolean save = save(records);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -352,7 +348,7 @@ public class DriveSchoolReservationCourseServiceImpl implements IDriveSchoolRese
|
||||
DecimalFormat df = new DecimalFormat("#.00");
|
||||
String formattedNumber = df.format(coachTime);
|
||||
double result = Double.parseDouble(formattedNumber);
|
||||
driveSchoolReservationCourse.setDriveTime(result);
|
||||
// driveSchoolReservationCourse.setDriveTime(result);
|
||||
}else if (ObjectUtils.isNotEmpty(driveSchoolReservationCourse.getCoachSigninTime())){
|
||||
if (stuSigninTime.compareTo(driveSchoolReservationCourse.getCoachSigninTime())> 0){
|
||||
tempStartTime = driveSchoolReservationCourse.getCoachSigninTime();
|
||||
@ -366,14 +362,14 @@ public class DriveSchoolReservationCourseServiceImpl implements IDriveSchoolRese
|
||||
String formattedNumber = df.format(coachTime);
|
||||
double result = Double.parseDouble(formattedNumber);
|
||||
|
||||
driveSchoolReservationCourse.setDriveTime(result);
|
||||
// driveSchoolReservationCourse.setDriveTime(result);
|
||||
}else {
|
||||
long differenceInMilliss = Math.abs(stuSignoutTime.getTime() - stuSigninTime.getTime()); // 计算时间差(毫秒)
|
||||
double coachTime = differenceInMilliss / 3600000.0;
|
||||
DecimalFormat df = new DecimalFormat("#.00");
|
||||
String formattedNumber = df.format(coachTime);
|
||||
double result = Double.parseDouble(formattedNumber);
|
||||
driveSchoolReservationCourse.setDriveTime(result);
|
||||
// driveSchoolReservationCourse.setDriveTime(result);
|
||||
}
|
||||
}
|
||||
//更新教练签到签退时间
|
||||
@ -413,7 +409,7 @@ public class DriveSchoolReservationCourseServiceImpl implements IDriveSchoolRese
|
||||
DecimalFormat df = new DecimalFormat("#.00");
|
||||
String formattedNumber = df.format(coachTime);
|
||||
double result = Double.parseDouble(formattedNumber);
|
||||
driveSchoolReservationCourse.setDriveTime(result);
|
||||
// driveSchoolReservationCourse.setDriveTime(result);
|
||||
}else if (ObjectUtils.isNotEmpty(driveSchoolReservationCourse.getStuSigninTime())){
|
||||
if (coachSigninTime1.compareTo(driveSchoolReservationCourse.getStuSigninTime())> 0){
|
||||
tempStartTime = driveSchoolReservationCourse.getStuSigninTime();
|
||||
@ -426,14 +422,14 @@ public class DriveSchoolReservationCourseServiceImpl implements IDriveSchoolRese
|
||||
DecimalFormat df = new DecimalFormat("#.00");
|
||||
String formattedNumber = df.format(coachTime);
|
||||
double result = Double.parseDouble(formattedNumber);
|
||||
driveSchoolReservationCourse.setDriveTime(result);
|
||||
// driveSchoolReservationCourse.setDriveTime(result);
|
||||
}else {
|
||||
long differenceInMilliss = Math.abs(coachSignoutTime1.getTime() - coachSigninTime1.getTime()); // 计算时间差(毫秒)
|
||||
double coachTime = differenceInMilliss / 3600000.0;
|
||||
DecimalFormat df = new DecimalFormat("#.00");
|
||||
String formattedNumber = df.format(coachTime);
|
||||
double result = Double.parseDouble(formattedNumber);
|
||||
driveSchoolReservationCourse.setDriveTime(result);
|
||||
// driveSchoolReservationCourse.setDriveTime(result);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,135 @@
|
||||
package cn.iocoder.yudao.module.train.controller.app;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
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.vo.DlDriveSchoolStudentVO;
|
||||
import cn.iocoder.yudao.module.course.service.ProcessService;
|
||||
import cn.iocoder.yudao.module.jx.domain.DriveSchoolCar;
|
||||
import cn.iocoder.yudao.module.jx.mapper.DriveSchoolCarMapper;
|
||||
import cn.iocoder.yudao.module.train.service.TrainService;
|
||||
import cn.iocoder.yudao.module.train.vo.TrainVO;
|
||||
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.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
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("/train")
|
||||
@Validated
|
||||
public class AppTrainController {
|
||||
|
||||
@Resource
|
||||
private TrainService trainService;
|
||||
@Resource
|
||||
private ProcessService processService;
|
||||
@Resource
|
||||
private DlDriveSchoolStudentMapper studentMapper;
|
||||
@Resource
|
||||
private DriveSchoolCarMapper carMapper;
|
||||
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得练车记录分页")
|
||||
public CommonResult<IPage<?>> getPage(TrainVO pageReqVO,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
|
||||
Page<TrainVO> page = new Page<>(pageNo,pageSize);
|
||||
if("my".equals(pageReqVO.getSelectType())){
|
||||
//查自己的
|
||||
Long userId = SecurityFrameworkUtils.getLoginUserId();
|
||||
pageReqVO.setUserId(userId);
|
||||
}
|
||||
return success(trainService.queryTrainListPage(pageReqVO,page));
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "到场打卡")
|
||||
public CommonResult<?> createObj( @RequestBody TrainVO trainVO) {
|
||||
trainService.createObj(trainVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "离场打卡")
|
||||
public CommonResult<?> updateObj( @RequestBody TrainVO trainVO) {
|
||||
trainService.updateObj(trainVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "查看练车记录详情")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
public CommonResult<?> getById(@RequestParam("id") String id) {
|
||||
return success(trainService.getById(id));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 首页数据统计查询接口 --
|
||||
* @author vinjor-M
|
||||
* @date 14:12 2025/2/14
|
||||
* @param type 查询类型(car-训练车辆|student-训练学生)
|
||||
* @param timeType 时间查询类型(all-全部|day-当日|month-当月|more-自定义)
|
||||
* @param coachId 教练id
|
||||
* @param startTime 查询时间范围--开始
|
||||
* @param endTime 查询时间范围--结束
|
||||
* @return cn.iocoder.yudao.framework.common.pojo.CommonResult<?>
|
||||
**/
|
||||
@GetMapping("/indexGetTrainList")
|
||||
@Operation(summary = "首页数据统计查询接口")
|
||||
public CommonResult<IPage<?>> indexGetTrainList(@RequestParam(value = "type") String type,
|
||||
@RequestParam(value = "timeType") String timeType,
|
||||
@RequestParam(value = "coachId",required = false) Long coachId,
|
||||
@RequestParam(value = "sourceCoachId",required = false) Long sourceCoachId,
|
||||
@RequestParam(value = "searchValue",required = false) String searchValue,
|
||||
@RequestParam(value = "courseType",required = false) String courseType,
|
||||
@RequestParam(value = "subject",required = false) Integer subject,
|
||||
@RequestParam(value = "sort",required = false) String sort,
|
||||
@RequestParam(value = "startTime",required = false) String startTime,
|
||||
@RequestParam(value = "endTime",required = false) String endTime,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
|
||||
//默认查全部数据
|
||||
String startTimeStr = "";
|
||||
String endTimeStr = "";
|
||||
if("more".equals(timeType)){
|
||||
if(StringUtils.isNotEmpty(startTime)){
|
||||
startTimeStr = startTime+" 00:00:01";
|
||||
}
|
||||
if(StringUtils.isNotEmpty(endTime)) {
|
||||
endTimeStr = endTime + " 23:59:59";
|
||||
}
|
||||
}else if("month".equals(timeType)){
|
||||
//当月
|
||||
startTimeStr = DateUtil.format(DateUtil.beginOfMonth(DateUtil.date()),"yyyy-MM-dd")+" 00:00:01";
|
||||
endTimeStr = DateUtil.format(DateUtil.endOfMonth(DateUtil.date()),"yyyy-MM-dd")+" 23:59:59";
|
||||
}else if("day".equals(timeType)){
|
||||
//当天
|
||||
startTimeStr = DateUtil.formatDate(DateUtil.date())+" 00:00:01";
|
||||
endTimeStr = DateUtil.formatDate(DateUtil.date())+" 23:59:59";
|
||||
}
|
||||
if("student".equals(type)){
|
||||
Page<DlDriveSchoolStudent> page = new Page<>(pageNo,pageSize);
|
||||
IPage<DlDriveSchoolStudentVO> studentPage = studentMapper.selectTrainStudent(coachId,startTimeStr,endTimeStr,searchValue,courseType,subject,sort,page);
|
||||
return success(studentPage);
|
||||
}else{
|
||||
//训练车辆
|
||||
Page<DriveSchoolCar> page = new Page<>(pageNo,pageSize);
|
||||
return success(carMapper.selectTrainCar(coachId,startTimeStr,endTimeStr,searchValue,courseType,page));
|
||||
}
|
||||
}
|
||||
}
|
@ -22,4 +22,5 @@ public interface TrainMapper extends BaseMapper<Train> {
|
||||
|
||||
List<TrainVO> selectTrainByCondition(@Param("coachId")Long coachId,@Param("startTime")String startTime,@Param("endTime")String endTime);
|
||||
|
||||
IPage<TrainVO> queryTrainListPage(@Param("entity") TrainVO pageReqVO,@Param("page") Page<TrainVO> page);
|
||||
}
|
@ -17,48 +17,63 @@ public interface TrainService extends IService<Train> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param pageReqVO TODO
|
||||
* @param page TODO
|
||||
* @author vinjor-M
|
||||
* @date 15:05 2025/1/14
|
||||
* @param pageReqVO TODO
|
||||
* @param page TODO
|
||||
**/
|
||||
**/
|
||||
IPage<TrainVO> queryListPage(TrainVO pageReqVO, Page<TrainVO> page);
|
||||
|
||||
/**
|
||||
* 分页查询训练记录
|
||||
*
|
||||
* @param pageReqVO TODO
|
||||
* @param page TODO
|
||||
* @author vinjor-M
|
||||
* @date 15:05 2025/1/14
|
||||
**/
|
||||
IPage<TrainVO> queryTrainListPage(TrainVO pageReqVO, Page<TrainVO> page);
|
||||
|
||||
/**
|
||||
* 到场打卡
|
||||
*
|
||||
* @param trainVO TODO
|
||||
* @author vinjor-M
|
||||
* @date 15:47 2025/1/14
|
||||
* @param trainVO TODO
|
||||
**/
|
||||
**/
|
||||
void createObj(TrainVO trainVO);
|
||||
|
||||
/**
|
||||
* 离场打卡
|
||||
*
|
||||
* @param trainVO TODO
|
||||
* @author vinjor-M
|
||||
* @date 15:49 2025/1/14
|
||||
* @param trainVO TODO
|
||||
**/
|
||||
**/
|
||||
void updateObj(TrainVO trainVO);
|
||||
|
||||
/**
|
||||
* 查某个学院某个课程某个科目某天的培训记录-未签退的
|
||||
*
|
||||
* @param userId 学员用户id
|
||||
* @param courseId 课程ID
|
||||
* @param subject 科目
|
||||
* @param dayStr 日期
|
||||
* @return cn.iocoder.yudao.module.train.entity.Train
|
||||
* @author vinjor-M
|
||||
* @date 10:21 2025/1/17
|
||||
* @param userId 学员用户id
|
||||
* @param courseId 课程ID
|
||||
* @param subject 科目
|
||||
* @param dayStr 日期
|
||||
* @return cn.iocoder.yudao.module.train.entity.Train
|
||||
**/
|
||||
Train getUserTrainData(Long userId,String courseId,Integer subject,String dayStr);
|
||||
**/
|
||||
Train getUserTrainData(Long userId, String courseId, Integer subject, String dayStr);
|
||||
|
||||
/**
|
||||
* 查某学生所有培训记录
|
||||
*
|
||||
* @param userId 学生id
|
||||
* @param coachId 教练id,可能为空
|
||||
* @return java.util.List<cn.iocoder.yudao.module.train.entity.Train>
|
||||
* @author vinjor-M
|
||||
* @date 16:26 2025/2/10
|
||||
* @param userId 学生id
|
||||
* @param coachId 教练id,可能为空
|
||||
* @return java.util.List<cn.iocoder.yudao.module.train.entity.Train>
|
||||
**/
|
||||
List<Train> selectByUserIdAndCoachId(Long userId,Long coachId);
|
||||
**/
|
||||
List<Train> selectByUserIdAndCoachId(Long userId, Long coachId);
|
||||
}
|
||||
|
@ -47,6 +47,19 @@ public class TrainServiceImpl extends ServiceImpl<TrainMapper, Train> implements
|
||||
return rtnList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询训练记录
|
||||
*
|
||||
* @param pageReqVO TODO
|
||||
* @param page TODO
|
||||
* @author vinjor-M
|
||||
* @date 15:05 2025/1/14
|
||||
**/
|
||||
@Override
|
||||
public IPage<TrainVO> queryTrainListPage(TrainVO pageReqVO, Page<TrainVO> page) {
|
||||
return trainMapper.queryTrainListPage(pageReqVO, page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 到场打卡
|
||||
*
|
||||
|
@ -17,4 +17,8 @@ public class TrainVO extends Train {
|
||||
* 车牌号
|
||||
*/
|
||||
private String carNo;
|
||||
/**
|
||||
* 课程类型
|
||||
*/
|
||||
private String courseType;
|
||||
}
|
||||
|
@ -253,7 +253,7 @@ order by create_time desc
|
||||
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 *,
|
||||
SELECT dsrc.*,dsc.type as courseType,
|
||||
CASE status
|
||||
WHEN 0 THEN '已拒绝'
|
||||
WHEN 1 THEN '已审核'
|
||||
@ -266,10 +266,14 @@ order by create_time desc
|
||||
WHEN 4 THEN '科目四'
|
||||
ELSE '未知'
|
||||
END AS subjectStr
|
||||
FROM drive_school_reservation_course
|
||||
FROM drive_school_reservation_course dsrc
|
||||
LEFT JOIN drive_school_course dsc
|
||||
ON dsrc.course_id = dsc.id
|
||||
<where>
|
||||
deleted = 0
|
||||
<if test="entity.userId != null ">and user_id = #{entity.userId}</if>
|
||||
dsrc.deleted = 0
|
||||
<if test="entity.userId != null ">and dsrc.user_id = #{entity.userId}</if>
|
||||
<if test="entity.coachId != null ">and dsrc.coach_id = #{entity.coachId}</if>
|
||||
<if test="entity.ifCancel != null ">and dsrc.if_cancel = #{entity.ifCancel}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
@ -50,4 +50,22 @@
|
||||
AND dst.create_time <= #{endTime}
|
||||
</if>
|
||||
</select>
|
||||
<select id="queryTrainListPage" resultType="cn.iocoder.yudao.module.train.vo.TrainVO">
|
||||
SELECT
|
||||
dst.*, dsc.type as courseType
|
||||
FROM
|
||||
drive_school_train dst
|
||||
LEFT JOIN drive_school_course dsc ON dst.course_id = dsc.id
|
||||
where
|
||||
dst.deleted = 0
|
||||
<if test="entity.userId != null and entity.userId != ''">
|
||||
and dst.user_id =#{entity.userId}
|
||||
</if>
|
||||
<if test="entity.coachId != null and entity.coachId != ''">
|
||||
and dst.coach_id =#{entity.coachId}
|
||||
</if>
|
||||
<if test="entity.courseId != null and entity.courseId != ''">
|
||||
and dst.course_id =#{entity.courseId}
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
|
Loading…
Reference in New Issue
Block a user