安全学习照片回显

This commit is contained in:
2026-05-30 16:31:40 +08:00
parent 7254f7c35f
commit 5b3c300c75

View File

@@ -80,8 +80,7 @@ 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::fillDriverPhotoImgUrl);
result.getRecords().forEach(this::fillDriverInfo);
} }
return TableDataInfo.build(result); return TableDataInfo.build(result);
@@ -127,14 +126,36 @@ public class HotTrainingParticipantServiceImpl implements IHotTrainingParticipan
vo.setCanAudit(canAudit ? 1L : 0L); vo.setCanAudit(canAudit ? 1L : 0L);
} }
private void fillDriverInfo(HotTrainingParticipantVo vo) { private void fillDriverPhotoImgUrl(HotTrainingParticipantVo vo) {
if (vo == null) { if (vo == null) {
return; return;
} }
HotDriverVo hotDriverVo = driverMapper.selectVoById(vo.getUserId()); vo.setDriverPhotoImgUrl(resolveStudyPhotoImgUrl(vo.getStudyPhotoOssId()));
if (hotDriverVo != null) {
vo.setDriverPhotoImgUrl(hotDriverVo.getPortraitUrl());
} }
private String resolveStudyPhotoImgUrl(String studyPhotoOssId) {
if (StringUtils.isBlank(studyPhotoOssId)) {
return null;
}
try {
LinkedHashMap<String, Object> photoMap = JsonUtils.parseObject(
studyPhotoOssId,
new TypeReference<LinkedHashMap<String, Object>>() {
}
);
if (photoMap != null && !photoMap.isEmpty()) {
String latestPhotoOssId = null;
for (Object value : photoMap.values()) {
if (value != null && StringUtils.isNotBlank(String.valueOf(value))) {
latestPhotoOssId = String.valueOf(value);
}
}
return latestPhotoOssId;
}
} catch (Exception e) {
log.warn("解析驾驶员学习拍照图片失败 studyPhotoOssId={} err={}", studyPhotoOssId, e.getMessage());
}
return studyPhotoOssId;
} }
private LambdaQueryWrapper<HotTrainingParticipant> buildQueryWrapper(HotTrainingParticipantBo bo) { private LambdaQueryWrapper<HotTrainingParticipant> buildQueryWrapper(HotTrainingParticipantBo bo) {