|
@@ -13,6 +13,8 @@ import com.hywa.map.dao.mapper.AreaDataMapper;
|
|
import com.hywa.map.dao.mapper.ExpertInfoMapper;
|
|
import com.hywa.map.dao.mapper.ExpertInfoMapper;
|
|
import com.hywa.map.dao.mapper.TopicInfoMapper;
|
|
import com.hywa.map.dao.mapper.TopicInfoMapper;
|
|
import com.hywa.map.representation.*;
|
|
import com.hywa.map.representation.*;
|
|
|
|
+import com.hywa.map.representation.amap.AmapEntity;
|
|
|
|
+import com.hywa.map.service.common.WeatherService;
|
|
import com.hywa.map.service.dict.DictService;
|
|
import com.hywa.map.service.dict.DictService;
|
|
import com.hywa.map.service.expert.AreaDataService;
|
|
import com.hywa.map.service.expert.AreaDataService;
|
|
import com.hywa.map.service.expert.DamService;
|
|
import com.hywa.map.service.expert.DamService;
|
|
@@ -63,6 +65,9 @@ public class MapStatisController {
|
|
@Autowired
|
|
@Autowired
|
|
private AreaDataMapper areaDataMapper;
|
|
private AreaDataMapper areaDataMapper;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private WeatherService weatherService;
|
|
|
|
+
|
|
public static String[] areaArrays = {"冠山街道", "龙山镇", "醒狮镇", "谷脚镇", "湾滩河镇", "洗马镇", "龙里县"};
|
|
public static String[] areaArrays = {"冠山街道", "龙山镇", "醒狮镇", "谷脚镇", "湾滩河镇", "洗马镇", "龙里县"};
|
|
public static DecimalFormat decimalFormat = new DecimalFormat("###################.###########");
|
|
public static DecimalFormat decimalFormat = new DecimalFormat("###################.###########");
|
|
|
|
|
|
@@ -968,11 +973,42 @@ public class MapStatisController {
|
|
}
|
|
}
|
|
String posAliasName = name.replaceAll("省", "").replaceAll("市", "");
|
|
String posAliasName = name.replaceAll("省", "").replaceAll("市", "");
|
|
SysArea sysArea = areaDataMapper.selectPosByName(name, posAliasName, porvinceName, cityName, countyName);
|
|
SysArea sysArea = areaDataMapper.selectPosByName(name, posAliasName, porvinceName, cityName, countyName);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
lon = sysArea.getPosLon();
|
|
lon = sysArea.getPosLon();
|
|
lat = sysArea.getPosLat();
|
|
lat = sysArea.getPosLat();
|
|
|
|
+ if (lon== null||lat == null){
|
|
|
|
+ AmapEntity detail = weatherService.getAddressDetail(cityName, name);
|
|
|
|
+ String location = detail.getLocation();
|
|
|
|
+ if (!StringUtils.isEmpty(location)){
|
|
|
|
+ String[] split = location.split(",");
|
|
|
|
+ lon = split[0];
|
|
|
|
+ lat = split[1];
|
|
|
|
+ }
|
|
|
|
+ }
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
|
+ AmapEntity detail = weatherService.getAddressDetail(cityName, name);
|
|
|
|
+ if (detail != null){
|
|
|
|
+ String location = detail.getLocation();
|
|
|
|
+ if (!StringUtils.isEmpty(location)){
|
|
|
|
+ String[] split = location.split(",");
|
|
|
|
+ lon = split[0];
|
|
|
|
+ lat = split[1];
|
|
|
|
+ }
|
|
|
|
+ }else {
|
|
|
|
+ AmapEntity ss = weatherService.getAddressDetail(cityName, cityName);
|
|
|
|
+ if (ss != null){
|
|
|
|
+ String location = ss.getLocation();
|
|
|
|
+ if (!StringUtils.isEmpty(location)){
|
|
|
|
+ String[] split = location.split(",");
|
|
|
|
+ lon = split[0];
|
|
|
|
+ lat = split[1];
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|