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:
+5
-8
@@ -345,7 +345,6 @@ public class TourismServiceImpl extends SuperServiceImpl<TourismMapper, Tourism>
|
||||
if (qrCodes == null || qrCodes.isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
String imageUrl=null;
|
||||
for (QrCode qrCode : qrCodes) {
|
||||
if (qrCode == null || qrCode.getCodeId() == null || qrCode.getCodeId().trim().isEmpty()) {
|
||||
continue;
|
||||
@@ -359,11 +358,8 @@ public class TourismServiceImpl extends SuperServiceImpl<TourismMapper, Tourism>
|
||||
vo.setQrCodeName(qrName);
|
||||
vo.setQrCode(qrCode.getCodeId());
|
||||
vo.setPrice(qrCode.getPrice());
|
||||
if(imageUrl==null){
|
||||
imageUrl = resolveQrCodeImageUrl(qrCode.getCodeId());
|
||||
vo.setQrCodeImage(imageUrl);
|
||||
}
|
||||
|
||||
String imageUrls = resolveQrCodeImageUrl(qrCode.getCodeId());
|
||||
vo.setQrCodeImage(imageUrls);
|
||||
BigDecimal[] lngLat = resolveDeviceLngLat(qrCode.getDeviceSn(), deviceSnToLngLat);
|
||||
if (lngLat != null && lngLat.length == 2) {
|
||||
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);
|
||||
if (files != null) {
|
||||
TourismFile file = files.get(0);
|
||||
if(file != null && file.getImageUrl() != null && !file.getImageUrl().trim().isEmpty()){
|
||||
imageUrl = fileCenterService.getViewUrlByPath(file.getImageUrl());
|
||||
if (file != null && file.getImageUrl() != null && !file.getImageUrl().trim().isEmpty()) {
|
||||
// findByIds 已将图片路径转换为可访问 URL,避免重复转换
|
||||
imageUrl = file.getImageUrl();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user