|
@@ -946,6 +946,22 @@ public class CadastreManageServiceImpl implements CadastreManageService {
|
|
|
boolean addRes = false;
|
|
boolean addRes = false;
|
|
|
Integer shpDbSRID = 4326;
|
|
Integer shpDbSRID = 4326;
|
|
|
if (!CollectionUtils.isEmpty(theValueList)) {
|
|
if (!CollectionUtils.isEmpty(theValueList)) {
|
|
|
|
|
+ List<String> dbFieldNameList = cadastreFileMapper.selectTableCollum(tableName.toLowerCase());
|
|
|
|
|
+ theValueList = theValueList.stream().map(source -> {
|
|
|
|
|
+ Map<String, Object> newMap = new HashMap<>();
|
|
|
|
|
+ for (String dbLowField : dbFieldNameList) {
|
|
|
|
|
+ // 忽略大小写匹配map中的key
|
|
|
|
|
+ Optional<String> upperKey = source.keySet().stream()
|
|
|
|
|
+ .filter(k -> k != null && k.equalsIgnoreCase(dbLowField))
|
|
|
|
|
+ .findFirst();
|
|
|
|
|
+ if (upperKey.isPresent()) {
|
|
|
|
|
+ newMap.put(dbLowField, source.get(upperKey.get()));
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ return newMap;
|
|
|
|
|
+ }).collect(Collectors.toList());
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
List<Map<String, String>> dbFieldNameAndTypeList = cadastreFileMapper.selectTableCollumAndType(tableName.toLowerCase(Locale.ROOT));
|
|
List<Map<String, String>> dbFieldNameAndTypeList = cadastreFileMapper.selectTableCollumAndType(tableName.toLowerCase(Locale.ROOT));
|
|
|
Map<String, String> columnTypeMap = new LinkedHashMap<>();
|
|
Map<String, String> columnTypeMap = new LinkedHashMap<>();
|
|
|
for (Map<String, String> col : dbFieldNameAndTypeList) {
|
|
for (Map<String, String> col : dbFieldNameAndTypeList) {
|
|
@@ -966,8 +982,11 @@ public class CadastreManageServiceImpl implements CadastreManageService {
|
|
|
private void cleanDataForInsert(Map<String, Object> map, Map<String, String> columnTypeMap) {
|
|
private void cleanDataForInsert(Map<String, Object> map, Map<String, String> columnTypeMap) {
|
|
|
Set<String> numericTypes = new HashSet<>(Arrays.asList(
|
|
Set<String> numericTypes = new HashSet<>(Arrays.asList(
|
|
|
"integer", "bigint", "smallint", "int2", "int4", "int8",
|
|
"integer", "bigint", "smallint", "int2", "int4", "int8",
|
|
|
- "numeric", "decimal", "real", "double precision", "float4", "float8"
|
|
|
|
|
|
|
+ "numeric", "decimal", "real", "double precision", "float4", "float8","bytea"
|
|
|
));
|
|
));
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
map.keySet().removeIf(key -> {
|
|
map.keySet().removeIf(key -> {
|
|
|
if ("valid_flag".equalsIgnoreCase(key) || "geom".equalsIgnoreCase(key)) {
|
|
if ("valid_flag".equalsIgnoreCase(key) || "geom".equalsIgnoreCase(key)) {
|
|
|
return false;
|
|
return false;
|
|
@@ -999,8 +1018,10 @@ public class CadastreManageServiceImpl implements CadastreManageService {
|
|
|
return Float.parseFloat(sv);
|
|
return Float.parseFloat(sv);
|
|
|
} else if (colType.equalsIgnoreCase("double precision") || colType.equalsIgnoreCase("float8")) {
|
|
} else if (colType.equalsIgnoreCase("double precision") || colType.equalsIgnoreCase("float8")) {
|
|
|
return Double.parseDouble(sv);
|
|
return Double.parseDouble(sv);
|
|
|
- } else {
|
|
|
|
|
- return new java.math.BigDecimal(sv);
|
|
|
|
|
|
|
+ }else if (colType.equalsIgnoreCase("bytea") || colType.equalsIgnoreCase("blob")) {
|
|
|
|
|
+ return new byte[0];
|
|
|
|
|
+ }else {
|
|
|
|
|
+ return new java.math.BigDecimal(sv);
|
|
|
}
|
|
}
|
|
|
} catch (NumberFormatException e) {
|
|
} catch (NumberFormatException e) {
|
|
|
return null;
|
|
return null;
|
|
@@ -1613,7 +1634,29 @@ public class CadastreManageServiceImpl implements CadastreManageService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public String getQlrList(String name) {
|
|
|
|
|
+ // 名称为空直接返回空
|
|
|
|
|
+ if (StringUtils.isBlank(name)) {
|
|
|
|
|
+ return "";
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ List<Map<String, Object>> qlrList = cadastreFileMapper.selectQlrList(name, "0");
|
|
|
|
|
+ // 提取bdcdyh并过滤null空值,拼接单引号
|
|
|
|
|
+ List<String> bdcdyhValues = qlrList.stream()
|
|
|
|
|
+ .map(map -> map.get("bdcdyh"))
|
|
|
|
|
+ .filter(val -> val != null && StringUtils.isNotBlank(val.toString()))
|
|
|
|
|
+ .map(val -> "'" + val + "'")
|
|
|
|
|
+ .collect(Collectors.toList());
|
|
|
|
|
|
|
|
|
|
+ // 无产权人编号返回空字符串
|
|
|
|
|
+ if (bdcdyhValues.isEmpty()) {
|
|
|
|
|
+ return "";
|
|
|
|
|
+ }
|
|
|
|
|
+ // 拼接in条件
|
|
|
|
|
+ String inContent = String.join(",", bdcdyhValues);
|
|
|
|
|
+ return "bdcdyh in (" + inContent + ")";
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|