|
@@ -106,19 +106,22 @@ public class InvalidPropertiesFinder {
|
|
|
GisMetadataDefine.TYPE_KINE.POINT,
|
|
|
null,
|
|
|
point.get(GisSurveyExcelDefine.FILE.POINT_LAYER),
|
|
|
- null
|
|
|
+ null,
|
|
|
+ GisSurveyExcelDefine.MESSAGE.INVALID_LAYERS
|
|
|
));
|
|
|
else
|
|
|
//图层存在则检查图层
|
|
|
checkLayer(point, layerTemplate, checkConstraint, projectConstraints, missingRequirementsResult, invalidTypesResult, outConstraintResult);
|
|
|
//检查坐标超出范围
|
|
|
- if (checkOutRanges(point, layerTemplate))
|
|
|
+ Boolean outRanged = checkOutRanges(point, layerTemplate);
|
|
|
+ if (outRanged == null || outRanged)
|
|
|
outRangesResult.add(
|
|
|
new GisSurveyThirdImportElement(
|
|
|
GisMetadataDefine.TYPE_KINE.POINT,
|
|
|
ThirdImportTemplateUtils.getValue(point, layerTemplate, GisSurveyExcelDefine.TEMPLATE.NO),
|
|
|
point.get(GisSurveyExcelDefine.FILE.POINT_LAYER),
|
|
|
- null
|
|
|
+ null,
|
|
|
+ outRanged == null ? GisSurveyExcelDefine.MESSAGE.OUT_RANGES_NULL : GisSurveyExcelDefine.MESSAGE.OUT_RANGES
|
|
|
)
|
|
|
);
|
|
|
}
|
|
@@ -136,7 +139,8 @@ public class InvalidPropertiesFinder {
|
|
|
null,
|
|
|
null,
|
|
|
line.get(GisSurveyExcelDefine.FILE.LINE_LAYER),
|
|
|
- null
|
|
|
+ null,
|
|
|
+ GisSurveyExcelDefine.MESSAGE.INVALID_LAYERS
|
|
|
));
|
|
|
else
|
|
|
//图层存在则检查图层
|
|
@@ -166,9 +170,9 @@ public class InvalidPropertiesFinder {
|
|
|
String latStr = ThirdImportTemplateUtils.getValue(point, layerTemplate, GisSurveyExcelDefine.TEMPLATE.LAT);
|
|
|
String lngStr = ThirdImportTemplateUtils.getValue(point, layerTemplate, GisSurveyExcelDefine.TEMPLATE.LNG);
|
|
|
//检查是否字符串
|
|
|
- if (StringUtils.isBlank(latStr) || StringUtils.isBlank(lngStr)) return true;
|
|
|
+ if (StringUtils.isBlank(latStr) || StringUtils.isBlank(lngStr)) return null;
|
|
|
//检查是否可解析
|
|
|
- if (!NumberUtils.isParsable(latStr) || !NumberUtils.isParsable(lngStr)) return true;
|
|
|
+ if (!NumberUtils.isParsable(latStr) || !NumberUtils.isParsable(lngStr)) return null;
|
|
|
//解析
|
|
|
double lat = Double.parseDouble(latStr);
|
|
|
double lng = Double.parseDouble(lngStr);
|
|
@@ -209,7 +213,8 @@ public class InvalidPropertiesFinder {
|
|
|
if (StringUtils.isBlank(value)) {
|
|
|
GisSurveyThirdImportElement gisSurveyThirdImportElement = GisSurveyThirdImportElement.create(data,
|
|
|
layerTemplate,
|
|
|
- propertyTemplate.getName()
|
|
|
+ propertyTemplate.getName(),
|
|
|
+ GisSurveyExcelDefine.MESSAGE.MISSING_REQUIREMENTS
|
|
|
);
|
|
|
missingRequirementsResult.add(gisSurveyThirdImportElement);
|
|
|
//值存在
|
|
@@ -225,7 +230,8 @@ public class InvalidPropertiesFinder {
|
|
|
&& !NumberUtils.isParsable(value)) {
|
|
|
invalidTypesResult.add(GisSurveyThirdImportElement.create(data,
|
|
|
layerTemplate,
|
|
|
- propertyTemplate.getName()
|
|
|
+ propertyTemplate.getName(),
|
|
|
+ GisSurveyExcelDefine.MESSAGE.INVALID_TYPES
|
|
|
));
|
|
|
}
|
|
|
}
|
|
@@ -278,7 +284,8 @@ public class InvalidPropertiesFinder {
|
|
|
//如列表不包含值,则超出约束
|
|
|
if (!ranges.contains(value)) {
|
|
|
outConstraintResult.add(GisSurveyThirdImportElement.create(data, layerTemplate,
|
|
|
- propertyTemplate.getName(), value, constraint
|
|
|
+ propertyTemplate.getName(), value, constraint,
|
|
|
+ GisSurveyExcelDefine.MESSAGE.OUT_CONSTRAINT
|
|
|
));
|
|
|
}
|
|
|
}
|
|
@@ -291,7 +298,9 @@ public class InvalidPropertiesFinder {
|
|
|
double min = Double.parseDouble(minStr);
|
|
|
if (!NumberUtils.isParsable(value) || Double.parseDouble(value) < min) {
|
|
|
outConstraintResult.add(GisSurveyThirdImportElement.create(data, layerTemplate,
|
|
|
- propertyTemplate.getName(), value, constraint));
|
|
|
+ propertyTemplate.getName(), value, constraint,
|
|
|
+ GisSurveyExcelDefine.MESSAGE.OUT_CONSTRAINT
|
|
|
+ ));
|
|
|
}
|
|
|
}
|
|
|
//最大值判断
|
|
@@ -300,7 +309,9 @@ public class InvalidPropertiesFinder {
|
|
|
double max = Double.parseDouble(maxStr);
|
|
|
if (!NumberUtils.isParsable(value) || Double.parseDouble(value) > max) {
|
|
|
outConstraintResult.add(GisSurveyThirdImportElement.create(data, layerTemplate,
|
|
|
- propertyTemplate.getName(), value, constraint));
|
|
|
+ propertyTemplate.getName(), value, constraint,
|
|
|
+ GisSurveyExcelDefine.MESSAGE.OUT_CONSTRAINT
|
|
|
+ ));
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -396,6 +407,7 @@ public class InvalidPropertiesFinder {
|
|
|
map.put(GisSurveyThirdImportResultHead.KEYS.VALUE, element.getValue());
|
|
|
if (element.getCondition() != null)
|
|
|
map.put(GisSurveyThirdImportResultHead.KEYS.CONDITION, element.getCondition().getRanges());
|
|
|
+ map.put(GisSurveyThirdImportResultHead.KEYS.MESSAGE, element.getMessage());
|
|
|
return map;
|
|
|
}).collect(Collectors.toList());
|
|
|
}
|