Browse Source

commit some codes

master
xiaowuler 3 years ago
parent
commit
5ba05f4223
  1. 5
      04.系统编码/01.xxl-job/xxl-job-executor/src/main/java/com/ping/chuan/ahpmsdp/xxljobexecutor/jobhandler/TianQingRadarDataHandler.java
  2. 3
      04.系统编码/01.xxl-job/xxl-job-executor/src/main/java/com/ping/chuan/ahpmsdp/xxljobexecutor/service/impl/RadarService.java
  3. 3
      04.系统编码/01.xxl-job/xxl-job-executor/src/main/java/com/ping/chuan/ahpmsdp/xxljobexecutor/service/impl/SchemaService.java
  4. 39
      04.系统编码/01.xxl-job/xxl-job-executor/src/test/java/com/ping/chuan/ahpmsdp/xxljobexecutor/XxlJobExecutorApplicationTests.java

5
04.系统编码/01.xxl-job/xxl-job-executor/src/main/java/com/ping/chuan/ahpmsdp/xxljobexecutor/jobhandler/TianQingRadarDataHandler.java

@ -83,11 +83,6 @@ public class TianQingRadarDataHandler {
for(Map.Entry<DealInfo, Map.Entry<MetaInfo, Coordinate>> entry : results.entrySet()){
XxlJobHelper.log("文件:{} 开始解析", entry.getKey().getFileName());
String result = radarService.read(entry);
// if(paramInfo.isWind()){
// result = dataService.readWindElement(entry);
// }else {
// result = dataService.readRoutineElement(entry, paramInfo.isTemp());
// }
XxlJobHelper.log("文件:{} 解析完成, 结果:{}", entry.getKey().getFileName(), result);
}
XxlJobHelper.log("文件解析完成");

3
04.系统编码/01.xxl-job/xxl-job-executor/src/main/java/com/ping/chuan/ahpmsdp/xxljobexecutor/service/impl/RadarService.java

@ -69,6 +69,7 @@ public class RadarService implements IRadarService {
put("site_configuration", GZipUtils.toList(GZipUtils.compress(mapper.writeValueAsBytes(commonBlock.getSiteConfiguration()))));
put("task_configuration", GZipUtils.toList(GZipUtils.compress(mapper.writeValueAsBytes(commonBlock.getTaskConfiguration()))));
put("generic_header", GZipUtils.toList(GZipUtils.compress(mapper.writeValueAsBytes(commonBlock.getGenericHeader()))));
put("cut_configurations", GZipUtils.toList(GZipUtils.compress(mapper.writeValueAsBytes(commonBlock.getCutConfigurations()))));
}};
}
@ -80,7 +81,7 @@ public class RadarService implements IRadarService {
MomentBlock momentBlock = tr.getMomentBlocks().stream().filter(mb -> mb.getMomentHeader().getDataType() == 1).findAny().orElse(null);
return new RadialBlock(tr.getRadialHeader(), momentBlock);
}).collect(Collectors.toList());
columns.put("col_%s".formatted(index), GZipUtils.toList(GZipUtils.compress(mapper.writeValueAsBytes(new RadarBlock(cutConfigurations.get(index), radialBlocks)))));
columns.put("col_%s".formatted(index), GZipUtils.toList(GZipUtils.compress(mapper.writeValueAsBytes(new RadarBlock(null, radialBlocks)))));
}
}
}

3
04.系统编码/01.xxl-job/xxl-job-executor/src/main/java/com/ping/chuan/ahpmsdp/xxljobexecutor/service/impl/SchemaService.java

@ -93,10 +93,11 @@ public class SchemaService implements ISchemaService {
}
private Map<String, DataType> toColumn(int length){
Map<String, DataType> columns = new LinkedHashMap<>(length + 4){{
Map<String, DataType> columns = new LinkedHashMap<>(length + 5){{
put("site_configuration", DataType.frozenList(DataType.cint()));
put("task_configuration", DataType.frozenList(DataType.cint()));
put("generic_header", DataType.frozenList(DataType.cint()));
put("cut_configurations", DataType.frozenList(DataType.cint()));
}};
for(int index = 0; index < length; index++){

39
04.系统编码/01.xxl-job/xxl-job-executor/src/test/java/com/ping/chuan/ahpmsdp/xxljobexecutor/XxlJobExecutorApplicationTests.java

@ -72,6 +72,7 @@ class XxlJobExecutorApplicationTests {
//// netcdfFile.getVariables().get(0).read()
//// });
// System.out.println("ssss");
schemaService.buildKeySpace();
}
@Test
@ -156,25 +157,25 @@ class XxlJobExecutorApplicationTests {
private List<List<Object>> createMetaInfos(){
List<List<Object>> metaInfos = new ArrayList<>();
// metaInfos.add(Lists.newArrayList("CLDAS", "BABJ", "VIS", 60, 60, 1010, "1201_1401_0.05_0.05_0_60_70_140", 0, "H", 60, 60, 70, "Visibility_surface"));
// metaInfos.add(Lists.newArrayList("CLDAS", "BABJ", "RHU", 60, 60, 1010, "1201_1401_0.05_0.05_0_60_70_140", 0, "H", 60, 60, 70, "Relative_humidity_height_above_ground"));
// metaInfos.add(Lists.newArrayList("CLDAS", "BABJ", "TEM", 60, 60, 1010, "1201_1401_0.05_0.05_0_60_70_140", 0, "H", 60, 60, 70, "Temperature_height_above_ground"));
// metaInfos.add(Lists.newArrayList("CLDAS", "BABJ", "WIN_U", 60, 60, 1010, "1201_1401_0.05_0.05_0_60_70_140", 0, "H", 60, 60, 70, "u-component_of_wind_height_above_ground"));
// metaInfos.add(Lists.newArrayList("CLDAS", "BABJ", "WIN_V", 60, 60, 1010, "1201_1401_0.05_0.05_0_60_70_140", 0, "H", 60, 60, 70, "v-component_of_wind_height_above_ground"));
// metaInfos.add(Lists.newArrayList("CLDAS", "BABJ", "MNRHU", 60, 60, 1010, "1201_1401_0.05_0.05_0_60_70_140", 0, "H", 60, 60, 70, "Fraction_of_snow_cover_height_above_ground"));
// metaInfos.add(Lists.newArrayList("CLDAS", "BABJ", "MNT", 60, 60, 1010, "1201_1401_0.05_0.05_0_60_70_140", 0, "H", 60, 60, 70, "Minimum_temperature_height_above_ground"));
// metaInfos.add(Lists.newArrayList("CLDAS", "BABJ", "MXRHU", 60, 60, 1010, "1201_1401_0.05_0.05_0_60_70_140", 0, "H", 60, 60, 70, "VAR0-1-122_FROM_38-0--1_height_above_ground"));
// metaInfos.add(Lists.newArrayList("CLDAS", "BABJ", "MXT", 60, 60, 1010, "1201_1401_0.05_0.05_0_60_70_140", 0, "H", 60, 60, 70, "Maximum_temperature_height_above_ground"));
// metaInfos.add(Lists.newArrayList("CLDAS", "BABJ", "MXWIN_U", 60, 60, 1010, "1201_1401_0.05_0.05_0_60_70_140", 0, "H", 60, 60, 70, "VAR0-2-102_FROM_38-0--1_height_above_ground"));
// metaInfos.add(Lists.newArrayList("CLDAS", "BABJ", "MXWIN_V", 60, 60, 1010, "1201_1401_0.05_0.05_0_60_70_140", 0, "H", 60, 60, 70, "VAR0-2-103_FROM_38-0--1_height_above_ground"));
// metaInfos.add(Lists.newArrayList("SPCC", "BEHF", "TMP", 180, 4320, 1010, "243_221_0.025_0.025_29_35.05_114.5_120", 180, "H", 60, 30, 30, "Temperature_height_above_ground"));
// metaInfos.add(Lists.newArrayList("SPCC", "BEHF", "EDA10_U", 180, 4320, 1010, "243_221_0.025_0.025_29_35.05_114.5_120", 180, "H", 60, 30, 30, "u-component_of_wind_height_above_ground"));
// metaInfos.add(Lists.newArrayList("SPCC", "BEHF", "EDA10_V", 180, 4320, 1010, "243_221_0.025_0.025_29_35.05_114.5_120", 180, "H", 60, 30, 30, "v-component_of_wind_height_above_ground"));
// metaInfos.add(Lists.newArrayList("SPCC", "BEHF", "ER03", 180, 4320, 1010, "243_221_0.025_0.025_29_35.05_114.5_120", 180, "H", 60, 30, 30, "Total_precipitation_surface_3_Hour_Accumulation"));
// metaInfos.add(Lists.newArrayList("SPCC", "BEHF", "PPH", 180, 4320, 1010, "243_221_0.025_0.025_29_35.05_114.5_120", 180, "H", 60, 30, 30, "Precipitation_type_surface_3_Hour_Accumulation"));
// metaInfos.add(Lists.newArrayList("SPCC", "BEHF", "TMAX", 1440, 4320, 1010, "243_221_0.025_0.025_29_35.05_114.5_120", 1440, "H", 60, 30, 30, "Maximum_temperature_height_above_ground_24_Hour_Maximum"));
// metaInfos.add(Lists.newArrayList("SPCC", "BEHF", "TMIN", 1440, 4320, 1010, "243_221_0.025_0.025_29_35.05_114.5_120", 1440, "H", 60, 30, 30, "Minimum_temperature_height_above_ground_24_Hour_Minimum"));
// metaInfos.add(Lists.newArrayList("CMPA", "BABJ", "PRE", 60, 60, 1010, "1201_1401_0.05_0.05_0_60_70_140", 0, "H", 60, 60, 70, "Total_precipitation_surface"));
metaInfos.add(Lists.newArrayList("CLDAS", "BABJ", "VIS", 60, 60, 1010, "1201_1401_0.05_0.05_0_60_70_140", 0, "H", 60, 60, 70, "Visibility_surface"));
metaInfos.add(Lists.newArrayList("CLDAS", "BABJ", "RHU", 60, 60, 1010, "1201_1401_0.05_0.05_0_60_70_140", 0, "H", 60, 60, 70, "Relative_humidity_height_above_ground"));
metaInfos.add(Lists.newArrayList("CLDAS", "BABJ", "TEM", 60, 60, 1010, "1201_1401_0.05_0.05_0_60_70_140", 0, "H", 60, 60, 70, "Temperature_height_above_ground"));
metaInfos.add(Lists.newArrayList("CLDAS", "BABJ", "WIN_U", 60, 60, 1010, "1201_1401_0.05_0.05_0_60_70_140", 0, "H", 60, 60, 70, "u-component_of_wind_height_above_ground"));
metaInfos.add(Lists.newArrayList("CLDAS", "BABJ", "WIN_V", 60, 60, 1010, "1201_1401_0.05_0.05_0_60_70_140", 0, "H", 60, 60, 70, "v-component_of_wind_height_above_ground"));
metaInfos.add(Lists.newArrayList("CLDAS", "BABJ", "MNRHU", 60, 60, 1010, "1201_1401_0.05_0.05_0_60_70_140", 0, "H", 60, 60, 70, "Fraction_of_snow_cover_height_above_ground"));
metaInfos.add(Lists.newArrayList("CLDAS", "BABJ", "MNT", 60, 60, 1010, "1201_1401_0.05_0.05_0_60_70_140", 0, "H", 60, 60, 70, "Minimum_temperature_height_above_ground"));
metaInfos.add(Lists.newArrayList("CLDAS", "BABJ", "MXRHU", 60, 60, 1010, "1201_1401_0.05_0.05_0_60_70_140", 0, "H", 60, 60, 70, "VAR0-1-122_FROM_38-0--1_height_above_ground"));
metaInfos.add(Lists.newArrayList("CLDAS", "BABJ", "MXT", 60, 60, 1010, "1201_1401_0.05_0.05_0_60_70_140", 0, "H", 60, 60, 70, "Maximum_temperature_height_above_ground"));
metaInfos.add(Lists.newArrayList("CLDAS", "BABJ", "MXWIN_U", 60, 60, 1010, "1201_1401_0.05_0.05_0_60_70_140", 0, "H", 60, 60, 70, "VAR0-2-102_FROM_38-0--1_height_above_ground"));
metaInfos.add(Lists.newArrayList("CLDAS", "BABJ", "MXWIN_V", 60, 60, 1010, "1201_1401_0.05_0.05_0_60_70_140", 0, "H", 60, 60, 70, "VAR0-2-103_FROM_38-0--1_height_above_ground"));
metaInfos.add(Lists.newArrayList("SPCC", "BEHF", "TMP", 180, 4320, 1010, "243_221_0.025_0.025_29_35.05_114.5_120", 180, "H", 60, 30, 30, "Temperature_height_above_ground"));
metaInfos.add(Lists.newArrayList("SPCC", "BEHF", "EDA10_U", 180, 4320, 1010, "243_221_0.025_0.025_29_35.05_114.5_120", 180, "H", 60, 30, 30, "u-component_of_wind_height_above_ground"));
metaInfos.add(Lists.newArrayList("SPCC", "BEHF", "EDA10_V", 180, 4320, 1010, "243_221_0.025_0.025_29_35.05_114.5_120", 180, "H", 60, 30, 30, "v-component_of_wind_height_above_ground"));
metaInfos.add(Lists.newArrayList("SPCC", "BEHF", "ER03", 180, 4320, 1010, "243_221_0.025_0.025_29_35.05_114.5_120", 180, "H", 60, 30, 30, "Total_precipitation_surface_3_Hour_Accumulation"));
metaInfos.add(Lists.newArrayList("SPCC", "BEHF", "PPH", 180, 4320, 1010, "243_221_0.025_0.025_29_35.05_114.5_120", 180, "H", 60, 30, 30, "Precipitation_type_surface_3_Hour_Accumulation"));
metaInfos.add(Lists.newArrayList("SPCC", "BEHF", "TMAX", 1440, 4320, 1010, "243_221_0.025_0.025_29_35.05_114.5_120", 1440, "H", 60, 30, 30, "Maximum_temperature_height_above_ground_24_Hour_Maximum"));
metaInfos.add(Lists.newArrayList("SPCC", "BEHF", "TMIN", 1440, 4320, 1010, "243_221_0.025_0.025_29_35.05_114.5_120", 1440, "H", 60, 30, 30, "Minimum_temperature_height_above_ground_24_Hour_Minimum"));
metaInfos.add(Lists.newArrayList("CMPA", "BABJ", "PRE", 60, 60, 1010, "1201_1401_0.05_0.05_0_60_70_140", 0, "H", 60, 60, 70, "Total_precipitation_surface"));
metaInfos.add(Lists.newArrayList("RADAR", "SAD", "CAP", 6, 6, 1010, "1201_1401_0.05_0.05_0_60_70_140", 0, "m", 6, 6, 70, ""));
metaInfos.add(Lists.newArrayList("RADAR", "CC", "CAP", 6, 6, 1010, "1201_1401_0.05_0.05_0_60_70_140", 0, "m", 6, 6, 70, ""));
metaInfos.add(Lists.newArrayList("RADAR", "SA", "CAP", 6, 6, 1010, "1201_1401_0.05_0.05_0_60_70_140", 0, "m", 6, 6, 70, ""));

Loading…
Cancel
Save