|
|
@@ -2,6 +2,7 @@ package com.yunfeiyun.agmp.iotm.web.service.impl;
|
|
|
|
|
|
import com.yunfeiyun.agmp.common.constant.ErrorCode;
|
|
|
import com.yunfeiyun.agmp.common.utils.SecurityUtils;
|
|
|
+import com.yunfeiyun.agmp.common.utils.StringUtils;
|
|
|
import com.yunfeiyun.agmp.iot.common.domain.IotDevice;
|
|
|
import com.yunfeiyun.agmp.iot.common.domain.IotDeviceGeoLocation;
|
|
|
import com.yunfeiyun.agmp.iot.common.exception.IotBizException;
|
|
|
@@ -108,15 +109,29 @@ public class IotHomeServiceImpl implements IIotHomeService {
|
|
|
List<IotHomeDeviceListResVo> dataList = mongoService.aggregate(IotDeviceGeoLocation.class, aggregation, IotHomeDeviceListResVo.class);
|
|
|
List<IotHomeDeviceListResVo> resultList = new ArrayList<>();
|
|
|
for(IotHomeDeviceListResVo item : dataList) {
|
|
|
- IotDevice deviceInfo = deviceMap.get(item.getDevBid());
|
|
|
+ IotDeviceListResVo deviceInfo = deviceMap.get(item.getDevBid());
|
|
|
if(deviceInfo == null){
|
|
|
continue;
|
|
|
}
|
|
|
+ String address = "";
|
|
|
+ try{
|
|
|
+ address = deviceInfo.getDevProvince() + deviceInfo.getDevCity() + deviceInfo.getDevDistrict();
|
|
|
+ }catch (Exception e){
|
|
|
+ }
|
|
|
+ if(StringUtils.isEmpty(address)){
|
|
|
+ try{
|
|
|
+ address = deviceInfo.getDevProvincealign() + deviceInfo.getDevCityalign() + deviceInfo.getDevDistrictalign();
|
|
|
+ }catch (Exception e){
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ item.setAddress(address);
|
|
|
item.setDevStatus(deviceInfo.getDevStatus());
|
|
|
item.setDevCode(deviceInfo.getDevCode());
|
|
|
item.setDevName(deviceInfo.getDevName());
|
|
|
item.setDevLngalign(BigDecimalUtil.toString(deviceInfo.getDevLngalign()));
|
|
|
item.setDevLatalign(BigDecimalUtil.toString(deviceInfo.getDevLatalign()));
|
|
|
+ item.setDevUpdateddate(deviceInfo.getDevUpdateddate());
|
|
|
resultList.add(item);
|
|
|
}
|
|
|
return resultList;
|