|
|
@@ -1,8 +1,8 @@
|
|
|
package com.yunfeiyun.agmp.iots.service;
|
|
|
|
|
|
import com.yunfeiyun.agmp.iot.common.domain.IotDevice;
|
|
|
-import com.yunfeiyun.agmp.iot.common.model.address.IotAddressModel;
|
|
|
-import com.yunfeiyun.agmp.iot.common.service.IotAddressService;
|
|
|
+import com.yunfeiyun.agmp.common.service.modal.LocationAddressModel;
|
|
|
+import com.yunfeiyun.agmp.common.service.LocationService;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
@@ -14,7 +14,7 @@ import java.math.RoundingMode;
|
|
|
@Slf4j
|
|
|
public class IotDeviceAddressService {
|
|
|
@Autowired
|
|
|
- public IotAddressService iotAddressService;
|
|
|
+ public LocationService locationService;
|
|
|
|
|
|
public void setDeviceAddress(IotDevice iotDevice, String lng, String lat){
|
|
|
try {
|
|
|
@@ -24,12 +24,12 @@ public class IotDeviceAddressService {
|
|
|
|
|
|
if (devLatBig.compareTo(oneBig) > 0 && devLngBig.compareTo(oneBig) > 0) {
|
|
|
// TODO 通过经纬度获取城市信息
|
|
|
- IotAddressModel iotAddressModel = iotAddressService.getAddressByLngLat(devLngBig, devLatBig);
|
|
|
+ LocationAddressModel locationAddressModel = locationService.getAddressByLngLat(devLngBig, devLatBig);
|
|
|
|
|
|
- if (iotAddressModel != null) {
|
|
|
- String devProvince = iotAddressModel.getProvince();
|
|
|
- String devCity = iotAddressModel.getCity();
|
|
|
- String devDistrict = iotAddressModel.getDistrict();
|
|
|
+ if (locationAddressModel != null) {
|
|
|
+ String devProvince = locationAddressModel.getProvince();
|
|
|
+ String devCity = locationAddressModel.getCity();
|
|
|
+ String devDistrict = locationAddressModel.getDistrict();
|
|
|
|
|
|
iotDevice.setDevProvince(devProvince);
|
|
|
iotDevice.setDevCity(devCity);
|