商品列表 返回区域信息

This commit is contained in:
2024-05-16 16:41:13 +08:00
parent 63921852e9
commit 200b75e04d
7 changed files with 38 additions and 16 deletions

View File

@@ -78,10 +78,10 @@ public class GroupOrderInfoService {
TbShopInfo shopInfo = shopInfoMapper.selectByPrimaryKey(groupOrder.getShopId());
result.setShopName(shopInfo.getShopName());
BigDecimal distance = LocationUtils.getDistanceFrom2LngLat(
String distance = LocationUtils.getDistanceString(
Double.parseDouble(lng), Double.parseDouble(lat),
Double.parseDouble(shopInfo.getLng()), Double.parseDouble(shopInfo.getLat()));
result.setDistances(distance.toString());
result.setDistances(distance);
result.setAddress(shopInfo.getAddress());
result.setShopPhone(shopInfo.getPhone());

View File

@@ -109,10 +109,10 @@ public class HomeDistrictService {
param.getAddress(), param.getLng(), param.getLat(),null);//西安市
for (SubShopVo subShopVo : subShopVos) {//距离计算
if (StringUtils.isNotBlank(subShopVo.getLat()) && StringUtils.isNotBlank(subShopVo.getLng())) {
BigDecimal distance = LocationUtils.getDistanceFrom2LngLat(
String distance = LocationUtils.getDistanceString(
Double.parseDouble(param.getLng()), Double.parseDouble(param.getLat()),
Double.parseDouble(subShopVo.getLng()), Double.parseDouble(subShopVo.getLat()));
subShopVo.setDistances(distance.toString());
subShopVo.setDistances(distance);
}
}
return Result.success(CodeEnum.SUCCESS, new PageInfo(subShopVos));
@@ -133,10 +133,10 @@ public class HomeDistrictService {
for (SubShopVo subShopVo : subShopVos) {//距离计算
subShopVo.setBusinessTime(subShopVo.getBusinessStartDay()+""+subShopVo.getBusinessEndDay()+" "+subShopVo.getBusinessTime());
if (StringUtils.isNotBlank(subShopVo.getLat()) && StringUtils.isNotBlank(subShopVo.getLng())) {
BigDecimal distance = LocationUtils.getDistanceFrom2LngLat(
String distance = LocationUtils.getDistanceString(
Double.parseDouble(param.getLng()), Double.parseDouble(param.getLat()),
Double.parseDouble(subShopVo.getLng()), Double.parseDouble(subShopVo.getLat()));
subShopVo.setDistances(distance.toString());
subShopVo.setDistances(distance);
}
}
return Result.success(CodeEnum.SUCCESS, subShopVos);

View File

@@ -204,10 +204,10 @@ public class ProductService {
homeVO.setShopTag(JSONUtil.parseListTNewList(tbPlatformDicts, TagVo.class));
}
if (StringUtils.isNotBlank(o.getLat()) && StringUtils.isNotBlank(o.getLng())) {
BigDecimal distance = LocationUtils.getDistanceFrom2LngLat(
String distance = LocationUtils.getDistanceString(
Double.parseDouble(homeDto.getLng()), Double.parseDouble(homeDto.getLat()),
Double.parseDouble(o.getLng()), Double.parseDouble(o.getLat()));
homeVO.setDistances(distance.toString());
homeVO.setDistances(distance);
}
homeVO.setProductName(o.getProName());
homeVO.setImage(o.getProImg());
@@ -297,12 +297,15 @@ public class ProductService {
productInfo.setShopNum(i);
}
productInfo.setPhone(tbShopInfo.getPhone());
productInfo.setLat(tbShopInfo.getLat());
productInfo.setLng(tbShopInfo.getLng());
productInfo.setBusinessTime(tbShopInfo.getBusinessStartDay() + "" + tbShopInfo.getBusinessEndDay() + " " + tbShopInfo.getBusinessTime());
BigDecimal distance = LocationUtils.getDistanceFrom2LngLat(
String distance = LocationUtils.getDistanceString(
Double.parseDouble(lng), Double.parseDouble(lat),
Double.parseDouble(tbShopInfo.getLng()), Double.parseDouble(tbShopInfo.getLat()));
productInfo.setDistances(distance.toString());//距离
productInfo.setDistances(distance);//距离
productInfo.setAddress(tbShopInfo.getAddress());
productInfo.setDistricts(tbShopInfo.getDistricts());
List<ProductVo> productVos = JSONUtil.parseListTNewList(tbProduct.getGroupSnap(), ProductVo.class);
for (ProductVo productVo : productVos) {