Commit c136c3ec authored by caotao's avatar caotao

1.大屏地图接口新增风险等级字段。

2.场站无法页面新增问题修复。
parent 4525316a
......@@ -74,7 +74,10 @@ public class StationBasicDto extends BaseDto {
@ApiModelProperty(value = "所属片区")
private String area;
@ApiModelProperty(value = "所属片区code")
private String areaCode;
@ApiModelProperty(value = "所属地区名称")
private String areaName;
......@@ -89,6 +92,8 @@ public class StationBasicDto extends BaseDto {
@ApiModelProperty(value = "平台关联场站id")
private String platformStationId;
@ApiModelProperty(value = "坐标列表")
private List<StationCoordinateDto> stationCoordinate;
......
......@@ -46,4 +46,7 @@ public class StationInfoDto {
@ApiModelProperty(value = "卡片数据")
private List<Indicator> indicatorData ;
@ApiModelProperty(value = "风险等级")
private String riskLevel;
}
......@@ -32,4 +32,8 @@ public class StationRecordInfo {
@ApiModelProperty(value = "所属地区")
private String belongArea;
@ApiModelProperty(value = "风险等级")
private String riskLevel;
}
......@@ -104,6 +104,7 @@ public class StationBasic extends BaseEntity {
@TableField("area_name")
private String areaName;
@TableField(exist = false)
private List<Integer> belongArealist;
/**
* 业主单位
......
......@@ -112,6 +112,7 @@
station_basic.station_flag stationFlag,
station_basic.area_code areaCode,
station_basic.jumpPath,
station_basic.risk_level riskLevel,
station_basic.belong_area belongArea,
station_coordinate.longitude,
station_coordinate.laitude ,
......
......@@ -119,7 +119,7 @@ public class StationBasicController extends BaseController {
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@GetMapping(value = "/getById")
@ApiOperation(httpMethod = "GET", value = "根据sequenceNbr查询单个场站基础信息表", notes = "根据sequenceNbr查询单个场站基础信息表")
public ResponseModel<StationBasic> selectOne(@RequestParam Long sequenceNbr) {
......
......@@ -274,11 +274,17 @@ public class StationBasicServiceImpl extends BaseService<StationBasicDto, Statio
}
public List<StationInfoDto> getStationList(String areaCode, String type) {
// 场站信息列表 地图接口返回使用
List<StationInfoDto> stationInfoDtoList = new LinkedList<>();
//场站信息列表
List<StationRecordInfo> list = new ArrayList<>();
//图例数据列表
List<Indicator> indicatorList = indicatorServiceImpl.getIndicatorByType(type);
if (areaCode != null) {
// 如果传递areaCode 或者areaCode值不为空
if (areaCode != null&&!areaCode.equals("")) {
//查询区域信息
MapRegion mapRegion = mapRegionServiceImpl.getOne(new QueryWrapper<MapRegion>().eq("name", areaCode));
//如果区域信息不为空则继续查询省份
if (mapRegion != null) {
ArrayList<String> provinces = mapRegion.getProvince();
if (!provinces.isEmpty()) {
......@@ -290,32 +296,35 @@ public class StationBasicServiceImpl extends BaseService<StationBasicDto, Statio
}
}
} else {
//如果查不到区域 则查询省份信息
Region region = regionServiceImpl.getRegionCodeByRegionName(areaCode);
if (region != null && region.getRegionCode() != null) {
list = stationBasicMapper.getStationList(String.valueOf(region.getRegionCode()));
}
}
}
//如果列表为空,则传值有问题返回所有
if (list.isEmpty()) {
return stationInfoDtoList;
} else {
list.forEach(stationRecordInfo -> {
StationInfoDto stationInfoDto = new StationInfoDto();
stationInfoDto.setStationName(stationRecordInfo.getStationName());
stationInfoDto.setType(stationRecordInfo.getStationType());
//url 暂时写死
stationInfoDto.setUrl("https://tse4-mm.cn.bing.net/th/id/OIP-C.ySnewoc464X4Aecg9jl03AAAAA?w=162&h=180&c=7&r=0&o=5&pid=1.7");
stationInfoDto.setJumpPath(stationRecordInfo.getJumpPath());
if (stationRecordInfo.getBelongArea() != null) {
stationInfoDto.setRegion(this.getProviceName(stationRecordInfo.getBelongArea()));
}
ArrayList<Double> arrayList = MapUtils.geoTo3d(Double.valueOf(stationRecordInfo.getLongitude()), Double.valueOf(stationRecordInfo.getLaitude()));
stationInfoDto.setTitlePos(arrayList);
stationInfoDto.setIndicatorData(indicatorList);
stationInfoDtoList.add(stationInfoDto);
});
list.addAll(stationBasicMapper.getStationList(null));
}
//便利返回给地图的数据并对数据进行处理
list.forEach(stationRecordInfo -> {
StationInfoDto stationInfoDto = new StationInfoDto();
stationInfoDto.setStationName(stationRecordInfo.getStationName());
stationInfoDto.setType(stationRecordInfo.getStationType());
//url 暂时写死
stationInfoDto.setUrl("https://tse4-mm.cn.bing.net/th/id/OIP-C.ySnewoc464X4Aecg9jl03AAAAA?w=162&h=180&c=7&r=0&o=5&pid=1.7");
stationInfoDto.setJumpPath(stationRecordInfo.getJumpPath());
if (stationRecordInfo.getBelongArea() != null) {
stationInfoDto.setRegion(this.getProviceName(stationRecordInfo.getBelongArea()));
}
ArrayList<Double> arrayList = MapUtils.geoTo3d(Double.valueOf(stationRecordInfo.getLongitude()), Double.valueOf(stationRecordInfo.getLaitude()));
stationInfoDto.setTitlePos(arrayList);
stationInfoDto.setIndicatorData(indicatorList);
stationInfoDto.setRiskLevel(stationRecordInfo.getRiskLevel());
stationInfoDtoList.add(stationInfoDto);
});
return stationInfoDtoList;
}
......
package com.yeejoin.amos.boot.module.jxiop.biz.utils;
import java.util.ArrayList;
import java.util.Random;
public class MapUtils {
private static final double EARTH_RADIUS = 63.781370; // 地球半径
......@@ -18,9 +19,9 @@ public class MapUtils {
double radLat = Math.toRadians(latitude);
// 计算x、y、z坐标值
double x = EARTH_RADIUS * Math.cos(radLat) * Math.cos(radLng)+10;
double y = EARTH_RADIUS * Math.cos(radLat) * Math.sin(radLng)-3;
double z = EARTH_RADIUS * Math.sin(radLat);
double x = EARTH_RADIUS * Math.cos(radLat) * Math.cos(radLng)+ Math.random()*1000 ;
double y = EARTH_RADIUS * Math.cos(radLat) * Math.sin(radLng)-Math.random()*1000;
double z = EARTH_RADIUS * Math.sin(radLat)+Math.random()*1000;
arrayList.add(x);
arrayList.add(y);
arrayList.add(z);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment