|
@@ -2,6 +2,7 @@ package com.ylx.massage.service.impl;
|
|
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
@@ -18,6 +19,7 @@ import com.ylx.useradress.domain.vo.UserAddressVo;
|
|
|
import com.ylx.massage.mapper.TAddressMapper;
|
|
import com.ylx.massage.mapper.TAddressMapper;
|
|
|
import com.ylx.massage.domain.TAddress;
|
|
import com.ylx.massage.domain.TAddress;
|
|
|
import com.ylx.massage.service.TAddressService;
|
|
import com.ylx.massage.service.TAddressService;
|
|
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
@@ -35,6 +37,7 @@ import java.util.stream.Collectors;
|
|
|
* @since 2024-04-11 17:18:53
|
|
* @since 2024-04-11 17:18:53
|
|
|
*/
|
|
*/
|
|
|
@Service("tAddressService")
|
|
@Service("tAddressService")
|
|
|
|
|
+@Slf4j
|
|
|
public class TAddressServiceImpl extends ServiceImpl<TAddressMapper, TAddress> implements TAddressService {
|
|
public class TAddressServiceImpl extends ServiceImpl<TAddressMapper, TAddress> implements TAddressService {
|
|
|
|
|
|
|
|
//0=未删除
|
|
//0=未删除
|
|
@@ -149,11 +152,12 @@ public class TAddressServiceImpl extends ServiceImpl<TAddressMapper, TAddress> i
|
|
|
if (tAddress.getType() != 2) {
|
|
if (tAddress.getType() != 2) {
|
|
|
throw new RuntimeException("地址类型错误,地址类型只能为2");
|
|
throw new RuntimeException("地址类型错误,地址类型只能为2");
|
|
|
}
|
|
}
|
|
|
- if(StrUtil.isBlank(tAddress.getCityCode())){
|
|
|
|
|
|
|
+ if(StringUtils.isBlank(tAddress.getCityCode())){
|
|
|
CoordinateDTO dto = new CoordinateDTO();
|
|
CoordinateDTO dto = new CoordinateDTO();
|
|
|
dto.setLongitude(tAddress.getLongitude());
|
|
dto.setLongitude(tAddress.getLongitude());
|
|
|
dto.setLatitude(tAddress.getLatitude());
|
|
dto.setLatitude(tAddress.getLatitude());
|
|
|
CityInfoVo cityInfoVo = areaService.getCityInfoByCoordinates(dto);
|
|
CityInfoVo cityInfoVo = areaService.getCityInfoByCoordinates(dto);
|
|
|
|
|
+ log.info("根据经纬度获取城市信息:{}", JSON.toJSONString(cityInfoVo));
|
|
|
tAddress.setCityCode(cityInfoVo.getCityCode());
|
|
tAddress.setCityCode(cityInfoVo.getCityCode());
|
|
|
}
|
|
}
|
|
|
if (StringUtils.isBlank(tAddress.getDetailAddress())){
|
|
if (StringUtils.isBlank(tAddress.getDetailAddress())){
|