diff --git a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/base/controller/admin/DlDriveSchoolStudentController.java b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/base/controller/admin/DlDriveSchoolStudentController.java index 805c728d..622dcad4 100644 --- a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/base/controller/admin/DlDriveSchoolStudentController.java +++ b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/base/controller/admin/DlDriveSchoolStudentController.java @@ -1,5 +1,6 @@ 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.module.base.service.DlDriveSchoolStudentService; 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.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 javax.validation.Valid; +import java.util.List; + import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; @Tag(name = "管理后台 - 驾校学员") @@ -48,11 +52,12 @@ public class DlDriveSchoolStudentController { /** * 获取学员详细信息 - * @author PQZ - * @date 9:58 2025/2/10 + * * @param id 学员id * @return cn.iocoder.yudao.framework.common.pojo.CommonResult - **/ + * @author PQZ + * @date 9:58 2025/2/10 + **/ @GetMapping("/get") @Operation(summary = "获得驾校学员") @Parameter(name = "id", description = "编号", required = true, example = "1024") @@ -81,29 +86,70 @@ public class DlDriveSchoolStudentController { /** * 获取可以考试的学员列表 + * + * @param courseId 课程ID + * @param subject 科目 + * @return List * @author vinjor-M * @date 23:16 2025/1/20 - * @param courseId 课程ID - * @param subject 科目 - * @return List **/ @GetMapping("/getCanExamStudentList") @Operation(summary = "获取可以考试的学员列表") - public CommonResult getCanExamStudentList(String courseId,Integer subject,String userName) { - return success(schoolStudentService.getCanExamStudentList(courseId, subject,userName)); + public CommonResult getCanExamStudentList(String courseId, Integer subject, String userName) { + return success(schoolStudentService.getCanExamStudentList(courseId, subject, userName)); } /** - * 教练查自己所有学生列表 + * 教练查自己所有学生列表 + * * @author vinjor-M * @date 17:20 2025/2/12 - **/ + **/ @GetMapping("/myStudentCoachPage") @Operation(summary = "教练查自己所有学生列表") public CommonResult> myStudentCoachPage(@Valid DlDriveSchoolStudentVO pageReqVO, - @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, - @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { + @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { Page page = new Page<>(pageNo, pageSize); 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> + * @author PQZ + * @date 16:30 2025/2/19 + **/ + @GetMapping("/indexStuentList") + @Operation(summary = "首页数据统计查询接口") + public CommonResult> 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)); + } } \ No newline at end of file diff --git a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/base/mapper/DlDriveSchoolStudentMapper.java b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/base/mapper/DlDriveSchoolStudentMapper.java index 8b63bd14..b99fc710 100644 --- a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/base/mapper/DlDriveSchoolStudentMapper.java +++ b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/base/mapper/DlDriveSchoolStudentMapper.java @@ -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.vo.DlDriveSchoolStaffVO; 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.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; @@ -87,5 +88,14 @@ public interface DlDriveSchoolStudentMapper extends BaseMapper selectTrainStudent(@Param("coachId")Long coachId, @Param("startTime") String startTime, @Param("endTime")String endTime,@Param("searchValue")String searchValue, Page page); - + /** + * @param type 时间查询类型(01驾校统招,02教练自招,03自来客户) + * @param coachId 教练id + * @param startTime 查询时间范围--开始 + * @param endTime 查询时间范围--结束 + * @return java.util.List + * @author PQZ + * @date 17:08 2025/2/19 + **/ + List indexGetTrainList(@Param("type")String type, @Param("coachId")Long coachId, @Param("startTime")String startTime, @Param("endTime")String endTime); } \ No newline at end of file diff --git a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/base/service/DlDriveSchoolStudentService.java b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/base/service/DlDriveSchoolStudentService.java index adb5aadd..b30896be 100644 --- a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/base/service/DlDriveSchoolStudentService.java +++ b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/base/service/DlDriveSchoolStudentService.java @@ -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.vo.DlDriveSchoolStaffVO; 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.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.IService; @@ -110,4 +111,16 @@ public interface DlDriveSchoolStudentService extends IService queryCoachListPage(DlDriveSchoolStudentVO pageReqVO, Page 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 + **/ + List indexGetTrainList(String type, Long coachId, String startTime, String endTime); } \ No newline at end of file diff --git a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/base/service/impl/DlDriveSchoolStudentServiceImpl.java b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/base/service/impl/DlDriveSchoolStudentServiceImpl.java index 1bd743c7..c7a9e9b5 100644 --- a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/base/service/impl/DlDriveSchoolStudentServiceImpl.java +++ b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/base/service/impl/DlDriveSchoolStudentServiceImpl.java @@ -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.vo.DlDriveSchoolStaffVO; 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 com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; @@ -159,5 +160,19 @@ public class DlDriveSchoolStudentServiceImpl extends ServiceImpl + * @author PQZ + * @date 17:08 2025/2/19 + **/ + @Override + public List indexGetTrainList(String type, Long coachId, String startTime, String endTime) { + return dlDriveSchoolStudentMapper.indexGetTrainList(type,coachId,startTime,endTime); + } + } \ No newline at end of file diff --git a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/base/vo/StudentCountVO.java b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/base/vo/StudentCountVO.java new file mode 100644 index 00000000..42f7f4fb --- /dev/null +++ b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/base/vo/StudentCountVO.java @@ -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; +} diff --git a/dl-module-jx/src/main/resources/mapper/base/DlDriveSchoolStudentMapper.xml b/dl-module-jx/src/main/resources/mapper/base/DlDriveSchoolStudentMapper.xml index 93466297..affc982f 100644 --- a/dl-module-jx/src/main/resources/mapper/base/DlDriveSchoolStudentMapper.xml +++ b/dl-module-jx/src/main/resources/mapper/base/DlDriveSchoolStudentMapper.xml @@ -147,4 +147,35 @@ GROUP BY dss.id + \ No newline at end of file