fix:修改台站管理 自建台站类型没有数据问题
This commit is contained in:
parent
00f56418d5
commit
30d88aa5e3
|
@ -6,6 +6,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Component
|
||||
|
@ -26,11 +27,7 @@ public class StationTypeUtil {
|
|||
for (StationType stationType:stationTypeList) {
|
||||
if (StringUtils.isNotBlank(stationType.getMinId()) && StringUtils.isNotBlank(stationType.getMaxId())){
|
||||
if (stationId>Integer.valueOf(stationType.getMinId()) && stationId<=Integer.valueOf(stationType.getMaxId())){
|
||||
if (category == 3) {
|
||||
type = "Car";
|
||||
} else if (category == 4) {
|
||||
type = "Ship";
|
||||
} else {
|
||||
if (Objects.equals(category, stationType.getCategory())) {
|
||||
type = stationType.getName();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,6 +19,8 @@ public class StationType implements Serializable {
|
|||
|
||||
private String maxId;
|
||||
|
||||
private Integer category;
|
||||
|
||||
private List<StationType> types = new ArrayList<>();
|
||||
|
||||
}
|
||||
|
|
|
@ -60,6 +60,9 @@ public class StationOperationServiceImpl extends ServiceImpl<StationOperationMap
|
|||
@Autowired
|
||||
private StationTypeUtil stationTypeUtil;
|
||||
|
||||
@Autowired
|
||||
private StationType stationType;
|
||||
|
||||
private final SpatialContext spatialContext = SpatialContext.GEO;
|
||||
|
||||
@Override
|
||||
|
@ -133,8 +136,8 @@ public class StationOperationServiceImpl extends ServiceImpl<StationOperationMap
|
|||
@Override
|
||||
public Result findInfo(String stationId, String type) {
|
||||
Result result = new Result();
|
||||
if (type.equals("IMS STATION(P)") || type.equals("IMS STATION(G)") || type.equals("NRL")
|
||||
|| type.equals("Car")|| type.equals("Ship")){
|
||||
List<String> stationTypes = stationType.getTypes().stream().map(StationType::getName).collect(Collectors.toList());
|
||||
if (stationTypes.contains(type)){
|
||||
HashMap<String, GardsStations> stationInfoMap = (HashMap<String, GardsStations>) redisUtil.get("stationInfoMap");
|
||||
GardsStations stations = stationInfoMap.get(stationId);
|
||||
if (Objects.nonNull(stations)){
|
||||
|
|
Loading…
Reference in New Issue
Block a user