From 41ee3f1a8d412171dbfab367557f20c9c604c773 Mon Sep 17 00:00:00 2001 From: xiaowuler Date: Wed, 6 Apr 2022 16:08:47 +0800 Subject: [PATCH] commit some codes --- .../apiservice/controller/BaseDataController.java | 12 ++++++------ .../apiservice/controller/BaseInfoController.java | 13 ++++++++----- .../ping/chuan/apiservice/service/IDataService.java | 3 ++- .../chuan/apiservice/service/impl/DataService.java | 4 ++-- 4 files changed, 18 insertions(+), 14 deletions(-) diff --git a/04.系统编码/02.api-service/src/main/java/com/ping/chuan/apiservice/controller/BaseDataController.java b/04.系统编码/02.api-service/src/main/java/com/ping/chuan/apiservice/controller/BaseDataController.java index 9535d60..8154d42 100644 --- a/04.系统编码/02.api-service/src/main/java/com/ping/chuan/apiservice/controller/BaseDataController.java +++ b/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"), }) diff --git a/04.系统编码/02.api-service/src/main/java/com/ping/chuan/apiservice/controller/BaseInfoController.java b/04.系统编码/02.api-service/src/main/java/com/ping/chuan/apiservice/controller/BaseInfoController.java index b5ade99..3fe9a87 100644 --- a/04.系统编码/02.api-service/src/main/java/com/ping/chuan/apiservice/controller/BaseInfoController.java +++ b/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 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") diff --git a/04.系统编码/02.api-service/src/main/java/com/ping/chuan/apiservice/service/IDataService.java b/04.系统编码/02.api-service/src/main/java/com/ping/chuan/apiservice/service/IDataService.java index 6f4f593..70255e6 100644 --- a/04.系统编码/02.api-service/src/main/java/com/ping/chuan/apiservice/service/IDataService.java +++ b/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 getRadarStations(); - List getRadarElevations(String radarElementType, String radarType, String station, LocalDateTime realTime) throws IOException; + List 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; } diff --git a/04.系统编码/02.api-service/src/main/java/com/ping/chuan/apiservice/service/impl/DataService.java b/04.系统编码/02.api-service/src/main/java/com/ping/chuan/apiservice/service/impl/DataService.java index a59cd7b..d370fcc 100644 --- a/04.系统编码/02.api-service/src/main/java/com/ping/chuan/apiservice/service/impl/DataService.java +++ b/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 getRadarElevations(String radarElementType, String radarType, String station, LocalDateTime realTime) throws IOException { + public List 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 cutConfigurations = dataRepository.findRadarElevations(keyspace, tableName, radarType, radarElementType, station, realTime); Objects.requireNonNull(cutConfigurations, "未查到相关信息,请调整参数查询"); - return cutConfigurations.stream().map(CutConfiguration::getElevation).collect(Collectors.toList()); + return cutConfigurations; } @Override