feat(培训参与者): 新增驾驶员肖像显示功能

为培训参与者视图对象新增驾驶员肖像URL字段,新增填充方法从驾驶员数据中获取肖像地址并赋值,在查询参与者列表时调用该填充逻辑。
This commit is contained in:
2026-05-26 18:56:00 +08:00
parent e4b4b89354
commit 175f1a310a
2 changed files with 18 additions and 0 deletions

View File

@@ -146,4 +146,9 @@ public class HotTrainingParticipantVo implements Serializable {
*/ */
private Long canAudit; private Long canAudit;
/**
* 驾驶员肖像
*/
private String driverPhotoImgUrl;
} }

View File

@@ -80,6 +80,9 @@ public class HotTrainingParticipantServiceImpl implements IHotTrainingParticipan
Page<HotTrainingParticipantVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw); Page<HotTrainingParticipantVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
if (result.getRecords() != null) { if (result.getRecords() != null) {
result.getRecords().forEach(this::fillCanAuditStatus); result.getRecords().forEach(this::fillCanAuditStatus);
// 填充学员信息
result.getRecords().forEach(this::fillDriverInfo);
} }
return TableDataInfo.build(result); return TableDataInfo.build(result);
} }
@@ -124,6 +127,16 @@ public class HotTrainingParticipantServiceImpl implements IHotTrainingParticipan
vo.setCanAudit(canAudit ? 1L : 0L); vo.setCanAudit(canAudit ? 1L : 0L);
} }
private void fillDriverInfo(HotTrainingParticipantVo vo) {
if (vo == null) {
return;
}
HotDriverVo hotDriverVo = driverMapper.selectVoById(vo.getUserId());
if (hotDriverVo != null) {
vo.setDriverPhotoImgUrl(hotDriverVo.getPortraitUrl());
}
}
private LambdaQueryWrapper<HotTrainingParticipant> buildQueryWrapper(HotTrainingParticipantBo bo) { private LambdaQueryWrapper<HotTrainingParticipant> buildQueryWrapper(HotTrainingParticipantBo bo) {
Map<String, Object> params = bo.getParams(); Map<String, Object> params = bo.getParams();
LambdaQueryWrapper<HotTrainingParticipant> lqw = Wrappers.lambdaQuery(); LambdaQueryWrapper<HotTrainingParticipant> lqw = Wrappers.lambdaQuery();