Browse Source

commit some codes

master
xiaowuler 3 years ago
parent
commit
41ee3f1a8d
  1. 12
      04.系统编码/02.api-service/src/main/java/com/ping/chuan/apiservice/controller/BaseDataController.java
  2. 13
      04.系统编码/02.api-service/src/main/java/com/ping/chuan/apiservice/controller/BaseInfoController.java
  3. 3
      04.系统编码/02.api-service/src/main/java/com/ping/chuan/apiservice/service/IDataService.java
  4. 4
      04.系统编码/02.api-service/src/main/java/com/ping/chuan/apiservice/service/impl/DataService.java

12
04.系统编码/02.api-service/src/main/java/com/ping/chuan/apiservice/controller/BaseDataController.java

@ -42,8 +42,8 @@ public class BaseDataController {
@ApiOperation(value="用户根据起报时间、要素编码获取SPCC模式要素预报数据", notes="用户根据起报时间、要素编码获取SPCC模式要素预报数据", produces="application/json", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(name = "elementCode", value = "要素编码", required = true, example = "TMP"),
@ApiImplicitParam(name = "initialTime", value = "起报时间", required = true, example = "20211110080000"),
@ApiImplicitParam(name = "forecastTime", value = "预报时间", required = true, example = "20211110110000"),
@ApiImplicitParam(name = "initialTime", value = "起报时间", required = true, example = "20220403080000"),
@ApiImplicitParam(name = "forecastTime", value = "预报时间", required = true, example = "20220403110000"),
@ApiImplicitParam(name = "latLons", value = "经纬度", required = true, example = "[[31.5509, 116.97061], [32.5509, 116.97061], [ 29.8, 118.55], [29.888, 118.77]]")
})
@PostMapping("getSPCCFcstByTargetTimeAndLatlons")
@ -77,7 +77,7 @@ public class BaseDataController {
@ApiOperation(value="用户根据起报时间、要素编码获取CLDAS模式要素预报数据", notes="用户根据起报时间、要素编码获取CLDAS模式要素预报数据", produces="application/json", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(name = "elementCode", value = "要素编码", required = true, example = "RHU"),
@ApiImplicitParam(name = "realTime", value = "实况时间", required = true, example = "20211112230000"),
@ApiImplicitParam(name = "realTime", value = "实况时间", required = true, example = "20220405060000"),
@ApiImplicitParam(name = "latLons", value = "经纬度", required = true, example = "[[31.5509, 116.97061], [32.5509, 116.97061], [ 29.8, 118.55], [29.888, 118.77]]")
})
@PostMapping("getCLDASRealByTargetTimeAndLatlons")
@ -111,7 +111,7 @@ public class BaseDataController {
@ApiOperation(value="用户根据起报时间、要素编码获取CMPA模式要素预报数据", notes="用户根据起报时间、要素编码获取CMPA模式要素预报数据", produces="application/json", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(name = "elementCode", value = "要素编码", required = true, example = "PRE"),
@ApiImplicitParam(name = "realTime", value = "实况时间", required = true, example = "20211112230000"),
@ApiImplicitParam(name = "realTime", value = "实况时间", required = true, example = "20220405060000"),
@ApiImplicitParam(name = "latLons", value = "经纬度", required = true, example = "[[31.5509, 116.97061], [32.5509, 116.97061], [ 29.8, 118.55], [29.888, 118.77]]")
})
@PostMapping("getCMPARealByInitialTimeAndLatlons")
@ -145,8 +145,8 @@ public class BaseDataController {
@ApiOperation(value="根据扫描配置项获取相关雷达数据", notes="根据扫描配置项获取相关雷达数据", produces="application/json", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(name="radarType", value="雷达类型", example = "SAD", required=true, paramType="query"),
@ApiImplicitParam(name="station", value="站点", example = "Z9558", required=true, paramType="query"),
@ApiImplicitParam(name="realTime", value="雷达时间", example = "20220402104823", required=true, paramType="query"),
@ApiImplicitParam(name="station", value="站点", example = "Z9552", required=true, paramType="query"),
@ApiImplicitParam(name="realTime", value="雷达时间", example = "20220406074717", required=true, paramType="query"),
@ApiImplicitParam(name="productType", value="雷达数据类型", example = "dBT", required=true, paramType="query"),
@ApiImplicitParam(name="cutConfigurationIndex", value="扫描配置索引,可通过 baseInfo/getRadarCutConfigurations 接口获取相关扫描配置", example = "0", required=true, paramType="query"),
})

13
04.系统编码/02.api-service/src/main/java/com/ping/chuan/apiservice/controller/BaseInfoController.java

