|
@@ -389,13 +389,6 @@ public class GisSurveyThirdImporter {
|
|
layerApply.setCode(PointCodeUtil.generateCode());
|
|
layerApply.setCode(PointCodeUtil.generateCode());
|
|
layerApply.setLayer(layerTemplate.getKey());
|
|
layerApply.setLayer(layerTemplate.getKey());
|
|
layerApply.setKind(GisMetadataDefine.TYPE_KINE.POINT);
|
|
layerApply.setKind(GisMetadataDefine.TYPE_KINE.POINT);
|
|
- //解析坐标
|
|
|
|
- String lngStr = ThirdImportTemplateUtils.getValue(point, layerTemplate, GisSurveyExcelDefine.TEMPLATE.LNG);
|
|
|
|
- String latStr = ThirdImportTemplateUtils.getValue(point, layerTemplate, GisSurveyExcelDefine.TEMPLATE.LAT);
|
|
|
|
- if (NumberUtils.isParsable(lngStr) && NumberUtils.isParsable(latStr)) {
|
|
|
|
- Point geometry = geometryFactory.createPoint(new Coordinate(Double.parseDouble(lngStr), Double.parseDouble(latStr)));
|
|
|
|
- layerApply.setGis(geometry);
|
|
|
|
- }
|
|
|
|
//默认值
|
|
//默认值
|
|
layerApply.setApply(GisSurveyExcelDefine.DEFAULT_VALUE.APPLY);
|
|
layerApply.setApply(GisSurveyExcelDefine.DEFAULT_VALUE.APPLY);
|
|
layerApply.setSource(GisSurveyExcelDefine.DEFAULT_VALUE.SOURCE);
|
|
layerApply.setSource(GisSurveyExcelDefine.DEFAULT_VALUE.SOURCE);
|
|
@@ -403,6 +396,9 @@ public class GisSurveyThirdImporter {
|
|
String noStr = ThirdImportTemplateUtils.getValue(point, layerTemplate, GisSurveyExcelDefine.TEMPLATE.NO);
|
|
String noStr = ThirdImportTemplateUtils.getValue(point, layerTemplate, GisSurveyExcelDefine.TEMPLATE.NO);
|
|
if (StringUtils.isNotBlank(noStr))
|
|
if (StringUtils.isNotBlank(noStr))
|
|
layerApply.setNo(StringUtils.substring(noStr, 0, 64));
|
|
layerApply.setNo(StringUtils.substring(noStr, 0, 64));
|
|
|
|
+ //经纬度
|
|
|
|
+ Double lng = null;
|
|
|
|
+ Double lat = null;
|
|
//遍历属性模版
|
|
//遍历属性模版
|
|
List<GisSurveyPropertyValueThirdCopy> propertyValueList = new ArrayList<>();
|
|
List<GisSurveyPropertyValueThirdCopy> propertyValueList = new ArrayList<>();
|
|
for (GisMetadataPropertyTemplate propertyTemplate : layerTemplate.getPropertyTemplates()) {
|
|
for (GisMetadataPropertyTemplate propertyTemplate : layerTemplate.getPropertyTemplates()) {
|
|
@@ -412,15 +408,30 @@ public class GisSurveyThirdImporter {
|
|
//不为空,填入数据
|
|
//不为空,填入数据
|
|
if (propertyValue != null) {
|
|
if (propertyValue != null) {
|
|
propertyValueList.add(propertyValue);
|
|
propertyValueList.add(propertyValue);
|
|
|
|
+ //经纬度属性
|
|
|
|
+ if (Objects.equals(propertyValue.getProperty(), GisSurveyExcelDefine.TEMPLATE.LNG)
|
|
|
|
+ && NumberUtils.isParsable(propertyValue.getValue()))
|
|
|
|
+ lng = Double.valueOf(propertyValue.getValue());
|
|
|
|
+ if (Objects.equals(propertyValue.getProperty(), GisSurveyExcelDefine.TEMPLATE.LAT)
|
|
|
|
+ && NumberUtils.isParsable(propertyValue.getValue()))
|
|
|
|
+ lat = Double.valueOf(propertyValue.getValue());
|
|
//高程和埋深
|
|
//高程和埋深
|
|
- if (Objects.equals(propertyValue.getProperty(), GisSurveyExcelDefine.TEMPLATE.ELEVATION))
|
|
|
|
|
|
+ if (Objects.equals(propertyValue.getProperty(), GisSurveyExcelDefine.TEMPLATE.ELEVATION)
|
|
|
|
+ && NumberUtils.isParsable(propertyValue.getValue()))
|
|
layerApply.setElevation(Double.valueOf(propertyValue.getValue()));
|
|
layerApply.setElevation(Double.valueOf(propertyValue.getValue()));
|
|
- if (Objects.equals(propertyValue.getProperty(), GisSurveyExcelDefine.TEMPLATE.DEPTH))
|
|
|
|
|
|
+ if (Objects.equals(propertyValue.getProperty(), GisSurveyExcelDefine.TEMPLATE.DEPTH)
|
|
|
|
+ && NumberUtils.isParsable(propertyValue.getValue()))
|
|
layerApply.setDepth(Double.valueOf(propertyValue.getValue()));
|
|
layerApply.setDepth(Double.valueOf(propertyValue.getValue()));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
layerApply.setPropertyValues(propertyValueList);
|
|
layerApply.setPropertyValues(propertyValueList);
|
|
|
|
|
|
|
|
+ //填入经纬度
|
|
|
|
+ if (lng != null && lat != null) {
|
|
|
|
+ Point geometry = geometryFactory.createPoint(new Coordinate(lng, lat));
|
|
|
|
+ layerApply.setGis(geometry);
|
|
|
|
+ }
|
|
|
|
+
|
|
return layerApply;
|
|
return layerApply;
|
|
}
|
|
}
|
|
|
|
|