From 5b3c300c7560c738f92dcd401ad6d26fe3ac2844 Mon Sep 17 00:00:00 2001 From: 18980591175 <470162950@qq.com> Date: Sat, 30 May 2026 16:31:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=89=E5=85=A8=E5=AD=A6=E4=B9=A0=E7=85=A7?= =?UTF-8?q?=E7=89=87=E5=9B=9E=E6=98=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../HotTrainingParticipantServiceImpl.java | 33 +++++++++++++++---- 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/hotwj/platform/securityManagement/trainingParticipant/service/impl/HotTrainingParticipantServiceImpl.java b/src/main/java/com/hotwj/platform/securityManagement/trainingParticipant/service/impl/HotTrainingParticipantServiceImpl.java index 3b0f476..eb1479f 100644 --- a/src/main/java/com/hotwj/platform/securityManagement/trainingParticipant/service/impl/HotTrainingParticipantServiceImpl.java +++ b/src/main/java/com/hotwj/platform/securityManagement/trainingParticipant/service/impl/HotTrainingParticipantServiceImpl.java @@ -80,8 +80,7 @@ public class HotTrainingParticipantServiceImpl implements IHotTrainingParticipan Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); if (result.getRecords() != null) { result.getRecords().forEach(this::fillCanAuditStatus); - // 填充学员信息 - result.getRecords().forEach(this::fillDriverInfo); + result.getRecords().forEach(this::fillDriverPhotoImgUrl); } return TableDataInfo.build(result); @@ -127,14 +126,36 @@ public class HotTrainingParticipantServiceImpl implements IHotTrainingParticipan vo.setCanAudit(canAudit ? 1L : 0L); } - private void fillDriverInfo(HotTrainingParticipantVo vo) { + private void fillDriverPhotoImgUrl(HotTrainingParticipantVo vo) { if (vo == null) { return; } - HotDriverVo hotDriverVo = driverMapper.selectVoById(vo.getUserId()); - if (hotDriverVo != null) { - vo.setDriverPhotoImgUrl(hotDriverVo.getPortraitUrl()); + vo.setDriverPhotoImgUrl(resolveStudyPhotoImgUrl(vo.getStudyPhotoOssId())); + } + + private String resolveStudyPhotoImgUrl(String studyPhotoOssId) { + if (StringUtils.isBlank(studyPhotoOssId)) { + return null; } + try { + LinkedHashMap photoMap = JsonUtils.parseObject( + studyPhotoOssId, + new TypeReference>() { + } + ); + 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 buildQueryWrapper(HotTrainingParticipantBo bo) {