Merge remote-tracking branch 'origin/driver' into driver

This commit is contained in:
Lx 2025-04-09 18:01:51 +08:00
commit 8192ab5f7b
7 changed files with 70 additions and 8 deletions

View File

@ -189,5 +189,20 @@ public class DlDriveSchoolStudentController {
return success(schoolStudentService.indexGetFormList(startTimeStr,endTimeStr));
}
/**
* 获取学员详细信息
*
* @param uniqueCode 学员id
* @return cn.iocoder.yudao.framework.common.pojo.CommonResult<cn.iocoder.yudao.module.base.vo.DlDriveSchoolStudentVO>
* @author PQZ
* @date 9:58 2025/2/10
**/
@GetMapping("/getByUniqueCode")
@Operation(summary = "获得驾校学员")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
public CommonResult<DlDriveSchoolStudentVO> getDlDriveSchoolStudentByUniqueCode(@RequestParam("uniqueCode") String uniqueCode) {
return success(schoolStudentService.queryStudentByUniqueCode(uniqueCode));
}
}

View File

@ -101,5 +101,9 @@ public class DlDriveSchoolStudent extends TenantBaseDO {
* 毕业时间
*/
private String gradTime;
/**
* 唯一码
*/
private String uniqueCode;
}

View File

@ -152,4 +152,12 @@ public interface DlDriveSchoolStudentService extends IService<DlDriveSchoolStude
* @param tenantId 租户id
*/
Boolean updateStudentPassAndGradTime(Date passTime, Long userId, String courseId, Long tenantId);
/**
* 根据唯一码查询学员信息
*
* @param uniqueCode 唯一码
* @return cn.iocoder.yudao.module.base.vo.DlDriveSchoolStaffVO
*/
DlDriveSchoolStudentVO queryStudentByUniqueCode(String uniqueCode);
}

View File

@ -1,6 +1,8 @@
package cn.iocoder.yudao.module.base.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
@ -16,6 +18,7 @@ import cn.iocoder.yudao.module.base.vo.StudentCountVO;
import cn.iocoder.yudao.module.course.entity.SchoolCourseOrder;
import cn.iocoder.yudao.module.course.service.ProcessService;
import cn.iocoder.yudao.module.course.service.SchoolCourseOrderService;
import cn.iocoder.yudao.module.staff.service.UniqueCodeService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
@ -52,12 +55,18 @@ public class DlDriveSchoolStudentServiceImpl extends ServiceImpl<DlDriveSchoolSt
@Resource
private SchoolNotifyMessageSendService schoolNotifyMessageSendService;
@Resource
private UniqueCodeService uniqueCodeService;
@Override
public String createDlDriveSchoolStudent(DlDriveSchoolStudentVO createReqVO) {
// 插入
DlDriveSchoolStudent dlDriveSchoolStudent = BeanUtils.toBean(createReqVO, DlDriveSchoolStudent.class);
DlDriveSchoolStudent studentByIdCard = this.getStudentByIdCard(dlDriveSchoolStudent.getIdCard());
if (studentByIdCard == null) {
// 生成唯一推广码
String uniqueCode = uniqueCodeService.createUniqueCode();
dlDriveSchoolStudent.setUniqueCode(uniqueCode);
dlDriveSchoolStudentMapper.insert(dlDriveSchoolStudent);
return dlDriveSchoolStudent.getId();
}
@ -121,11 +130,24 @@ public class DlDriveSchoolStudentServiceImpl extends ServiceImpl<DlDriveSchoolSt
**/
@Override
public DlDriveSchoolStudent getStudentByUserId(Long userId) {
LambdaQueryWrapper<DlDriveSchoolStudent> queryWrapper = new LambdaQueryWrapper<DlDriveSchoolStudent>()
DlDriveSchoolStudent student = getOne(Wrappers.<DlDriveSchoolStudent>lambdaQuery()
.eq(DlDriveSchoolStudent::getUserId, userId)
.orderByDesc(BaseDO::getCreateTime);
List<DlDriveSchoolStudent> list = this.list(queryWrapper);
return list.isEmpty() ? null : list.get(0);
.orderByDesc(DlDriveSchoolStudent::getCreateTime)
.last("limit 1"));
// 如果没有找到则返回null
if (ObjectUtil.isEmpty(student)) {
return null;
} else {
// 判断是否有唯一码
if (StringUtils.isBlank(student.getUniqueCode())) {
// 生成唯一推广码
String uniqueCode = uniqueCodeService.createUniqueCode();
student.setUniqueCode(uniqueCode);
dlDriveSchoolStudentMapper.updateById(student);
}
return student;
}
}
/**
@ -256,7 +278,7 @@ public class DlDriveSchoolStudentServiceImpl extends ServiceImpl<DlDriveSchoolSt
@TenantIgnore
@Override
@Transactional
public Boolean updateStudentPassAndGradTime(Date passTime, Long userId,String courseId, Long tenantId) {
public Boolean updateStudentPassAndGradTime(Date passTime, Long userId, String courseId, Long tenantId) {
if (ObjectUtils.isEmpty(passTime) || ObjectUtils.isEmpty(userId) || ObjectUtils.isEmpty(tenantId)) {
return false;
}
@ -276,5 +298,17 @@ public class DlDriveSchoolStudentServiceImpl extends ServiceImpl<DlDriveSchoolSt
return true;
}
/**
* 根据唯一码查询学员信息
*
* @param uniqueCode 唯一码
* @return cn.iocoder.yudao.module.base.vo.DlDriveSchoolStaffVO
*/
@Override
public DlDriveSchoolStudentVO queryStudentByUniqueCode(String uniqueCode) {
return BeanUtil.copyProperties(getOne(Wrappers.<DlDriveSchoolStudent>lambdaQuery().eq(DlDriveSchoolStudent::getUniqueCode, uniqueCode)),
DlDriveSchoolStudentVO.class);
}
}

View File

@ -446,6 +446,7 @@ public class ProcessServiceImpl extends ServiceImpl<ProcessMapper, Process> impl
.in(Process::getStatus, Arrays.asList("1", "2"))
.in(Process::getSubject, Arrays.asList(1, 4))
.isNotNull(Process::getExamScore)
.orderByDesc(Process::getExamTime)
);
List<ExamVO> examBatchItemNew = examBatchItemMapper.selectExamByUserIdAndCoachId(userId, null);
List<ExamVO> result = new ArrayList<>();

View File

@ -88,7 +88,7 @@ public class ReservationCourseServiceImpl extends ServiceImpl<ReservationCourseM
//查该学员该科目进度
Process process = processService.getByStudentAndCourse(userId,courseId,subject,coachId,null);
if(null==process){
throw new Exception("该学员未报名你的课程,请向管理员核实");
throw new RuntimeException("该学员未报名你的课程,请向管理员核实");
}
//查当天训练记录--未签退的
rtnMap.put("train",trainService.getUserTrainData(userId,courseId,subject,nowDayStr));

View File

@ -116,10 +116,10 @@
AND dss.`name` LIKE CONCAT('%',#{entity.name},'%')
</if>
<if test="entity.startTime!=null and entity.startTime!=''">
AND dss.create_time &gt;= #{startTime}
AND dss.create_time &gt;= #{entity.startTime}
</if>
<if test="entity.endTime!=null and entity.endTime!=''">
AND dss.create_time &lt;= #{endTime}
AND dss.create_time &lt;= #{entity.endTime}
</if>
AND dss.id IS NOT NULL
ORDER BY