添加河流空间数据接口
This commit is contained in:
parent
65ee59f1ea
commit
83ba536679
@ -1,11 +1,25 @@
|
|||||||
package com.gis3c.spatial.service;
|
package com.gis3c.spatial.service;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by hukekuan on 2018/4/12.
|
* Created by hukekuan on 2018/4/12.
|
||||||
*/
|
*/
|
||||||
public interface RiverService {
|
public interface RiverService {
|
||||||
public String findRiversByStationCodes(Set<String> stationCodes);
|
/**
|
||||||
public String findRiversByRiverCodes(Set<String> riverCodes);
|
* 根据站点编号获取分段河流数据
|
||||||
|
* @param stationCodes 站点编号
|
||||||
|
* @param sufaceStations 站点编号和站点水质的集合
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public String findRiversByStationCodes(Set<String> stationCodes,Map<String,String> sufaceStations);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据河流编号获取分段河流数据
|
||||||
|
* @param riverCodes 河流编号
|
||||||
|
* @param sufaceStations 站点编号和站点水质的集合
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public String findRiversByRiverCodes(Set<String> riverCodes,Map<String,String> sufaceStations);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,6 +10,7 @@ import org.springframework.stereotype.Service;
|
|||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -21,10 +22,19 @@ public class RiverServiceImpl implements RiverService {
|
|||||||
private RiverDao riverDao;
|
private RiverDao riverDao;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String findRiversByStationCodes(Set<String> stationCodes) {
|
public String findRiversByStationCodes(Set<String> stationCodes,Map<String,String> sufaceStations) {
|
||||||
String riverJson = null;
|
String riverJson = null;
|
||||||
List<SeparatedRiver> riverList
|
List<SeparatedRiver> riverList
|
||||||
= riverDao.findRiversByStationCodes(stationCodes);
|
= riverDao.findRiversByStationCodes(stationCodes);
|
||||||
|
if(sufaceStations != null){
|
||||||
|
riverList.forEach(separatedRiver -> {
|
||||||
|
if(sufaceStations.keySet().contains(separatedRiver.getStationCode())){
|
||||||
|
separatedRiver.setLevel(sufaceStations.get(separatedRiver.getStationCode()));
|
||||||
|
}else {
|
||||||
|
separatedRiver.setLevel("--");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
riverJson = FeatureUtilities.JavaBeans2Json(riverList);
|
riverJson = FeatureUtilities.JavaBeans2Json(riverList);
|
||||||
} catch (IllegalAccessException | IOException e) {
|
} catch (IllegalAccessException | IOException e) {
|
||||||
@ -34,10 +44,20 @@ public class RiverServiceImpl implements RiverService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String findRiversByRiverCodes(Set<String> riverCodes) {
|
public String findRiversByRiverCodes(Set<String> riverCodes,Map<String,String> sufaceStations) {
|
||||||
String riverJson = null;
|
String riverJson = null;
|
||||||
List<SeparatedRiver> riverList
|
List<SeparatedRiver> riverList
|
||||||
= riverDao.findRiversByRiverCodes(riverCodes);
|
= riverDao.findRiversByRiverCodes(riverCodes);
|
||||||
|
if(sufaceStations != null){
|
||||||
|
riverList.forEach(separatedRiver -> {
|
||||||
|
if(separatedRiver.getStationCode() != null
|
||||||
|
&& sufaceStations.keySet().contains(separatedRiver.getStationCode())){
|
||||||
|
separatedRiver.setLevel(sufaceStations.get(separatedRiver.getStationCode()));
|
||||||
|
}else {
|
||||||
|
separatedRiver.setLevel("--");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
riverJson = FeatureUtilities.JavaBeans2Json(riverList);
|
riverJson = FeatureUtilities.JavaBeans2Json(riverList);
|
||||||
} catch (IllegalAccessException | IOException e) {
|
} catch (IllegalAccessException | IOException e) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user