安全学习照片回显
This commit is contained in:
@@ -80,8 +80,7 @@ public class HotTrainingParticipantServiceImpl implements IHotTrainingParticipan
|
||||
Page<HotTrainingParticipantVo> 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<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) {
|
||||
|
||||
Reference in New Issue
Block a user