|
|
@@ -12,6 +12,9 @@ import com.siwei.apply.utils.FileExtractUtil;
|
|
|
import com.siwei.apply.utils.MdbUtil;
|
|
|
import com.siwei.common.core.domain.R;
|
|
|
import com.siwei.common.core.exception.ServiceException;
|
|
|
+import com.vividsolutions.jts.io.ParseException;
|
|
|
+import com.vividsolutions.jts.io.WKBReader;
|
|
|
+import com.vividsolutions.jts.io.WKTWriter;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
|
import org.apache.commons.collections4.MapUtils;
|
|
|
@@ -1260,14 +1263,49 @@ public class CadastreManageServiceImpl implements CadastreManageService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public List<Map<String,Object>> selectTableRow(String tableName,String validFlag,String bsm,String ywh) {
|
|
|
+ public List<Map<String,Object>> selectTableRow(String tableName,String geomFlag,String bsm,String ywh) {
|
|
|
+ String validFlag = "0";
|
|
|
List<Map<String,Object>> res = cadastreFileMapper.selectTableData(validFlag,tableName);
|
|
|
- if(CollectionUtils.isNotEmpty(res)){
|
|
|
- res.forEach(m -> m.keySet().removeIf(k -> "geom".equalsIgnoreCase(k)|| "valid_flag".equalsIgnoreCase(k)));
|
|
|
+ if(CollectionUtils.isNotEmpty(res)){ //去掉geom字段和valid_flag字段
|
|
|
+ //res.forEach(m -> m.keySet().removeIf(k -> "geom".equalsIgnoreCase(k)|| "valid_flag".equalsIgnoreCase(k)));
|
|
|
+ res.forEach(m -> m.keySet().removeIf(k -> "valid_flag".equalsIgnoreCase(k)));
|
|
|
+ if("0".equals(geomFlag)){
|
|
|
+ res.forEach(m -> m.keySet().removeIf(k -> "geom".equalsIgnoreCase(k)));
|
|
|
+ }
|
|
|
+// res.forEach(s->{
|
|
|
+// WKBReader reader = new WKBReader();
|
|
|
+// com.vividsolutions.jts.geom.Geometry geom = null;
|
|
|
+// try {
|
|
|
+// geom = reader.read(WKBReader.hexToBytes(s.get("geom").toString()));
|
|
|
+// } catch (ParseException e) {
|
|
|
+// throw new RuntimeException(e);
|
|
|
+// }
|
|
|
+// s.put("geom",geom.toText());
|
|
|
+// });
|
|
|
+
|
|
|
+ res.forEach(s -> {
|
|
|
+ if(s.get("geom") != null){
|
|
|
+ WKBReader reader = new WKBReader();
|
|
|
+ com.vividsolutions.jts.geom.Geometry geom = null;
|
|
|
+ try {
|
|
|
+ geom = reader.read(WKBReader.hexToBytes(s.get("geom").toString()));
|
|
|
+ } catch (ParseException e) {
|
|
|
+ throw new RuntimeException(e);
|
|
|
+ }
|
|
|
+ //geom.setSRID(4490);
|
|
|
+ WKTWriter writer = new WKTWriter();
|
|
|
+ String ewkt = "SRID=" + "4326" + ";" + writer.write(geom);
|
|
|
+ s.put("geom", ewkt);
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
}
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
@Override
|
|
|
public String tableRowUpdate(String tableName, List<Map<String,Object>> list) {
|
|
|
int res = cadastreFileMapper.batchUpdateByBsm(tableName,list);
|