|
@@ -156,97 +156,6 @@ public class InvalidPropertiesFinder {
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- * 创建结果
|
|
|
|
- *
|
|
|
|
- * @param invalidLayersResult 无效图层结果
|
|
|
|
- * @param missingRequirementsResult 缺失必填结果
|
|
|
|
- * @param invalidTypesResult 无效类型结果
|
|
|
|
- * @param outRangesResult 超出范围结果
|
|
|
|
- * @param outConstraintResult 超出约束结果
|
|
|
|
- * @param jobId 任务id
|
|
|
|
- * @param begin 开始时间
|
|
|
|
- * @return 结果
|
|
|
|
- */
|
|
|
|
- private Map<String, GisSurveyThirdImportResultDetail<List<GisSurveyThirdImportElement>>> createResult(
|
|
|
|
- List<GisSurveyThirdImportElement> invalidLayersResult,
|
|
|
|
- List<GisSurveyThirdImportElement> missingRequirementsResult,
|
|
|
|
- List<GisSurveyThirdImportElement> invalidTypesResult,
|
|
|
|
- List<GisSurveyThirdImportElement> outRangesResult,
|
|
|
|
- List<GisSurveyThirdImportElement> outConstraintResult,
|
|
|
|
- String jobId, long begin) {
|
|
|
|
- long end = System.currentTimeMillis();
|
|
|
|
- LogPrintMgr.getInstance().printLogMsg(LogLevelFlag.LOG_INFO, mBizType, mStrClassName
|
|
|
|
- , String.format(
|
|
|
|
- "结束执行寻找无效线,用时(毫秒):%d"
|
|
|
|
- , (end - begin)
|
|
|
|
- )
|
|
|
|
- );
|
|
|
|
-
|
|
|
|
- //结果flag
|
|
|
|
- final String FLAG = GisSurveyThirdImporter.RESULT_PREFIX + jobId;
|
|
|
|
-
|
|
|
|
- //无效图层构建excel和详情
|
|
|
|
- Path invalidLayersExcelPath = asyncResultManager.writeExcel(GisSurveyThirdImportResultHead.INVALID_LAYERS,
|
|
|
|
- buildExcel(invalidLayersResult), FLAG, GisSurveyThirdImportKeys.INVALID_LAYERS + ".xlsx");
|
|
|
|
- GisSurveyThirdImportResultDetail<List<GisSurveyThirdImportElement>> invalidLayersDetail
|
|
|
|
- = new GisSurveyThirdImportResultDetail<>(true, invalidLayersResult
|
|
|
|
- , FLAG + "/" + invalidLayersExcelPath.getFileName());
|
|
|
|
- //缺失必填构建excel和详情
|
|
|
|
- Path missingRequirementsExcelPath = asyncResultManager.writeExcel(GisSurveyThirdImportResultHead.MISSING_REQUIREMENTS,
|
|
|
|
- buildExcel(missingRequirementsResult), FLAG, GisSurveyThirdImportKeys.MISSING_REQUIREMENTS + ".xlsx");
|
|
|
|
- GisSurveyThirdImportResultDetail<List<GisSurveyThirdImportElement>> missingRequirementsDetail
|
|
|
|
- = new GisSurveyThirdImportResultDetail<>(true, missingRequirementsResult
|
|
|
|
- , FLAG + "/" + missingRequirementsExcelPath.getFileName());
|
|
|
|
- //无效类型构建excel和详情
|
|
|
|
- Path invalidTypesExcelPath = asyncResultManager.writeExcel(GisSurveyThirdImportResultHead.INVALID_TYPES,
|
|
|
|
- buildExcel(invalidTypesResult), FLAG, GisSurveyThirdImportKeys.INVALID_TYPES + ".xlsx");
|
|
|
|
- GisSurveyThirdImportResultDetail<List<GisSurveyThirdImportElement>> invalidTypesDetail
|
|
|
|
- = new GisSurveyThirdImportResultDetail<>(true, invalidTypesResult
|
|
|
|
- , FLAG + "/" + invalidTypesExcelPath.getFileName());
|
|
|
|
- //超出范围构建excel和详情
|
|
|
|
- Path outRangesExcelPath = asyncResultManager.writeExcel(GisSurveyThirdImportResultHead.OUT_RANGES,
|
|
|
|
- buildExcel(outRangesResult), FLAG, GisSurveyThirdImportKeys.OUT_RANGES + ".xlsx");
|
|
|
|
- GisSurveyThirdImportResultDetail<List<GisSurveyThirdImportElement>> outRangesDetail
|
|
|
|
- = new GisSurveyThirdImportResultDetail<>(true, outRangesResult
|
|
|
|
- , FLAG + "/" + outRangesExcelPath.getFileName());
|
|
|
|
- //超出约束构建excel和详情
|
|
|
|
- Path outConstraintExcelPath = asyncResultManager.writeExcel(GisSurveyThirdImportResultHead.OUT_CONSTRAINT,
|
|
|
|
- buildExcel(outConstraintResult), FLAG, GisSurveyThirdImportKeys.OUT_CONSTRAINT + ".xlsx");
|
|
|
|
- GisSurveyThirdImportResultDetail<List<GisSurveyThirdImportElement>> outConstraintDetail
|
|
|
|
- = new GisSurveyThirdImportResultDetail<>(true, outConstraintResult
|
|
|
|
- , FLAG + "/" + outConstraintExcelPath.getFileName());
|
|
|
|
-
|
|
|
|
- //构建结果
|
|
|
|
- Map<String, GisSurveyThirdImportResultDetail<List<GisSurveyThirdImportElement>>> result = new HashMap<>();
|
|
|
|
- result.put(GisSurveyThirdImportKeys.INVALID_LAYERS, invalidLayersDetail);
|
|
|
|
- result.put(GisSurveyThirdImportKeys.MISSING_REQUIREMENTS, missingRequirementsDetail);
|
|
|
|
- result.put(GisSurveyThirdImportKeys.INVALID_TYPES, invalidTypesDetail);
|
|
|
|
- result.put(GisSurveyThirdImportKeys.OUT_RANGES, outRangesDetail);
|
|
|
|
- result.put(GisSurveyThirdImportKeys.OUT_CONSTRAINT, outConstraintDetail);
|
|
|
|
-
|
|
|
|
- return result;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 构建第三方导入excel数据
|
|
|
|
- *
|
|
|
|
- * @param data 数据
|
|
|
|
- * @return excel数据
|
|
|
|
- */
|
|
|
|
- private List<Map<String, Object>> buildExcel(List<GisSurveyThirdImportElement> data) {
|
|
|
|
- return data.stream().map(element -> {
|
|
|
|
- Map<String, Object> map = new HashMap<>();
|
|
|
|
- map.put(GisSurveyThirdImportResultHead.KEYS.KIND, element.getKind());
|
|
|
|
- map.put(GisSurveyThirdImportResultHead.KEYS.LAYER_NAME, element.getLayerName());
|
|
|
|
- map.put(GisSurveyThirdImportResultHead.KEYS.NO, element.getNo());
|
|
|
|
- map.put(GisSurveyThirdImportResultHead.KEYS.UP_NO, element.getUpNO());
|
|
|
|
- map.put(GisSurveyThirdImportResultHead.KEYS.DOWN_NO, element.getDownNO());
|
|
|
|
- map.put(GisSurveyThirdImportResultHead.KEYS.PROPERTY_NAME, element.getPropertyName());
|
|
|
|
- return map;
|
|
|
|
- }).collect(Collectors.toList());
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
* 检查超出范围
|
|
* 检查超出范围
|
|
*
|
|
*
|
|
* @param point 点
|
|
* @param point 点
|
|
@@ -396,4 +305,98 @@ public class InvalidPropertiesFinder {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 创建结果
|
|
|
|
+ *
|
|
|
|
+ * @param invalidLayersResult 无效图层结果
|
|
|
|
+ * @param missingRequirementsResult 缺失必填结果
|
|
|
|
+ * @param invalidTypesResult 无效类型结果
|
|
|
|
+ * @param outRangesResult 超出范围结果
|
|
|
|
+ * @param outConstraintResult 超出约束结果
|
|
|
|
+ * @param jobId 任务id
|
|
|
|
+ * @param begin 开始时间
|
|
|
|
+ * @return 结果
|
|
|
|
+ */
|
|
|
|
+ private Map<String, GisSurveyThirdImportResultDetail<List<GisSurveyThirdImportElement>>> createResult(
|
|
|
|
+ List<GisSurveyThirdImportElement> invalidLayersResult,
|
|
|
|
+ List<GisSurveyThirdImportElement> missingRequirementsResult,
|
|
|
|
+ List<GisSurveyThirdImportElement> invalidTypesResult,
|
|
|
|
+ List<GisSurveyThirdImportElement> outRangesResult,
|
|
|
|
+ List<GisSurveyThirdImportElement> outConstraintResult,
|
|
|
|
+ String jobId, long begin) {
|
|
|
|
+ long end = System.currentTimeMillis();
|
|
|
|
+ LogPrintMgr.getInstance().printLogMsg(LogLevelFlag.LOG_INFO, mBizType, mStrClassName
|
|
|
|
+ , String.format(
|
|
|
|
+ "结束执行寻找无效线,用时(毫秒):%d"
|
|
|
|
+ , (end - begin)
|
|
|
|
+ )
|
|
|
|
+ );
|
|
|
|
+
|
|
|
|
+ //结果flag
|
|
|
|
+ final String FLAG = GisSurveyThirdImporter.RESULT_PREFIX + jobId;
|
|
|
|
+
|
|
|
|
+ //无效图层构建excel和详情
|
|
|
|
+ Path invalidLayersExcelPath = asyncResultManager.writeExcel(GisSurveyThirdImportResultHead.INVALID_LAYERS,
|
|
|
|
+ buildExcel(invalidLayersResult), FLAG, GisSurveyThirdImportKeys.INVALID_LAYERS + ".xlsx");
|
|
|
|
+ GisSurveyThirdImportResultDetail<List<GisSurveyThirdImportElement>> invalidLayersDetail
|
|
|
|
+ = new GisSurveyThirdImportResultDetail<>(true, invalidLayersResult
|
|
|
|
+ , FLAG + "/" + invalidLayersExcelPath.getFileName());
|
|
|
|
+ //缺失必填构建excel和详情
|
|
|
|
+ Path missingRequirementsExcelPath = asyncResultManager.writeExcel(GisSurveyThirdImportResultHead.MISSING_REQUIREMENTS,
|
|
|
|
+ buildExcel(missingRequirementsResult), FLAG, GisSurveyThirdImportKeys.MISSING_REQUIREMENTS + ".xlsx");
|
|
|
|
+ GisSurveyThirdImportResultDetail<List<GisSurveyThirdImportElement>> missingRequirementsDetail
|
|
|
|
+ = new GisSurveyThirdImportResultDetail<>(true, missingRequirementsResult
|
|
|
|
+ , FLAG + "/" + missingRequirementsExcelPath.getFileName());
|
|
|
|
+ //无效类型构建excel和详情
|
|
|
|
+ Path invalidTypesExcelPath = asyncResultManager.writeExcel(GisSurveyThirdImportResultHead.INVALID_TYPES,
|
|
|
|
+ buildExcel(invalidTypesResult), FLAG, GisSurveyThirdImportKeys.INVALID_TYPES + ".xlsx");
|
|
|
|
+ GisSurveyThirdImportResultDetail<List<GisSurveyThirdImportElement>> invalidTypesDetail
|
|
|
|
+ = new GisSurveyThirdImportResultDetail<>(true, invalidTypesResult
|
|
|
|
+ , FLAG + "/" + invalidTypesExcelPath.getFileName());
|
|
|
|
+ //超出范围构建excel和详情
|
|
|
|
+ Path outRangesExcelPath = asyncResultManager.writeExcel(GisSurveyThirdImportResultHead.OUT_RANGES,
|
|
|
|
+ buildExcel(outRangesResult), FLAG, GisSurveyThirdImportKeys.OUT_RANGES + ".xlsx");
|
|
|
|
+ GisSurveyThirdImportResultDetail<List<GisSurveyThirdImportElement>> outRangesDetail
|
|
|
|
+ = new GisSurveyThirdImportResultDetail<>(true, outRangesResult
|
|
|
|
+ , FLAG + "/" + outRangesExcelPath.getFileName());
|
|
|
|
+ //超出约束构建excel和详情
|
|
|
|
+ Path outConstraintExcelPath = asyncResultManager.writeExcel(GisSurveyThirdImportResultHead.OUT_CONSTRAINT,
|
|
|
|
+ buildExcel(outConstraintResult), FLAG, GisSurveyThirdImportKeys.OUT_CONSTRAINT + ".xlsx");
|
|
|
|
+ GisSurveyThirdImportResultDetail<List<GisSurveyThirdImportElement>> outConstraintDetail
|
|
|
|
+ = new GisSurveyThirdImportResultDetail<>(true, outConstraintResult
|
|
|
|
+ , FLAG + "/" + outConstraintExcelPath.getFileName());
|
|
|
|
+
|
|
|
|
+ //构建结果
|
|
|
|
+ Map<String, GisSurveyThirdImportResultDetail<List<GisSurveyThirdImportElement>>> result = new HashMap<>();
|
|
|
|
+ result.put(GisSurveyThirdImportKeys.INVALID_LAYERS, invalidLayersDetail);
|
|
|
|
+ result.put(GisSurveyThirdImportKeys.MISSING_REQUIREMENTS, missingRequirementsDetail);
|
|
|
|
+ result.put(GisSurveyThirdImportKeys.INVALID_TYPES, invalidTypesDetail);
|
|
|
|
+ result.put(GisSurveyThirdImportKeys.OUT_RANGES, outRangesDetail);
|
|
|
|
+ result.put(GisSurveyThirdImportKeys.OUT_CONSTRAINT, outConstraintDetail);
|
|
|
|
+
|
|
|
|
+ return result;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 构建第三方导入excel数据
|
|
|
|
+ *
|
|
|
|
+ * @param data 数据
|
|
|
|
+ * @return excel数据
|
|
|
|
+ */
|
|
|
|
+ private List<Map<String, Object>> buildExcel(List<GisSurveyThirdImportElement> data) {
|
|
|
|
+ return data.stream().map(element -> {
|
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
|
+ map.put(GisSurveyThirdImportResultHead.KEYS.KIND, element.getKind());
|
|
|
|
+ map.put(GisSurveyThirdImportResultHead.KEYS.LAYER_NAME, element.getLayerName());
|
|
|
|
+ map.put(GisSurveyThirdImportResultHead.KEYS.NO, element.getNo());
|
|
|
|
+ map.put(GisSurveyThirdImportResultHead.KEYS.UP_NO, element.getUpNO());
|
|
|
|
+ map.put(GisSurveyThirdImportResultHead.KEYS.DOWN_NO, element.getDownNO());
|
|
|
|
+ map.put(GisSurveyThirdImportResultHead.KEYS.PROPERTY_NAME, element.getPropertyName());
|
|
|
|
+ map.put(GisSurveyThirdImportResultHead.KEYS.VALUE, element.getValue());
|
|
|
|
+ if (element.getCondition() != null)
|
|
|
|
+ map.put(GisSurveyThirdImportResultHead.KEYS.CONDITION, element.getCondition().getRanges());
|
|
|
|
+ return map;
|
|
|
|
+ }).collect(Collectors.toList());
|
|
|
|
+ }
|
|
}
|
|
}
|