0401-2
This commit is contained in:
parent
13bfeabaa9
commit
f00389d7d9
@ -141,5 +141,17 @@
|
||||
<!-- 请到https://search.maven.org/search?q=tencentcloud-sdk-java查询所有版本,最新版本如下 -->
|
||||
<version>3.1.837</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.poi</groupId>
|
||||
<artifactId>poi</artifactId>
|
||||
<version>5.2.5</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.poi</groupId>
|
||||
<artifactId>poi</artifactId>
|
||||
<version>5.2.5</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
@ -87,6 +87,10 @@
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-mail</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-common</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
</project>
|
||||
</project>
|
||||
|
@ -1,13 +1,19 @@
|
||||
package cn.iocoder.yudao.module.base.controller.app;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
|
||||
import cn.iocoder.yudao.module.base.entity.DlDriveSchoolCoachCourse;
|
||||
import cn.iocoder.yudao.module.base.service.DlDriveSchoolCoachCourseService;
|
||||
import cn.iocoder.yudao.module.base.service.DlDriveSchoolCoachService;
|
||||
import cn.iocoder.yudao.module.base.vo.DlDriveSchoolCoachPageReqVO;
|
||||
import cn.iocoder.yudao.module.base.vo.DlDriveSchoolCoachRespVO;
|
||||
import cn.iocoder.yudao.module.base.vo.DlDriveSchoolCoachVO;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
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.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@ -18,6 +24,8 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
import javax.annotation.Resource;
|
||||
import javax.annotation.security.PermitAll;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "小程序 - 驾校教练")
|
||||
@ -29,6 +37,9 @@ public class DlDriveSchoolCoachSmallProgramController {
|
||||
@Resource
|
||||
private DlDriveSchoolCoachService dlDriveSchoolCoachService;
|
||||
|
||||
@Resource
|
||||
private DlDriveSchoolCoachCourseService coachCourseService;
|
||||
|
||||
/**
|
||||
* 驾校教练、普通员工列表
|
||||
*
|
||||
@ -49,4 +60,36 @@ public class DlDriveSchoolCoachSmallProgramController {
|
||||
Page<DlDriveSchoolCoachRespVO> page = new Page<>(pageNo, pageSize);
|
||||
return success(dlDriveSchoolCoachService.queryListPage(pageReqVO, page));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过课程id查询课程与教练关联关系
|
||||
*
|
||||
* @param courseId 课程id
|
||||
* @return java.util.List<cn.iocoder.yudao.module.base.entity.DlDriveSchoolCoachCourse>
|
||||
* @author PQZ
|
||||
* @date 14:17 2025/2/8
|
||||
**/
|
||||
@GetMapping("/queryCoachByCourseId")
|
||||
@TenantIgnore
|
||||
@PermitAll
|
||||
public List<DlDriveSchoolCoachCourse> queryByCourseId(String courseId) {
|
||||
return coachCourseService.queryByCourseId(courseId);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @author vinjor-M
|
||||
* @date 15:41 2025/2/18
|
||||
* @param userId userId
|
||||
* @return cn.iocoder.yudao.framework.common.pojo.CommonResult<?>
|
||||
**/
|
||||
@GetMapping("/getCoachByUserId")
|
||||
@Operation(summary = "根据userId获得驾校教练信息")
|
||||
@Parameter(name = "userId", description = "用户id", required = true, example = "1024")
|
||||
@TenantIgnore
|
||||
@PermitAll
|
||||
public CommonResult<?> getCoachByUserId(@RequestParam("userId") Long userId) {
|
||||
return success(dlDriveSchoolCoachService.getDlDriveSchoolCoachByUserId(userId));
|
||||
}
|
||||
}
|
||||
|
@ -1,17 +1,25 @@
|
||||
package cn.iocoder.yudao.module.base.controller.app;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
|
||||
import cn.iocoder.yudao.module.base.entity.DlDriveSchoolStudent;
|
||||
import cn.iocoder.yudao.module.base.service.DlDriveSchoolStudentService;
|
||||
import cn.iocoder.yudao.module.base.vo.DlDriveSchoolStudentVO;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
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.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.annotation.security.PermitAll;
|
||||
import javax.validation.Valid;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "驾校学员")
|
||||
@ -23,8 +31,13 @@ public class DlDriveSchoolStudentSmallProgramController {
|
||||
@Resource
|
||||
private DlDriveSchoolStudentService schoolStudentService;
|
||||
|
||||
@Autowired
|
||||
private DlDriveSchoolStudentService studentService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建驾校学员")
|
||||
@TenantIgnore
|
||||
@PermitAll
|
||||
public CommonResult<String> createDlDriveSchoolStudent(@Valid @RequestBody DlDriveSchoolStudentVO createReqVO) {
|
||||
return success(schoolStudentService.createDlDriveSchoolStudent(createReqVO));
|
||||
}
|
||||
@ -50,4 +63,19 @@ public class DlDriveSchoolStudentSmallProgramController {
|
||||
public CommonResult<DlDriveSchoolStudentVO> getDlDriveSchoolStudent(@RequestParam("id") String id) {
|
||||
return success(schoolStudentService.queryStudentById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据userID查学员详情
|
||||
*
|
||||
* @param userId 用户ID
|
||||
* @return cn.iocoder.yudao.module.base.entity.DlDriveSchoolStudent
|
||||
* @author vinjor-M
|
||||
* @date 22:17 2025/1/20
|
||||
**/
|
||||
@GetMapping("/getByUserId")
|
||||
@TenantIgnore
|
||||
@PermitAll
|
||||
public CommonResult<DlDriveSchoolStudent> getStudentByUserId(Long userId) {
|
||||
return success(studentService.getStudentByUserId(userId));
|
||||
}
|
||||
}
|
||||
|
@ -26,6 +26,15 @@ public interface DlDriveSchoolStudentService extends IService<DlDriveSchoolStude
|
||||
*/
|
||||
String createDlDriveSchoolStudent(@Valid DlDriveSchoolStudentVO createReqVO);
|
||||
|
||||
/**
|
||||
* 根据身份证查询学员是否已存在
|
||||
*
|
||||
* @param idCard 身份证号
|
||||
* return boolean
|
||||
*
|
||||
*/
|
||||
DlDriveSchoolStudent getStudentByIdCard(String idCard);
|
||||
|
||||
/**
|
||||
* 获取学员详细信息
|
||||
*
|
||||
@ -133,4 +142,4 @@ public interface DlDriveSchoolStudentService extends IService<DlDriveSchoolStude
|
||||
* @return cn.iocoder.yudao.module.base.vo.DlDriveSchoolStaffVO
|
||||
**/
|
||||
List<DlDriveSchoolStaffVO> indexGetFormList( String startTimeStr, String endTimeStr);
|
||||
}
|
||||
}
|
||||
|
@ -12,6 +12,7 @@ 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.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
@ -40,11 +41,26 @@ public class DlDriveSchoolStudentServiceImpl extends ServiceImpl<DlDriveSchoolSt
|
||||
public String createDlDriveSchoolStudent(DlDriveSchoolStudentVO createReqVO) {
|
||||
// 插入
|
||||
DlDriveSchoolStudent dlDriveSchoolStudent = BeanUtils.toBean(createReqVO, DlDriveSchoolStudent.class);
|
||||
dlDriveSchoolStudentMapper.insert(dlDriveSchoolStudent);
|
||||
DlDriveSchoolStudent studentByIdCard = this.getStudentByIdCard(dlDriveSchoolStudent.getIdCard());
|
||||
if(studentByIdCard == null){
|
||||
dlDriveSchoolStudentMapper.insert(dlDriveSchoolStudent);
|
||||
return dlDriveSchoolStudent.getId();
|
||||
}
|
||||
|
||||
// 返回
|
||||
return dlDriveSchoolStudent.getId();
|
||||
return studentByIdCard.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public DlDriveSchoolStudent getStudentByIdCard(String idCard) {
|
||||
return lambdaQuery()
|
||||
.eq(DlDriveSchoolStudent::getIdCard, idCard)
|
||||
.orderByDesc(DlDriveSchoolStudent::getCreateTime)
|
||||
.last("LIMIT 1")
|
||||
.one();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取学员详细信息
|
||||
*
|
||||
@ -215,4 +231,4 @@ public class DlDriveSchoolStudentServiceImpl extends ServiceImpl<DlDriveSchoolSt
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.course.controller.admin;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
|
||||
import cn.iocoder.yudao.module.course.entity.Process;
|
||||
import cn.iocoder.yudao.module.course.service.ProcessService;
|
||||
import cn.iocoder.yudao.module.course.vo.ProcessAddVO;
|
||||
@ -15,6 +16,7 @@ import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.annotation.security.PermitAll;
|
||||
import javax.validation.Valid;
|
||||
|
||||
import java.util.List;
|
||||
@ -122,4 +124,4 @@ public class ProcessController {
|
||||
return success(true);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -49,7 +49,8 @@
|
||||
dsp.deleted = 0
|
||||
<if test="entity.coachName != null and entity.coachName != '' "> and dsp.coach_name like concat('%', #{entity.coachName}, '%')</if>
|
||||
<if test="entity.userName != null and entity.userName != '' "> and dsp.user_name like concat('%', #{entity.userName}, '%')</if>
|
||||
<if test="entity.courseName != null and entity.courseName != '' "> and dsc.name like concat('%', #{entity.courseName}, '%')</if>
|
||||
<if test="entity.courseName != null and entity.courseName != '' "> and dsp.name like concat('%', #{entity.courseName}, '%')</if>
|
||||
<if test="entity.userId != null "> and dsp.user_id = #{entity.userId}</if>
|
||||
</where>
|
||||
order by dsp.create_time desc
|
||||
</select>
|
||||
|
@ -31,6 +31,10 @@
|
||||
<artifactId>poi-tl</artifactId>
|
||||
<version>1.10.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<properties>
|
||||
<maven.compiler.source>8</maven.compiler.source>
|
||||
|
Loading…
Reference in New Issue
Block a user