fix:修改getTifByRegionAndTime拼接url

main
xlp 6 months ago
parent 8032a8db91
commit de9589f00a

@ -76,8 +76,6 @@ public class DataImportServiceImpl implements DataImportService {
radi_chn_mul_horMapper radichnmulhorMapper;
@Override
public List<String> upLoadProjectLedgerBySingleFile(MultipartFile file) throws IOException {
return null;
@ -89,7 +87,6 @@ public class DataImportServiceImpl implements DataImportService {
}
/**
* Excel
*
@ -128,7 +125,7 @@ public class DataImportServiceImpl implements DataImportService {
});
//将list插入数据库
Integer integer = tSamplingDataDetailsMapper.insertByBatch(list);
log.info("成功插入 {} 条数据",integer);
log.info("成功插入 {} 条数据", integer);
} catch (IOException e) {
throw new RuntimeException(e);
@ -245,15 +242,15 @@ public class DataImportServiceImpl implements DataImportService {
}
@Override
public List<String> upLoadRailwayStaUAVTifData(MultipartFile[] railwayStaUAVTifDataFile){
public List<String> upLoadRailwayStaUAVTifData(MultipartFile[] railwayStaUAVTifDataFile) {
//设置时间格式
SimpleDateFormat sdf = new SimpleDateFormat( "yyyyMMdd" );
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
//1、处理文件位置
//文件存放位置
String realPath = "data";
//按照时间格式划分
String format = sdf.format(new Date());
String path = realPath + File.separator+ format+ File.separator + UUID.randomUUID()+ File.separator;
String path = realPath + File.separator + format + File.separator + UUID.randomUUID() + File.separator;
// String path = realPath + File.separator + UUID.randomUUID()+ File.separator;
// String path = realPath;
@ -264,7 +261,6 @@ public class DataImportServiceImpl implements DataImportService {
}
String objPath = System.getProperty("user.dir") + File.separator + path;
// 2、保存文件到指定路径存文件到指定路径
for (MultipartFile file : railwayStaUAVTifDataFile) {
@ -298,17 +294,6 @@ public class DataImportServiceImpl implements DataImportService {
return retMsg;
// //设置时间格式
// SimpleDateFormat sdf = new SimpleDateFormat( "yyyyMMdd" );
// //1、处理文件位置
@ -363,6 +348,7 @@ public class DataImportServiceImpl implements DataImportService {
/**
*
*
* @param folder
* @return
*/
@ -408,7 +394,7 @@ public class DataImportServiceImpl implements DataImportService {
@Override
public List<TGeoserverinfo> getTifByRegion(String region) {
try{
try {
List<TGeoserverinfo> tifByRegion = tGeoserverinfoMapper.getTifByRegion(region);
if (tifByRegion != null) {
for (TGeoserverinfo info : tifByRegion) {
@ -416,7 +402,7 @@ public class DataImportServiceImpl implements DataImportService {
}
}
return tifByRegion;
}catch (ParamsException e){
} catch (ParamsException e) {
throw new RuntimeException("Failed to get region info", e);
}
@ -424,29 +410,31 @@ public class DataImportServiceImpl implements DataImportService {
@Override
public TGeoserverinfo getTifByRegionAndTime(String region) {
try{
try {
TGeoserverinfo tGeoserverinfo = new TGeoserverinfo();
tGeoserverinfo = tGeoserverinfoMapper.getTifByRegionAndTime(region);
if (tGeoserverinfo != null) {
tGeoserverinfo.setUrl(geoServerPubService.getMapBox3857RasterWmsUrl(tGeoserverinfo.getId()));
}
return tGeoserverinfo;
}catch (ParamsException e){
}catch(ParamsException e){
throw new RuntimeException("数据库获取失败", e);
}
}
@Override
public List<String> getLayer() {
try{
public List<String> getLayer () {
try {
List<String> layer = new ArrayList<>();
layer.add("城市三维模型");
layer.add("居民点");
return layer;
}catch (ParamsException e){
} catch (ParamsException e) {
return null;
}
}
@Override
public List<String> getTifByLayer(String layer) {
public List<String> getTifByLayer (String layer){
List<String> tifUrls;
try {
tifUrls = new ArrayList<>();
@ -469,18 +457,18 @@ public class DataImportServiceImpl implements DataImportService {
}
@Override
public List<ElementRet> getElementInfo() {
public List<ElementRet> getElementInfo () {
try {
List<ElementRet> elementInfo = new ArrayList<>();
elementInfo = radichnmulhorMapper.getElementInfo();
return elementInfo;
}catch (ParamsException e){
} catch (ParamsException e) {
return null;
}
}
@Override
public List<ElementValue> getValueByElement(String element) {
public List<ElementValue> getValueByElement (String element){
Map<String, String> elementMap = new HashMap<String, String>() {{
put("总辐射辐照度", "V14311");
put("净辐射辐照度", "V14312");
@ -507,7 +495,7 @@ public class DataImportServiceImpl implements DataImportService {
}
@Override
public List<MonitorRet> getMonitorInfo() {
public List<MonitorRet> getMonitorInfo () {
List<MonitorRet> monitorInfoList = new ArrayList<>();
try {
Map<String, String> monitorMap = new HashMap<>();
@ -522,16 +510,16 @@ public class DataImportServiceImpl implements DataImportService {
monitorMap.put("监测点9", "10");
monitorMap.put("监测点10", "5");
monitorInfoList.add(new MonitorRet("监测点1", 104.06, 30.67,"50")); // 成都
monitorInfoList.add(new MonitorRet("监测点2", 104.76, 31.46,"45")); // 绵阳
monitorInfoList.add(new MonitorRet("监测点3", 105.06, 30.87,"40")); // 德阳
monitorInfoList.add(new MonitorRet("监测点4", 105.36, 30.57,"35")); // 广元
monitorInfoList.add(new MonitorRet("监测点5", 106.06, 29.37,"30")); // 遂宁
monitorInfoList.add(new MonitorRet("监测点6", 106.76, 29.07,"25")); // 内江
monitorInfoList.add(new MonitorRet("监测点7", 107.06, 28.77,"20")); // 乐山
monitorInfoList.add(new MonitorRet("监测点8", 107.36, 28.47,"15")); // 眉山
monitorInfoList.add(new MonitorRet("监测点9", 107.66, 28.17,"10")); // 宜宾
monitorInfoList.add(new MonitorRet("监测点10", 107.96, 27.87,"5")); // 泸州
monitorInfoList.add(new MonitorRet("监测点1", 104.06, 30.67, "50")); // 成都
monitorInfoList.add(new MonitorRet("监测点2", 104.76, 31.46, "45")); // 绵阳
monitorInfoList.add(new MonitorRet("监测点3", 105.06, 30.87, "40")); // 德阳
monitorInfoList.add(new MonitorRet("监测点4", 105.36, 30.57, "35")); // 广元
monitorInfoList.add(new MonitorRet("监测点5", 106.06, 29.37, "30")); // 遂宁
monitorInfoList.add(new MonitorRet("监测点6", 106.76, 29.07, "25")); // 内江
monitorInfoList.add(new MonitorRet("监测点7", 107.06, 28.77, "20")); // 乐山
monitorInfoList.add(new MonitorRet("监测点8", 107.36, 28.47, "15")); // 眉山
monitorInfoList.add(new MonitorRet("监测点9", 107.66, 28.17, "10")); // 宜宾
monitorInfoList.add(new MonitorRet("监测点10", 107.96, 27.87, "5")); // 泸州
// 使用Collections.sort和自定义的Comparator进行排序
Collections.sort(monitorInfoList, new Comparator<MonitorRet>() {
@ -552,7 +540,7 @@ public class DataImportServiceImpl implements DataImportService {
}
@Override
public List<String> getCurrentTime() {
public List<String> getCurrentTime () {
// 获取当前时间
LocalDateTime now = LocalDateTime.now();
// 定义时间格式
@ -564,7 +552,7 @@ public class DataImportServiceImpl implements DataImportService {
}
@Override
public List<BaseMapVoRet> getBaseMapList() {
public List<BaseMapVoRet> getBaseMapList () {
List<BaseMapVoRet> baseMapVoRetList = new ArrayList<>();
//配置文件中定义的
List<BaseMapVoRet> basemapConfigList = layerDispConfig.getBasemap();
@ -590,7 +578,7 @@ public class DataImportServiceImpl implements DataImportService {
}
@Override
public List<ElementValueRet> getElementStatus(String element) {
public List<ElementValueRet> getElementStatus (String element){
Map<String, String> elementMap = new HashMap<String, String>() {{
put("总辐射辐照度", "V14311");
put("净辐射辐照度", "V14312");
@ -625,7 +613,7 @@ public class DataImportServiceImpl implements DataImportService {
}
@Override
public PageVo<SiteListVoRet> getSiteListInfo(SiteListVoReq siteListVoReq) {
public PageVo<SiteListVoRet> getSiteListInfo (SiteListVoReq siteListVoReq){
Page<SiteListVoRet> page = new Page<>(siteListVoReq.getCurrent(), siteListVoReq.getSize());
if (siteListVoReq.getDataType().equals("总辐射辐照度")) {
page = radichnmulhorMapper.getSiteListInfo1(page, siteListVoReq.getDataType());
@ -645,7 +633,8 @@ public class DataImportServiceImpl implements DataImportService {
//将records数据取出来
return new PageVo<>(page);
}
private String getURL(TGeoserverinfo geoBasedatageoserverinfo) {
private String getURL (TGeoserverinfo geoBasedatageoserverinfo){
String url = "";
String geoServerURL = "";
geoServerURL = mygeoServerConfig.getGeoserverapiurl();
@ -686,7 +675,7 @@ public class DataImportServiceImpl implements DataImportService {
* @param coordsExcelFile Excel
* @return List<DataManageExcelModel>
*/
private List<DataManageExcelModel> readExcelSheets(MultipartFile coordsExcelFile) {
private List<DataManageExcelModel> readExcelSheets (MultipartFile coordsExcelFile){
List<DataManageExcelModel> list = new ArrayList<>();
// 坐标数据读入
@ -721,7 +710,7 @@ public class DataImportServiceImpl implements DataImportService {
}
public Map readExcel(MultipartFile file) throws IOException {
public Map readExcel (MultipartFile file) throws IOException {
Map map = new HashMap<>();
// public List<DataManageExcelModel> readExcel() throws IOException {
//读取Excel中的数据
@ -757,5 +746,4 @@ public class DataImportServiceImpl implements DataImportService {
return map;
}
}

Loading…
Cancel
Save