Commit c136c3ec authored by caotao's avatar caotao

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

2.场站无法页面新增问题修复。
parent 4525316a
...@@ -74,7 +74,10 @@ public class StationBasicDto extends BaseDto { ...@@ -74,7 +74,10 @@ public class StationBasicDto extends BaseDto {
@ApiModelProperty(value = "所属片区") @ApiModelProperty(value = "所属片区")
private String area; private String area;
@ApiModelProperty(value = "所属片区code")
private String areaCode; private String areaCode;
@ApiModelProperty(value = "所属地区名称") @ApiModelProperty(value = "所属地区名称")
private String areaName; private String areaName;
...@@ -89,6 +92,8 @@ public class StationBasicDto extends BaseDto { ...@@ -89,6 +92,8 @@ public class StationBasicDto extends BaseDto {
@ApiModelProperty(value = "平台关联场站id") @ApiModelProperty(value = "平台关联场站id")
private String platformStationId; private String platformStationId;
@ApiModelProperty(value = "坐标列表")
private List<StationCoordinateDto> stationCoordinate; private List<StationCoordinateDto> stationCoordinate;
......
...@@ -46,4 +46,7 @@ public class StationInfoDto { ...@@ -46,4 +46,7 @@ public class StationInfoDto {
@ApiModelProperty(value = "卡片数据") @ApiModelProperty(value = "卡片数据")
private List<Indicator> indicatorData ; private List<Indicator> indicatorData ;
@ApiModelProperty(value = "风险等级")
private String riskLevel;
} }
...@@ -32,4 +32,8 @@ public class StationRecordInfo { ...@@ -32,4 +32,8 @@ public class StationRecordInfo {
@ApiModelProperty(value = "所属地区") @ApiModelProperty(value = "所属地区")
private String belongArea; private String belongArea;
@ApiModelProperty(value = "风险等级")
private String riskLevel;
} }
...@@ -104,6 +104,7 @@ public class StationBasic extends BaseEntity { ...@@ -104,6 +104,7 @@ public class StationBasic extends BaseEntity {
@TableField("area_name") @TableField("area_name")
private String areaName; private String areaName;
@TableField(exist = false)
private List<Integer> belongArealist; private List<Integer> belongArealist;
/** /**
* 业主单位 * 业主单位
......
...@@ -112,6 +112,7 @@ ...@@ -112,6 +112,7 @@
station_basic.station_flag stationFlag, station_basic.station_flag stationFlag,
station_basic.area_code areaCode, station_basic.area_code areaCode,
station_basic.jumpPath, station_basic.jumpPath,
station_basic.risk_level riskLevel,
station_basic.belong_area belongArea, station_basic.belong_area belongArea,
station_coordinate.longitude, station_coordinate.longitude,
station_coordinate.laitude , station_coordinate.laitude ,
......
...@@ -119,7 +119,7 @@ public class StationBasicController extends BaseController { ...@@ -119,7 +119,7 @@ public class StationBasicController extends BaseController {
* @param sequenceNbr 主键 * @param sequenceNbr 主键
* @return * @return
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@GetMapping(value = "/getById") @GetMapping(value = "/getById")
@ApiOperation(httpMethod = "GET", value = "根据sequenceNbr查询单个场站基础信息表", notes = "根据sequenceNbr查询单个场站基础信息表") @ApiOperation(httpMethod = "GET", value = "根据sequenceNbr查询单个场站基础信息表", notes = "根据sequenceNbr查询单个场站基础信息表")
public ResponseModel<StationBasic> selectOne(@RequestParam Long sequenceNbr) { public ResponseModel<StationBasic> selectOne(@RequestParam Long sequenceNbr) {
......
...@@ -274,11 +274,17 @@ public class StationBasicServiceImpl extends BaseService<StationBasicDto, Statio ...@@ -274,11 +274,17 @@ public class StationBasicServiceImpl extends BaseService<StationBasicDto, Statio
} }
public List<StationInfoDto> getStationList(String areaCode, String type) { public List<StationInfoDto> getStationList(String areaCode, String type) {
// 场站信息列表 地图接口返回使用
List<StationInfoDto> stationInfoDtoList = new LinkedList<>(); List<StationInfoDto> stationInfoDtoList = new LinkedList<>();
//场站信息列表
List<StationRecordInfo> list = new ArrayList<>(); List<StationRecordInfo> list = new ArrayList<>();
//图例数据列表
List<Indicator> indicatorList = indicatorServiceImpl.getIndicatorByType(type); 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)); MapRegion mapRegion = mapRegionServiceImpl.getOne(new QueryWrapper<MapRegion>().eq("name", areaCode));
//如果区域信息不为空则继续查询省份
if (mapRegion != null) { if (mapRegion != null) {
ArrayList<String> provinces = mapRegion.getProvince(); ArrayList<String> provinces = mapRegion.getProvince();
if (!provinces.isEmpty()) { if (!provinces.isEmpty()) {
...@@ -290,32 +296,35 @@ public class StationBasicServiceImpl extends BaseService<StationBasicDto, Statio ...@@ -290,32 +296,35 @@ public class StationBasicServiceImpl extends BaseService<StationBasicDto, Statio
} }
} }
} else { } else {
//如果查不到区域 则查询省份信息
Region region = regionServiceImpl.getRegionCodeByRegionName(areaCode); Region region = regionServiceImpl.getRegionCodeByRegionName(areaCode);
if (region != null && region.getRegionCode() != null) { if (region != null && region.getRegionCode() != null) {
list = stationBasicMapper.getStationList(String.valueOf(region.getRegionCode())); list = stationBasicMapper.getStationList(String.valueOf(region.getRegionCode()));
} }
} }
} }
//如果列表为空,则传值有问题返回所有
if (list.isEmpty()) { if (list.isEmpty()) {
return stationInfoDtoList; list.addAll(stationBasicMapper.getStationList(null));
} 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.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; return stationInfoDtoList;
} }
......
package com.yeejoin.amos.boot.module.jxiop.biz.utils; package com.yeejoin.amos.boot.module.jxiop.biz.utils;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Random;
public class MapUtils { public class MapUtils {
private static final double EARTH_RADIUS = 63.781370; // 地球半径 private static final double EARTH_RADIUS = 63.781370; // 地球半径
...@@ -18,9 +19,9 @@ public class MapUtils { ...@@ -18,9 +19,9 @@ public class MapUtils {
double radLat = Math.toRadians(latitude); double radLat = Math.toRadians(latitude);
// 计算x、y、z坐标值 // 计算x、y、z坐标值
double x = EARTH_RADIUS * Math.cos(radLat) * Math.cos(radLng)+10; double x = EARTH_RADIUS * Math.cos(radLat) * Math.cos(radLng)+ Math.random()*1000 ;
double y = EARTH_RADIUS * Math.cos(radLat) * Math.sin(radLng)-3; double y = EARTH_RADIUS * Math.cos(radLat) * Math.sin(radLng)-Math.random()*1000;
double z = EARTH_RADIUS * Math.sin(radLat); double z = EARTH_RADIUS * Math.sin(radLat)+Math.random()*1000;
arrayList.add(x); arrayList.add(x);
arrayList.add(y); arrayList.add(y);
arrayList.add(z); 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