1
This commit is contained in:
parent
c02b4143b8
commit
cec4058a27
@ -1,5 +1,6 @@
|
|||||||
package cn.iocoder.yudao.module.base.controller.admin;
|
package cn.iocoder.yudao.module.base.controller.admin;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
import cn.iocoder.yudao.module.base.service.DlDriveSchoolStudentService;
|
import cn.iocoder.yudao.module.base.service.DlDriveSchoolStudentService;
|
||||||
import cn.iocoder.yudao.module.base.vo.DlDriveSchoolStudentVO;
|
import cn.iocoder.yudao.module.base.vo.DlDriveSchoolStudentVO;
|
||||||
@ -8,12 +9,15 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.v3.oas.annotations.Parameter;
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
@Tag(name = "管理后台 - 驾校学员")
|
@Tag(name = "管理后台 - 驾校学员")
|
||||||
@ -48,11 +52,12 @@ public class DlDriveSchoolStudentController {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取学员详细信息
|
* 获取学员详细信息
|
||||||
* @author PQZ
|
*
|
||||||
* @date 9:58 2025/2/10
|
|
||||||
* @param id 学员id
|
* @param id 学员id
|
||||||
* @return cn.iocoder.yudao.framework.common.pojo.CommonResult<cn.iocoder.yudao.module.base.vo.DlDriveSchoolStudentVO>
|
* @return cn.iocoder.yudao.framework.common.pojo.CommonResult<cn.iocoder.yudao.module.base.vo.DlDriveSchoolStudentVO>
|
||||||
**/
|
* @author PQZ
|
||||||
|
* @date 9:58 2025/2/10
|
||||||
|
**/
|
||||||
@GetMapping("/get")
|
@GetMapping("/get")
|
||||||
@Operation(summary = "获得驾校学员")
|
@Operation(summary = "获得驾校学员")
|
||||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
@ -81,29 +86,70 @@ public class DlDriveSchoolStudentController {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取可以考试的学员列表
|
* 获取可以考试的学员列表
|
||||||
|
*
|
||||||
|
* @param courseId 课程ID
|
||||||
|
* @param subject 科目
|
||||||
|
* @return List<DlDriveSchoolStudent>
|
||||||
* @author vinjor-M
|
* @author vinjor-M
|
||||||
* @date 23:16 2025/1/20
|
* @date 23:16 2025/1/20
|
||||||
* @param courseId 课程ID
|
|
||||||
* @param subject 科目
|
|
||||||
* @return List<DlDriveSchoolStudent>
|
|
||||||
**/
|
**/
|
||||||
@GetMapping("/getCanExamStudentList")
|
@GetMapping("/getCanExamStudentList")
|
||||||
@Operation(summary = "获取可以考试的学员列表")
|
@Operation(summary = "获取可以考试的学员列表")
|
||||||
public CommonResult<?> getCanExamStudentList(String courseId,Integer subject,String userName) {
|
public CommonResult<?> getCanExamStudentList(String courseId, Integer subject, String userName) {
|
||||||
return success(schoolStudentService.getCanExamStudentList(courseId, subject,userName));
|
return success(schoolStudentService.getCanExamStudentList(courseId, subject, userName));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 教练查自己所有学生列表
|
* 教练查自己所有学生列表
|
||||||
|
*
|
||||||
* @author vinjor-M
|
* @author vinjor-M
|
||||||
* @date 17:20 2025/2/12
|
* @date 17:20 2025/2/12
|
||||||
**/
|
**/
|
||||||
@GetMapping("/myStudentCoachPage")
|
@GetMapping("/myStudentCoachPage")
|
||||||
@Operation(summary = "教练查自己所有学生列表")
|
@Operation(summary = "教练查自己所有学生列表")
|
||||||
public CommonResult<IPage<?>> myStudentCoachPage(@Valid DlDriveSchoolStudentVO pageReqVO,
|
public CommonResult<IPage<?>> myStudentCoachPage(@Valid DlDriveSchoolStudentVO pageReqVO,
|
||||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
|
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
|
||||||
Page<DlDriveSchoolStudentVO> page = new Page<>(pageNo, pageSize);
|
Page<DlDriveSchoolStudentVO> page = new Page<>(pageNo, pageSize);
|
||||||
return success(schoolStudentService.queryCoachListPage(pageReqVO, page));
|
return success(schoolStudentService.queryCoachListPage(pageReqVO, page));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param type 时间查询类型(01驾校统招,02教练自招,03自来客户)
|
||||||
|
* @param timeType 时间查询类型(all-全部|day-当日|month-当月|more-自定义)
|
||||||
|
* @param coachId 教练id
|
||||||
|
* @param startTime 查询时间范围--开始
|
||||||
|
* @param endTime 查询时间范围--结束
|
||||||
|
* @return cn.iocoder.yudao.framework.common.pojo.CommonResult<java.util.List < ?>>
|
||||||
|
* @author PQZ
|
||||||
|
* @date 16:30 2025/2/19
|
||||||
|
**/
|
||||||
|
@GetMapping("/indexStuentList")
|
||||||
|
@Operation(summary = "首页数据统计查询接口")
|
||||||
|
public CommonResult<List<?>> indexGetTrainList(@RequestParam(value = "type") String type,
|
||||||
|
@RequestParam(value = "timeType") String timeType,
|
||||||
|
@RequestParam(value = "coachId", required = false) Long coachId,
|
||||||
|
@RequestParam(value = "startTime", required = false) String startTime,
|
||||||
|
@RequestParam(value = "endTime", required = false) String endTime) {
|
||||||
|
//默认查全部数据
|
||||||
|
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";
|
||||||
|
}
|
||||||
|
return success(schoolStudentService.indexGetTrainList(type,coachId,startTimeStr,endTimeStr));
|
||||||
|
}
|
||||||
}
|
}
|
@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.base.mapper;
|
|||||||
import cn.iocoder.yudao.module.base.entity.DlDriveSchoolStudent;
|
import cn.iocoder.yudao.module.base.entity.DlDriveSchoolStudent;
|
||||||
import cn.iocoder.yudao.module.base.vo.DlDriveSchoolStaffVO;
|
import cn.iocoder.yudao.module.base.vo.DlDriveSchoolStaffVO;
|
||||||
import cn.iocoder.yudao.module.base.vo.DlDriveSchoolStudentVO;
|
import cn.iocoder.yudao.module.base.vo.DlDriveSchoolStudentVO;
|
||||||
|
import cn.iocoder.yudao.module.base.vo.StudentCountVO;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
@ -87,5 +88,14 @@ public interface DlDriveSchoolStudentMapper extends BaseMapper<DlDriveSchoolStud
|
|||||||
**/
|
**/
|
||||||
IPage<DlDriveSchoolStudentVO> selectTrainStudent(@Param("coachId")Long coachId, @Param("startTime") String startTime, @Param("endTime")String endTime, Page<DlDriveSchoolStudent> page);
|
IPage<DlDriveSchoolStudentVO> selectTrainStudent(@Param("coachId")Long coachId, @Param("startTime") String startTime, @Param("endTime")String endTime, Page<DlDriveSchoolStudent> page);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param type 时间查询类型(01驾校统招,02教练自招,03自来客户)
|
||||||
|
* @param coachId 教练id
|
||||||
|
* @param startTime 查询时间范围--开始
|
||||||
|
* @param endTime 查询时间范围--结束
|
||||||
|
* @return java.util.List<cn.iocoder.yudao.module.base.vo.StudentCountVO>
|
||||||
|
* @author PQZ
|
||||||
|
* @date 17:08 2025/2/19
|
||||||
|
**/
|
||||||
|
List<StudentCountVO> indexGetTrainList(String type, Long coachId, String startTime, String endTime);
|
||||||
}
|
}
|
@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.base.service;
|
|||||||
import cn.iocoder.yudao.module.base.entity.DlDriveSchoolStudent;
|
import cn.iocoder.yudao.module.base.entity.DlDriveSchoolStudent;
|
||||||
import cn.iocoder.yudao.module.base.vo.DlDriveSchoolStaffVO;
|
import cn.iocoder.yudao.module.base.vo.DlDriveSchoolStaffVO;
|
||||||
import cn.iocoder.yudao.module.base.vo.DlDriveSchoolStudentVO;
|
import cn.iocoder.yudao.module.base.vo.DlDriveSchoolStudentVO;
|
||||||
|
import cn.iocoder.yudao.module.base.vo.StudentCountVO;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
@ -110,4 +111,16 @@ public interface DlDriveSchoolStudentService extends IService<DlDriveSchoolStude
|
|||||||
* @date 10:41 2025/1/18
|
* @date 10:41 2025/1/18
|
||||||
**/
|
**/
|
||||||
IPage<DlDriveSchoolStudentVO> queryCoachListPage(DlDriveSchoolStudentVO pageReqVO, Page<DlDriveSchoolStudentVO> page);
|
IPage<DlDriveSchoolStudentVO> queryCoachListPage(DlDriveSchoolStudentVO pageReqVO, Page<DlDriveSchoolStudentVO> page);
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author PQZ
|
||||||
|
* @date 17:08 2025/2/19
|
||||||
|
* @param type 时间查询类型(01驾校统招,02教练自招,03自来客户)
|
||||||
|
* @param coachId 教练id
|
||||||
|
* @param startTime 查询时间范围--开始
|
||||||
|
* @param endTime 查询时间范围--结束
|
||||||
|
* @return java.util.List<cn.iocoder.yudao.module.base.vo.StudentCountVO>
|
||||||
|
**/
|
||||||
|
List<StudentCountVO> indexGetTrainList(String type, Long coachId, String startTime, String endTime);
|
||||||
}
|
}
|
@ -8,6 +8,7 @@ import cn.iocoder.yudao.module.base.mapper.DlDriveSchoolStudentMapper;
|
|||||||
import cn.iocoder.yudao.module.base.service.DlDriveSchoolStudentService;
|
import cn.iocoder.yudao.module.base.service.DlDriveSchoolStudentService;
|
||||||
import cn.iocoder.yudao.module.base.vo.DlDriveSchoolStaffVO;
|
import cn.iocoder.yudao.module.base.vo.DlDriveSchoolStaffVO;
|
||||||
import cn.iocoder.yudao.module.base.vo.DlDriveSchoolStudentVO;
|
import cn.iocoder.yudao.module.base.vo.DlDriveSchoolStudentVO;
|
||||||
|
import cn.iocoder.yudao.module.base.vo.StudentCountVO;
|
||||||
import cn.iocoder.yudao.module.course.service.ProcessService;
|
import cn.iocoder.yudao.module.course.service.ProcessService;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
@ -159,5 +160,19 @@ public class DlDriveSchoolStudentServiceImpl extends ServiceImpl<DlDriveSchoolSt
|
|||||||
return pageResult;
|
return pageResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param type 时间查询类型(01驾校统招,02教练自招,03自来客户)
|
||||||
|
* @param coachId 教练id
|
||||||
|
* @param startTime 查询时间范围--开始
|
||||||
|
* @param endTime 查询时间范围--结束
|
||||||
|
* @return java.util.List<cn.iocoder.yudao.module.base.vo.StudentCountVO>
|
||||||
|
* @author PQZ
|
||||||
|
* @date 17:08 2025/2/19
|
||||||
|
**/
|
||||||
|
@Override
|
||||||
|
public List<StudentCountVO> indexGetTrainList(String type, Long coachId, String startTime, String endTime) {
|
||||||
|
return dlDriveSchoolStudentMapper.indexGetTrainList(type,coachId,startTime,endTime);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
@ -0,0 +1,19 @@
|
|||||||
|
package cn.iocoder.yudao.module.base.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class StudentCountVO {
|
||||||
|
/**教练头像*/
|
||||||
|
private String image;
|
||||||
|
/**姓名*/
|
||||||
|
private String coachName;
|
||||||
|
/**车牌号*/
|
||||||
|
private String carId;
|
||||||
|
/**C1人数*/
|
||||||
|
private Integer c1Num;
|
||||||
|
/**C2人数*/
|
||||||
|
private Integer c2Num;
|
||||||
|
/**总人数*/
|
||||||
|
private Integer totalNum;
|
||||||
|
}
|
@ -144,4 +144,35 @@
|
|||||||
GROUP BY
|
GROUP BY
|
||||||
dss.id
|
dss.id
|
||||||
</select>
|
</select>
|
||||||
|
<select id="indexGetTrainList" resultType="cn.iocoder.yudao.module.base.vo.StudentCountVO">
|
||||||
|
SELECT
|
||||||
|
c.image AS image,
|
||||||
|
c.NAME AS coachName,
|
||||||
|
c.car_id AS carId,
|
||||||
|
COUNT(DISTINCT s.user_id) AS totalNum,
|
||||||
|
COUNT(DISTINCT CASE WHEN o.course_type = 'C1' THEN o.user_id END) AS c1Num,
|
||||||
|
COUNT(DISTINCT CASE WHEN o.course_type = 'C2' THEN o.user_id END) AS c2Num
|
||||||
|
FROM
|
||||||
|
drive_school_coach c
|
||||||
|
LEFT JOIN drive_school_student s ON c.id = s.source_user_id
|
||||||
|
LEFT JOIN drive_school_course_order o ON s.user_id = o.user_id AND o.payment_status > 1
|
||||||
|
WHERE
|
||||||
|
c.deleted = 0
|
||||||
|
<if test="type != null and type != ''">
|
||||||
|
AND s.source = #{type}
|
||||||
|
</if>
|
||||||
|
<if test="coachId != null and coachId != ''">
|
||||||
|
AND c.id = #{coachId}
|
||||||
|
</if>
|
||||||
|
<if test="starTime != null and starTime != ''">
|
||||||
|
AND o.create_time >= #{starTime}
|
||||||
|
</if>
|
||||||
|
<if test="endTime != null and endTime != ''">
|
||||||
|
AND o.create_time <= #{endTime}
|
||||||
|
</if>
|
||||||
|
GROUP BY
|
||||||
|
c.image, c.NAME, c.car_id
|
||||||
|
ORDER BY
|
||||||
|
totalNum ASC;
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
Loading…
Reference in New Issue
Block a user