@ -1,5 +1,6 @@
package com.ping.chuan.apiservice.controller;
import com.google.common.collect.Lists;
import com.ping.chuan.apiservice.model.dao.Coordinate;
import com.ping.chuan.apiservice.model.dao.MetaInfo;
import com.ping.chuan.apiservice.service.IDataService;
@ -61,6 +62,7 @@ public class BaseInfoController {
@RequestMapping("getAllModeCode")
public RequestResult getAllModeCode(){
List<String> result = CacheTemplate.metaInfos.keySet().stream()
.filter(m -> !m.getModeCode().equals("RADAR"))
.map(m -> m.getModeCode())
.distinct()
.collect(Collectors.toList());
@ -109,7 +111,7 @@ public class BaseInfoController {
@ApiImplicitParams({
@ApiImplicitParam(name="modeCode", value="模式编码", example = "SPCC", required=true, paramType="query"),
@ApiImplicitParam(name="elementCode", value="要素编码", example = "TMP", required=true, paramType="query"),
@ApiImplicitParam(name="initialTime", value="起报时间", example = "20211112080000", required=true, paramType="query")
@ApiImplicitParam(name="initialTime", value="起报时间", example = "20220403080000", required=true, paramType="query")
})
@RequestMapping("getForecastTimeByModeCodeAndElementCode")
public RequestResult getForecastTimeByModeCodeAndElementCode(String modeCode, String elementCode, String initialTime) throws Exception {
@ -151,8 +153,9 @@ public class BaseInfoController {
@ApiOperation(value="获取所有的雷达类型", notes="获取所有的雷达类型", produces="application/json", httpMethod = "POST")
@PostMapping("getAllRadarType")
public RequestResult getRadarTypes() {
return RequestResult.success(CacheTemplate.metaInfos.keySet().stream()
.filter(metaInfo -> metaInfo.getModeCode().equals("RADAR")).map(m -> m.getMemberCode()).collect(Collectors.toList()));
// return RequestResult.success(CacheTemplate.metaInfos.keySet().stream()
// .filter(metaInfo -> metaInfo.getModeCode().equals("RADAR")).map(m -> m.getMemberCode()).collect(Collectors.toList()));
return RequestResult.success(Lists.newArrayList("SAD"));
}
@ApiOperation(value="获取所有的雷达站点", notes="获取所有的雷达站点", produces="application/json", httpMethod = "POST")
@ -177,8 +180,8 @@ public class BaseInfoController {
@ApiOperation(value="获取雷达所有的扫描配置", notes="获取雷达所有的扫描配置", produces="application/json", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(name="radarType", value="雷达类型", example = "SAD", required=true, paramType="query"),
@ApiImplicitParam(name="station", value="站点", example = "Z9558", required=true, paramType="query"),
@ApiImplicitParam(name="realTime", value="雷达时间", example = "20220402104823", required=true, paramType="query"),
@ApiImplicitParam(name="station", value="站点", example = "Z9552", required=true, paramType="query"),
@ApiImplicitParam(name="realTime", value="雷达时间", example = "20220406074717", required=true, paramType="query"),
@ApiImplicitParam(name="productType", value="雷达数据类型", example = "dBT", required=true, paramType="query"),
})
@PostMapping("getRadarCutConfigurations")

3
04.系统编码/02.api-service/src/main/java/com/ping/chuan/apiservice/service/IDataService.java

@ -11,6 +11,7 @@ import com.ping.chuan.apiservice.model.dao.Coordinate;
import com.ping.chuan.apiservice.model.dao.DealInfo;
import com.ping.chuan.apiservice.model.dao.MetaInfo;
import com.ping.chuan.apiservice.model.vo.PointValueVo;
import com.xiaowuler.radar.core.weather.domain.CutConfiguration;
/**
* @describe: 数据服务接口
@ -30,7 +31,7 @@ public interface IDataService {
List<String> getRadarStations();
List<Float> getRadarElevations(String radarElementType, String radarType, String station, LocalDateTime realTime) throws IOException;
List<CutConfiguration> getRadarElevations(String radarElementType, String radarType, String station, LocalDateTime realTime) throws IOException;
Object getRadarByCutConfiguration(String productType, String radarType, String station, LocalDateTime realTime, Integer cutConfigurationIndex) throws IOException;
}

4
04.系统编码/02.api-service/src/main/java/com/ping/chuan/apiservice/service/impl/DataService.java

@ -124,12 +124,12 @@ public class DataService implements IDataService {
}
@Override
public List<Float> getRadarElevations(String radarElementType, String radarType, String station, LocalDateTime realTime) throws IOException {
public List<CutConfiguration> getRadarElevations(String radarElementType, String radarType, String station, LocalDateTime realTime) throws IOException {
String keyspace = toKeyspace(realTime);
String tableName = "radar_%s_cap_6_6_1010".formatted(radarType).toLowerCase(Locale.ROOT);
List<CutConfiguration> cutConfigurations = dataRepository.findRadarElevations(keyspace, tableName, radarType, radarElementType, station, realTime);
Objects.requireNonNull(cutConfigurations, "未查到相关信息,请调整参数查询");
return cutConfigurations.stream().map(CutConfiguration::getElevation).collect(Collectors.toList());
return cutConfigurations;
}
@Override

Loading…
Cancel
Save