|
@@ -89,7 +89,7 @@ public class PoiAddressController {
|
|
|
* *** latLonSplitStr: 经纬度字段分隔符
|
|
|
* *** matchingDistance: 匹配距离,如果不为空,经纬度字段名称不能为空
|
|
|
* *** outCoordinate: 输出坐标系(默认为wgs84)
|
|
|
- * *** matchingLevel: 匹配等级,详情见xmind文件【1、2、3、4、0】
|
|
|
+ * *** matchingLevel: 匹配等级,详情见xmind文件【1、2、3、4、5】
|
|
|
* *** regionalJudgment: 区域判断,geojson、shape文件[前端可以内置一些常用的区域文件,通过下拉框的方式进行选择]
|
|
|
* *** outFileType: 输出文件类型【xlsx、csv、geojson、shape】
|
|
|
*
|
|
@@ -109,6 +109,7 @@ public class PoiAddressController {
|
|
|
@RequestParam(name = "outputFileName", required = false) String outputFileName) throws IOException {
|
|
|
// 参数合法性判断
|
|
|
if ((file != null && !file.isEmpty()) && (addrColNames != null && !addrColNames.isEmpty())) {
|
|
|
+ outputFileName += UUID.randomUUID();
|
|
|
// 搜索地址key
|
|
|
String addr1Key = "";
|
|
|
String addr2Key = "";
|
|
@@ -138,16 +139,6 @@ public class PoiAddressController {
|
|
|
return "当匹配距离参数不为空时,必须传入经纬度参数!";
|
|
|
}
|
|
|
}
|
|
|
- if (outFileType != null) {
|
|
|
- if (outFileType.contains("csv")) {
|
|
|
- outFileType = "csv";
|
|
|
- }
|
|
|
- if (outFileType.contains("xlsx")) {
|
|
|
- outFileType = "xlsx";
|
|
|
- }
|
|
|
- } else {
|
|
|
- outFileType = "xlsx";
|
|
|
- }
|
|
|
// 经纬度合法性判断
|
|
|
if (latLonColName != null) {
|
|
|
// 两个key
|
|
@@ -313,20 +304,30 @@ public class PoiAddressController {
|
|
|
dataList.add(fileDataDto.getProperties());
|
|
|
}
|
|
|
// TODO 结果输出 result[_匹配等级][_匹配距离][_区域名称][_坐标系].[文件类型]
|
|
|
-// 保存实体类到序列化文件
|
|
|
- SerializationUtils.serialize(fileDataDtoList, "output/output" + outputFileName + ".ser");
|
|
|
- /*switch (outFileType) {
|
|
|
- case "xlsx":
|
|
|
- ExcelReaderUtils.writeToExcel(dataList, "output/output" + outputFileName + ".xlsx");
|
|
|
- ReadFileData.outputFile("output/output" + outputFileName + ".xlsx", response);
|
|
|
- break;
|
|
|
- case "csv":
|
|
|
- CsvWriter.writeToCsv(dataList, "output/output" + outputFileName + ".csv");
|
|
|
- ReadFileData.outputFile("output/output" + outputFileName + ".csv", response);
|
|
|
- break;
|
|
|
- case "geojson":
|
|
|
- break;
|
|
|
- }*/
|
|
|
+ if (outFileType != null) {
|
|
|
+ if (outFileType.contains("csv")) {
|
|
|
+ outFileType = "csv";
|
|
|
+ }
|
|
|
+ if (outFileType.contains("xlsx")) {
|
|
|
+ outFileType = "xlsx";
|
|
|
+ }
|
|
|
+
|
|
|
+ switch (outFileType) {
|
|
|
+ case "xlsx":
|
|
|
+ ExcelReaderUtils.writeToExcel(dataList, "output/output" + outputFileName + ".xlsx");
|
|
|
+ ReadFileData.outputFile("output/output" + outputFileName + ".xlsx", response);
|
|
|
+ break;
|
|
|
+ case "csv":
|
|
|
+ CsvWriter.writeToCsv(dataList, "output/output" + outputFileName + ".csv");
|
|
|
+ ReadFileData.outputFile("output/output" + outputFileName + ".csv", response);
|
|
|
+ break;
|
|
|
+ case "geojson":
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ // 保存实体类到序列化文件
|
|
|
+ SerializationUtils.serialize(fileDataDtoList, "output/output" + outputFileName + ".ser");
|
|
|
+ }
|
|
|
// 从文件中反序列化读取数据
|
|
|
/*List<FileDataDto> deserializedList = SerializationUtils.deserialize("output/output" + outputFileName + ".ser");
|
|
|
if (deserializedList != null) {
|