Merge pull request 'feat: 根据租户获取景区二维码内容' (#36) from feature_dzc into test

Reviewed-on: http://220.205.16.27:18081/goflytec/GoFly-platform-services/pulls/36
This commit is contained in:
2026-01-15 08:46:37 +00:00
@@ -345,7 +345,6 @@ public class TourismServiceImpl extends SuperServiceImpl<TourismMapper, Tourism>
if (qrCodes == null || qrCodes.isEmpty()) { if (qrCodes == null || qrCodes.isEmpty()) {
continue; continue;
} }
String imageUrl=null;
for (QrCode qrCode : qrCodes) { for (QrCode qrCode : qrCodes) {
if (qrCode == null || qrCode.getCodeId() == null || qrCode.getCodeId().trim().isEmpty()) { if (qrCode == null || qrCode.getCodeId() == null || qrCode.getCodeId().trim().isEmpty()) {
continue; continue;
@@ -359,11 +358,8 @@ public class TourismServiceImpl extends SuperServiceImpl<TourismMapper, Tourism>
vo.setQrCodeName(qrName); vo.setQrCodeName(qrName);
vo.setQrCode(qrCode.getCodeId()); vo.setQrCode(qrCode.getCodeId());
vo.setPrice(qrCode.getPrice()); vo.setPrice(qrCode.getPrice());
if(imageUrl==null){ String imageUrls = resolveQrCodeImageUrl(qrCode.getCodeId());
imageUrl = resolveQrCodeImageUrl(qrCode.getCodeId()); vo.setQrCodeImage(imageUrls);
vo.setQrCodeImage(imageUrl);
}
BigDecimal[] lngLat = resolveDeviceLngLat(qrCode.getDeviceSn(), deviceSnToLngLat); BigDecimal[] lngLat = resolveDeviceLngLat(qrCode.getDeviceSn(), deviceSnToLngLat);
if (lngLat != null && lngLat.length == 2) { if (lngLat != null && lngLat.length == 2) {
vo.setDistance(GeoDistanceUtils.distanceKm(longitude, latitude, lngLat[0], lngLat[1])); vo.setDistance(GeoDistanceUtils.distanceKm(longitude, latitude, lngLat[0], lngLat[1]));
@@ -400,8 +396,9 @@ public class TourismServiceImpl extends SuperServiceImpl<TourismMapper, Tourism>
List<TourismFile> files = tourismFileService.findByIds(fileIds); List<TourismFile> files = tourismFileService.findByIds(fileIds);
if (files != null) { if (files != null) {
TourismFile file = files.get(0); TourismFile file = files.get(0);
if(file != null && file.getImageUrl() != null && !file.getImageUrl().trim().isEmpty()){ if (file != null && file.getImageUrl() != null && !file.getImageUrl().trim().isEmpty()) {
imageUrl = fileCenterService.getViewUrlByPath(file.getImageUrl()); // findByIds 已将图片路径转换为可访问 URL,避免重复转换
imageUrl = file.getImageUrl();
} }
} }
} }