Преглед изворни кода

更新用地规划许可方法

DESKTOP-2K9OVK9\siwei пре 1 месец
родитељ
комит
71d6d61c99
15 измењених фајлова са 2466 додато и 2004 уклоњено
  1. 428 428
      siwei-modules/siwei-apply/src/main/java/com/siwei/apply/controller/cadastre/CadastreManageController.java
  2. 1 0
      siwei-modules/siwei-apply/src/main/java/com/siwei/apply/domain/Jsydghxk.java
  3. 1 0
      siwei-modules/siwei-apply/src/main/java/com/siwei/apply/domain/Tdhyhs.java
  4. 1 0
      siwei-modules/siwei-apply/src/main/java/com/siwei/apply/domain/vo/JsydghxkVo.java
  5. 1 0
      siwei-modules/siwei-apply/src/main/java/com/siwei/apply/domain/vo/TdhyhsVo.java
  6. 4 0
      siwei-modules/siwei-apply/src/main/java/com/siwei/apply/mapper/JsydghxkMapper.java
  7. 1569 1569
      siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/cadastre/impl/CadastreManageServiceImpl.java
  8. 1 1
      siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/zrzysite/IZrzysiteCommonService.java
  9. 17 0
      siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/zrzysite/IZrzysiteGhhsService.java
  10. 17 0
      siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/zrzysite/IZrzysiteLandService.java
  11. 4 2
      siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/zrzysite/impl/ZrzysiteCommonServiceImpl.java
  12. 190 0
      siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/zrzysite/impl/ZrzysiteGhhsServiceImpl.java
  13. 214 0
      siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/zrzysite/impl/ZrzysiteLandServiceImpl.java
  14. 12 2
      siwei-modules/siwei-apply/src/main/resources/mapper/JsydghxkMapper.xml
  15. 6 2
      siwei-modules/siwei-apply/src/main/resources/mapper/TdhyhsMapper.xml

+ 428 - 428
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/controller/cadastre/CadastreManageController.java

@@ -1,428 +1,428 @@
-package com.siwei.apply.controller.cadastre;
-
-import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson2.JSONArray;
-import com.siwei.apply.domain.FzssFxrwrz;
-import com.siwei.apply.domain.LayerAndDbData;
-import com.siwei.apply.domain.MdbAndDbData;
-import com.siwei.apply.domain.RowUpdateContent;
-import com.siwei.apply.domain.vo.*;
-import com.siwei.apply.service.cadastre.CadastreManageService;
-import com.siwei.apply.service.cadastre.IZymlService;
-import com.siwei.apply.service.cadastre.impl.FzssFxrwrzHandleService;
-import com.siwei.apply.utils.ServiceFileUtil;
-import com.siwei.common.core.domain.R;
-import com.siwei.common.core.utils.StringUtils;
-import com.siwei.common.core.web.controller.BaseController;
-import org.apache.commons.collections4.CollectionUtils;
-import org.gdal.ogr.*;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-import org.springframework.http.ResponseEntity;
-import org.springframework.http.HttpHeaders;
-import org.springframework.http.MediaType;
-import org.springframework.core.io.Resource;
-import org.springframework.core.io.ByteArrayResource;
-
-import javax.servlet.http.HttpServletResponse;
-import java.util.*;
-import java.net.URLEncoder;
-import java.nio.charset.StandardCharsets;
-import java.text.SimpleDateFormat;
-import java.util.stream.Collectors;
-
-@RestController
-@RequestMapping("/cadastre/manage")
-/**
- * 地籍库管理模块
- */
-public class CadastreManageController extends BaseController {
-
-    @Autowired
-    private CadastreManageService cadastreManageService;
-    @Autowired
-    private FzssFxrwrzHandleService fzssFxrwrzHandleService;
-
-    @Autowired
-    private IZymlService zymlService;
-
-
-
-
-
-    /**
-     *
-     * //1.先获取相关信息,进行入库
-     * //2.日志记录写入
-     * //3.读取文件进行录入
-     * //4.质量进行检查
-     *
-     * @param theFileName
-     * @param theFilePath
-     * @param fileType
-     * @param updateType
-     * @return
-     */
-    @PostMapping("/checkUploadDquality")
-    public R<CheckInfoResultVo> checkData(String theFileName, String theFilePath, String fileType, String updateType) {
-        try {
-            CheckInfoResultVo res = cadastreManageService.checkFileData(theFileName, theFilePath, fileType, updateType);
-            return R.ok(res);
-        } catch (Exception e) {
-            e.printStackTrace();
-            return R.fail(e.getMessage());
-        }
-    }
-
-    @PostMapping("/getCompareData")
-    public R<CompareResultVo> compareData(String uploadId) {
-        try {
-            CompareResultVo res = cadastreManageService.getCompareData(uploadId);
-            return R.ok(res);
-        } catch (Exception e) {
-            e.printStackTrace();
-            return R.fail(e.getMessage());
-        }
-    }
-
-    @PostMapping("/addBatchGdbData")
-    public R<String> addBatchGdbData(String uploadId) {
-        try {
-            String res = cadastreManageService.addBatchGdbData(uploadId);
-            return R.ok(res);
-        } catch (Exception e) {
-            e.printStackTrace();
-            return R.fail(e.getMessage());
-        }
-    }
-
-
-    @PostMapping("/addBatchMdbData")
-    public R<String> addBatchMdbData(String uploadId) {
-        try {
-            String res = cadastreManageService.addBatchMdbData(uploadId);
-            return R.ok(res);
-        } catch (Exception e) {
-            e.printStackTrace();
-            return R.fail(e.getMessage());
-        }
-    }
-
-
-    /**
-     * 获取列表
-     *
-     * @return
-     */
-    @PostMapping("/list")
-    public R<Map<String, Object>> list(@RequestBody CadastreFileFilterVo cadastreFileFilterVo) {
-        try {
-            Map<String, Object> res = cadastreManageService.list(cadastreFileFilterVo);
-            return R.ok(res);
-        } catch (Exception e) {
-            return R.fail(e.getMessage());
-        }
-    }
-
-    /**
-     * 批量删除
-     *
-     * @param idsVo 包含要删除的ID列表
-     * @return
-     */
-    @DeleteMapping("")
-    public R<Void> Delete(@RequestBody IdsVo idsVo) {
-        try {
-            if (idsVo == null || idsVo.getIds() == null || idsVo.getIds().isEmpty()) {
-                return R.fail("删除的ID列表不能为空");
-            }
-            cadastreManageService.batchDelete(idsVo.getIds());
-            return R.ok();
-        } catch (Exception e) {
-            return R.fail(e.getMessage());
-        }
-    }
-
-    /**
-     * 获取任务日志
-     *
-     * @param bsm
-     * @return
-     */
-    @GetMapping("/GetLog")
-    public R<List<FzssFxrwrz>> GetLog(String bsm) {
-        try {
-            List<FzssFxrwrz> list = fzssFxrwrzHandleService.getLog(bsm);
-            return R.ok(list);
-        } catch (Exception e) {
-            return R.fail(e.getMessage());
-        }
-    }
-
-
-    /**
-     * 获取任务日志文件,最终前端可以下载成txt内容,每一条数据作为txt的一行记录
-     *
-     * @param rwbsm
-     * @return
-     */
-    @GetMapping("/GetLogFile")
-    public ResponseEntity<Resource> GetLogFile(String rwbsm) {
-        List<FzssFxrwrz> list = fzssFxrwrzHandleService.getLog(rwbsm);
-        StringBuilder sb = new StringBuilder();
-        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-        for (FzssFxrwrz item : list) {
-            String time = item.getRzsj() != null ? sdf.format(item.getRzsj()) : "";
-            String line = String.join(" | ",
-                    time,
-                    Optional.ofNullable(item.getRwlx()).orElse(""),
-                    Optional.ofNullable(item.getRzlx()).orElse(""),
-                    Optional.ofNullable(item.getRzlr()).orElse(""));
-            sb.append(line).append("\n");
-        }
-        byte[] data = sb.toString().getBytes(StandardCharsets.UTF_8);
-        ByteArrayResource resource = new ByteArrayResource(data);
-        String fileName = "log_" + rwbsm + ".txt";
-        String encName;
-        try {
-            encName = URLEncoder.encode(fileName, "UTF-8");
-        } catch (Exception e) {
-            encName = fileName;
-        }
-        HttpHeaders headers = new HttpHeaders();
-        headers.add(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=" + encName);
-        headers.setContentType(new MediaType("text", "plain", StandardCharsets.UTF_8));
-        return ResponseEntity
-                .ok()
-                .headers(headers)
-                .contentLength(data.length)
-                .body(resource);
-    }
-
-
-    @PostMapping("/getLayerData")
-    public R<List<LayerAndDbData>> getLayerData(String uploadId) {
-        try {
-            List<LayerAndDbData> res = cadastreManageService.getLayerData(uploadId);
-            return R.ok(res);
-        } catch (Exception e) {
-            e.printStackTrace();
-            return R.fail(e.getMessage());
-        }
-    }
-
-    /**
-     * 获取表格数据进行对比
-     * @param uploadId
-     * @return
-     */
-    @PostMapping("/getMdbPropertyData")
-    public R<List<LayerAndDbData>> mdbPropertyData(String uploadId) {
-        try {
-            List<LayerAndDbData> res = cadastreManageService.getMdbPropertyData(uploadId);
-            return R.ok(res);
-        } catch (Exception e) {
-            e.printStackTrace();
-            return R.fail(e.getMessage());
-        }
-    }
-
-
-    @PostMapping("/backToOld")
-    public R<String> backToOld(String uploadId) {
-        try {
-            String res = cadastreManageService.backToOldData(uploadId);
-            return R.ok(res);
-        } catch (Exception e) {
-            e.printStackTrace();
-            return R.fail(e.getMessage());
-        }
-    }
-
-    @PostMapping("/getMdbCompareData")
-    public R<List<MdbAndDbData>> mdbCompareData(String uploadId) {
-        try {
-            List<MdbAndDbData> res = cadastreManageService.getMdbCompareData(uploadId);
-            return R.ok(res);
-        } catch (Exception e) {
-            e.printStackTrace();
-            return R.fail(e.getMessage());
-        }
-    }
-
-    @RequestMapping("/testRun")
-    public R<Object> testRun() {
-        try {
-            String filePath = "C:\\Users\\Administrator\\Desktop\\08\\shp_create\\public_dict";
-            cadastreManageService.testBuildMdbFile("fdcq1", filePath, "public_dict");
-            //cadastreManageService.testRun();
-            return R.ok(null);
-        } catch (Exception e) {
-            e.printStackTrace();
-            return R.fail(e.getMessage());
-        }
-
-    }
-
-
-    /**
-     * 动态查询数据
-     * @param tableName
-     * @param geomFlag
-     * @param bsm
-     * @param ywh
-     * @return
-     */
-    @GetMapping("/selectTableList")
-    public R<List<Map<String,Object>>> selectTableRow(@RequestParam("tableName") String tableName,@RequestParam("geomFlag") String geomFlag,@RequestParam(value = "bsm",required = false,defaultValue = "") String bsm, @RequestParam(value = "ywh",required = false,defaultValue = "") String ywh) {
-        try {
-            List<Map<String, Object>> res = cadastreManageService.selectTableRow(tableName, geomFlag, bsm, ywh);
-            return R.ok(res);
-        } catch (Exception e) {
-            e.printStackTrace();
-            return R.fail(e.getMessage());
-        }
-    }
-
-
-
-
-    @GetMapping("/selectTableList2")
-    public R<List<Map<String,Object>>> selectTableRow2(@RequestParam("tableName") String tableName,@RequestParam("geomFlag") String geomFlag,
-                                                       @RequestParam(value = "zddm",required = false,defaultValue = "") String zddm,
-                                                       @RequestParam(value = "bdcdyh",required = false,defaultValue = "") String bdcdyh,
-                                                       @RequestParam(value = "zl",required = false,defaultValue = "") String zl,
-                                                       @RequestParam(value = "qlr",required = false,defaultValue = "") String qlr,
-                                                       @RequestParam(value = "shape",required = false,defaultValue = "") String cxfw,
-                                                       @RequestParam(value = "bsm",required = false,defaultValue = "") String bsm,
-                                                       @RequestParam(value = "ywh",required = false,defaultValue = "") String ywh) {
-
-        try {
-            if(StringUtils.isBlank(ywh)){
-                ywh +=  " 1=1 ";
-            }
-            if(StringUtils.isNotBlank(zddm)){
-                ywh +=  " AND zddm like '%" + zddm + "%'";
-            }
-            if(StringUtils.isNotBlank(bdcdyh)){
-                ywh +=  " AND bdcdyh like '%" + bdcdyh + "%'";
-            }
-
-            if(StringUtils.isNotBlank(zl)){
-                if("zrz".equalsIgnoreCase(tableName)){
-                    ywh +=  " AND lzzl like '%" + zl + "%'";
-                }else{
-                    ywh +=  " AND zl like '%" + zl + "%'";
-                }
-            }
-            if (StringUtils.isNotBlank(cxfw)) {
-                if (!cxfw.contains("SRID=")) {
-                    cxfw = "SRID=" + "4326" + ";" + cxfw;
-                }
-                //todo 这里根据不同的表使用图形查询交集,然后获取bsm,拼接ywh
-                ywh += " AND public.st_intersects(geom,public.st_geomfromewkt('"+cxfw+"'))";
-            }
-            List<Map<String, Object>> res = cadastreManageService.selectTableRow(tableName, geomFlag, bsm, ywh);
-            return R.ok(res);
-        } catch (Exception e) {
-            e.printStackTrace();
-            return R.fail(e.getMessage());
-        }
-    }
-
-
-
-    @GetMapping("/getTableFields")
-    public R<List<String>> getTableFields(@RequestParam("tableName") String tableName) {
-        try {
-            List<String> res = cadastreManageService.getTableFields(tableName);
-            return R.ok(res);
-        } catch (Exception e) {
-            e.printStackTrace();
-            return R.fail(e.getMessage());
-        }
-    }
-
-    @GetMapping("/getDistinctValueByField")
-    public R<List<String>> getDistinctValueByField(@RequestParam("tableName") String tableName, @RequestParam("fieldName") String fieldName) {
-        try {
-            List<String> res = cadastreManageService.getDistinctValueByField(tableName, fieldName);
-            return R.ok(res);
-        } catch (Exception e) {
-            e.printStackTrace();
-            return R.fail(e.getMessage());
-        }
-    }
-
-
-    @GetMapping("/checkQueryWhere")
-    public R<Boolean> checkQueryWhere(@RequestParam("tableName") String tableName, @RequestParam("queryWhere") String queryWhere) {
-        try {
-            Boolean res = cadastreManageService.checkQueryWhere(tableName, queryWhere);
-            return R.ok(res);
-        } catch (Exception e) {
-            return R.fail(e.getMessage());
-        }
-    }
-
-    /**
-     * 批量更新
-     * @param content
-     * @return
-     */
-    @PutMapping("/tableRowUpdate")
-    public R<Void> tableRow(@RequestBody RowUpdateContent content) {
-        String tableName = content.getTableName();
-        List<Map<String, Object>> list = content.getRowList();
-         String res = cadastreManageService.tableRowUpdate(tableName,list);
-        return R.ok();
-    }
-
-    /**
-     * 批量删除
-     * @param content
-     * @return
-     */
-    @DeleteMapping("/tableRowDelete")
-    public R<Void> tableRowDelete(@RequestBody RowUpdateContent content) {
-        String tableName = content.getTableName();
-        List<Map<String, Object>> list = content.getRowList();
-        String res = cadastreManageService.batchDeleteByBsm(tableName,list);
-        return R.ok();
-    }
-
-    @PostMapping("/export")
-    public void exportList(HttpServletResponse response, @RequestBody RowUpdateContent content) {
-        try {
-            String tableName = content.getTableName();
-            List<Map<String, Object>> paramlist = content.getRowList();
-            List<Object> bsmList = null;
-            List<String> ywhList = null;
-            if(CollectionUtils.isNotEmpty(paramlist)){
-                bsmList = paramlist.stream().filter(map -> map.containsKey("bsm")).map(map -> map.get("bsm")).collect(Collectors.toList());
-                ywhList = paramlist.stream().filter(map -> map.containsKey("ywh")).map(map -> map.get("ywh").toString()).collect(Collectors.toList());
-            }
-            List<Map<String, Object>> list = cadastreManageService.selectTableRowExcel(tableName, "0", bsmList, ywhList);
-            ServiceFileUtil.exportExcel(response,list,tableName+"导出");
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-    }
-
-
-    @GetMapping("/GetLegend")
-    public R<JSONArray> GetLegend(String sjlx) {
-        try {
-            String legend = zymlService.GetLegendBySjlx(sjlx);
-            if(StringUtils.isNotBlank(legend)){
-                JSONArray jsonArray = JSONArray.of(JSON.parseArray(legend));
-                return R.ok(jsonArray);
-            }
-            return null;
-        } catch (Exception e) {
-            return R.fail(e.getMessage());
-        }
-    }
-
-
-}
+//package com.siwei.apply.controller.cadastre;
+//
+//import com.alibaba.fastjson.JSON;
+//import com.alibaba.fastjson2.JSONArray;
+//import com.siwei.apply.domain.FzssFxrwrz;
+//import com.siwei.apply.domain.LayerAndDbData;
+//import com.siwei.apply.domain.MdbAndDbData;
+//import com.siwei.apply.domain.RowUpdateContent;
+//import com.siwei.apply.domain.vo.*;
+//import com.siwei.apply.service.cadastre.CadastreManageService;
+//import com.siwei.apply.service.cadastre.IZymlService;
+//import com.siwei.apply.service.cadastre.impl.FzssFxrwrzHandleService;
+//import com.siwei.apply.utils.ServiceFileUtil;
+//import com.siwei.common.core.domain.R;
+//import com.siwei.common.core.utils.StringUtils;
+//import com.siwei.common.core.web.controller.BaseController;
+//import org.apache.commons.collections4.CollectionUtils;
+////import org.gdal.ogr.*;
+//import org.springframework.beans.factory.annotation.Autowired;
+//import org.springframework.web.bind.annotation.*;
+//import org.springframework.http.ResponseEntity;
+//import org.springframework.http.HttpHeaders;
+//import org.springframework.http.MediaType;
+//import org.springframework.core.io.Resource;
+//import org.springframework.core.io.ByteArrayResource;
+//
+//import javax.servlet.http.HttpServletResponse;
+//import java.util.*;
+//import java.net.URLEncoder;
+//import java.nio.charset.StandardCharsets;
+//import java.text.SimpleDateFormat;
+//import java.util.stream.Collectors;
+//
+//@RestController
+//@RequestMapping("/cadastre/manage")
+///**
+// * 地籍库管理模块
+// */
+//public class CadastreManageController extends BaseController {
+//
+//    @Autowired
+//    private CadastreManageService cadastreManageService;
+//    @Autowired
+//    private FzssFxrwrzHandleService fzssFxrwrzHandleService;
+//
+//    @Autowired
+//    private IZymlService zymlService;
+//
+//
+//
+//
+//
+//    /**
+//     *
+//     * //1.先获取相关信息,进行入库
+//     * //2.日志记录写入
+//     * //3.读取文件进行录入
+//     * //4.质量进行检查
+//     *
+//     * @param theFileName
+//     * @param theFilePath
+//     * @param fileType
+//     * @param updateType
+//     * @return
+//     */
+//    @PostMapping("/checkUploadDquality")
+//    public R<CheckInfoResultVo> checkData(String theFileName, String theFilePath, String fileType, String updateType) {
+//        try {
+//            CheckInfoResultVo res = cadastreManageService.checkFileData(theFileName, theFilePath, fileType, updateType);
+//            return R.ok(res);
+//        } catch (Exception e) {
+//            e.printStackTrace();
+//            return R.fail(e.getMessage());
+//        }
+//    }
+//
+//    @PostMapping("/getCompareData")
+//    public R<CompareResultVo> compareData(String uploadId) {
+//        try {
+//            CompareResultVo res = cadastreManageService.getCompareData(uploadId);
+//            return R.ok(res);
+//        } catch (Exception e) {
+//            e.printStackTrace();
+//            return R.fail(e.getMessage());
+//        }
+//    }
+//
+//    @PostMapping("/addBatchGdbData")
+//    public R<String> addBatchGdbData(String uploadId) {
+//        try {
+//            String res = cadastreManageService.addBatchGdbData(uploadId);
+//            return R.ok(res);
+//        } catch (Exception e) {
+//            e.printStackTrace();
+//            return R.fail(e.getMessage());
+//        }
+//    }
+//
+//
+//    @PostMapping("/addBatchMdbData")
+//    public R<String> addBatchMdbData(String uploadId) {
+//        try {
+//            String res = cadastreManageService.addBatchMdbData(uploadId);
+//            return R.ok(res);
+//        } catch (Exception e) {
+//            e.printStackTrace();
+//            return R.fail(e.getMessage());
+//        }
+//    }
+//
+//
+//    /**
+//     * 获取列表
+//     *
+//     * @return
+//     */
+//    @PostMapping("/list")
+//    public R<Map<String, Object>> list(@RequestBody CadastreFileFilterVo cadastreFileFilterVo) {
+//        try {
+//            Map<String, Object> res = cadastreManageService.list(cadastreFileFilterVo);
+//            return R.ok(res);
+//        } catch (Exception e) {
+//            return R.fail(e.getMessage());
+//        }
+//    }
+//
+//    /**
+//     * 批量删除
+//     *
+//     * @param idsVo 包含要删除的ID列表
+//     * @return
+//     */
+//    @DeleteMapping("")
+//    public R<Void> Delete(@RequestBody IdsVo idsVo) {
+//        try {
+//            if (idsVo == null || idsVo.getIds() == null || idsVo.getIds().isEmpty()) {
+//                return R.fail("删除的ID列表不能为空");
+//            }
+//            cadastreManageService.batchDelete(idsVo.getIds());
+//            return R.ok();
+//        } catch (Exception e) {
+//            return R.fail(e.getMessage());
+//        }
+//    }
+//
+//    /**
+//     * 获取任务日志
+//     *
+//     * @param bsm
+//     * @return
+//     */
+//    @GetMapping("/GetLog")
+//    public R<List<FzssFxrwrz>> GetLog(String bsm) {
+//        try {
+//            List<FzssFxrwrz> list = fzssFxrwrzHandleService.getLog(bsm);
+//            return R.ok(list);
+//        } catch (Exception e) {
+//            return R.fail(e.getMessage());
+//        }
+//    }
+//
+//
+//    /**
+//     * 获取任务日志文件,最终前端可以下载成txt内容,每一条数据作为txt的一行记录
+//     *
+//     * @param rwbsm
+//     * @return
+//     */
+//    @GetMapping("/GetLogFile")
+//    public ResponseEntity<Resource> GetLogFile(String rwbsm) {
+//        List<FzssFxrwrz> list = fzssFxrwrzHandleService.getLog(rwbsm);
+//        StringBuilder sb = new StringBuilder();
+//        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+//        for (FzssFxrwrz item : list) {
+//            String time = item.getRzsj() != null ? sdf.format(item.getRzsj()) : "";
+//            String line = String.join(" | ",
+//                    time,
+//                    Optional.ofNullable(item.getRwlx()).orElse(""),
+//                    Optional.ofNullable(item.getRzlx()).orElse(""),
+//                    Optional.ofNullable(item.getRzlr()).orElse(""));
+//            sb.append(line).append("\n");
+//        }
+//        byte[] data = sb.toString().getBytes(StandardCharsets.UTF_8);
+//        ByteArrayResource resource = new ByteArrayResource(data);
+//        String fileName = "log_" + rwbsm + ".txt";
+//        String encName;
+//        try {
+//            encName = URLEncoder.encode(fileName, "UTF-8");
+//        } catch (Exception e) {
+//            encName = fileName;
+//        }
+//        HttpHeaders headers = new HttpHeaders();
+//        headers.add(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=" + encName);
+//        headers.setContentType(new MediaType("text", "plain", StandardCharsets.UTF_8));
+//        return ResponseEntity
+//                .ok()
+//                .headers(headers)
+//                .contentLength(data.length)
+//                .body(resource);
+//    }
+//
+//
+//    @PostMapping("/getLayerData")
+//    public R<List<LayerAndDbData>> getLayerData(String uploadId) {
+//        try {
+//            List<LayerAndDbData> res = cadastreManageService.getLayerData(uploadId);
+//            return R.ok(res);
+//        } catch (Exception e) {
+//            e.printStackTrace();
+//            return R.fail(e.getMessage());
+//        }
+//    }
+//
+//    /**
+//     * 获取表格数据进行对比
+//     * @param uploadId
+//     * @return
+//     */
+//    @PostMapping("/getMdbPropertyData")
+//    public R<List<LayerAndDbData>> mdbPropertyData(String uploadId) {
+//        try {
+//            List<LayerAndDbData> res = cadastreManageService.getMdbPropertyData(uploadId);
+//            return R.ok(res);
+//        } catch (Exception e) {
+//            e.printStackTrace();
+//            return R.fail(e.getMessage());
+//        }
+//    }
+//
+//
+//    @PostMapping("/backToOld")
+//    public R<String> backToOld(String uploadId) {
+//        try {
+//            String res = cadastreManageService.backToOldData(uploadId);
+//            return R.ok(res);
+//        } catch (Exception e) {
+//            e.printStackTrace();
+//            return R.fail(e.getMessage());
+//        }
+//    }
+//
+//    @PostMapping("/getMdbCompareData")
+//    public R<List<MdbAndDbData>> mdbCompareData(String uploadId) {
+//        try {
+//            List<MdbAndDbData> res = cadastreManageService.getMdbCompareData(uploadId);
+//            return R.ok(res);
+//        } catch (Exception e) {
+//            e.printStackTrace();
+//            return R.fail(e.getMessage());
+//        }
+//    }
+//
+//    @RequestMapping("/testRun")
+//    public R<Object> testRun() {
+//        try {
+//            String filePath = "C:\\Users\\Administrator\\Desktop\\08\\shp_create\\public_dict";
+//            cadastreManageService.testBuildMdbFile("fdcq1", filePath, "public_dict");
+//            //cadastreManageService.testRun();
+//            return R.ok(null);
+//        } catch (Exception e) {
+//            e.printStackTrace();
+//            return R.fail(e.getMessage());
+//        }
+//
+//    }
+//
+//
+//    /**
+//     * 动态查询数据
+//     * @param tableName
+//     * @param geomFlag
+//     * @param bsm
+//     * @param ywh
+//     * @return
+//     */
+//    @GetMapping("/selectTableList")
+//    public R<List<Map<String,Object>>> selectTableRow(@RequestParam("tableName") String tableName,@RequestParam("geomFlag") String geomFlag,@RequestParam(value = "bsm",required = false,defaultValue = "") String bsm, @RequestParam(value = "ywh",required = false,defaultValue = "") String ywh) {
+//        try {
+//            List<Map<String, Object>> res = cadastreManageService.selectTableRow(tableName, geomFlag, bsm, ywh);
+//            return R.ok(res);
+//        } catch (Exception e) {
+//            e.printStackTrace();
+//            return R.fail(e.getMessage());
+//        }
+//    }
+//
+//
+//
+//
+//    @GetMapping("/selectTableList2")
+//    public R<List<Map<String,Object>>> selectTableRow2(@RequestParam("tableName") String tableName,@RequestParam("geomFlag") String geomFlag,
+//                                                       @RequestParam(value = "zddm",required = false,defaultValue = "") String zddm,
+//                                                       @RequestParam(value = "bdcdyh",required = false,defaultValue = "") String bdcdyh,
+//                                                       @RequestParam(value = "zl",required = false,defaultValue = "") String zl,
+//                                                       @RequestParam(value = "qlr",required = false,defaultValue = "") String qlr,
+//                                                       @RequestParam(value = "shape",required = false,defaultValue = "") String cxfw,
+//                                                       @RequestParam(value = "bsm",required = false,defaultValue = "") String bsm,
+//                                                       @RequestParam(value = "ywh",required = false,defaultValue = "") String ywh) {
+//
+//        try {
+//            if(StringUtils.isBlank(ywh)){
+//                ywh +=  " 1=1 ";
+//            }
+//            if(StringUtils.isNotBlank(zddm)){
+//                ywh +=  " AND zddm like '%" + zddm + "%'";
+//            }
+//            if(StringUtils.isNotBlank(bdcdyh)){
+//                ywh +=  " AND bdcdyh like '%" + bdcdyh + "%'";
+//            }
+//
+//            if(StringUtils.isNotBlank(zl)){
+//                if("zrz".equalsIgnoreCase(tableName)){
+//                    ywh +=  " AND lzzl like '%" + zl + "%'";
+//                }else{
+//                    ywh +=  " AND zl like '%" + zl + "%'";
+//                }
+//            }
+//            if (StringUtils.isNotBlank(cxfw)) {
+//                if (!cxfw.contains("SRID=")) {
+//                    cxfw = "SRID=" + "4326" + ";" + cxfw;
+//                }
+//                //todo 这里根据不同的表使用图形查询交集,然后获取bsm,拼接ywh
+//                ywh += " AND public.st_intersects(geom,public.st_geomfromewkt('"+cxfw+"'))";
+//            }
+//            List<Map<String, Object>> res = cadastreManageService.selectTableRow(tableName, geomFlag, bsm, ywh);
+//            return R.ok(res);
+//        } catch (Exception e) {
+//            e.printStackTrace();
+//            return R.fail(e.getMessage());
+//        }
+//    }
+//
+//
+//
+//    @GetMapping("/getTableFields")
+//    public R<List<String>> getTableFields(@RequestParam("tableName") String tableName) {
+//        try {
+//            List<String> res = cadastreManageService.getTableFields(tableName);
+//            return R.ok(res);
+//        } catch (Exception e) {
+//            e.printStackTrace();
+//            return R.fail(e.getMessage());
+//        }
+//    }
+//
+//    @GetMapping("/getDistinctValueByField")
+//    public R<List<String>> getDistinctValueByField(@RequestParam("tableName") String tableName, @RequestParam("fieldName") String fieldName) {
+//        try {
+//            List<String> res = cadastreManageService.getDistinctValueByField(tableName, fieldName);
+//            return R.ok(res);
+//        } catch (Exception e) {
+//            e.printStackTrace();
+//            return R.fail(e.getMessage());
+//        }
+//    }
+//
+//
+//    @GetMapping("/checkQueryWhere")
+//    public R<Boolean> checkQueryWhere(@RequestParam("tableName") String tableName, @RequestParam("queryWhere") String queryWhere) {
+//        try {
+//            Boolean res = cadastreManageService.checkQueryWhere(tableName, queryWhere);
+//            return R.ok(res);
+//        } catch (Exception e) {
+//            return R.fail(e.getMessage());
+//        }
+//    }
+//
+//    /**
+//     * 批量更新
+//     * @param content
+//     * @return
+//     */
+//    @PutMapping("/tableRowUpdate")
+//    public R<Void> tableRow(@RequestBody RowUpdateContent content) {
+//        String tableName = content.getTableName();
+//        List<Map<String, Object>> list = content.getRowList();
+//         String res = cadastreManageService.tableRowUpdate(tableName,list);
+//        return R.ok();
+//    }
+//
+//    /**
+//     * 批量删除
+//     * @param content
+//     * @return
+//     */
+//    @DeleteMapping("/tableRowDelete")
+//    public R<Void> tableRowDelete(@RequestBody RowUpdateContent content) {
+//        String tableName = content.getTableName();
+//        List<Map<String, Object>> list = content.getRowList();
+//        String res = cadastreManageService.batchDeleteByBsm(tableName,list);
+//        return R.ok();
+//    }
+//
+//    @PostMapping("/export")
+//    public void exportList(HttpServletResponse response, @RequestBody RowUpdateContent content) {
+//        try {
+//            String tableName = content.getTableName();
+//            List<Map<String, Object>> paramlist = content.getRowList();
+//            List<Object> bsmList = null;
+//            List<String> ywhList = null;
+//            if(CollectionUtils.isNotEmpty(paramlist)){
+//                bsmList = paramlist.stream().filter(map -> map.containsKey("bsm")).map(map -> map.get("bsm")).collect(Collectors.toList());
+//                ywhList = paramlist.stream().filter(map -> map.containsKey("ywh")).map(map -> map.get("ywh").toString()).collect(Collectors.toList());
+//            }
+//            List<Map<String, Object>> list = cadastreManageService.selectTableRowExcel(tableName, "0", bsmList, ywhList);
+//            ServiceFileUtil.exportExcel(response,list,tableName+"导出");
+//        } catch (Exception e) {
+//            e.printStackTrace();
+//        }
+//    }
+//
+//
+//    @GetMapping("/GetLegend")
+//    public R<JSONArray> GetLegend(String sjlx) {
+//        try {
+//            String legend = zymlService.GetLegendBySjlx(sjlx);
+//            if(StringUtils.isNotBlank(legend)){
+//                JSONArray jsonArray = JSONArray.of(JSON.parseArray(legend));
+//                return R.ok(jsonArray);
+//            }
+//            return null;
+//        } catch (Exception e) {
+//            return R.fail(e.getMessage());
+//        }
+//    }
+//
+//
+//}

+ 1 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/domain/Jsydghxk.java

@@ -31,4 +31,5 @@ public class Jsydghxk extends BaseId {
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private Date updatedAt;            // 更新时间
     private String ydUnit;             // 用地面积单位(对应列:yd_unit)
+    private String sourceId;           // 同步表id
 }

+ 1 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/domain/Tdhyhs.java

@@ -31,4 +31,5 @@ public class Tdhyhs extends BaseId {
     private Date createdAt;             // 创建时间
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private Date updatedAt;             // 更新时间
+    private String sourceId;           // 同步表id
 }

+ 1 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/domain/vo/JsydghxkVo.java

@@ -20,4 +20,5 @@ public class JsydghxkVo {
     private String zsbh;               // 证书编号
     private String fzjg;               // 发证机关
     private String fzDate;               // 发证日期
+    private String sourceId;            // 同步表id
 }

+ 1 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/domain/vo/TdhyhsVo.java

@@ -15,5 +15,6 @@ public class TdhyhsVo {
     private String jsdw;                // 建设单位
     private String gljsgcghxkh;         // 关联建设工程规划许可号
     private String hyyj;                // 核验意见
+    private String sourceId;            // 同步表id
 
 }

+ 4 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/mapper/JsydghxkMapper.java

@@ -5,6 +5,8 @@ import com.siwei.apply.domain.vo.JsydghxkUpdateVo;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
+import java.util.List;
+
 // 建设用地规划许可 Mapper 接口
 @Mapper
 public interface JsydghxkMapper {
@@ -28,6 +30,8 @@ public interface JsydghxkMapper {
      */
     Jsydghxk get(String projectId);
 
+    List<Jsydghxk> getList(String projectId);
+
     /**
      * 获取建设用地规划许可信息(按主键ID)
      */

+ 1569 - 1569
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/cadastre/impl/CadastreManageServiceImpl.java

@@ -1,1569 +1,1569 @@
-package com.siwei.apply.service.cadastre.impl;
-
-import com.siwei.apply.domain.CadastreFile;
-import com.siwei.apply.domain.LayerAndDbData;
-import com.siwei.apply.domain.MdbAndDbData;
-import com.siwei.apply.domain.vo.*;
-import com.siwei.apply.mapper.CadastreFileMapper;
-import com.siwei.apply.mapper.FzssFxrwrzMapper;
-import com.siwei.apply.service.cadastre.CadastreManageService;
-
-import com.siwei.apply.utils.FileExtractUtil;
-import com.siwei.apply.utils.MdbUtil;
-import com.siwei.common.core.exception.ServiceException;
-import lombok.extern.slf4j.Slf4j;
-import org.apache.commons.collections4.CollectionUtils;
-import org.apache.commons.collections4.MapUtils;
-import org.apache.commons.lang3.StringUtils;
-import org.gdal.ogr.*;
-import org.gdal.osr.CoordinateTransformation;
-import org.gdal.osr.SpatialReference;
-import org.locationtech.jts.io.ParseException;
-import org.locationtech.jts.io.WKBReader;
-import org.locationtech.jts.io.WKTWriter;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Propagation;
-import org.springframework.transaction.annotation.Transactional;
-
-import java.io.File;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.util.*;
-import java.util.stream.Collectors;
-
-
-/**
- * 地籍管理系统主业务逻辑
- */
-@Slf4j
-@Service
-public class CadastreManageServiceImpl implements CadastreManageService {
-    static {
-        ogr.RegisterAll();
-    }
-
-    @Autowired
-    private CadastreFileMapper cadastreFileMapper;
-
-    @Autowired
-    private FzssFxrwrzHandleService fzssFxrwrzHandleService;
-
-    @Autowired
-    private FzssFxrwrzMapper fzssFxrwrzMapper;
-
-
-    /**
-     *
-     * 解析文件内容,insert 到表中
-     * <p>
-     * <p>
-     * 1.进行解析数据成为list<map></map>
-     * 2.进行调用方法动态插入到当前表中
-     * 3.需要修改upload 的表更新状态
-     * 4.考虑增量入库还是全量入库。()
-     * 5.校验逻辑复杂()
-     *
-     */
-    @Transactional(rollbackFor = Exception.class)
-    @Override
-    public String addBatchGdbData(String uploadId) {
-        String result = "success";
-        try {
-            CadastreFile cadastreFile = cadastreFileMapper.get(uploadId);
-            //这里判断是否校验通过
-            if (!cadastreFile.getStatus().equalsIgnoreCase("3")) {
-                log.info("校验未通过,不能入库");
-                result = "校验未通过,不能入库";
-                fzssFxrwrzHandleService.insertFxrwrz(uploadId, "地籍库管理", result, "info");
-                return result;
-            }
-
-            String gdbPath = cadastreFile.getUnzipPath();
-            DataSource ds = ogr.Open(gdbPath + "/" + cadastreFile.getName(), 0); // 0 = 只读
-            if (ds == null) {
-                log.warn("无法打开 gdb");
-                result = "无法打开gdb文件,不能入库";
-                fzssFxrwrzHandleService.insertFxrwrz(uploadId, "地籍库管理", result, "info");
-                return result;
-            }
-
-            fzssFxrwrzHandleService.insertFxrwrz(uploadId, "地籍库管理", "正在执行入库操作。。。", "info");
-            //这里进行遍历每个图层
-            for (int i = 0; i < ds.GetLayerCount(); i++) {
-                Layer layer = ds.GetLayer(i);
-                String layerName = layer.GetName();
-
-                boolean haveGeom = false;
-                //获取字段信息
-                List<String> dbFieldNameList = cadastreFileMapper.selectTableCollum(layerName.toLowerCase(Locale.ROOT));
-                if (dbFieldNameList.contains("geom")) {
-                    haveGeom = true;
-                }
-
-                List<Map<String, String>> dbFieldNameAndTypeList = cadastreFileMapper.selectTableCollumAndType(layerName.toLowerCase(Locale.ROOT));
-                Map<String, String> dbFieldNameAndTypeMap = dbFieldNameAndTypeList.stream().collect(Collectors.toMap(
-                        s -> s.get("column_name"),
-                        s -> s.get("data_type"),
-                        (existing, replacement) -> existing // 如果有重复键,保留第一个值
-                ));
-                List<Map<String, Object>> theValueList = getValueList(layer, dbFieldNameAndTypeMap, haveGeom);
-                fzssFxrwrzHandleService.insertFxrwrz(uploadId, "地籍库管理", "正在执行-" + layerName + "-入库", "info");
-                //这里直接数据入库,区分增量或者全量
-                Boolean addRes;
-                if ("2".equalsIgnoreCase(cadastreFile.getReadStatus())) {
-                    //增量更新
-                    addRes = incrementDataStorage(layerName, theValueList);
-                    if (addRes.equals(true)) {
-                        fzssFxrwrzHandleService.insertFxrwrz(uploadId, "地籍库管理", "增量更新-" + layerName + "-成功", "info");
-                    }
-                } else {
-                    addRes = fullDataStorage(layerName, theValueList);
-                    if (addRes.equals(true)) {
-                        fzssFxrwrzHandleService.insertFxrwrz(uploadId, "地籍库管理", "增量更新-" + layerName + "-成功", "info");
-                    }
-                }
-                log.error("当前图层{},入库结果 {}", layerName, addRes);
-            }
-            //成功则更新状态
-            CadastreFile updateCadastreFile = new CadastreFile();
-            updateCadastreFile.setId(cadastreFile.getId());
-            updateCadastreFile.setStatus("1");//入库成功
-            updateCadastreFile.setReadMessage("入库成功");//入库成功
-            cadastreFileMapper.update(updateCadastreFile);
-            fzssFxrwrzHandleService.insertFxrwrz(uploadId, "地籍库管理", "当前批次-" + cadastreFile.getId() + "-入库成功", "info");
-        } catch (Exception e) {
-            log.error("矢量数据入库异常,uploadId: {}", uploadId, e);
-            //更新状态
-            CadastreFile updateCadastreFile = new CadastreFile();
-            updateCadastreFile.setId(uploadId);
-            updateCadastreFile.setStatus("2");//入库失败
-            updateCadastreFile.setReadMessage("入库失败");//入库失败
-            cadastreFileMapper.update(updateCadastreFile);
-            fzssFxrwrzHandleService.insertFxrwrz(uploadId, "地籍库管理", "当前批次-" + uploadId + "-入库失败", "info");
-            throw new ServiceException("矢量数据入库异常," + e.getMessage());
-        }
-        return result;
-    }
-
-
-    @Transactional(rollbackFor = Exception.class)
-    @Override
-    public String addBatchMdbData(String uploadId) {
-        String result = "success";
-        try {
-            CadastreFile cadastreFile = cadastreFileMapper.get(uploadId);
-            //这里判断是否校验通过
-            if (!cadastreFile.getStatus().equalsIgnoreCase("3")) {
-                log.info("校验未通过,不能入库");
-                result = "校验未通过,不能入库";
-                fzssFxrwrzHandleService.insertFxrwrz(uploadId, "地籍库管理", result, "info");
-                return result;
-            }
-
-            String gdbPath = cadastreFile.getUnzipPath();
-            List<Map<String, Object>> allMdbTableList = MdbUtil.MdbTables(gdbPath + "/" + cadastreFile.getName(), "", "");
-
-            if (allMdbTableList == null) {
-                log.warn("无法打开 mdb");
-                result = "无法打开mdb文件,不能入库";
-                fzssFxrwrzHandleService.insertFxrwrz(uploadId, "地籍库管理", result, "info");
-                return result;
-            }
-
-            fzssFxrwrzHandleService.insertFxrwrz(uploadId, "地籍库管理", "正在执行入库操作。。。", "info");
-            for (Map<String, Object> tableMap : allMdbTableList) {
-                String talbleName = String.valueOf(tableMap.get("name"));
-                //List<Map<String, Object>> theValueList = getValueList(layer, dbFieldNameAndTypeMap, haveGeom);
-                Map<String, Object> allMdbTableFieldMap = MdbUtil.MdbTableContent(gdbPath + "/" + cadastreFile.getName(), talbleName, "", "", 1, 1000);
-                List<Map<String, Object>> theValueList = (List<Map<String, Object>>) allMdbTableFieldMap.get("rows");
-
-                fzssFxrwrzHandleService.insertFxrwrz(uploadId, "地籍库管理", "正在执行-" + talbleName + "-入库", "info");
-                //这里直接数据入库,区分增量或者全量
-                Boolean addRes;
-                if ("2".equalsIgnoreCase(cadastreFile.getReadStatus())) {
-                    //增量更新
-                    addRes = incrementDataStorage(talbleName, theValueList);
-                    if (addRes.equals(true)) {
-                        fzssFxrwrzHandleService.insertFxrwrz(uploadId, "地籍库管理", "增量更新-" + talbleName + "-成功", "info");
-                    }
-                } else {
-                    addRes = fullDataStorage(talbleName, theValueList);
-                    if (addRes.equals(true)) {
-                        fzssFxrwrzHandleService.insertFxrwrz(uploadId, "地籍库管理", "全量更新-" + talbleName + "-成功", "info");
-                    }
-                }
-                log.error("当前属性名{},入库结果 {}", talbleName, addRes);
-            }
-            //成功则更新状态
-            CadastreFile updateCadastreFile = new CadastreFile();
-            updateCadastreFile.setId(cadastreFile.getId());
-            updateCadastreFile.setStatus("1");//入库成功
-            updateCadastreFile.setReadMessage("入库成功");//入库成功
-            cadastreFileMapper.update(updateCadastreFile);
-            fzssFxrwrzHandleService.insertFxrwrz(uploadId, "地籍库管理", "当前批次-" + cadastreFile.getId() + "-入库成功", "info");
-        } catch (Exception e) {
-            log.error("mdb表格数据入库异常,uploadId: {}", uploadId, e);
-            //更新状态
-            CadastreFile updateCadastreFile = new CadastreFile();
-            updateCadastreFile.setId(uploadId);
-            updateCadastreFile.setStatus("2");//入库失败
-            updateCadastreFile.setReadMessage("入库失败");//入库失败
-            cadastreFileMapper.update(updateCadastreFile);
-            fzssFxrwrzHandleService.insertFxrwrz(uploadId, "地籍库管理", "当前批次-" + uploadId + "-入库失败", "info");
-            throw new ServiceException("表格数据入库异常," + e.getMessage());
-        }
-        return result;
-    }
-
-
-    /**
-     * 获取比较数据
-     *
-     * @param uploadId
-     * @return
-     */
-    @Override
-    public CompareResultVo getCompareData(String uploadId) {
-        CompareResultVo compareResultVo = new CompareResultVo();
-        compareResultVo.setUploadId(uploadId);
-        compareResultVo.setResultStatus(true);
-        try {
-            List<CompareGemoVo> gemos = new ArrayList<>();
-            CadastreFile cadastreFile = cadastreFileMapper.get(uploadId);
-            String gdbPath = cadastreFile.getUnzipPath();
-            DataSource ds = ogr.Open(gdbPath + "/" + cadastreFile.getName(), 0); // 0 = 只读
-            if (ds == null) {
-                log.warn("无法打开 gdb");
-                return compareResultVo;
-            }
-            //这里进行遍历每个图层
-            for (int i = 0; i < ds.GetLayerCount(); i++) {
-                Layer layer = ds.GetLayer(i);
-                String layerName = layer.GetName();
-
-                CompareGemoVo compareGemoVo = new CompareGemoVo();
-                compareGemoVo.setLayerName(layerName);
-                List<String> layerGeom = getLayerGeom(layer);
-                compareGemoVo.setGeomData(layerGeom);
-                List<String> dbGeom = getDbGeom(layerName);
-                compareGemoVo.setOldGeomData(dbGeom);
-                //加入当前图层对比对象
-                gemos.add(compareGemoVo);
-            }
-            compareResultVo.setGemos(gemos);
-        } catch (Exception e) {
-            log.error("获取对比矢量数据信息异常,uploadId: {}", uploadId, e);
-            throw new ServiceException("获取对比矢量数据信息异常," + e.getMessage());
-        }
-        return compareResultVo;
-    }
-
-
-    /**
-     * 文件upload入库
-     *
-     * @param theFileName
-     * @param theFilePath
-     * @param fileType
-     * @return
-     */
-    @Override
-    public CadastreFile saveUploadFile(String theFileName, String theFilePath, String fileType, String updateType) {
-        try {
-            if (theFilePath == null || theFilePath.trim().isEmpty()) {
-                log.warn("处理文件失败:filePath不能为空");
-                return null;
-            }
-            Path currentFilePath = Paths.get(theFilePath);
-            if (!Files.exists(currentFilePath)) {
-                log.warn("处理文件失败:文件不存在: {}", theFilePath);
-                return null;
-            }
-            Long fileSize = Files.size(currentFilePath);
-
-            // 判断是否为压缩文件
-            if (FileExtractUtil.isCompressedFile(theFilePath)) {
-                // 解压文件到同名文件夹并获取目录结构
-                String extractRes = FileExtractUtil.extractToSameNameFolder(theFilePath);
-                if (StringUtils.isBlank(extractRes)) {
-                    log.warn("解压文件失败:文件不存在: {}", theFilePath);
-                    throw new ServiceException("解压文件失败:文件不存在,");
-                }
-
-                //解压成功文件保存
-                if (StringUtils.isNotBlank(extractRes)) {
-                    String unZipPath = extractRes;
-                    if ("1".equals(fileType)) { //gdb格式
-                        String innerExtractFileName = FileExtractUtil.getInnerFolderByDirName(unZipPath);
-                        // 如果解压后的文件夹名称不为空,则使用解压后的文件夹名称作为文件名
-                        if (StringUtils.isNotBlank(innerExtractFileName)) {
-                            theFileName = innerExtractFileName;
-                        } else {
-                            String suffix = ".gdb"; //需要后缀为.gdb才能被jar包识别为矢量数据进行读取
-                            //这里解压文件名称作为文件名
-                            String fileName = currentFilePath.getFileName().toString();
-                            theFileName = fileName.substring(0, fileName.lastIndexOf('.'));
-                            theFileName += suffix;
-
-                            //如果当前压缩文件为gdb文件,则解压后的文件夹名称需要修改为.gdb结尾
-                            FileExtractUtil.modifyDirName(unZipPath, unZipPath + suffix);
-                            unZipPath += suffix;
-                            unZipPath = unZipPath.replace(theFileName, "");
-                            if (StringUtils.isNotBlank(unZipPath) && (unZipPath.endsWith("/") || unZipPath.endsWith("\\"))) {
-                                unZipPath = unZipPath.substring(0, unZipPath.length() - 1);
-                            }
-                        }
-                        if (StringUtils.isNotBlank(theFileName) && !theFileName.toLowerCase(Locale.ROOT).endsWith(".gdb")) {
-                            throw new ServiceException("文件不是gdb格式矢量数据,请检查重新上传");
-                        }
-                    } else if ("2".equals(fileType)) {//如果是mdb文件
-                        String innerExtractFileName = FileExtractUtil.getInnerFileByDirName(unZipPath);
-                        if (StringUtils.isBlank(innerExtractFileName)) {
-                            throw new ServiceException("可能入库失败或没有历史版本,无法回退");
-                        }
-                        theFileName = innerExtractFileName;
-                        if (StringUtils.isNotBlank(theFileName) && !theFileName.toLowerCase(Locale.ROOT).endsWith(".mdb")) {
-                            throw new ServiceException("文件不是mdb格式表格数据,请检查重新上传");
-                        }
-                    }
-
-                    CadastreFile cadastreFile = new CadastreFile();
-                    cadastreFile.generateId();//生成id
-                    cadastreFile.setName(theFileName);
-                    cadastreFile.setFilePath(theFilePath);
-                    cadastreFile.setUnzipPath(unZipPath);
-                    cadastreFile.setFileType("1");//矢量/表格
-                    if (StringUtils.isNotBlank(fileType)) {
-                        cadastreFile.setFileType(fileType);
-                    }
-
-                    //0 为全量更新,1为增量更新
-                    if (StringUtils.isNotBlank(updateType)) {
-                        cadastreFile.setReadStatus(updateType);
-                    }
-                    cadastreFile.setFileSize(fileSize);
-                    cadastreFile.setStatus("0");
-                    cadastreFile.setUploadUser("admin");
-                    cadastreFile.setUploadTime(new Date());
-                    cadastreFile.setReadMessage("入库中。。。");
-                    cadastreFile.setUpdateTime(new Date());
-                    cadastreFileMapper.add(cadastreFile);
-                    return cadastreFile;
-                }
-            }
-        } catch (Exception e) {
-            log.error("处理文件并保存附件信息异常,filePath: {}", theFilePath, e);
-            throw new ServiceException("处理文件并保存附件信息异常," + e.getMessage());
-        }
-        return null;
-    }
-
-    /**
-     * //1.文件进行解压
-     * //1.先获取相关信息,进行入库
-     * //2.日志记录写入
-     * //3.读取文件进行录入
-     * //4.质量进行检查
-     * //日志记录
-     * //fzssFxrwrzHandleService.insertFxrwrz();
-     *
-     * @param theFileName
-     * @param theFilePath
-     * @param fileType
-     * @param updateType
-     * @return
-     */
-    @Override
-    public CheckInfoResultVo checkFileData(String theFileName, String theFilePath, String fileType, String updateType) {
-        CheckInfoResultVo checkInfoResult = new CheckInfoResultVo();
-        checkInfoResult.setResultStatus(true);
-        List<CheckInfoVo> checkInfoSuccessList = new ArrayList<>();
-        List<CheckInfoVo> checkInfoFailList = new ArrayList<>();
-
-        CadastreFile uploadFile = this.saveUploadFile(theFileName, theFilePath, fileType, updateType);
-
-        if (Objects.nonNull(uploadFile)) {
-            //入库成功
-            fzssFxrwrzHandleService.insertFxrwrz(uploadFile.getId(), "地籍库管理", "上传文件成功", "info");
-            checkInfoResult.setUploadId(uploadFile.getId());
-            String gdbPath = uploadFile.getUnzipPath();
-            theFileName = uploadFile.getName();//这里需要使用解压处理后的文件名称进行读取
-            //获取库中表名
-            List<String> allTableList = cadastreFileMapper.selectAllTable();
-
-            //这里区分文件类型,矢量还是表格的读取方式不一样
-            if (uploadFile.getFileType().equals("1")) { //矢量数据读取方式
-                DataSource ds = ogr.Open(gdbPath + "/" + theFileName, 0); // 0 = 只读
-                if (ds == null) {
-                    log.warn("无法打开 gdb");
-                    return checkInfoResult;
-                }
-                log.info("图层数量: {}", ds.GetLayerCount());
-                //这里进行遍历每个图层
-                for (int i = 0; i < ds.GetLayerCount(); i++) {
-                    Layer layer = ds.GetLayer(i);
-                    //todo 测试代码
-                    //这里做质量检查
-                    CheckInfoVo checkRes = checkLayerInfo(layer, allTableList, uploadFile.getId());
-                    if (checkRes.getCheckStatus().equals(false)) { //检查出错
-                        checkInfoFailList.add(checkRes);
-                        checkInfoResult.setResultStatus(false);
-                    } else if (checkRes.getCheckStatus().equals(true)) {
-                        //成功则更新文件上传状态
-                        CadastreFile cadastreFile = new CadastreFile();
-                        cadastreFile.setId(uploadFile.getId());
-                        cadastreFile.setStatus("3");//校验通过
-                        cadastreFileMapper.update(cadastreFile);
-                        checkInfoSuccessList.add(checkRes);
-                    }
-                }
-                ds.delete();
-            } else if (uploadFile.getFileType().equals("2")) {//处理表格类型
-                try {
-                    List<Map<String, Object>> allMdbTableList = MdbUtil.MdbTables(gdbPath + "/" + theFileName, "", "");
-                    if (CollectionUtils.isNotEmpty(allTableList)) {
-                        for (Map<String, Object> tableMap : allMdbTableList) {
-                            String talbleName = String.valueOf(tableMap.get("name"));
-                            Map<String, Object> allMdbTableFieldMap = MdbUtil.MdbTableContent(gdbPath + "/" + theFileName, talbleName, "", "", 1, 1000);
-                            //这里做质量检查
-                            CheckInfoVo checkRes = checkMdbInfo(talbleName, allTableList, allMdbTableFieldMap, uploadFile.getId());
-                            if (checkRes.getCheckStatus().equals(false)) { //检查出错
-                                checkInfoFailList.add(checkRes);
-                                checkInfoResult.setResultStatus(false);
-                            } else if (checkRes.getCheckStatus().equals(true)) {
-                                //成功则更新文件上传状态
-                                CadastreFile cadastreFile = new CadastreFile();
-                                cadastreFile.setId(uploadFile.getId());
-                                cadastreFile.setStatus("3");//校验通过
-                                cadastreFileMapper.update(cadastreFile);
-                                checkInfoSuccessList.add(checkRes);
-                            }
-                        }
-                    }
-                } catch (Exception e) {
-                    log.error("表格数据校验异常,uploadId: {}", uploadFile.getId(), e);
-                    throw new ServiceException("表格数据校验异常,uploadId:" + uploadFile.getId());
-                }
-            }
-            checkInfoResult.setCheckFailList(checkInfoFailList);
-            checkInfoResult.setCheckSuccessList(checkInfoSuccessList);
-        }
-        return checkInfoResult;
-    }
-
-
-    /**
-     * 对每个图层进行数据格式校验
-     *
-     * @param layer
-     * @param allTableList
-     * @return
-     */
-    private CheckInfoVo checkLayerInfo(Layer layer, List<String> allTableList, String uploadId) {
-        //总返回对象
-        CheckInfoVo checkInfoVo = new CheckInfoVo();
-        checkInfoVo.setCheckStatus(true);//初始化检查通过
-
-        List<String> checkInfoList = new ArrayList<>();
-        String name = layer.GetName();
-        checkInfoVo.setUploadFileTableName(name);
-
-        //检查表名对应
-        if (!allTableList.contains(name.toLowerCase(Locale.ROOT))) {
-            checkInfoList.add(name + ":图层名称不在地籍库范围内!");
-            fzssFxrwrzHandleService.insertFxrwrz(uploadId, "地籍库管理", name + ":图层名称不在地籍库范围内!", "info");
-            checkInfoVo.setCheckStatus(false);
-        }
-
-        //检查坐标系
-        if (checkCoordinateSystem(layer).equals(false)) {
-            checkInfoList.add(name + ":坐标系不正确,确认是否CGCS2000!");
-            fzssFxrwrzHandleService.insertFxrwrz(uploadId, "地籍库管理", name + ":坐标系不正确,确认是否CGCS2000!", "info");
-            checkInfoVo.setCheckStatus(false);
-        }
-
-        boolean haveGeom = false;
-        //获取字段信息
-        List<String> dbFieldNameList = cadastreFileMapper.selectTableCollum(name.toLowerCase(Locale.ROOT));
-        if (dbFieldNameList.contains("geom")) {
-            haveGeom = true;
-        }
-        //这里移除校验字段(非属mdb中的字段)
-        dbFieldNameList.remove("valid_flag");
-
-        List<String> layerFieldNameList = this.getFieldName(layer, haveGeom);
-        // 判断是否包含相同的元素(不考虑顺序)
-        boolean areCollectionsEqual = CollectionUtils.containsAll(layerFieldNameList,dbFieldNameList);
-        if (!areCollectionsEqual) {
-            checkInfoList.add(name + ":字段数据不一致!-" + dbFieldNameList);
-            fzssFxrwrzHandleService.insertFxrwrz(uploadId, "地籍库管理", name + ":字段数据不一致!-" + dbFieldNameList, "info");
-            checkInfoVo.setCheckStatus(false);
-        }
-
-        //检查字段数据是否为空
-        //todo 这里根据表名获取相关校验字段信息
-        List<String> checkFieldList = new ArrayList<>();
-        //checkFieldList.add("111");
-        //checkFieldList.add("bz");
-        //仅获取图层属性
-        List<Map<String, Object>> theValueList = getValueList(layer, new LinkedHashMap<>(), false);
-        for (Map<String, Object> theMap : theValueList) {
-            for (String fieldName : checkFieldList) {
-                if (Objects.isNull(theMap.get(fieldName))) {
-                    checkInfoList.add(name + "--" + fieldName + "字段不能为空!");
-                    checkInfoVo.setCheckStatus(false);
-                }
-            }
-        }
-        checkInfoVo.setCheckInfoList(checkInfoList);
-        //todo 这里需要放入到缓存中,并且可以下载为txt内容
-        if (checkInfoVo.getCheckStatus().equals(true)) {
-            checkInfoList.add("当前矢量数据:" + name + "---" + "数据格式为gdb");
-            checkInfoList.add("当前矢量数据:" + name + "---" + "坐标系是CGCS2000");
-            checkInfoList.add("当前矢量数据:" + name + "---" + "检查校验通过!");
-            fzssFxrwrzHandleService.insertFxrwrz(uploadId, "地籍库管理", "当前矢量数据:" + name + "---" + "数据格式为gdb", "info");
-            fzssFxrwrzHandleService.insertFxrwrz(uploadId, "地籍库管理", "当前矢量数据:" + name + "---" + "坐标系是CGCS2000", "info");
-            fzssFxrwrzHandleService.insertFxrwrz(uploadId, "地籍库管理", "当前矢量数据:" + name + "---" + "检查校验通过!", "info");
-        }
-        return checkInfoVo;
-    }
-
-
-    /**
-     *
-     * 对表格属性数据进行数据格式校验
-     *
-     * @param mdbTableName
-     * @param allTableList
-     * @return
-     */
-    private CheckInfoVo checkMdbInfo(String mdbTableName, List<String> allTableList, Map<String, Object> mdbTableFieldMap, String uploadId) {
-        //总返回对象
-        CheckInfoVo checkInfoVo = new CheckInfoVo();
-        checkInfoVo.setCheckStatus(true);//初始化检查通过
-        List<String> checkInfoList = new ArrayList<>();
-        checkInfoVo.setUploadFileTableName(mdbTableName);
-
-        //字段名称
-        List<String> mdbTableFieldNameList = (List<String>) mdbTableFieldMap.get("column");
-        List<String> lowerCaseMdbTableFieldNameList = mdbTableFieldNameList.stream().map(String::toLowerCase).collect(Collectors.toList());
-
-        //所有条数
-        List<Map<String, String>> dataList = (List<Map<String, String>>) mdbTableFieldMap.get("rows");
-
-        //检查表名对应
-        if (!allTableList.contains(mdbTableName.toLowerCase(Locale.ROOT))) {
-            checkInfoList.add(mdbTableName + ":图层名称不在地籍库范围内!");
-            fzssFxrwrzHandleService.insertFxrwrz(uploadId, "地籍库管理", mdbTableName + ":图层名称不在地籍库范围内!", "info");
-            checkInfoVo.setCheckStatus(false);
-        }
-
-        //获取当前表数据库字段信息
-        List<String> dbFieldNameList = cadastreFileMapper.selectTableCollum(mdbTableName.toLowerCase(Locale.ROOT));
-        //这里移除校验字段(非属mdb中的字段)
-        dbFieldNameList.remove("valid_flag");
-        // 判断是否包含相同的元素(不考虑顺序)
-        boolean areCollectionsEqual = CollectionUtils.containsAll(lowerCaseMdbTableFieldNameList,dbFieldNameList);
-        if (!areCollectionsEqual) {
-            checkInfoList.add(mdbTableName + ":字段数据不一致!-" + dbFieldNameList);
-            fzssFxrwrzHandleService.insertFxrwrz(uploadId, "地籍库管理", mdbTableName + ":字段数据不一致!-" + dbFieldNameList, "info");
-            checkInfoVo.setCheckStatus(false);
-        }
-
-        //检查字段数据是否为空
-        //todo 这里根据表名获取相关校验字段信息
-        List<String> checkFieldList = new ArrayList<>();
-        //checkFieldList.add("111");
-        //checkFieldList.add("bz");
-
-        for (Map<String, String> theMap : dataList) {
-            for (String fieldName : checkFieldList) {
-                if (Objects.isNull(theMap.get(fieldName))) {
-                    checkInfoList.add(mdbTableName + "--" + fieldName + "字段不能为空!");
-                    checkInfoVo.setCheckStatus(false);
-                }
-            }
-        }
-        checkInfoVo.setCheckInfoList(checkInfoList);
-        if (checkInfoVo.getCheckStatus().equals(true)) {
-            checkInfoList.add("当前表格数据:" + mdbTableName + "---" + "数据格式为mdb");
-            checkInfoList.add("当前表格数据:" + mdbTableName + "---" + "检查校验通过!");
-            fzssFxrwrzHandleService.insertFxrwrz(uploadId, "地籍库管理", "当前表格数据:" + mdbTableName + "---" + "数据格式为mdb", "info");
-            fzssFxrwrzHandleService.insertFxrwrz(uploadId, "地籍库管理", "当前表格数据:" + mdbTableName + "---" + "检查校验通过!", "info");
-        }
-        return checkInfoVo;
-    }
-
-
-    /**
-     * 获取当前图层的所有属性字段名
-     *
-     * @param layer
-     * @return
-     */
-    private List<String> getFieldName(Layer layer, Boolean haveGeom) {
-        List<String> nameList = new ArrayList();
-        FeatureDefn defn = layer.GetLayerDefn();
-        System.out.println("字段数: " + defn.GetFieldCount());
-        for (int i = 0; i < defn.GetFieldCount(); i++) {
-            FieldDefn field = defn.GetFieldDefn(i);
-            nameList.add(field.GetName().toLowerCase(Locale.ROOT));
-        }
-        if (haveGeom.equals(true)) {
-            nameList.add("geom");
-        }
-        return nameList;
-    }
-
-
-    private static final String[] DATE_PATTERNS = {
-            "yyyy-MM-dd HH:mm:ssX",
-            "yyyy-MM-dd HH:mm:ss",
-            "yyyy/MM/dd HH:mm:ssX",
-            "yyyy/MM/dd HH:mm:ss",
-            "yyyy-MM-dd",
-            "yyyy/MM/dd"
-    };
-
-    private Object convertFieldValue(Feature feature, int fieldIndex, String fieldName, String fieldType) {
-        if (feature.IsFieldNull(fieldIndex)) {
-            return null;
-        }
-        String strValue = feature.GetFieldAsString(fieldIndex);
-        if (StringUtils.isBlank(strValue)) {
-            return null;
-        }
-        try {
-            if (StringUtils.containsIgnoreCase(fieldType, "character") || StringUtils.containsIgnoreCase(fieldType, "text")) {
-                return strValue;
-            } else if (StringUtils.containsIgnoreCase(fieldType, "integer") || StringUtils.containsIgnoreCase(fieldType, "smallint") || StringUtils.containsIgnoreCase(fieldType, "int2") || StringUtils.containsIgnoreCase(fieldType, "int4")) {
-                return feature.GetFieldAsInteger(fieldIndex);
-            } else if (StringUtils.containsIgnoreCase(fieldType, "bigint") || StringUtils.containsIgnoreCase(fieldType, "int8")) {
-                return feature.GetFieldAsInteger64(fieldIndex);
-            } else if (StringUtils.containsIgnoreCase(fieldType, "timestamp")) {
-                return parseDate(strValue, fieldName);
-            } else if (StringUtils.containsIgnoreCase(fieldType, "date")) {
-                return parseDate(strValue, fieldName);
-            } else if (StringUtils.containsIgnoreCase(fieldType, "numeric") || StringUtils.containsIgnoreCase(fieldType, "double") || StringUtils.containsIgnoreCase(fieldType, "real")) {
-                return feature.GetFieldAsDouble(fieldIndex);
-            } else if (StringUtils.containsIgnoreCase(fieldType, "bytea") || StringUtils.containsIgnoreCase(fieldType, "blob") || StringUtils.containsIgnoreCase(fieldType, "binary")) {
-                return null;
-            } else if (StringUtils.containsIgnoreCase(fieldType, "boolean")) {
-                return feature.GetFieldAsInteger(fieldIndex) != 0;
-            } else {
-                return strValue;
-            }
-        } catch (Exception e) {
-            log.warn("字段{}类型转换异常,值:{},类型:{},置空处理", fieldName, strValue, fieldType, e);
-            return null;
-        }
-    }
-
-    private java.sql.Date parseDate(String dateStr, String fieldName) {
-        if (StringUtils.isBlank(dateStr)) {
-            return null;
-        }
-        String cleaned = dateStr.trim();
-        for (String pattern : DATE_PATTERNS) {
-            try {
-                java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat(pattern);
-                sdf.setLenient(false);
-                java.util.Date parsed = sdf.parse(cleaned);
-                return new java.sql.Date(parsed.getTime());
-            } catch (Exception ignored) {
-            }
-        }
-        try {
-            String normalized = cleaned.replace("/", "-");
-            if (normalized.contains(" ") || normalized.contains("T")) {
-                normalized = normalized.substring(0, Math.min(normalized.indexOf(' ') > 0 ? normalized.indexOf(' ') : Integer.MAX_VALUE, normalized.indexOf('T') > 0 ? normalized.indexOf('T') : Integer.MAX_VALUE));
-            }
-            if (normalized.length() > 10) {
-                normalized = normalized.substring(0, 10);
-            }
-            return java.sql.Date.valueOf(normalized);
-        } catch (Exception e) {
-            log.warn("日期字段{}解析失败,值:{},置空处理", fieldName, dateStr);
-            return null;
-        }
-    }
-
-    /**
-     * 获取当前图层的所有字段名称和值
-     *
-     * @param layer
-     * @return
-     */
-    private List<Map<String, Object>> getValueList(Layer layer, Map<String, String> fieldNameAndTypeMap, Boolean haveGeom) {
-        List<Map<String, Object>> list = new ArrayList<>();
-        Integer sourceSRID = 4326;
-
-        // ========== 1. 获取源数据坐标系 EPSG:4527 ==========
-        try {
-            SpatialReference srcSR = layer.GetSpatialRef();
-            if (srcSR != null) {
-                srcSR.AutoIdentifyEPSG();
-                String code = srcSR.GetAuthorityCode(null);
-                if (code != null) {
-                    sourceSRID = Integer.parseInt(code);
-                }
-            }
-        } catch (Exception e) {
-            log.warn("获取图层坐标系SRID失败,使用默认4326", e);
-        }
-
-        layer.ResetReading();
-        Feature feature;
-        while ((feature = layer.GetNextFeature()) != null) {
-            Map<String, Object> map = new LinkedHashMap<>();
-            for (int i = 0; i < feature.GetFieldCount(); i++) {
-                String fieldName = feature.GetFieldDefnRef(i).GetName();
-                if (fieldNameAndTypeMap.containsKey(fieldName.toLowerCase())) {
-                    String fieldType = fieldNameAndTypeMap.get(fieldName.toLowerCase());
-
-
-/*                    if ("dclxtzm".equalsIgnoreCase(fieldName)) {
-                        map.put(fieldName, "99");
-                    }
-                    else if ("fwjg".equalsIgnoreCase(fieldName)) {
-                        map.put(fieldName, null);
-                    }
-                    else if ("jzwgd".equalsIgnoreCase(fieldName)) {
-                        map.put(fieldName, 1);
-                    }
-                    else if ("ycjzmj".equalsIgnoreCase(fieldName)) {
-                        map.put(fieldName, 1);
-                    }
-                    else if ("zts".equalsIgnoreCase(fieldName)) {
-                        map.put(fieldName, 1);
-                    }
-                    else if ("zydmj".equalsIgnoreCase(fieldName)) {
-                        map.put(fieldName, null);
-                    }*/
-
-                    if ("ydyhfl".equalsIgnoreCase(fieldName)) {
-                        map.put(fieldName, null);
-                    }
-                    else if (StringUtils.containsIgnoreCase(fieldType, "character")) {
-                        map.put(fieldName, feature.GetFieldAsString(i));
-                    } else if (StringUtils.containsIgnoreCase(fieldType, "integer") || StringUtils.containsIgnoreCase(fieldType, "smallint") || StringUtils.containsIgnoreCase(fieldType, "int2") || StringUtils.containsIgnoreCase(fieldType, "int4")) {
-                        map.put(fieldName, feature.GetFieldAsInteger(i));
-                    } else if (StringUtils.containsIgnoreCase(fieldType, "bigint") || StringUtils.containsIgnoreCase(fieldType, "int8")) {
-                        map.put(fieldName, feature.GetFieldAsInteger64(i));
-                    } else if (StringUtils.containsIgnoreCase(fieldType, "date")) {
-                        String dateStr = feature.GetFieldAsString(i);
-                        if (StringUtils.isNotBlank(dateStr)) {
-                            try {
-                                String normalized = dateStr.trim().replace("/", "-");
-                                if (normalized.length() > 10) {
-                                    normalized = normalized.substring(0, 10);
-                                }
-                                map.put(fieldName, java.sql.Date.valueOf(normalized));
-                            } catch (Exception e) {
-                                log.warn("日期字段{}解析失败,值:{},置空处理", fieldName, dateStr);
-                                map.put(fieldName, null);
-                            }
-                        } else {
-                            map.put(fieldName, null);
-                        }
-                    } else if (StringUtils.containsIgnoreCase(fieldType, "numeric") || StringUtils.containsIgnoreCase(fieldType, "double") || StringUtils.containsIgnoreCase(fieldType, "real")) {
-                        if (feature.IsFieldNull(i)) {
-                            map.put(fieldName, null);
-                        } else {
-                            map.put(fieldName, feature.GetFieldAsDouble(i));
-                        }
-                    } else if (StringUtils.containsIgnoreCase(fieldType, "bytea") || StringUtils.containsIgnoreCase(fieldType, "blob") || StringUtils.containsIgnoreCase(fieldType, "binary")) {
-                        map.put(fieldName, new byte[0]);
-                    }
-                    else {
-                        map.put(fieldName, feature.GetFieldAsString(i));
-                    }
-                } else {
-                    //这里兼容图层可能存在多出的字段不处理
-                    //map.put(fieldName, feature.GetFieldAsString(i));
-                    log.warn("当前图层-{},多出字段-{}",layer.GetName(),fieldName);
-                }
-            }
-            if (haveGeom.equals(true)) {
-                String ewkt = null;
-                Geometry geom = feature.GetGeometryRef();
-                if (geom != null) {
-                    String wkt = geom.ExportToWkt();
-                    ewkt = "SRID=" + sourceSRID + ";" + wkt;
-                    ewkt = this.transforGeomTo4326(ewkt);
-                }
-                map.put("geom", ewkt);
-            }
-            list.add(map);
-        }
-        return list;
-    }
-
-
-    /**
-     * 校验当前图层坐标系是否为:CGCS2000
-     *
-     * @param layer
-     * @return
-     */
-    private Boolean checkCoordinateSystem(Layer layer) {
-        boolean isCGCS2000 = false;
-        SpatialReference sr = layer.GetSpatialRef();
-        if (sr != null) {
-            String wkt = sr.ExportToWkt();
-            log.info("当前图层{},wkt为:{}", layer.GetName(), wkt);
-            // 判断 WKT 是否包含 "CGCS2000"
-            if (wkt.contains("CGCS2000")) {
-                isCGCS2000 = true;
-            }
-        }
-        return isCGCS2000;
-    }
-
-
-    /**
-     * 校验当前图层是否存在矢量数据
-     *
-     * @param layer
-     * @return
-     */
-    private Boolean checkHaveGeom(Layer layer) {
-        boolean haveGeom = false;
-        // 循环处理每个要素
-        for (int i = 0; i < layer.GetFeatureCount(0); i++) {
-            Feature feature = layer.GetFeature(i);
-            if (feature == null) {
-                continue;
-            }
-            Geometry geometry = feature.GetGeometryRef(); // 获取几何对象
-            if (geometry != null) {
-                // 将几何对象转换为 WKT 格式
-                String wkt = geometry.ExportToWkt();
-                if (StringUtils.isNotBlank(wkt)) {
-                    haveGeom = true;
-                    break;
-                }
-            }
-        }
-        return haveGeom;
-    }
-
-    /**
-     * 获取对比的矢量图层
-     *
-     * @param layer
-     * @return
-     */
-    private List<String> getLayerGeom(Layer layer) {
-        List<String> list = new ArrayList<>();
-        SpatialReference srcSrs = layer.GetSpatialRef();
-        Integer srid = null;
-        if (srcSrs != null) {
-            String authCode = srcSrs.GetAuthorityCode(null);
-            if (authCode != null) {
-                srid = Integer.parseInt(authCode);
-            }
-        }
-        if (srid == null) {
-            srid = 4527;
-        }
-
-        layer.ResetReading();
-        Feature feature;
-        while ((feature = layer.GetNextFeature()) != null) {
-            Geometry geom = feature.GetGeometryRef();
-            if (geom == null) {
-                list.add("");
-                continue;
-            }
-            String wkt = geom.ExportToWkt();
-            String ewkt = "SRID=" + srid + ";" + wkt;
-            ewkt = this.transforGeomTo4326(ewkt);
-            list.add(ewkt);
-        }
-        return list;
-    }
-
-
-    /**
-     * 获取对比的矢量图层
-     *
-     * @param layer
-     * @return
-     */
-    private List<String> getLayerGeom_del(Layer layer) {
-        List<String> list = new ArrayList<>();
-        // 循环处理每个要素
-        for (int i = 0; i < layer.GetFeatureCount(0); i++) {
-            Feature feature = layer.GetFeature(i);
-            if (feature == null) {
-                continue;
-            }
-            Geometry geometry = feature.GetGeometryRef(); // 获取几何对象
-            if (geometry != null) {
-                // 将几何对象转换为 WKT 格式
-                String wkt = geometry.ExportToWkt();
-                list.add(wkt);
-            }
-        }
-        return list;
-    }
-
-
-    /**
-     *
-     * @param tableName
-     * @return
-     */
-    private List<String> getDbGeom(String tableName) {
-        List<String> list = new ArrayList<>();
-        String geomsStr = cadastreFileMapper.selectGeoms(tableName);
-        if (StringUtils.isNotBlank(geomsStr)) {
-            list = Arrays.asList(geomsStr.split("\\|"));
-        }
-        return list;
-    }
-
-
-    /**
-     * 这里需要开启事务
-     * 数据全量入库
-     *
-     * @param tableName
-     * @param theValueList
-     * @return
-     */
-    @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
-    public Boolean fullDataStorage(String tableName, List<Map<String, Object>> theValueList) {
-        boolean addRes = false;
-        Integer shpDbSRID = 4326;
-        if (!CollectionUtils.isEmpty(theValueList)) {
-            //先删除数据
-            cadastreFileMapper.deleteByValidFlag("1", tableName);
-            //先把当前版本都修改为历史版本
-            cadastreFileMapper.updateValidFlag("1", "0", tableName);
-            for (Map<String, Object> map : theValueList) {
-//                Collection<Object> values = map.values();
-//                Collection<String> keys = map.keySet();
-                map.put("valid_flag", 0);//有效数据标识
-                cadastreFileMapper.insertTableData(tableName, map, shpDbSRID);
-            }
-        }
-        return addRes;
-    }
-
-
-    /**
-     * 判断两个Map中的数据是否完全一致(排除geom字段的比较方式,或根据业务需求处理)
-     */
-    private boolean isSameData(Map<String, Object> map1, Map<String, Object> map2) {
-        if (map1 == map2) return true;
-        if (map1 == null || map2 == null) return false;
-
-        // 比较两个map的交集字段(排除valid_flag)
-        Set<String> keys1 = new HashSet<>(map1.keySet());
-        Set<String> keys2 = new HashSet<>(map2.keySet());
-        keys1.retainAll(keys2); // 取交集
-        if (keys1.isEmpty()) return false;
-
-        for (String field : keys1) {
-            if ("valid_flag".equalsIgnoreCase(field)) {
-                continue; // 忽略版本标识
-            }
-            Object val1 = map1.get(field);
-            Object val2 = map2.get(field);
-
-            if (val1 == null && val2 == null) continue;
-            if (val1 == null || val2 == null) return false;
-
-            // 特殊处理geom字段:以字符串比较,去掉空白
-            if ("geom".equalsIgnoreCase(field)) {
-                String s1 = String.valueOf(val1).trim();
-                String s2 = String.valueOf(val2).trim();
-                if (!s1.equals(s2)) {
-                    return false;
-                } else {
-                    continue;
-                }
-            }
-
-            // 数值类型比较
-            if (val1 instanceof Number && val2 instanceof Number) {
-                if (Double.compare(((Number) val1).doubleValue(), ((Number) val2).doubleValue()) != 0) {
-                    return false;
-                }
-                continue;
-            }
-
-            // 尝试将字符串数字与数字类型做比较(例如数据库返回Integer/String混合)
-            if (val1 instanceof Number && val2 instanceof String) {
-                try {
-                    double d2 = Double.parseDouble(((String) val2).trim());
-                    if (Double.compare(((Number) val1).doubleValue(), d2) != 0) return false;
-                    else continue;
-                } catch (Exception ignored) {
-                    // fallthrough to string compare
-                }
-            }
-            if (val2 instanceof Number && val1 instanceof String) {
-                try {
-                    double d1 = Double.parseDouble(((String) val1).trim());
-                    if (Double.compare(((Number) val2).doubleValue(), d1) != 0) return false;
-                    else continue;
-                } catch (Exception ignored) {
-                    // fallthrough to string compare
-                }
-            }
-
-            // 默认字符串比较(去除首尾空白)
-            if (!String.valueOf(val1).trim().equals(String.valueOf(val2).trim())) {
-                return false;
-            }
-        }
-
-        return true;
-    }
-
-
-    /**
-     * 这里需要开启事务
-     * 数据增量入库
-     *
-     * @param tableName
-     * @param theValueList
-     * @return
-     */
-    @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
-    public Boolean incrementDataStorage(String tableName, List<Map<String, Object>> theValueList) {
-        /**
-         * 1。查询出当前表所有数据。
-         * 2.修改当前数据的valid_flag为1,表示历史版本
-         * 3.把当前数据和数据库数据进行对比,获取新增数据和修改数据。
-         * 4.新增数据直接插入,修改数据根据主键进行更新。
-         * 任务标识码相同,并且geom数据有相交则认为数据相同。
-         */
-        boolean addRes = false;
-        Integer shpDbSRID = 4326;
-        if (!CollectionUtils.isEmpty(theValueList)) {
-            //先删除数据
-            cadastreFileMapper.deleteByValidFlag("1", tableName);
-            //查询出当前表所有数据。
-            List<Map<String, Object>> dbDataList = cadastreFileMapper.selectTableData("0", tableName);
-            //筛选出需要更新的数据
-            List<Map<String, Object>> dbExistsList = new ArrayList<>();
-            for (Map<String, Object> map : theValueList) {
-                Map<String, Object> dbExistsMap = cadastreFileMapper.selectExistsSameData("0", map, tableName);
-                if (MapUtils.isNotEmpty(dbExistsMap)) {
-                    dbExistsList.add(dbExistsMap);
-                }
-            }
-
-            // 在dbDataList 中找出 dbExistsMap中各个字段完全一致的数据 并从dbDataList移除
-            if (CollectionUtils.isNotEmpty(dbExistsList)) {
-                for (Map<String, Object> dbExistsMap : dbExistsList) {
-                    dbDataList.removeIf(dbData -> isSameData(dbData, dbExistsMap));
-                }
-            }
-
-            //这里合并两个list 最终写入数据表
-            if (CollectionUtils.isNotEmpty(dbDataList)) {
-                theValueList.addAll(dbDataList);
-            }
-
-            //先把当前版本都修改为历史版本
-            cadastreFileMapper.updateValidFlag("1", "0", tableName);
-            for (Map<String, Object> map : theValueList) {
-                map.put("valid_flag", 0);//有效数据标识
-                cadastreFileMapper.insertTableData(tableName, map, shpDbSRID);
-            }
-        }
-        return addRes;
-    }
-
-
-    /**
-     * 获取列表
-     */
-    @Override
-    public Map<String, Object> list(CadastreFileFilterVo cadastreFileFilterVo) {
-        List<CadastreFile> list = cadastreFileMapper.getListByFilter(cadastreFileFilterVo);
-        int count = cadastreFileMapper.getCountByFilter(cadastreFileFilterVo);
-        Map<String, Object> map = new HashMap<>();
-        map.put("rows", list);
-        map.put("total", count);
-        return map;
-    }
-
-    /**
-     * 批量删除
-     */
-    @Override
-    @Transactional(rollbackFor = Exception.class)
-    public void batchDelete(List<String> ids) {
-        if (ids == null || ids.isEmpty()) {
-            throw new IllegalArgumentException("IDs list cannot be null or empty");
-        }
-        cadastreFileMapper.batchDelete(ids);
-    }
-
-    @Override
-    @Transactional(rollbackFor = Exception.class)
-    public void testRun() {
-        //这里批量增修改表结构增加校验字段:
-        String[] arr = new String[]{
-                "tdgy_jh",
-                "tdjyq",
-                "TB_TDGY_SJ",
-                "t_cgzj_cwtc_m",
-                "t_cgzj_cwtc_m_bak1",
-                "t_cgzj_cwtc_m_copy1",
-                "public_dict",
-                "spatial_ref_sys"
-        };
-
-        //获取库中表名
-        //List<String> allTableList = cadastreFileMapper.selectAllTable();
-        List<String> allTableList = cadastreFileMapper.selectAllTableNoView();
-        allTableList.removeAll(Arrays.asList(arr));
-
-        // 对每个表名执行添加校验字段的操作
-        for (String tableName : allTableList) {
-            System.out.println("正在处理表: " + tableName);
-            cadastreFileMapper.addValidFlagColumn(tableName);
-            System.out.println("正在处理表: " + tableName + " 完成");
-        }
-    }
-
-    @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
-    @Override
-    public String backToOldData(String uploadId) {
-        try {
-            CadastreFile cadastreFile = cadastreFileMapper.get(uploadId);
-            if (!"1".equals(cadastreFile.getStatus())) {
-                throw new ServiceException("可能未入库成功,无法回退");
-            }
-
-            List<String> fileTableNameList = new ArrayList<>();
-            if ("1".equals(cadastreFile.getFileType())) {//矢量数据
-                fileTableNameList = getLayerNameList(uploadId);
-            } else if ("2".equals(cadastreFile.getFileType())) { //表格数据
-                fileTableNameList = getMdbTableNameList(uploadId);
-            }
-
-            for (String layerName : fileTableNameList) {
-                //校验是否都有历史版本
-                Integer count = cadastreFileMapper.countByValidFlag("1", layerName.toLowerCase(Locale.ROOT));
-                if (count == 0) {
-                    throw new ServiceException("表" + layerName + "没有历史版本,无法回退");
-                }
-            }
-
-            for (String layerName : fileTableNameList) {
-
-                cadastreFileMapper.deleteByValidFlag("0", layerName.toLowerCase(Locale.ROOT));
-                cadastreFileMapper.updateValidFlag("0", "1", layerName.toLowerCase(Locale.ROOT));
-                log.info("正在回退表:{}。。。", layerName);
-            }
-        } catch (Exception e) {
-            log.error("数据回退异常,uploadId: {}", uploadId, e);
-            throw new ServiceException("数据回退异常," + e.getMessage());
-        }
-
-//        //成功则更新状态
-//        CadastreFile updateCadastreFile = new CadastreFile();
-//        updateCadastreFile.setId(uploadId);
-//        updateCadastreFile.setStatus("4");//已经回退
-//        updateCadastreFile.setReadMessage("已经回退");//校验通过
-//        cadastreFileMapper.update(updateCadastreFile);
-        return "当前批次数据已回退到上一个版本!:" + uploadId;
-    }
-
-
-    /**
-     * 获取图层名称列表
-     *
-     * @param uploadId
-     * @return
-     */
-    public List<String> getLayerNameList(String uploadId) {
-        List<String> nameList = new ArrayList<>();
-        CadastreFile cadastreFile = cadastreFileMapper.get(uploadId);
-        String gdbPath = cadastreFile.getUnzipPath();
-        DataSource ds = ogr.Open(gdbPath + "/" + cadastreFile.getName(), 0); // 0 = 只读
-        if (ds == null) {
-            throw new ServiceException("无法打开 gdb");
-        }
-        //这里进行遍历每个图层
-        for (int i = 0; i < ds.GetLayerCount(); i++) {
-            Layer layer = ds.GetLayer(i);
-            String layerName = layer.GetName();
-            nameList.add(layerName);
-        }
-        return nameList;
-    }
-
-
-    /**
-     *
-     * 获取mdb文件中表名称
-     *
-     * @param uploadId
-     * @return
-     */
-    public List<String> getMdbTableNameList(String uploadId) throws Exception {
-        List<String> nameList = new ArrayList<>();
-        CadastreFile cadastreFile = cadastreFileMapper.get(uploadId);
-        String gdbPath = cadastreFile.getUnzipPath();
-        List<Map<String, Object>> allMdbTableList = MdbUtil.MdbTables(gdbPath + "/" + cadastreFile.getName(), "", "");
-        for (Map<String, Object> tableMap : allMdbTableList) {
-            String talbleName = String.valueOf(tableMap.get("name"));
-            nameList.add(talbleName);
-        }
-        return nameList;
-    }
-
-    //1.获取图层中所有数据
-    //2.获取库中所有数据
-    //3.进行对比返回
-    @Override
-    public List<LayerAndDbData> getLayerData(String uploadId) {
-        List<LayerAndDbData> resList = new ArrayList<>();
-        try {
-            CadastreFile cadastreFile = cadastreFileMapper.get(uploadId);
-            //这里判断是否校验通过
-            if (!cadastreFile.getStatus().equalsIgnoreCase("3")) {
-                log.info("校验未通过,不能入库");
-                throw new ServiceException("校验未通过,不能入库");
-            }
-            String gdbPath = cadastreFile.getUnzipPath();
-            DataSource ds = ogr.Open(gdbPath + "/" + cadastreFile.getName(), 0); // 0 = 只读
-            if (ds == null) {
-                log.warn("无法打开 gdb");
-                throw new ServiceException("无法打开 gdb");
-            }
-            //这里进行遍历每个图层
-            for (int i = 0; i < ds.GetLayerCount(); i++) {
-                Layer layer = ds.GetLayer(i);
-                String layerName = layer.GetName();
-                LayerAndDbData layerAndDbData = new LayerAndDbData();
-                layerAndDbData.setCurrentTableName(layerName);
-
-                boolean haveGeom = false;//这里不需要geom信息
-                List<Map<String, String>> dbFieldNameAndTypeList = cadastreFileMapper.selectTableCollumAndType(layerName.toLowerCase(Locale.ROOT));
-                Map<String, String> dbFieldNameAndTypeMap = dbFieldNameAndTypeList.stream().collect(Collectors.toMap(
-                        s -> s.get("column_name"),
-                        s -> s.get("data_type"),
-                        (existing, replacement) -> existing // 如果有重复键,保留第一个值
-                ));
-                List<Map<String, Object>> theValueList = getValueList(layer, dbFieldNameAndTypeMap, haveGeom);
-                List<Map<String, Object>> dbDataList = cadastreFileMapper.selectTableData("0", layerName);
-
-                layerAndDbData.setAddTotalNum(theValueList.size());
-                layerAndDbData.setInsertNum(theValueList.size());
-                layerAndDbData.setMarkHistoryNum(dbDataList.size());
-                layerAndDbData.setInsertDataList(theValueList);
-                layerAndDbData.setMarkHistoryDataList(dbDataList);
-                resList.add(layerAndDbData);
-            }
-        } catch (Exception e) {
-            log.error("矢量数据入库异常,uploadId: {}", uploadId, e);
-            throw new ServiceException("矢量数据入库异常," + e.getMessage());
-        }
-
-        return resList;
-    }
-
-
-    /**
-     * 获取表格数据进行对比
-     *
-     * @param uploadId
-     * @return
-     */
-    @Override
-    public List<LayerAndDbData> getMdbPropertyData(String uploadId) {
-        List<LayerAndDbData> resList = new ArrayList<>();
-        try {
-            CadastreFile cadastreFile = cadastreFileMapper.get(uploadId);
-            //这里判断是否校验通过
-            if (!cadastreFile.getStatus().equalsIgnoreCase("3")) {
-                log.info("校验未通过,不能入库");
-                throw new ServiceException("校验未通过,不能入库");
-            }
-            String gdbPath = cadastreFile.getUnzipPath();
-            List<Map<String, Object>> allMdbTableList = MdbUtil.MdbTables(gdbPath + "/" + cadastreFile.getName(), "", "");
-
-            for (Map<String, Object> tableMap : allMdbTableList) {
-                String talbleName = String.valueOf(tableMap.get("name"));
-                LayerAndDbData layerAndDbData = new LayerAndDbData();
-                layerAndDbData.setCurrentTableName(talbleName);
-
-                Map<String, Object> allMdbTableFieldMap = MdbUtil.MdbTableContent(gdbPath + "/" + cadastreFile.getName(), talbleName, "", "", 1, 1000);
-                List<Map<String, Object>> theValueList = (List<Map<String, Object>>) allMdbTableFieldMap.get("rows");
-                List<Map<String, Object>> dbDataList = cadastreFileMapper.selectTableData("0", talbleName);
-
-                layerAndDbData.setAddTotalNum(theValueList.size());
-                layerAndDbData.setInsertNum(theValueList.size());
-                layerAndDbData.setMarkHistoryNum(dbDataList.size());
-                layerAndDbData.setInsertDataList(theValueList);
-                layerAndDbData.setMarkHistoryDataList(dbDataList);
-                resList.add(layerAndDbData);
-            }
-        } catch (Exception e) {
-            log.error("矢量数据入库异常,uploadId: {}", uploadId, e);
-            throw new ServiceException("矢量数据入库异常," + e.getMessage());
-        }
-        return resList;
-    }
-
-
-    @Override
-    public List<MdbAndDbData> getMdbCompareData(String uploadId) {
-        List<MdbAndDbData> resList = new ArrayList<>();
-        try {
-            CadastreFile cadastreFile = cadastreFileMapper.get(uploadId);
-            //这里判断是否校验通过
-            if (!cadastreFile.getStatus().equalsIgnoreCase("3")) {
-                log.info("校验未通过,不能入库");
-                throw new ServiceException("校验未通过,不能入库");
-            }
-            String gdbPath = cadastreFile.getUnzipPath();
-            List<Map<String, Object>> allMdbTableList = MdbUtil.MdbTables(gdbPath + "/" + cadastreFile.getName(), "", "");
-
-            for (Map<String, Object> tableMap : allMdbTableList) {
-                String talbleName = String.valueOf(tableMap.get("name"));
-                MdbAndDbData mdbAndDbData = new MdbAndDbData();
-                mdbAndDbData.setCurrentTableName(talbleName);
-                List<Map<String, String>> dbFieldNameAndTypeList = cadastreFileMapper.selectTableCollumAndType(talbleName.toLowerCase(Locale.ROOT));
-                Map<String, String> dbFieldNameAndTypeMap = dbFieldNameAndTypeList.stream().collect(Collectors.toMap(
-                        s -> s.get("column_name"),
-                        s -> s.get("data_type"),
-                        (existing, replacement) -> existing // 如果有重复键,保留第一个值
-                ));
-
-                Map<String, Object> allMdbTableFieldMap = MdbUtil.MdbTableContent(gdbPath + "/" + cadastreFile.getName(), talbleName, "", "", 1, 1000);
-                List<Map<String, Object>> theValueList = (List<Map<String, Object>>) allMdbTableFieldMap.get("rows");
-                List<Map<String, Object>> dbDataList = cadastreFileMapper.selectTableData("0", talbleName);
-
-                //这里进行遍历dbDataList,判断是否存在bsm字段,且bsm字段是否存在于theValueList中
-                Set<String> mdbBsmSet = theValueList.stream()
-                        .map(v -> v.get("bsm".toUpperCase(Locale.ROOT)))
-                        .filter(bsm -> bsm != null)
-                        .map(String::valueOf)
-                        .collect(Collectors.toSet());
-
-                dbDataList.stream()
-                        .filter(dbData -> {
-                            Object bsmObj = dbData.get("bsm");
-                            return bsmObj != null && mdbBsmSet.contains(String.valueOf(bsmObj));
-                        })
-                        .forEach(dbData -> dbData.put("valid_flag", 100));
-
-                mdbAndDbData.setMdbFileDataList(theValueList);
-                mdbAndDbData.setDbDataList(dbDataList);
-                resList.add(mdbAndDbData);
-            }
-        } catch (Exception e) {
-            log.error("获取mdb对比数据异常,uploadId: {}", uploadId, e);
-            throw new ServiceException("获取mdb对比数据异常," + e.getMessage());
-        }
-        return resList;
-    }
-
-    @Override
-    public List<Map<String,Object>> selectTableRow(String tableName,String geomFlag,String bsm,String ywh) {
-        String validFlag = "0";
-        if(Arrays.asList("tf_500", "tf_1000", "tf_2000","zd_shp").contains(tableName)){
-            validFlag = "";
-        }
-        if(StringUtils.isNotEmpty(bsm)){
-            bsm = bsm.trim();
-        }
-        if(StringUtils.isNotEmpty(ywh)){
-            ywh = ywh.trim();
-        }
-        if (ywh.matches(".*=\\d+")) {
-            ywh = ywh.replaceAll("=(\\d+)", "='$1'");
-        }
-        List<Map<String,Object>> res = cadastreFileMapper.selectTableDataByCondition(validFlag,tableName,bsm,ywh);
-        if(CollectionUtils.isNotEmpty(res)){ //去掉geom字段和valid_flag字段
-            List<Map<String, String>> dbFieldNameAndTypeList = cadastreFileMapper.selectTableCollumAndType(tableName.toLowerCase(Locale.ROOT));
-            List<Object> filterCollumList =  dbFieldNameAndTypeList.stream().filter(s->s.get("data_type").equals("bytea")).map(s->s.get("column_name")).collect(Collectors.toList());
-            filterCollumList.add("valid_flag");
-            //res.forEach(m -> m.keySet().removeIf(k -> "valid_flag".equalsIgnoreCase(k)));
-            res.forEach(m -> m.keySet().removeIf(filterCollumList::contains));
-            if("0".equals(geomFlag)){
-                res.forEach(m -> m.keySet().removeIf("geom"::equalsIgnoreCase));
-            }
-           res.forEach(s -> {
-                if(s.get("geom") != null){
-                    WKBReader reader = new WKBReader();
-                    org.locationtech.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 List<String> getTableFields(String tableName) {
-        List<String> res = cadastreFileMapper.selectTableCollum(tableName);
-        res.remove("valid_flag");
-        res.remove("geom");
-        return res;
-    }
-
-    @Override
-    public List<String> getDistinctValueByField(String tableName,String fieldName) {
-        List<String> res = new ArrayList<>();
-        String validFlag =null;
-        List<String> collumList = cadastreFileMapper.selectTableCollum(tableName);
-        if(!collumList.contains(fieldName)){
-            return res;
-        }
-        if(collumList.contains("valid_flag")){
-            validFlag = "0";
-        }
-        res = cadastreFileMapper.selectDistinctValueByField(tableName,fieldName,validFlag);
-        return res;
-    }
-
-
-    @Override
-    public String tableRowUpdate(String tableName, List<Map<String,Object>> list) {
-        for (Map<String, Object> row : list) {
-            row.replaceAll((k, v) -> {
-                if (v instanceof String) {
-                    String sv = (String) v;
-                    try {
-                        return new java.math.BigDecimal(sv);
-                    } catch (NumberFormatException e) {
-                        return v;
-                    }
-                }
-                return v;
-            });
-        }
-         int res = cadastreFileMapper.batchUpdateByBsm(tableName,list);
-        return res+"";
-    }
-
-    @Override
-    public String batchDeleteByBsm(String tableName, List<Map<String,Object>> list) {
-         int res = cadastreFileMapper.batchDeleteByBsm(tableName,list);
-        return res+"";
-    }
-
-
-    @Override
-    public List<Map<String, Object>> getDataByName(String tableName) {
-        Map<String, Object> map = cadastreFileMapper.selectTableDataByBsm(tableName, "");
-        List<Map<String, Object>> list = new ArrayList<>();
-        list.add(map);
-        return list;
-    }
-
-    @Override
-    public List<Map<String, Object>> selectTableRowExcel(String tableName, String geomFlag, List<Object> bsmList, List<String> ywhList) {
-        List<Map<String, Object>> res = cadastreFileMapper.selectTableRowExcel(tableName, geomFlag, bsmList, ywhList);
-        if(CollectionUtils.isNotEmpty(res)) { //去掉geom字段和valid_flag字段
-            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)));
-            }
-        }
-        return res;
-    }
-
-
-    @Override
-    public Boolean checkQueryWhere(String tableName, String queryWhere) {
-        try {
-            if (queryWhere.matches(".*=\\d+")) {
-                queryWhere = queryWhere.replaceAll("=(\\d+)", "='$1'");
-            }
-            String res  = cadastreFileMapper.checkQueryWhere(tableName, queryWhere);
-            log.info("SQL语法检查结果,res: {}", res);
-            return true;
-        } catch (Exception e) {
-            throw new ServiceException("SQL语法检查异常:");
-        }
-    }
-
-
-    /**
-     *
-     * 生成一个mdb文件
-     *
-     * @param tableName
-     * @param filePath
-     * @param fileName
-     */
-    @Override
-    public void testBuildMdbFile(String tableName, String filePath, String fileName) {
-        try {
-            // 1. 获取表字段及类型信息
-            List<Map<String, String>> columns = cadastreFileMapper.selectTableCollumAndType(tableName);
-            if (columns == null || columns.isEmpty()) {
-                log.warn("无法获取表字段信息: {}", tableName);
-                throw new ServiceException("无法获取表字段信息: "+tableName);
-            }
-
-            if(columns.stream().anyMatch(s->s.get("column_name").equals("geom"))){
-                log.warn("当前为矢量数据,无法生成mdb: {}", tableName);
-                throw new ServiceException("当前为矢量数据,无法生成mdb");
-            }
-
-            // 2. 获取表数据 (获取 valid_flag 为 0 的当前版本数据)
-            List<Map<String, Object>> dataList = cadastreFileMapper.selectTableData("", tableName);
-
-            // 3. 构造完整的文件路径
-            String mdbPath = filePath;
-            if (!mdbPath.endsWith(File.separator)) {
-                mdbPath += File.separator;
-            }
-            mdbPath += fileName;
-            if (!mdbPath.toLowerCase().endsWith(".mdb")) {
-                mdbPath += ".mdb";
-            }
-
-            // 4. 调用工具类生成 MDB 文件并写入数据
-            MdbUtil.writeMdbByTable(mdbPath, tableName, columns, dataList);
-
-            log.info("MDB 文件生成成功: {}", mdbPath);
-        } catch (Exception e) {
-            log.error("生成 MDB 文件失败: {}", tableName, e);
-            throw new ServiceException("生成 MDB 文件失败: " + e.getMessage());
-        }
-    }
-
-
-    /**
-     * 4527坐标系转换为4326坐标系
-     * @param ewkt
-     * @return
-     */
-    private String  transforGeomTo4326(String ewkt) {
-        if(StringUtils.isBlank(ewkt)){
-            return "";
-        }
-        return cadastreFileMapper.transformTo4326(ewkt);
-    }
-
-
-
-
-
-
-}
+//package com.siwei.apply.service.cadastre.impl;
+//
+//import com.siwei.apply.domain.CadastreFile;
+//import com.siwei.apply.domain.LayerAndDbData;
+//import com.siwei.apply.domain.MdbAndDbData;
+//import com.siwei.apply.domain.vo.*;
+//import com.siwei.apply.mapper.CadastreFileMapper;
+//import com.siwei.apply.mapper.FzssFxrwrzMapper;
+//import com.siwei.apply.service.cadastre.CadastreManageService;
+//
+//import com.siwei.apply.utils.FileExtractUtil;
+//import com.siwei.apply.utils.MdbUtil;
+//import com.siwei.common.core.exception.ServiceException;
+//import lombok.extern.slf4j.Slf4j;
+//import org.apache.commons.collections4.CollectionUtils;
+//import org.apache.commons.collections4.MapUtils;
+//import org.apache.commons.lang3.StringUtils;
+//import org.gdal.ogr.*;
+//import org.gdal.osr.CoordinateTransformation;
+//import org.gdal.osr.SpatialReference;
+//import org.locationtech.jts.io.ParseException;
+//import org.locationtech.jts.io.WKBReader;
+//import org.locationtech.jts.io.WKTWriter;
+//import org.springframework.beans.factory.annotation.Autowired;
+//import org.springframework.stereotype.Service;
+//import org.springframework.transaction.annotation.Propagation;
+//import org.springframework.transaction.annotation.Transactional;
+//
+//import java.io.File;
+//import java.nio.file.Files;
+//import java.nio.file.Path;
+//import java.nio.file.Paths;
+//import java.util.*;
+//import java.util.stream.Collectors;
+//
+//
+///**
+// * 地籍管理系统主业务逻辑
+// */
+//@Slf4j
+//@Service
+//public class CadastreManageServiceImpl implements CadastreManageService {
+//    static {
+//        ogr.RegisterAll();
+//    }
+//
+//    @Autowired
+//    private CadastreFileMapper cadastreFileMapper;
+//
+//    @Autowired
+//    private FzssFxrwrzHandleService fzssFxrwrzHandleService;
+//
+//    @Autowired
+//    private FzssFxrwrzMapper fzssFxrwrzMapper;
+//
+//
+//    /**
+//     *
+//     * 解析文件内容,insert 到表中
+//     * <p>
+//     * <p>
+//     * 1.进行解析数据成为list<map></map>
+//     * 2.进行调用方法动态插入到当前表中
+//     * 3.需要修改upload 的表更新状态
+//     * 4.考虑增量入库还是全量入库。()
+//     * 5.校验逻辑复杂()
+//     *
+//     */
+//    @Transactional(rollbackFor = Exception.class)
+//    @Override
+//    public String addBatchGdbData(String uploadId) {
+//        String result = "success";
+//        try {
+//            CadastreFile cadastreFile = cadastreFileMapper.get(uploadId);
+//            //这里判断是否校验通过
+//            if (!cadastreFile.getStatus().equalsIgnoreCase("3")) {
+//                log.info("校验未通过,不能入库");
+//                result = "校验未通过,不能入库";
+//                fzssFxrwrzHandleService.insertFxrwrz(uploadId, "地籍库管理", result, "info");
+//                return result;
+//            }
+//
+//            String gdbPath = cadastreFile.getUnzipPath();
+//            DataSource ds = ogr.Open(gdbPath + "/" + cadastreFile.getName(), 0); // 0 = 只读
+//            if (ds == null) {
+//                log.warn("无法打开 gdb");
+//                result = "无法打开gdb文件,不能入库";
+//                fzssFxrwrzHandleService.insertFxrwrz(uploadId, "地籍库管理", result, "info");
+//                return result;
+//            }
+//
+//            fzssFxrwrzHandleService.insertFxrwrz(uploadId, "地籍库管理", "正在执行入库操作。。。", "info");
+//            //这里进行遍历每个图层
+//            for (int i = 0; i < ds.GetLayerCount(); i++) {
+//                Layer layer = ds.GetLayer(i);
+//                String layerName = layer.GetName();
+//
+//                boolean haveGeom = false;
+//                //获取字段信息
+//                List<String> dbFieldNameList = cadastreFileMapper.selectTableCollum(layerName.toLowerCase(Locale.ROOT));
+//                if (dbFieldNameList.contains("geom")) {
+//                    haveGeom = true;
+//                }
+//
+//                List<Map<String, String>> dbFieldNameAndTypeList = cadastreFileMapper.selectTableCollumAndType(layerName.toLowerCase(Locale.ROOT));
+//                Map<String, String> dbFieldNameAndTypeMap = dbFieldNameAndTypeList.stream().collect(Collectors.toMap(
+//                        s -> s.get("column_name"),
+//                        s -> s.get("data_type"),
+//                        (existing, replacement) -> existing // 如果有重复键,保留第一个值
+//                ));
+//                List<Map<String, Object>> theValueList = getValueList(layer, dbFieldNameAndTypeMap, haveGeom);
+//                fzssFxrwrzHandleService.insertFxrwrz(uploadId, "地籍库管理", "正在执行-" + layerName + "-入库", "info");
+//                //这里直接数据入库,区分增量或者全量
+//                Boolean addRes;
+//                if ("2".equalsIgnoreCase(cadastreFile.getReadStatus())) {
+//                    //增量更新
+//                    addRes = incrementDataStorage(layerName, theValueList);
+//                    if (addRes.equals(true)) {
+//                        fzssFxrwrzHandleService.insertFxrwrz(uploadId, "地籍库管理", "增量更新-" + layerName + "-成功", "info");
+//                    }
+//                } else {
+//                    addRes = fullDataStorage(layerName, theValueList);
+//                    if (addRes.equals(true)) {
+//                        fzssFxrwrzHandleService.insertFxrwrz(uploadId, "地籍库管理", "增量更新-" + layerName + "-成功", "info");
+//                    }
+//                }
+//                log.error("当前图层{},入库结果 {}", layerName, addRes);
+//            }
+//            //成功则更新状态
+//            CadastreFile updateCadastreFile = new CadastreFile();
+//            updateCadastreFile.setId(cadastreFile.getId());
+//            updateCadastreFile.setStatus("1");//入库成功
+//            updateCadastreFile.setReadMessage("入库成功");//入库成功
+//            cadastreFileMapper.update(updateCadastreFile);
+//            fzssFxrwrzHandleService.insertFxrwrz(uploadId, "地籍库管理", "当前批次-" + cadastreFile.getId() + "-入库成功", "info");
+//        } catch (Exception e) {
+//            log.error("矢量数据入库异常,uploadId: {}", uploadId, e);
+//            //更新状态
+//            CadastreFile updateCadastreFile = new CadastreFile();
+//            updateCadastreFile.setId(uploadId);
+//            updateCadastreFile.setStatus("2");//入库失败
+//            updateCadastreFile.setReadMessage("入库失败");//入库失败
+//            cadastreFileMapper.update(updateCadastreFile);
+//            fzssFxrwrzHandleService.insertFxrwrz(uploadId, "地籍库管理", "当前批次-" + uploadId + "-入库失败", "info");
+//            throw new ServiceException("矢量数据入库异常," + e.getMessage());
+//        }
+//        return result;
+//    }
+//
+//
+//    @Transactional(rollbackFor = Exception.class)
+//    @Override
+//    public String addBatchMdbData(String uploadId) {
+//        String result = "success";
+//        try {
+//            CadastreFile cadastreFile = cadastreFileMapper.get(uploadId);
+//            //这里判断是否校验通过
+//            if (!cadastreFile.getStatus().equalsIgnoreCase("3")) {
+//                log.info("校验未通过,不能入库");
+//                result = "校验未通过,不能入库";
+//                fzssFxrwrzHandleService.insertFxrwrz(uploadId, "地籍库管理", result, "info");
+//                return result;
+//            }
+//
+//            String gdbPath = cadastreFile.getUnzipPath();
+//            List<Map<String, Object>> allMdbTableList = MdbUtil.MdbTables(gdbPath + "/" + cadastreFile.getName(), "", "");
+//
+//            if (allMdbTableList == null) {
+//                log.warn("无法打开 mdb");
+//                result = "无法打开mdb文件,不能入库";
+//                fzssFxrwrzHandleService.insertFxrwrz(uploadId, "地籍库管理", result, "info");
+//                return result;
+//            }
+//
+//            fzssFxrwrzHandleService.insertFxrwrz(uploadId, "地籍库管理", "正在执行入库操作。。。", "info");
+//            for (Map<String, Object> tableMap : allMdbTableList) {
+//                String talbleName = String.valueOf(tableMap.get("name"));
+//                //List<Map<String, Object>> theValueList = getValueList(layer, dbFieldNameAndTypeMap, haveGeom);
+//                Map<String, Object> allMdbTableFieldMap = MdbUtil.MdbTableContent(gdbPath + "/" + cadastreFile.getName(), talbleName, "", "", 1, 1000);
+//                List<Map<String, Object>> theValueList = (List<Map<String, Object>>) allMdbTableFieldMap.get("rows");
+//
+//                fzssFxrwrzHandleService.insertFxrwrz(uploadId, "地籍库管理", "正在执行-" + talbleName + "-入库", "info");
+//                //这里直接数据入库,区分增量或者全量
+//                Boolean addRes;
+//                if ("2".equalsIgnoreCase(cadastreFile.getReadStatus())) {
+//                    //增量更新
+//                    addRes = incrementDataStorage(talbleName, theValueList);
+//                    if (addRes.equals(true)) {
+//                        fzssFxrwrzHandleService.insertFxrwrz(uploadId, "地籍库管理", "增量更新-" + talbleName + "-成功", "info");
+//                    }
+//                } else {
+//                    addRes = fullDataStorage(talbleName, theValueList);
+//                    if (addRes.equals(true)) {
+//                        fzssFxrwrzHandleService.insertFxrwrz(uploadId, "地籍库管理", "全量更新-" + talbleName + "-成功", "info");
+//                    }
+//                }
+//                log.error("当前属性名{},入库结果 {}", talbleName, addRes);
+//            }
+//            //成功则更新状态
+//            CadastreFile updateCadastreFile = new CadastreFile();
+//            updateCadastreFile.setId(cadastreFile.getId());
+//            updateCadastreFile.setStatus("1");//入库成功
+//            updateCadastreFile.setReadMessage("入库成功");//入库成功
+//            cadastreFileMapper.update(updateCadastreFile);
+//            fzssFxrwrzHandleService.insertFxrwrz(uploadId, "地籍库管理", "当前批次-" + cadastreFile.getId() + "-入库成功", "info");
+//        } catch (Exception e) {
+//            log.error("mdb表格数据入库异常,uploadId: {}", uploadId, e);
+//            //更新状态
+//            CadastreFile updateCadastreFile = new CadastreFile();
+//            updateCadastreFile.setId(uploadId);
+//            updateCadastreFile.setStatus("2");//入库失败
+//            updateCadastreFile.setReadMessage("入库失败");//入库失败
+//            cadastreFileMapper.update(updateCadastreFile);
+//            fzssFxrwrzHandleService.insertFxrwrz(uploadId, "地籍库管理", "当前批次-" + uploadId + "-入库失败", "info");
+//            throw new ServiceException("表格数据入库异常," + e.getMessage());
+//        }
+//        return result;
+//    }
+//
+//
+//    /**
+//     * 获取比较数据
+//     *
+//     * @param uploadId
+//     * @return
+//     */
+//    @Override
+//    public CompareResultVo getCompareData(String uploadId) {
+//        CompareResultVo compareResultVo = new CompareResultVo();
+//        compareResultVo.setUploadId(uploadId);
+//        compareResultVo.setResultStatus(true);
+//        try {
+//            List<CompareGemoVo> gemos = new ArrayList<>();
+//            CadastreFile cadastreFile = cadastreFileMapper.get(uploadId);
+//            String gdbPath = cadastreFile.getUnzipPath();
+//            DataSource ds = ogr.Open(gdbPath + "/" + cadastreFile.getName(), 0); // 0 = 只读
+//            if (ds == null) {
+//                log.warn("无法打开 gdb");
+//                return compareResultVo;
+//            }
+//            //这里进行遍历每个图层
+//            for (int i = 0; i < ds.GetLayerCount(); i++) {
+//                Layer layer = ds.GetLayer(i);
+//                String layerName = layer.GetName();
+//
+//                CompareGemoVo compareGemoVo = new CompareGemoVo();
+//                compareGemoVo.setLayerName(layerName);
+//                List<String> layerGeom = getLayerGeom(layer);
+//                compareGemoVo.setGeomData(layerGeom);
+//                List<String> dbGeom = getDbGeom(layerName);
+//                compareGemoVo.setOldGeomData(dbGeom);
+//                //加入当前图层对比对象
+//                gemos.add(compareGemoVo);
+//            }
+//            compareResultVo.setGemos(gemos);
+//        } catch (Exception e) {
+//            log.error("获取对比矢量数据信息异常,uploadId: {}", uploadId, e);
+//            throw new ServiceException("获取对比矢量数据信息异常," + e.getMessage());
+//        }
+//        return compareResultVo;
+//    }
+//
+//
+//    /**
+//     * 文件upload入库
+//     *
+//     * @param theFileName
+//     * @param theFilePath
+//     * @param fileType
+//     * @return
+//     */
+//    @Override
+//    public CadastreFile saveUploadFile(String theFileName, String theFilePath, String fileType, String updateType) {
+//        try {
+//            if (theFilePath == null || theFilePath.trim().isEmpty()) {
+//                log.warn("处理文件失败:filePath不能为空");
+//                return null;
+//            }
+//            Path currentFilePath = Paths.get(theFilePath);
+//            if (!Files.exists(currentFilePath)) {
+//                log.warn("处理文件失败:文件不存在: {}", theFilePath);
+//                return null;
+//            }
+//            Long fileSize = Files.size(currentFilePath);
+//
+//            // 判断是否为压缩文件
+//            if (FileExtractUtil.isCompressedFile(theFilePath)) {
+//                // 解压文件到同名文件夹并获取目录结构
+//                String extractRes = FileExtractUtil.extractToSameNameFolder(theFilePath);
+//                if (StringUtils.isBlank(extractRes)) {
+//                    log.warn("解压文件失败:文件不存在: {}", theFilePath);
+//                    throw new ServiceException("解压文件失败:文件不存在,");
+//                }
+//
+//                //解压成功文件保存
+//                if (StringUtils.isNotBlank(extractRes)) {
+//                    String unZipPath = extractRes;
+//                    if ("1".equals(fileType)) { //gdb格式
+//                        String innerExtractFileName = FileExtractUtil.getInnerFolderByDirName(unZipPath);
+//                        // 如果解压后的文件夹名称不为空,则使用解压后的文件夹名称作为文件名
+//                        if (StringUtils.isNotBlank(innerExtractFileName)) {
+//                            theFileName = innerExtractFileName;
+//                        } else {
+//                            String suffix = ".gdb"; //需要后缀为.gdb才能被jar包识别为矢量数据进行读取
+//                            //这里解压文件名称作为文件名
+//                            String fileName = currentFilePath.getFileName().toString();
+//                            theFileName = fileName.substring(0, fileName.lastIndexOf('.'));
+//                            theFileName += suffix;
+//
+//                            //如果当前压缩文件为gdb文件,则解压后的文件夹名称需要修改为.gdb结尾
+//                            FileExtractUtil.modifyDirName(unZipPath, unZipPath + suffix);
+//                            unZipPath += suffix;
+//                            unZipPath = unZipPath.replace(theFileName, "");
+//                            if (StringUtils.isNotBlank(unZipPath) && (unZipPath.endsWith("/") || unZipPath.endsWith("\\"))) {
+//                                unZipPath = unZipPath.substring(0, unZipPath.length() - 1);
+//                            }
+//                        }
+//                        if (StringUtils.isNotBlank(theFileName) && !theFileName.toLowerCase(Locale.ROOT).endsWith(".gdb")) {
+//                            throw new ServiceException("文件不是gdb格式矢量数据,请检查重新上传");
+//                        }
+//                    } else if ("2".equals(fileType)) {//如果是mdb文件
+//                        String innerExtractFileName = FileExtractUtil.getInnerFileByDirName(unZipPath);
+//                        if (StringUtils.isBlank(innerExtractFileName)) {
+//                            throw new ServiceException("可能入库失败或没有历史版本,无法回退");
+//                        }
+//                        theFileName = innerExtractFileName;
+//                        if (StringUtils.isNotBlank(theFileName) && !theFileName.toLowerCase(Locale.ROOT).endsWith(".mdb")) {
+//                            throw new ServiceException("文件不是mdb格式表格数据,请检查重新上传");
+//                        }
+//                    }
+//
+//                    CadastreFile cadastreFile = new CadastreFile();
+//                    cadastreFile.generateId();//生成id
+//                    cadastreFile.setName(theFileName);
+//                    cadastreFile.setFilePath(theFilePath);
+//                    cadastreFile.setUnzipPath(unZipPath);
+//                    cadastreFile.setFileType("1");//矢量/表格
+//                    if (StringUtils.isNotBlank(fileType)) {
+//                        cadastreFile.setFileType(fileType);
+//                    }
+//
+//                    //0 为全量更新,1为增量更新
+//                    if (StringUtils.isNotBlank(updateType)) {
+//                        cadastreFile.setReadStatus(updateType);
+//                    }
+//                    cadastreFile.setFileSize(fileSize);
+//                    cadastreFile.setStatus("0");
+//                    cadastreFile.setUploadUser("admin");
+//                    cadastreFile.setUploadTime(new Date());
+//                    cadastreFile.setReadMessage("入库中。。。");
+//                    cadastreFile.setUpdateTime(new Date());
+//                    cadastreFileMapper.add(cadastreFile);
+//                    return cadastreFile;
+//                }
+//            }
+//        } catch (Exception e) {
+//            log.error("处理文件并保存附件信息异常,filePath: {}", theFilePath, e);
+//            throw new ServiceException("处理文件并保存附件信息异常," + e.getMessage());
+//        }
+//        return null;
+//    }
+//
+//    /**
+//     * //1.文件进行解压
+//     * //1.先获取相关信息,进行入库
+//     * //2.日志记录写入
+//     * //3.读取文件进行录入
+//     * //4.质量进行检查
+//     * //日志记录
+//     * //fzssFxrwrzHandleService.insertFxrwrz();
+//     *
+//     * @param theFileName
+//     * @param theFilePath
+//     * @param fileType
+//     * @param updateType
+//     * @return
+//     */
+//    @Override
+//    public CheckInfoResultVo checkFileData(String theFileName, String theFilePath, String fileType, String updateType) {
+//        CheckInfoResultVo checkInfoResult = new CheckInfoResultVo();
+//        checkInfoResult.setResultStatus(true);
+//        List<CheckInfoVo> checkInfoSuccessList = new ArrayList<>();
+//        List<CheckInfoVo> checkInfoFailList = new ArrayList<>();
+//
+//        CadastreFile uploadFile = this.saveUploadFile(theFileName, theFilePath, fileType, updateType);
+//
+//        if (Objects.nonNull(uploadFile)) {
+//            //入库成功
+//            fzssFxrwrzHandleService.insertFxrwrz(uploadFile.getId(), "地籍库管理", "上传文件成功", "info");
+//            checkInfoResult.setUploadId(uploadFile.getId());
+//            String gdbPath = uploadFile.getUnzipPath();
+//            theFileName = uploadFile.getName();//这里需要使用解压处理后的文件名称进行读取
+//            //获取库中表名
+//            List<String> allTableList = cadastreFileMapper.selectAllTable();
+//
+//            //这里区分文件类型,矢量还是表格的读取方式不一样
+//            if (uploadFile.getFileType().equals("1")) { //矢量数据读取方式
+//                DataSource ds = ogr.Open(gdbPath + "/" + theFileName, 0); // 0 = 只读
+//                if (ds == null) {
+//                    log.warn("无法打开 gdb");
+//                    return checkInfoResult;
+//                }
+//                log.info("图层数量: {}", ds.GetLayerCount());
+//                //这里进行遍历每个图层
+//                for (int i = 0; i < ds.GetLayerCount(); i++) {
+//                    Layer layer = ds.GetLayer(i);
+//                    //todo 测试代码
+//                    //这里做质量检查
+//                    CheckInfoVo checkRes = checkLayerInfo(layer, allTableList, uploadFile.getId());
+//                    if (checkRes.getCheckStatus().equals(false)) { //检查出错
+//                        checkInfoFailList.add(checkRes);
+//                        checkInfoResult.setResultStatus(false);
+//                    } else if (checkRes.getCheckStatus().equals(true)) {
+//                        //成功则更新文件上传状态
+//                        CadastreFile cadastreFile = new CadastreFile();
+//                        cadastreFile.setId(uploadFile.getId());
+//                        cadastreFile.setStatus("3");//校验通过
+//                        cadastreFileMapper.update(cadastreFile);
+//                        checkInfoSuccessList.add(checkRes);
+//                    }
+//                }
+//                ds.delete();
+//            } else if (uploadFile.getFileType().equals("2")) {//处理表格类型
+//                try {
+//                    List<Map<String, Object>> allMdbTableList = MdbUtil.MdbTables(gdbPath + "/" + theFileName, "", "");
+//                    if (CollectionUtils.isNotEmpty(allTableList)) {
+//                        for (Map<String, Object> tableMap : allMdbTableList) {
+//                            String talbleName = String.valueOf(tableMap.get("name"));
+//                            Map<String, Object> allMdbTableFieldMap = MdbUtil.MdbTableContent(gdbPath + "/" + theFileName, talbleName, "", "", 1, 1000);
+//                            //这里做质量检查
+//                            CheckInfoVo checkRes = checkMdbInfo(talbleName, allTableList, allMdbTableFieldMap, uploadFile.getId());
+//                            if (checkRes.getCheckStatus().equals(false)) { //检查出错
+//                                checkInfoFailList.add(checkRes);
+//                                checkInfoResult.setResultStatus(false);
+//                            } else if (checkRes.getCheckStatus().equals(true)) {
+//                                //成功则更新文件上传状态
+//                                CadastreFile cadastreFile = new CadastreFile();
+//                                cadastreFile.setId(uploadFile.getId());
+//                                cadastreFile.setStatus("3");//校验通过
+//                                cadastreFileMapper.update(cadastreFile);
+//                                checkInfoSuccessList.add(checkRes);
+//                            }
+//                        }
+//                    }
+//                } catch (Exception e) {
+//                    log.error("表格数据校验异常,uploadId: {}", uploadFile.getId(), e);
+//                    throw new ServiceException("表格数据校验异常,uploadId:" + uploadFile.getId());
+//                }
+//            }
+//            checkInfoResult.setCheckFailList(checkInfoFailList);
+//            checkInfoResult.setCheckSuccessList(checkInfoSuccessList);
+//        }
+//        return checkInfoResult;
+//    }
+//
+//
+//    /**
+//     * 对每个图层进行数据格式校验
+//     *
+//     * @param layer
+//     * @param allTableList
+//     * @return
+//     */
+//    private CheckInfoVo checkLayerInfo(Layer layer, List<String> allTableList, String uploadId) {
+//        //总返回对象
+//        CheckInfoVo checkInfoVo = new CheckInfoVo();
+//        checkInfoVo.setCheckStatus(true);//初始化检查通过
+//
+//        List<String> checkInfoList = new ArrayList<>();
+//        String name = layer.GetName();
+//        checkInfoVo.setUploadFileTableName(name);
+//
+//        //检查表名对应
+//        if (!allTableList.contains(name.toLowerCase(Locale.ROOT))) {
+//            checkInfoList.add(name + ":图层名称不在地籍库范围内!");
+//            fzssFxrwrzHandleService.insertFxrwrz(uploadId, "地籍库管理", name + ":图层名称不在地籍库范围内!", "info");
+//            checkInfoVo.setCheckStatus(false);
+//        }
+//
+//        //检查坐标系
+//        if (checkCoordinateSystem(layer).equals(false)) {
+//            checkInfoList.add(name + ":坐标系不正确,确认是否CGCS2000!");
+//            fzssFxrwrzHandleService.insertFxrwrz(uploadId, "地籍库管理", name + ":坐标系不正确,确认是否CGCS2000!", "info");
+//            checkInfoVo.setCheckStatus(false);
+//        }
+//
+//        boolean haveGeom = false;
+//        //获取字段信息
+//        List<String> dbFieldNameList = cadastreFileMapper.selectTableCollum(name.toLowerCase(Locale.ROOT));
+//        if (dbFieldNameList.contains("geom")) {
+//            haveGeom = true;
+//        }
+//        //这里移除校验字段(非属mdb中的字段)
+//        dbFieldNameList.remove("valid_flag");
+//
+//        List<String> layerFieldNameList = this.getFieldName(layer, haveGeom);
+//        // 判断是否包含相同的元素(不考虑顺序)
+//        boolean areCollectionsEqual = CollectionUtils.containsAll(layerFieldNameList,dbFieldNameList);
+//        if (!areCollectionsEqual) {
+//            checkInfoList.add(name + ":字段数据不一致!-" + dbFieldNameList);
+//            fzssFxrwrzHandleService.insertFxrwrz(uploadId, "地籍库管理", name + ":字段数据不一致!-" + dbFieldNameList, "info");
+//            checkInfoVo.setCheckStatus(false);
+//        }
+//
+//        //检查字段数据是否为空
+//        //todo 这里根据表名获取相关校验字段信息
+//        List<String> checkFieldList = new ArrayList<>();
+//        //checkFieldList.add("111");
+//        //checkFieldList.add("bz");
+//        //仅获取图层属性
+//        List<Map<String, Object>> theValueList = getValueList(layer, new LinkedHashMap<>(), false);
+//        for (Map<String, Object> theMap : theValueList) {
+//            for (String fieldName : checkFieldList) {
+//                if (Objects.isNull(theMap.get(fieldName))) {
+//                    checkInfoList.add(name + "--" + fieldName + "字段不能为空!");
+//                    checkInfoVo.setCheckStatus(false);
+//                }
+//            }
+//        }
+//        checkInfoVo.setCheckInfoList(checkInfoList);
+//        //todo 这里需要放入到缓存中,并且可以下载为txt内容
+//        if (checkInfoVo.getCheckStatus().equals(true)) {
+//            checkInfoList.add("当前矢量数据:" + name + "---" + "数据格式为gdb");
+//            checkInfoList.add("当前矢量数据:" + name + "---" + "坐标系是CGCS2000");
+//            checkInfoList.add("当前矢量数据:" + name + "---" + "检查校验通过!");
+//            fzssFxrwrzHandleService.insertFxrwrz(uploadId, "地籍库管理", "当前矢量数据:" + name + "---" + "数据格式为gdb", "info");
+//            fzssFxrwrzHandleService.insertFxrwrz(uploadId, "地籍库管理", "当前矢量数据:" + name + "---" + "坐标系是CGCS2000", "info");
+//            fzssFxrwrzHandleService.insertFxrwrz(uploadId, "地籍库管理", "当前矢量数据:" + name + "---" + "检查校验通过!", "info");
+//        }
+//        return checkInfoVo;
+//    }
+//
+//
+//    /**
+//     *
+//     * 对表格属性数据进行数据格式校验
+//     *
+//     * @param mdbTableName
+//     * @param allTableList
+//     * @return
+//     */
+//    private CheckInfoVo checkMdbInfo(String mdbTableName, List<String> allTableList, Map<String, Object> mdbTableFieldMap, String uploadId) {
+//        //总返回对象
+//        CheckInfoVo checkInfoVo = new CheckInfoVo();
+//        checkInfoVo.setCheckStatus(true);//初始化检查通过
+//        List<String> checkInfoList = new ArrayList<>();
+//        checkInfoVo.setUploadFileTableName(mdbTableName);
+//
+//        //字段名称
+//        List<String> mdbTableFieldNameList = (List<String>) mdbTableFieldMap.get("column");
+//        List<String> lowerCaseMdbTableFieldNameList = mdbTableFieldNameList.stream().map(String::toLowerCase).collect(Collectors.toList());
+//
+//        //所有条数
+//        List<Map<String, String>> dataList = (List<Map<String, String>>) mdbTableFieldMap.get("rows");
+//
+//        //检查表名对应
+//        if (!allTableList.contains(mdbTableName.toLowerCase(Locale.ROOT))) {
+//            checkInfoList.add(mdbTableName + ":图层名称不在地籍库范围内!");
+//            fzssFxrwrzHandleService.insertFxrwrz(uploadId, "地籍库管理", mdbTableName + ":图层名称不在地籍库范围内!", "info");
+//            checkInfoVo.setCheckStatus(false);
+//        }
+//
+//        //获取当前表数据库字段信息
+//        List<String> dbFieldNameList = cadastreFileMapper.selectTableCollum(mdbTableName.toLowerCase(Locale.ROOT));
+//        //这里移除校验字段(非属mdb中的字段)
+//        dbFieldNameList.remove("valid_flag");
+//        // 判断是否包含相同的元素(不考虑顺序)
+//        boolean areCollectionsEqual = CollectionUtils.containsAll(lowerCaseMdbTableFieldNameList,dbFieldNameList);
+//        if (!areCollectionsEqual) {
+//            checkInfoList.add(mdbTableName + ":字段数据不一致!-" + dbFieldNameList);
+//            fzssFxrwrzHandleService.insertFxrwrz(uploadId, "地籍库管理", mdbTableName + ":字段数据不一致!-" + dbFieldNameList, "info");
+//            checkInfoVo.setCheckStatus(false);
+//        }
+//
+//        //检查字段数据是否为空
+//        //todo 这里根据表名获取相关校验字段信息
+//        List<String> checkFieldList = new ArrayList<>();
+//        //checkFieldList.add("111");
+//        //checkFieldList.add("bz");
+//
+//        for (Map<String, String> theMap : dataList) {
+//            for (String fieldName : checkFieldList) {
+//                if (Objects.isNull(theMap.get(fieldName))) {
+//                    checkInfoList.add(mdbTableName + "--" + fieldName + "字段不能为空!");
+//                    checkInfoVo.setCheckStatus(false);
+//                }
+//            }
+//        }
+//        checkInfoVo.setCheckInfoList(checkInfoList);
+//        if (checkInfoVo.getCheckStatus().equals(true)) {
+//            checkInfoList.add("当前表格数据:" + mdbTableName + "---" + "数据格式为mdb");
+//            checkInfoList.add("当前表格数据:" + mdbTableName + "---" + "检查校验通过!");
+//            fzssFxrwrzHandleService.insertFxrwrz(uploadId, "地籍库管理", "当前表格数据:" + mdbTableName + "---" + "数据格式为mdb", "info");
+//            fzssFxrwrzHandleService.insertFxrwrz(uploadId, "地籍库管理", "当前表格数据:" + mdbTableName + "---" + "检查校验通过!", "info");
+//        }
+//        return checkInfoVo;
+//    }
+//
+//
+//    /**
+//     * 获取当前图层的所有属性字段名
+//     *
+//     * @param layer
+//     * @return
+//     */
+//    private List<String> getFieldName(Layer layer, Boolean haveGeom) {
+//        List<String> nameList = new ArrayList();
+//        FeatureDefn defn = layer.GetLayerDefn();
+//        System.out.println("字段数: " + defn.GetFieldCount());
+//        for (int i = 0; i < defn.GetFieldCount(); i++) {
+//            FieldDefn field = defn.GetFieldDefn(i);
+//            nameList.add(field.GetName().toLowerCase(Locale.ROOT));
+//        }
+//        if (haveGeom.equals(true)) {
+//            nameList.add("geom");
+//        }
+//        return nameList;
+//    }
+//
+//
+//    private static final String[] DATE_PATTERNS = {
+//            "yyyy-MM-dd HH:mm:ssX",
+//            "yyyy-MM-dd HH:mm:ss",
+//            "yyyy/MM/dd HH:mm:ssX",
+//            "yyyy/MM/dd HH:mm:ss",
+//            "yyyy-MM-dd",
+//            "yyyy/MM/dd"
+//    };
+//
+//    private Object convertFieldValue(Feature feature, int fieldIndex, String fieldName, String fieldType) {
+//        if (feature.IsFieldNull(fieldIndex)) {
+//            return null;
+//        }
+//        String strValue = feature.GetFieldAsString(fieldIndex);
+//        if (StringUtils.isBlank(strValue)) {
+//            return null;
+//        }
+//        try {
+//            if (StringUtils.containsIgnoreCase(fieldType, "character") || StringUtils.containsIgnoreCase(fieldType, "text")) {
+//                return strValue;
+//            } else if (StringUtils.containsIgnoreCase(fieldType, "integer") || StringUtils.containsIgnoreCase(fieldType, "smallint") || StringUtils.containsIgnoreCase(fieldType, "int2") || StringUtils.containsIgnoreCase(fieldType, "int4")) {
+//                return feature.GetFieldAsInteger(fieldIndex);
+//            } else if (StringUtils.containsIgnoreCase(fieldType, "bigint") || StringUtils.containsIgnoreCase(fieldType, "int8")) {
+//                return feature.GetFieldAsInteger64(fieldIndex);
+//            } else if (StringUtils.containsIgnoreCase(fieldType, "timestamp")) {
+//                return parseDate(strValue, fieldName);
+//            } else if (StringUtils.containsIgnoreCase(fieldType, "date")) {
+//                return parseDate(strValue, fieldName);
+//            } else if (StringUtils.containsIgnoreCase(fieldType, "numeric") || StringUtils.containsIgnoreCase(fieldType, "double") || StringUtils.containsIgnoreCase(fieldType, "real")) {
+//                return feature.GetFieldAsDouble(fieldIndex);
+//            } else if (StringUtils.containsIgnoreCase(fieldType, "bytea") || StringUtils.containsIgnoreCase(fieldType, "blob") || StringUtils.containsIgnoreCase(fieldType, "binary")) {
+//                return null;
+//            } else if (StringUtils.containsIgnoreCase(fieldType, "boolean")) {
+//                return feature.GetFieldAsInteger(fieldIndex) != 0;
+//            } else {
+//                return strValue;
+//            }
+//        } catch (Exception e) {
+//            log.warn("字段{}类型转换异常,值:{},类型:{},置空处理", fieldName, strValue, fieldType, e);
+//            return null;
+//        }
+//    }
+//
+//    private java.sql.Date parseDate(String dateStr, String fieldName) {
+//        if (StringUtils.isBlank(dateStr)) {
+//            return null;
+//        }
+//        String cleaned = dateStr.trim();
+//        for (String pattern : DATE_PATTERNS) {
+//            try {
+//                java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat(pattern);
+//                sdf.setLenient(false);
+//                java.util.Date parsed = sdf.parse(cleaned);
+//                return new java.sql.Date(parsed.getTime());
+//            } catch (Exception ignored) {
+//            }
+//        }
+//        try {
+//            String normalized = cleaned.replace("/", "-");
+//            if (normalized.contains(" ") || normalized.contains("T")) {
+//                normalized = normalized.substring(0, Math.min(normalized.indexOf(' ') > 0 ? normalized.indexOf(' ') : Integer.MAX_VALUE, normalized.indexOf('T') > 0 ? normalized.indexOf('T') : Integer.MAX_VALUE));
+//            }
+//            if (normalized.length() > 10) {
+//                normalized = normalized.substring(0, 10);
+//            }
+//            return java.sql.Date.valueOf(normalized);
+//        } catch (Exception e) {
+//            log.warn("日期字段{}解析失败,值:{},置空处理", fieldName, dateStr);
+//            return null;
+//        }
+//    }
+//
+//    /**
+//     * 获取当前图层的所有字段名称和值
+//     *
+//     * @param layer
+//     * @return
+//     */
+//    private List<Map<String, Object>> getValueList(Layer layer, Map<String, String> fieldNameAndTypeMap, Boolean haveGeom) {
+//        List<Map<String, Object>> list = new ArrayList<>();
+//        Integer sourceSRID = 4326;
+//
+//        // ========== 1. 获取源数据坐标系 EPSG:4527 ==========
+//        try {
+//            SpatialReference srcSR = layer.GetSpatialRef();
+//            if (srcSR != null) {
+//                srcSR.AutoIdentifyEPSG();
+//                String code = srcSR.GetAuthorityCode(null);
+//                if (code != null) {
+//                    sourceSRID = Integer.parseInt(code);
+//                }
+//            }
+//        } catch (Exception e) {
+//            log.warn("获取图层坐标系SRID失败,使用默认4326", e);
+//        }
+//
+//        layer.ResetReading();
+//        Feature feature;
+//        while ((feature = layer.GetNextFeature()) != null) {
+//            Map<String, Object> map = new LinkedHashMap<>();
+//            for (int i = 0; i < feature.GetFieldCount(); i++) {
+//                String fieldName = feature.GetFieldDefnRef(i).GetName();
+//                if (fieldNameAndTypeMap.containsKey(fieldName.toLowerCase())) {
+//                    String fieldType = fieldNameAndTypeMap.get(fieldName.toLowerCase());
+//
+//
+///*                    if ("dclxtzm".equalsIgnoreCase(fieldName)) {
+//                        map.put(fieldName, "99");
+//                    }
+//                    else if ("fwjg".equalsIgnoreCase(fieldName)) {
+//                        map.put(fieldName, null);
+//                    }
+//                    else if ("jzwgd".equalsIgnoreCase(fieldName)) {
+//                        map.put(fieldName, 1);
+//                    }
+//                    else if ("ycjzmj".equalsIgnoreCase(fieldName)) {
+//                        map.put(fieldName, 1);
+//                    }
+//                    else if ("zts".equalsIgnoreCase(fieldName)) {
+//                        map.put(fieldName, 1);
+//                    }
+//                    else if ("zydmj".equalsIgnoreCase(fieldName)) {
+//                        map.put(fieldName, null);
+//                    }*/
+//
+//                    if ("ydyhfl".equalsIgnoreCase(fieldName)) {
+//                        map.put(fieldName, null);
+//                    }
+//                    else if (StringUtils.containsIgnoreCase(fieldType, "character")) {
+//                        map.put(fieldName, feature.GetFieldAsString(i));
+//                    } else if (StringUtils.containsIgnoreCase(fieldType, "integer") || StringUtils.containsIgnoreCase(fieldType, "smallint") || StringUtils.containsIgnoreCase(fieldType, "int2") || StringUtils.containsIgnoreCase(fieldType, "int4")) {
+//                        map.put(fieldName, feature.GetFieldAsInteger(i));
+//                    } else if (StringUtils.containsIgnoreCase(fieldType, "bigint") || StringUtils.containsIgnoreCase(fieldType, "int8")) {
+//                        map.put(fieldName, feature.GetFieldAsInteger64(i));
+//                    } else if (StringUtils.containsIgnoreCase(fieldType, "date")) {
+//                        String dateStr = feature.GetFieldAsString(i);
+//                        if (StringUtils.isNotBlank(dateStr)) {
+//                            try {
+//                                String normalized = dateStr.trim().replace("/", "-");
+//                                if (normalized.length() > 10) {
+//                                    normalized = normalized.substring(0, 10);
+//                                }
+//                                map.put(fieldName, java.sql.Date.valueOf(normalized));
+//                            } catch (Exception e) {
+//                                log.warn("日期字段{}解析失败,值:{},置空处理", fieldName, dateStr);
+//                                map.put(fieldName, null);
+//                            }
+//                        } else {
+//                            map.put(fieldName, null);
+//                        }
+//                    } else if (StringUtils.containsIgnoreCase(fieldType, "numeric") || StringUtils.containsIgnoreCase(fieldType, "double") || StringUtils.containsIgnoreCase(fieldType, "real")) {
+//                        if (feature.IsFieldNull(i)) {
+//                            map.put(fieldName, null);
+//                        } else {
+//                            map.put(fieldName, feature.GetFieldAsDouble(i));
+//                        }
+//                    } else if (StringUtils.containsIgnoreCase(fieldType, "bytea") || StringUtils.containsIgnoreCase(fieldType, "blob") || StringUtils.containsIgnoreCase(fieldType, "binary")) {
+//                        map.put(fieldName, new byte[0]);
+//                    }
+//                    else {
+//                        map.put(fieldName, feature.GetFieldAsString(i));
+//                    }
+//                } else {
+//                    //这里兼容图层可能存在多出的字段不处理
+//                    //map.put(fieldName, feature.GetFieldAsString(i));
+//                    log.warn("当前图层-{},多出字段-{}",layer.GetName(),fieldName);
+//                }
+//            }
+//            if (haveGeom.equals(true)) {
+//                String ewkt = null;
+//                Geometry geom = feature.GetGeometryRef();
+//                if (geom != null) {
+//                    String wkt = geom.ExportToWkt();
+//                    ewkt = "SRID=" + sourceSRID + ";" + wkt;
+//                    ewkt = this.transforGeomTo4326(ewkt);
+//                }
+//                map.put("geom", ewkt);
+//            }
+//            list.add(map);
+//        }
+//        return list;
+//    }
+//
+//
+//    /**
+//     * 校验当前图层坐标系是否为:CGCS2000
+//     *
+//     * @param layer
+//     * @return
+//     */
+//    private Boolean checkCoordinateSystem(Layer layer) {
+//        boolean isCGCS2000 = false;
+//        SpatialReference sr = layer.GetSpatialRef();
+//        if (sr != null) {
+//            String wkt = sr.ExportToWkt();
+//            log.info("当前图层{},wkt为:{}", layer.GetName(), wkt);
+//            // 判断 WKT 是否包含 "CGCS2000"
+//            if (wkt.contains("CGCS2000")) {
+//                isCGCS2000 = true;
+//            }
+//        }
+//        return isCGCS2000;
+//    }
+//
+//
+//    /**
+//     * 校验当前图层是否存在矢量数据
+//     *
+//     * @param layer
+//     * @return
+//     */
+//    private Boolean checkHaveGeom(Layer layer) {
+//        boolean haveGeom = false;
+//        // 循环处理每个要素
+//        for (int i = 0; i < layer.GetFeatureCount(0); i++) {
+//            Feature feature = layer.GetFeature(i);
+//            if (feature == null) {
+//                continue;
+//            }
+//            Geometry geometry = feature.GetGeometryRef(); // 获取几何对象
+//            if (geometry != null) {
+//                // 将几何对象转换为 WKT 格式
+//                String wkt = geometry.ExportToWkt();
+//                if (StringUtils.isNotBlank(wkt)) {
+//                    haveGeom = true;
+//                    break;
+//                }
+//            }
+//        }
+//        return haveGeom;
+//    }
+//
+//    /**
+//     * 获取对比的矢量图层
+//     *
+//     * @param layer
+//     * @return
+//     */
+//    private List<String> getLayerGeom(Layer layer) {
+//        List<String> list = new ArrayList<>();
+//        SpatialReference srcSrs = layer.GetSpatialRef();
+//        Integer srid = null;
+//        if (srcSrs != null) {
+//            String authCode = srcSrs.GetAuthorityCode(null);
+//            if (authCode != null) {
+//                srid = Integer.parseInt(authCode);
+//            }
+//        }
+//        if (srid == null) {
+//            srid = 4527;
+//        }
+//
+//        layer.ResetReading();
+//        Feature feature;
+//        while ((feature = layer.GetNextFeature()) != null) {
+//            Geometry geom = feature.GetGeometryRef();
+//            if (geom == null) {
+//                list.add("");
+//                continue;
+//            }
+//            String wkt = geom.ExportToWkt();
+//            String ewkt = "SRID=" + srid + ";" + wkt;
+//            ewkt = this.transforGeomTo4326(ewkt);
+//            list.add(ewkt);
+//        }
+//        return list;
+//    }
+//
+//
+//    /**
+//     * 获取对比的矢量图层
+//     *
+//     * @param layer
+//     * @return
+//     */
+//    private List<String> getLayerGeom_del(Layer layer) {
+//        List<String> list = new ArrayList<>();
+//        // 循环处理每个要素
+//        for (int i = 0; i < layer.GetFeatureCount(0); i++) {
+//            Feature feature = layer.GetFeature(i);
+//            if (feature == null) {
+//                continue;
+//            }
+//            Geometry geometry = feature.GetGeometryRef(); // 获取几何对象
+//            if (geometry != null) {
+//                // 将几何对象转换为 WKT 格式
+//                String wkt = geometry.ExportToWkt();
+//                list.add(wkt);
+//            }
+//        }
+//        return list;
+//    }
+//
+//
+//    /**
+//     *
+//     * @param tableName
+//     * @return
+//     */
+//    private List<String> getDbGeom(String tableName) {
+//        List<String> list = new ArrayList<>();
+//        String geomsStr = cadastreFileMapper.selectGeoms(tableName);
+//        if (StringUtils.isNotBlank(geomsStr)) {
+//            list = Arrays.asList(geomsStr.split("\\|"));
+//        }
+//        return list;
+//    }
+//
+//
+//    /**
+//     * 这里需要开启事务
+//     * 数据全量入库
+//     *
+//     * @param tableName
+//     * @param theValueList
+//     * @return
+//     */
+//    @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
+//    public Boolean fullDataStorage(String tableName, List<Map<String, Object>> theValueList) {
+//        boolean addRes = false;
+//        Integer shpDbSRID = 4326;
+//        if (!CollectionUtils.isEmpty(theValueList)) {
+//            //先删除数据
+//            cadastreFileMapper.deleteByValidFlag("1", tableName);
+//            //先把当前版本都修改为历史版本
+//            cadastreFileMapper.updateValidFlag("1", "0", tableName);
+//            for (Map<String, Object> map : theValueList) {
+////                Collection<Object> values = map.values();
+////                Collection<String> keys = map.keySet();
+//                map.put("valid_flag", 0);//有效数据标识
+//                cadastreFileMapper.insertTableData(tableName, map, shpDbSRID);
+//            }
+//        }
+//        return addRes;
+//    }
+//
+//
+//    /**
+//     * 判断两个Map中的数据是否完全一致(排除geom字段的比较方式,或根据业务需求处理)
+//     */
+//    private boolean isSameData(Map<String, Object> map1, Map<String, Object> map2) {
+//        if (map1 == map2) return true;
+//        if (map1 == null || map2 == null) return false;
+//
+//        // 比较两个map的交集字段(排除valid_flag)
+//        Set<String> keys1 = new HashSet<>(map1.keySet());
+//        Set<String> keys2 = new HashSet<>(map2.keySet());
+//        keys1.retainAll(keys2); // 取交集
+//        if (keys1.isEmpty()) return false;
+//
+//        for (String field : keys1) {
+//            if ("valid_flag".equalsIgnoreCase(field)) {
+//                continue; // 忽略版本标识
+//            }
+//            Object val1 = map1.get(field);
+//            Object val2 = map2.get(field);
+//
+//            if (val1 == null && val2 == null) continue;
+//            if (val1 == null || val2 == null) return false;
+//
+//            // 特殊处理geom字段:以字符串比较,去掉空白
+//            if ("geom".equalsIgnoreCase(field)) {
+//                String s1 = String.valueOf(val1).trim();
+//                String s2 = String.valueOf(val2).trim();
+//                if (!s1.equals(s2)) {
+//                    return false;
+//                } else {
+//                    continue;
+//                }
+//            }
+//
+//            // 数值类型比较
+//            if (val1 instanceof Number && val2 instanceof Number) {
+//                if (Double.compare(((Number) val1).doubleValue(), ((Number) val2).doubleValue()) != 0) {
+//                    return false;
+//                }
+//                continue;
+//            }
+//
+//            // 尝试将字符串数字与数字类型做比较(例如数据库返回Integer/String混合)
+//            if (val1 instanceof Number && val2 instanceof String) {
+//                try {
+//                    double d2 = Double.parseDouble(((String) val2).trim());
+//                    if (Double.compare(((Number) val1).doubleValue(), d2) != 0) return false;
+//                    else continue;
+//                } catch (Exception ignored) {
+//                    // fallthrough to string compare
+//                }
+//            }
+//            if (val2 instanceof Number && val1 instanceof String) {
+//                try {
+//                    double d1 = Double.parseDouble(((String) val1).trim());
+//                    if (Double.compare(((Number) val2).doubleValue(), d1) != 0) return false;
+//                    else continue;
+//                } catch (Exception ignored) {
+//                    // fallthrough to string compare
+//                }
+//            }
+//
+//            // 默认字符串比较(去除首尾空白)
+//            if (!String.valueOf(val1).trim().equals(String.valueOf(val2).trim())) {
+//                return false;
+//            }
+//        }
+//
+//        return true;
+//    }
+//
+//
+//    /**
+//     * 这里需要开启事务
+//     * 数据增量入库
+//     *
+//     * @param tableName
+//     * @param theValueList
+//     * @return
+//     */
+//    @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
+//    public Boolean incrementDataStorage(String tableName, List<Map<String, Object>> theValueList) {
+//        /**
+//         * 1。查询出当前表所有数据。
+//         * 2.修改当前数据的valid_flag为1,表示历史版本
+//         * 3.把当前数据和数据库数据进行对比,获取新增数据和修改数据。
+//         * 4.新增数据直接插入,修改数据根据主键进行更新。
+//         * 任务标识码相同,并且geom数据有相交则认为数据相同。
+//         */
+//        boolean addRes = false;
+//        Integer shpDbSRID = 4326;
+//        if (!CollectionUtils.isEmpty(theValueList)) {
+//            //先删除数据
+//            cadastreFileMapper.deleteByValidFlag("1", tableName);
+//            //查询出当前表所有数据。
+//            List<Map<String, Object>> dbDataList = cadastreFileMapper.selectTableData("0", tableName);
+//            //筛选出需要更新的数据
+//            List<Map<String, Object>> dbExistsList = new ArrayList<>();
+//            for (Map<String, Object> map : theValueList) {
+//                Map<String, Object> dbExistsMap = cadastreFileMapper.selectExistsSameData("0", map, tableName);
+//                if (MapUtils.isNotEmpty(dbExistsMap)) {
+//                    dbExistsList.add(dbExistsMap);
+//                }
+//            }
+//
+//            // 在dbDataList 中找出 dbExistsMap中各个字段完全一致的数据 并从dbDataList移除
+//            if (CollectionUtils.isNotEmpty(dbExistsList)) {
+//                for (Map<String, Object> dbExistsMap : dbExistsList) {
+//                    dbDataList.removeIf(dbData -> isSameData(dbData, dbExistsMap));
+//                }
+//            }
+//
+//            //这里合并两个list 最终写入数据表
+//            if (CollectionUtils.isNotEmpty(dbDataList)) {
+//                theValueList.addAll(dbDataList);
+//            }
+//
+//            //先把当前版本都修改为历史版本
+//            cadastreFileMapper.updateValidFlag("1", "0", tableName);
+//            for (Map<String, Object> map : theValueList) {
+//                map.put("valid_flag", 0);//有效数据标识
+//                cadastreFileMapper.insertTableData(tableName, map, shpDbSRID);
+//            }
+//        }
+//        return addRes;
+//    }
+//
+//
+//    /**
+//     * 获取列表
+//     */
+//    @Override
+//    public Map<String, Object> list(CadastreFileFilterVo cadastreFileFilterVo) {
+//        List<CadastreFile> list = cadastreFileMapper.getListByFilter(cadastreFileFilterVo);
+//        int count = cadastreFileMapper.getCountByFilter(cadastreFileFilterVo);
+//        Map<String, Object> map = new HashMap<>();
+//        map.put("rows", list);
+//        map.put("total", count);
+//        return map;
+//    }
+//
+//    /**
+//     * 批量删除
+//     */
+//    @Override
+//    @Transactional(rollbackFor = Exception.class)
+//    public void batchDelete(List<String> ids) {
+//        if (ids == null || ids.isEmpty()) {
+//            throw new IllegalArgumentException("IDs list cannot be null or empty");
+//        }
+//        cadastreFileMapper.batchDelete(ids);
+//    }
+//
+//    @Override
+//    @Transactional(rollbackFor = Exception.class)
+//    public void testRun() {
+//        //这里批量增修改表结构增加校验字段:
+//        String[] arr = new String[]{
+//                "tdgy_jh",
+//                "tdjyq",
+//                "TB_TDGY_SJ",
+//                "t_cgzj_cwtc_m",
+//                "t_cgzj_cwtc_m_bak1",
+//                "t_cgzj_cwtc_m_copy1",
+//                "public_dict",
+//                "spatial_ref_sys"
+//        };
+//
+//        //获取库中表名
+//        //List<String> allTableList = cadastreFileMapper.selectAllTable();
+//        List<String> allTableList = cadastreFileMapper.selectAllTableNoView();
+//        allTableList.removeAll(Arrays.asList(arr));
+//
+//        // 对每个表名执行添加校验字段的操作
+//        for (String tableName : allTableList) {
+//            System.out.println("正在处理表: " + tableName);
+//            cadastreFileMapper.addValidFlagColumn(tableName);
+//            System.out.println("正在处理表: " + tableName + " 完成");
+//        }
+//    }
+//
+//    @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
+//    @Override
+//    public String backToOldData(String uploadId) {
+//        try {
+//            CadastreFile cadastreFile = cadastreFileMapper.get(uploadId);
+//            if (!"1".equals(cadastreFile.getStatus())) {
+//                throw new ServiceException("可能未入库成功,无法回退");
+//            }
+//
+//            List<String> fileTableNameList = new ArrayList<>();
+//            if ("1".equals(cadastreFile.getFileType())) {//矢量数据
+//                fileTableNameList = getLayerNameList(uploadId);
+//            } else if ("2".equals(cadastreFile.getFileType())) { //表格数据
+//                fileTableNameList = getMdbTableNameList(uploadId);
+//            }
+//
+//            for (String layerName : fileTableNameList) {
+//                //校验是否都有历史版本
+//                Integer count = cadastreFileMapper.countByValidFlag("1", layerName.toLowerCase(Locale.ROOT));
+//                if (count == 0) {
+//                    throw new ServiceException("表" + layerName + "没有历史版本,无法回退");
+//                }
+//            }
+//
+//            for (String layerName : fileTableNameList) {
+//
+//                cadastreFileMapper.deleteByValidFlag("0", layerName.toLowerCase(Locale.ROOT));
+//                cadastreFileMapper.updateValidFlag("0", "1", layerName.toLowerCase(Locale.ROOT));
+//                log.info("正在回退表:{}。。。", layerName);
+//            }
+//        } catch (Exception e) {
+//            log.error("数据回退异常,uploadId: {}", uploadId, e);
+//            throw new ServiceException("数据回退异常," + e.getMessage());
+//        }
+//
+////        //成功则更新状态
+////        CadastreFile updateCadastreFile = new CadastreFile();
+////        updateCadastreFile.setId(uploadId);
+////        updateCadastreFile.setStatus("4");//已经回退
+////        updateCadastreFile.setReadMessage("已经回退");//校验通过
+////        cadastreFileMapper.update(updateCadastreFile);
+//        return "当前批次数据已回退到上一个版本!:" + uploadId;
+//    }
+//
+//
+//    /**
+//     * 获取图层名称列表
+//     *
+//     * @param uploadId
+//     * @return
+//     */
+//    public List<String> getLayerNameList(String uploadId) {
+//        List<String> nameList = new ArrayList<>();
+//        CadastreFile cadastreFile = cadastreFileMapper.get(uploadId);
+//        String gdbPath = cadastreFile.getUnzipPath();
+//        DataSource ds = ogr.Open(gdbPath + "/" + cadastreFile.getName(), 0); // 0 = 只读
+//        if (ds == null) {
+//            throw new ServiceException("无法打开 gdb");
+//        }
+//        //这里进行遍历每个图层
+//        for (int i = 0; i < ds.GetLayerCount(); i++) {
+//            Layer layer = ds.GetLayer(i);
+//            String layerName = layer.GetName();
+//            nameList.add(layerName);
+//        }
+//        return nameList;
+//    }
+//
+//
+//    /**
+//     *
+//     * 获取mdb文件中表名称
+//     *
+//     * @param uploadId
+//     * @return
+//     */
+//    public List<String> getMdbTableNameList(String uploadId) throws Exception {
+//        List<String> nameList = new ArrayList<>();
+//        CadastreFile cadastreFile = cadastreFileMapper.get(uploadId);
+//        String gdbPath = cadastreFile.getUnzipPath();
+//        List<Map<String, Object>> allMdbTableList = MdbUtil.MdbTables(gdbPath + "/" + cadastreFile.getName(), "", "");
+//        for (Map<String, Object> tableMap : allMdbTableList) {
+//            String talbleName = String.valueOf(tableMap.get("name"));
+//            nameList.add(talbleName);
+//        }
+//        return nameList;
+//    }
+//
+//    //1.获取图层中所有数据
+//    //2.获取库中所有数据
+//    //3.进行对比返回
+//    @Override
+//    public List<LayerAndDbData> getLayerData(String uploadId) {
+//        List<LayerAndDbData> resList = new ArrayList<>();
+//        try {
+//            CadastreFile cadastreFile = cadastreFileMapper.get(uploadId);
+//            //这里判断是否校验通过
+//            if (!cadastreFile.getStatus().equalsIgnoreCase("3")) {
+//                log.info("校验未通过,不能入库");
+//                throw new ServiceException("校验未通过,不能入库");
+//            }
+//            String gdbPath = cadastreFile.getUnzipPath();
+//            DataSource ds = ogr.Open(gdbPath + "/" + cadastreFile.getName(), 0); // 0 = 只读
+//            if (ds == null) {
+//                log.warn("无法打开 gdb");
+//                throw new ServiceException("无法打开 gdb");
+//            }
+//            //这里进行遍历每个图层
+//            for (int i = 0; i < ds.GetLayerCount(); i++) {
+//                Layer layer = ds.GetLayer(i);
+//                String layerName = layer.GetName();
+//                LayerAndDbData layerAndDbData = new LayerAndDbData();
+//                layerAndDbData.setCurrentTableName(layerName);
+//
+//                boolean haveGeom = false;//这里不需要geom信息
+//                List<Map<String, String>> dbFieldNameAndTypeList = cadastreFileMapper.selectTableCollumAndType(layerName.toLowerCase(Locale.ROOT));
+//                Map<String, String> dbFieldNameAndTypeMap = dbFieldNameAndTypeList.stream().collect(Collectors.toMap(
+//                        s -> s.get("column_name"),
+//                        s -> s.get("data_type"),
+//                        (existing, replacement) -> existing // 如果有重复键,保留第一个值
+//                ));
+//                List<Map<String, Object>> theValueList = getValueList(layer, dbFieldNameAndTypeMap, haveGeom);
+//                List<Map<String, Object>> dbDataList = cadastreFileMapper.selectTableData("0", layerName);
+//
+//                layerAndDbData.setAddTotalNum(theValueList.size());
+//                layerAndDbData.setInsertNum(theValueList.size());
+//                layerAndDbData.setMarkHistoryNum(dbDataList.size());
+//                layerAndDbData.setInsertDataList(theValueList);
+//                layerAndDbData.setMarkHistoryDataList(dbDataList);
+//                resList.add(layerAndDbData);
+//            }
+//        } catch (Exception e) {
+//            log.error("矢量数据入库异常,uploadId: {}", uploadId, e);
+//            throw new ServiceException("矢量数据入库异常," + e.getMessage());
+//        }
+//
+//        return resList;
+//    }
+//
+//
+//    /**
+//     * 获取表格数据进行对比
+//     *
+//     * @param uploadId
+//     * @return
+//     */
+//    @Override
+//    public List<LayerAndDbData> getMdbPropertyData(String uploadId) {
+//        List<LayerAndDbData> resList = new ArrayList<>();
+//        try {
+//            CadastreFile cadastreFile = cadastreFileMapper.get(uploadId);
+//            //这里判断是否校验通过
+//            if (!cadastreFile.getStatus().equalsIgnoreCase("3")) {
+//                log.info("校验未通过,不能入库");
+//                throw new ServiceException("校验未通过,不能入库");
+//            }
+//            String gdbPath = cadastreFile.getUnzipPath();
+//            List<Map<String, Object>> allMdbTableList = MdbUtil.MdbTables(gdbPath + "/" + cadastreFile.getName(), "", "");
+//
+//            for (Map<String, Object> tableMap : allMdbTableList) {
+//                String talbleName = String.valueOf(tableMap.get("name"));
+//                LayerAndDbData layerAndDbData = new LayerAndDbData();
+//                layerAndDbData.setCurrentTableName(talbleName);
+//
+//                Map<String, Object> allMdbTableFieldMap = MdbUtil.MdbTableContent(gdbPath + "/" + cadastreFile.getName(), talbleName, "", "", 1, 1000);
+//                List<Map<String, Object>> theValueList = (List<Map<String, Object>>) allMdbTableFieldMap.get("rows");
+//                List<Map<String, Object>> dbDataList = cadastreFileMapper.selectTableData("0", talbleName);
+//
+//                layerAndDbData.setAddTotalNum(theValueList.size());
+//                layerAndDbData.setInsertNum(theValueList.size());
+//                layerAndDbData.setMarkHistoryNum(dbDataList.size());
+//                layerAndDbData.setInsertDataList(theValueList);
+//                layerAndDbData.setMarkHistoryDataList(dbDataList);
+//                resList.add(layerAndDbData);
+//            }
+//        } catch (Exception e) {
+//            log.error("矢量数据入库异常,uploadId: {}", uploadId, e);
+//            throw new ServiceException("矢量数据入库异常," + e.getMessage());
+//        }
+//        return resList;
+//    }
+//
+//
+//    @Override
+//    public List<MdbAndDbData> getMdbCompareData(String uploadId) {
+//        List<MdbAndDbData> resList = new ArrayList<>();
+//        try {
+//            CadastreFile cadastreFile = cadastreFileMapper.get(uploadId);
+//            //这里判断是否校验通过
+//            if (!cadastreFile.getStatus().equalsIgnoreCase("3")) {
+//                log.info("校验未通过,不能入库");
+//                throw new ServiceException("校验未通过,不能入库");
+//            }
+//            String gdbPath = cadastreFile.getUnzipPath();
+//            List<Map<String, Object>> allMdbTableList = MdbUtil.MdbTables(gdbPath + "/" + cadastreFile.getName(), "", "");
+//
+//            for (Map<String, Object> tableMap : allMdbTableList) {
+//                String talbleName = String.valueOf(tableMap.get("name"));
+//                MdbAndDbData mdbAndDbData = new MdbAndDbData();
+//                mdbAndDbData.setCurrentTableName(talbleName);
+//                List<Map<String, String>> dbFieldNameAndTypeList = cadastreFileMapper.selectTableCollumAndType(talbleName.toLowerCase(Locale.ROOT));
+//                Map<String, String> dbFieldNameAndTypeMap = dbFieldNameAndTypeList.stream().collect(Collectors.toMap(
+//                        s -> s.get("column_name"),
+//                        s -> s.get("data_type"),
+//                        (existing, replacement) -> existing // 如果有重复键,保留第一个值
+//                ));
+//
+//                Map<String, Object> allMdbTableFieldMap = MdbUtil.MdbTableContent(gdbPath + "/" + cadastreFile.getName(), talbleName, "", "", 1, 1000);
+//                List<Map<String, Object>> theValueList = (List<Map<String, Object>>) allMdbTableFieldMap.get("rows");
+//                List<Map<String, Object>> dbDataList = cadastreFileMapper.selectTableData("0", talbleName);
+//
+//                //这里进行遍历dbDataList,判断是否存在bsm字段,且bsm字段是否存在于theValueList中
+//                Set<String> mdbBsmSet = theValueList.stream()
+//                        .map(v -> v.get("bsm".toUpperCase(Locale.ROOT)))
+//                        .filter(bsm -> bsm != null)
+//                        .map(String::valueOf)
+//                        .collect(Collectors.toSet());
+//
+//                dbDataList.stream()
+//                        .filter(dbData -> {
+//                            Object bsmObj = dbData.get("bsm");
+//                            return bsmObj != null && mdbBsmSet.contains(String.valueOf(bsmObj));
+//                        })
+//                        .forEach(dbData -> dbData.put("valid_flag", 100));
+//
+//                mdbAndDbData.setMdbFileDataList(theValueList);
+//                mdbAndDbData.setDbDataList(dbDataList);
+//                resList.add(mdbAndDbData);
+//            }
+//        } catch (Exception e) {
+//            log.error("获取mdb对比数据异常,uploadId: {}", uploadId, e);
+//            throw new ServiceException("获取mdb对比数据异常," + e.getMessage());
+//        }
+//        return resList;
+//    }
+//
+//    @Override
+//    public List<Map<String,Object>> selectTableRow(String tableName,String geomFlag,String bsm,String ywh) {
+//        String validFlag = "0";
+//        if(Arrays.asList("tf_500", "tf_1000", "tf_2000","zd_shp").contains(tableName)){
+//            validFlag = "";
+//        }
+//        if(StringUtils.isNotEmpty(bsm)){
+//            bsm = bsm.trim();
+//        }
+//        if(StringUtils.isNotEmpty(ywh)){
+//            ywh = ywh.trim();
+//        }
+//        if (ywh.matches(".*=\\d+")) {
+//            ywh = ywh.replaceAll("=(\\d+)", "='$1'");
+//        }
+//        List<Map<String,Object>> res = cadastreFileMapper.selectTableDataByCondition(validFlag,tableName,bsm,ywh);
+//        if(CollectionUtils.isNotEmpty(res)){ //去掉geom字段和valid_flag字段
+//            List<Map<String, String>> dbFieldNameAndTypeList = cadastreFileMapper.selectTableCollumAndType(tableName.toLowerCase(Locale.ROOT));
+//            List<Object> filterCollumList =  dbFieldNameAndTypeList.stream().filter(s->s.get("data_type").equals("bytea")).map(s->s.get("column_name")).collect(Collectors.toList());
+//            filterCollumList.add("valid_flag");
+//            //res.forEach(m -> m.keySet().removeIf(k -> "valid_flag".equalsIgnoreCase(k)));
+//            res.forEach(m -> m.keySet().removeIf(filterCollumList::contains));
+//            if("0".equals(geomFlag)){
+//                res.forEach(m -> m.keySet().removeIf("geom"::equalsIgnoreCase));
+//            }
+//           res.forEach(s -> {
+//                if(s.get("geom") != null){
+//                    WKBReader reader = new WKBReader();
+//                    org.locationtech.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 List<String> getTableFields(String tableName) {
+//        List<String> res = cadastreFileMapper.selectTableCollum(tableName);
+//        res.remove("valid_flag");
+//        res.remove("geom");
+//        return res;
+//    }
+//
+//    @Override
+//    public List<String> getDistinctValueByField(String tableName,String fieldName) {
+//        List<String> res = new ArrayList<>();
+//        String validFlag =null;
+//        List<String> collumList = cadastreFileMapper.selectTableCollum(tableName);
+//        if(!collumList.contains(fieldName)){
+//            return res;
+//        }
+//        if(collumList.contains("valid_flag")){
+//            validFlag = "0";
+//        }
+//        res = cadastreFileMapper.selectDistinctValueByField(tableName,fieldName,validFlag);
+//        return res;
+//    }
+//
+//
+//    @Override
+//    public String tableRowUpdate(String tableName, List<Map<String,Object>> list) {
+//        for (Map<String, Object> row : list) {
+//            row.replaceAll((k, v) -> {
+//                if (v instanceof String) {
+//                    String sv = (String) v;
+//                    try {
+//                        return new java.math.BigDecimal(sv);
+//                    } catch (NumberFormatException e) {
+//                        return v;
+//                    }
+//                }
+//                return v;
+//            });
+//        }
+//         int res = cadastreFileMapper.batchUpdateByBsm(tableName,list);
+//        return res+"";
+//    }
+//
+//    @Override
+//    public String batchDeleteByBsm(String tableName, List<Map<String,Object>> list) {
+//         int res = cadastreFileMapper.batchDeleteByBsm(tableName,list);
+//        return res+"";
+//    }
+//
+//
+//    @Override
+//    public List<Map<String, Object>> getDataByName(String tableName) {
+//        Map<String, Object> map = cadastreFileMapper.selectTableDataByBsm(tableName, "");
+//        List<Map<String, Object>> list = new ArrayList<>();
+//        list.add(map);
+//        return list;
+//    }
+//
+//    @Override
+//    public List<Map<String, Object>> selectTableRowExcel(String tableName, String geomFlag, List<Object> bsmList, List<String> ywhList) {
+//        List<Map<String, Object>> res = cadastreFileMapper.selectTableRowExcel(tableName, geomFlag, bsmList, ywhList);
+//        if(CollectionUtils.isNotEmpty(res)) { //去掉geom字段和valid_flag字段
+//            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)));
+//            }
+//        }
+//        return res;
+//    }
+//
+//
+//    @Override
+//    public Boolean checkQueryWhere(String tableName, String queryWhere) {
+//        try {
+//            if (queryWhere.matches(".*=\\d+")) {
+//                queryWhere = queryWhere.replaceAll("=(\\d+)", "='$1'");
+//            }
+//            String res  = cadastreFileMapper.checkQueryWhere(tableName, queryWhere);
+//            log.info("SQL语法检查结果,res: {}", res);
+//            return true;
+//        } catch (Exception e) {
+//            throw new ServiceException("SQL语法检查异常:");
+//        }
+//    }
+//
+//
+//    /**
+//     *
+//     * 生成一个mdb文件
+//     *
+//     * @param tableName
+//     * @param filePath
+//     * @param fileName
+//     */
+//    @Override
+//    public void testBuildMdbFile(String tableName, String filePath, String fileName) {
+//        try {
+//            // 1. 获取表字段及类型信息
+//            List<Map<String, String>> columns = cadastreFileMapper.selectTableCollumAndType(tableName);
+//            if (columns == null || columns.isEmpty()) {
+//                log.warn("无法获取表字段信息: {}", tableName);
+//                throw new ServiceException("无法获取表字段信息: "+tableName);
+//            }
+//
+//            if(columns.stream().anyMatch(s->s.get("column_name").equals("geom"))){
+//                log.warn("当前为矢量数据,无法生成mdb: {}", tableName);
+//                throw new ServiceException("当前为矢量数据,无法生成mdb");
+//            }
+//
+//            // 2. 获取表数据 (获取 valid_flag 为 0 的当前版本数据)
+//            List<Map<String, Object>> dataList = cadastreFileMapper.selectTableData("", tableName);
+//
+//            // 3. 构造完整的文件路径
+//            String mdbPath = filePath;
+//            if (!mdbPath.endsWith(File.separator)) {
+//                mdbPath += File.separator;
+//            }
+//            mdbPath += fileName;
+//            if (!mdbPath.toLowerCase().endsWith(".mdb")) {
+//                mdbPath += ".mdb";
+//            }
+//
+//            // 4. 调用工具类生成 MDB 文件并写入数据
+//            MdbUtil.writeMdbByTable(mdbPath, tableName, columns, dataList);
+//
+//            log.info("MDB 文件生成成功: {}", mdbPath);
+//        } catch (Exception e) {
+//            log.error("生成 MDB 文件失败: {}", tableName, e);
+//            throw new ServiceException("生成 MDB 文件失败: " + e.getMessage());
+//        }
+//    }
+//
+//
+//    /**
+//     * 4527坐标系转换为4326坐标系
+//     * @param ewkt
+//     * @return
+//     */
+//    private String  transforGeomTo4326(String ewkt) {
+//        if(StringUtils.isBlank(ewkt)){
+//            return "";
+//        }
+//        return cadastreFileMapper.transformTo4326(ewkt);
+//    }
+//
+//
+//
+//
+//
+//
+//}

+ 1 - 1
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/zrzysite/IZrzysiteCommonService.java

@@ -20,6 +20,6 @@ public interface IZrzysiteCommonService {
     void syncCurrentNodeInfo(String projectId,String nodeTableName);
 
 
-
+    String getNodeAttachment(String projectId, String nodeId, String sourceId, String nodeName);
 
 }

+ 17 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/zrzysite/IZrzysiteGhhsService.java

@@ -0,0 +1,17 @@
+package com.siwei.apply.service.zrzysite;
+
+
+
+public interface IZrzysiteGhhsService {
+
+
+
+    void syncConstructInfo();
+
+
+    void syncCurrentNodeInfo(String projectId,String nodeTableName);
+
+
+
+
+}

+ 17 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/zrzysite/IZrzysiteLandService.java

@@ -0,0 +1,17 @@
+package com.siwei.apply.service.zrzysite;
+
+
+
+public interface IZrzysiteLandService {
+
+
+
+    void syncConstructInfo();
+
+
+    void syncCurrentNodeInfo(String projectId,String nodeTableName);
+
+
+
+
+}

+ 4 - 2
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/zrzysite/impl/ZrzysiteCommonServiceImpl.java

@@ -222,12 +222,15 @@ public class ZrzysiteCommonServiceImpl implements IZrzysiteCommonService {
             JsgcghxkUpdateVo jsgcghxkUpdateVo = new JsgcghxkUpdateVo();
             jsgcghxkUpdateVo.setId(needUpdateNodeId);
             jsgcghxkUpdateVo.setProjectId(projectId);
-            jsgcghxkUpdateVo.setYddw(construct.getYdwz());
+            jsgcghxkUpdateVo.setYdwz(construct.getYdwz());
             jsgcghxkUpdateVo.setYddw(construct.getXddw());
             jsgcghxkUpdateVo.setJsgm(construct.getJsgm());
             jsgcghxkUpdateVo.setZsbh(construct.getZsbh());
             jsgcghxkUpdateVo.setFzjg(construct.getFadw());
             jsgcghxkUpdateVo.setSourceId(construct.getSqbh());
+            if (construct.getFzrq() != null) {
+                jsgcghxkUpdateVo.setFzDate(sdf.format(construct.getFzrq()));
+            }
             jsgcghxkService.update(jsgcghxkUpdateVo);
             addNodeId = needUpdateNodeId;
         }else {
@@ -248,7 +251,6 @@ public class ZrzysiteCommonServiceImpl implements IZrzysiteCommonService {
     }
 
 
-
     /*
     1.先拿到示例id
     2.根据实例id,获取所有的附件材料条数。

+ 190 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/zrzysite/impl/ZrzysiteGhhsServiceImpl.java

@@ -0,0 +1,190 @@
+package com.siwei.apply.service.zrzysite.impl;
+
+import com.siwei.apply.domain.Project;
+import com.siwei.apply.domain.Tdhyhs;
+import com.siwei.apply.domain.vo.TdhyhsUpdateVo;
+import com.siwei.apply.domain.vo.TdhyhsVo;
+import com.siwei.apply.domain.zrzysite.ZrzysiteGhhs;
+import com.siwei.apply.mapper.ProjectMapper;
+import com.siwei.apply.mapper.TdhyhsMapper;
+import com.siwei.apply.mapper.zrzysite.ZrzysiteGhhsMapper;
+import com.siwei.apply.service.TdhyhsService;
+import com.siwei.apply.service.zrzysite.IZrzysiteCommonService;
+import com.siwei.apply.service.zrzysite.IZrzysiteGhhsService;
+import com.siwei.apply.enums.AloneWorkFlowEnum;
+import com.siwei.common.core.exception.ServiceException;
+import com.siwei.common.core.utils.DateUtils;
+import com.siwei.common.core.utils.StringUtils;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections4.CollectionUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.text.SimpleDateFormat;
+import java.util.*;
+import java.util.stream.Collectors;
+
+@Slf4j
+@Service
+public class ZrzysiteGhhsServiceImpl implements IZrzysiteGhhsService {
+
+    @Autowired
+    private ZrzysiteGhhsMapper zrzysiteGhhsMapper;
+
+    @Autowired
+    private ProjectMapper projectMapper;
+
+    @Autowired
+    private TdhyhsMapper tdhyhsMapper;
+
+    @Autowired
+    private TdhyhsService tdhyhsService;
+
+    @Autowired
+    private IZrzysiteCommonService zrzysiteCommonService;
+
+    private final SimpleDateFormat sdf = new SimpleDateFormat(DateUtils.YYYY_MM_DD);
+
+    @Override
+    public void syncConstructInfo() {
+        List<Project> ghhsProjectList = projectMapper.getZrzysiteProjectList("t_tdhyhs");
+        if (!ghhsProjectList.isEmpty()) {
+            List<String> projectCodes = ghhsProjectList.stream()
+                    .map(Project::getCode)
+                    .filter(StringUtils::isNotBlank)
+                    .collect(Collectors.toList());
+
+            List<ZrzysiteGhhs> ghhsList = zrzysiteGhhsMapper.selectByXmdmList(projectCodes);
+
+            Map<String, List<ZrzysiteGhhs>> codeToGhhsMap = ghhsList.stream()
+                    .collect(Collectors.groupingBy(ZrzysiteGhhs::getXmdm));
+
+            LinkedHashMap<Project, List<ZrzysiteGhhs>> zrzysiteGhhsMap = new LinkedHashMap<>();
+            for (Project project : ghhsProjectList) {
+                List<ZrzysiteGhhs> items = codeToGhhsMap.getOrDefault(project.getCode(), new ArrayList<>());
+                zrzysiteGhhsMap.put(project, items);
+            }
+            addGhhsInfoToDataBase(zrzysiteGhhsMap);
+        }
+        log.info("当前批次执行完毕");
+    }
+
+    @Override
+    public void syncCurrentNodeInfo(String projectId, String nodeTableName) {
+        Project project = projectMapper.get(projectId);
+        if (Objects.isNull(project) || StringUtils.isBlank(project.getCode())) {
+            throw new ServiceException("当前项目不具备同步条件,请检查项目代码是否存在");
+        }
+
+        List<ZrzysiteGhhs> ghhsList = zrzysiteGhhsMapper.selectByXmdmList(new ArrayList<>(Collections.singleton(project.getCode())));
+        if (CollectionUtils.isEmpty(ghhsList)) {
+            return;
+        }
+        List<Tdhyhs> tdhyhsList = tdhyhsMapper.get(projectId);
+        Map<String, String> resSourceIdMap = tdhyhsList.stream()
+                .filter(obj -> StringUtils.isNotBlank(obj.getSourceId()))
+                .collect(Collectors.toMap(Tdhyhs::getSourceId, Tdhyhs::getId));
+        List<String> needUpdateNodeIdList = tdhyhsList.stream()
+                .filter(s -> StringUtils.isBlank(s.getSourceId()))
+                .map(Tdhyhs::getId)
+                .collect(Collectors.toList());
+
+        String addNodeId = "";
+        for (ZrzysiteGhhs ghhs : ghhsList) {
+            String needUpdateNodeId = "";
+            if (resSourceIdMap.containsKey(ghhs.getApplyinstId())) {
+                needUpdateNodeId = resSourceIdMap.get(ghhs.getApplyinstId());
+            } else if (!needUpdateNodeIdList.isEmpty()) {
+                needUpdateNodeId = needUpdateNodeIdList.remove(0);
+            }
+            addNodeId = addOrUpdatToTable(ghhs, projectId, needUpdateNodeId);
+            zrzysiteCommonService.getNodeAttachment(projectId, addNodeId, ghhs.getApplyinstId(), AloneWorkFlowEnum.NODE_6.getName());
+        }
+    }
+
+    public void addGhhsInfoToDataBase(Map<Project, List<ZrzysiteGhhs>> zrzysiteGhhsMap) {
+        for (Map.Entry<Project, List<ZrzysiteGhhs>> entry : zrzysiteGhhsMap.entrySet()) {
+            Project project = entry.getKey();
+            List<ZrzysiteGhhs> ghhsList = entry.getValue();
+            if (CollectionUtils.isEmpty(ghhsList)) {
+                continue;
+            }
+            String projectId = project.getId();
+            String sourceType = project.getCreatorId();
+
+            String addNodeId = "";
+            if ("2".equals(sourceType)) {
+                List<Tdhyhs> tdhyhsList = tdhyhsMapper.get(projectId);
+                Optional<Tdhyhs> hasOnchainRes = tdhyhsList.stream().filter(Tdhyhs::getHasOnchain).findFirst();
+                if (hasOnchainRes.isPresent()) {
+                    continue;
+                }
+
+                if (tdhyhsList.stream().anyMatch(obj ->
+                        StringUtils.isNotBlank(obj.getHgzh())
+                                && StringUtils.isNotBlank(obj.getFzDate()))) {
+                    continue;
+                }
+
+                List<String> resSourceIdList = tdhyhsList.stream()
+                        .map(Tdhyhs::getSourceId)
+                        .filter(StringUtils::isNotBlank)
+                        .collect(Collectors.toList());
+                if (!resSourceIdList.isEmpty()) {
+                    continue;
+                }
+
+                List<String> needUpdateNodeIdList = tdhyhsList.stream()
+                        .filter(s -> StringUtils.isBlank(s.getSourceId()))
+                        .map(Tdhyhs::getId)
+                        .collect(Collectors.toList());
+
+                for (ZrzysiteGhhs ghhs : ghhsList) {
+                    String needUpdateNodeId = "";
+                    if (!needUpdateNodeIdList.isEmpty()) {
+                        needUpdateNodeId = needUpdateNodeIdList.remove(0);
+                    }
+                    addNodeId = addOrUpdatToTable(ghhs, projectId, needUpdateNodeId);
+                    zrzysiteCommonService.getNodeAttachment(projectId, addNodeId, ghhs.getApplyinstId(), AloneWorkFlowEnum.NODE_6.getName());
+                }
+            } else if ("1".equals(sourceType)) {
+                for (ZrzysiteGhhs ghhs : ghhsList) {
+                    addNodeId = addOrUpdatToTable(ghhs, projectId, "");
+                    zrzysiteCommonService.getNodeAttachment(projectId, addNodeId, ghhs.getApplyinstId(), AloneWorkFlowEnum.NODE_6.getName());
+                }
+            }
+        }
+    }
+
+    public String addOrUpdatToTable(ZrzysiteGhhs ghhs, String projectId, String needUpdateNodeId) {
+        String addNodeId = "";
+        if (StringUtils.isNotBlank(needUpdateNodeId)) {
+            TdhyhsUpdateVo updateVo = new TdhyhsUpdateVo();
+            updateVo.setId(needUpdateNodeId);
+            updateVo.setProjectId(projectId);
+            updateVo.setHgzh(ghhs.getHgzh());
+            updateVo.setFzjg(ghhs.getFzjg());
+            updateVo.setJsdw(ghhs.getYddw());
+            updateVo.setHyyj(ghhs.getHyyj());
+            updateVo.setSourceId(ghhs.getApplyinstId());
+            if (ghhs.getFzrq() != null) {
+                updateVo.setFzDate(sdf.format(ghhs.getFzrq()));
+            }
+            tdhyhsService.update(updateVo);
+            addNodeId = needUpdateNodeId;
+        } else {
+            TdhyhsVo vo = new TdhyhsVo();
+            vo.setProjectId(projectId);
+            vo.setHgzh(ghhs.getHgzh());
+            vo.setFzjg(ghhs.getFzjg());
+            vo.setJsdw(ghhs.getYddw());
+            vo.setHyyj(ghhs.getHyyj());
+            vo.setSourceId(ghhs.getApplyinstId());
+            if (ghhs.getFzrq() != null) {
+                vo.setFzDate(sdf.format(ghhs.getFzrq()));
+            }
+            addNodeId = tdhyhsService.add(vo);
+        }
+        return addNodeId;
+    }
+}

+ 214 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/zrzysite/impl/ZrzysiteLandServiceImpl.java

@@ -0,0 +1,214 @@
+package com.siwei.apply.service.zrzysite.impl;
+
+import com.siwei.apply.domain.Jsydghxk;
+import com.siwei.apply.domain.Project;
+import com.siwei.apply.domain.vo.JsydghxkUpdateVo;
+import com.siwei.apply.domain.vo.JsydghxkVo;
+import com.siwei.apply.domain.zrzysite.ZrzysiteLand;
+import com.siwei.apply.mapper.JsydghxkMapper;
+import com.siwei.apply.mapper.ProjectMapper;
+import com.siwei.apply.mapper.zrzysite.ZrzysiteLandMapper;
+import com.siwei.apply.service.JsydghxkService;
+import com.siwei.apply.service.zrzysite.IZrzysiteCommonService;
+import com.siwei.apply.service.zrzysite.IZrzysiteLandService;
+import com.siwei.apply.enums.AloneWorkFlowEnum;
+import com.siwei.common.core.exception.ServiceException;
+import com.siwei.common.core.utils.DateUtils;
+import com.siwei.common.core.utils.StringUtils;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections4.CollectionUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.text.SimpleDateFormat;
+import java.util.*;
+import java.util.stream.Collectors;
+
+@Slf4j
+@Service
+public class ZrzysiteLandServiceImpl implements IZrzysiteLandService {
+
+    @Autowired
+    private ZrzysiteLandMapper zrzysiteLandMapper;
+
+    @Autowired
+    private ProjectMapper projectMapper;
+
+    @Autowired
+    private JsydghxkMapper jsydghxkMapper;
+
+    @Autowired
+    private JsydghxkService jsydghxkService;
+
+    @Autowired
+    private IZrzysiteCommonService zrzysiteCommonService;
+
+    private final SimpleDateFormat sdf = new SimpleDateFormat(DateUtils.YYYY_MM_DD);
+
+    @Override
+    public void syncConstructInfo() {
+        List<Project> landProjectList = projectMapper.getZrzysiteProjectList("t_jsydghxk");
+        if (!landProjectList.isEmpty()) {
+            List<String> projectCodes = landProjectList.stream()
+                    .map(Project::getCode)
+                    .filter(StringUtils::isNotBlank)
+                    .collect(Collectors.toList());
+
+            List<ZrzysiteLand> landList = zrzysiteLandMapper.selectByXmdmList(projectCodes);
+
+            Map<String, List<ZrzysiteLand>> codeToLandMap = landList.stream()
+                    .collect(Collectors.groupingBy(ZrzysiteLand::getXmdm));
+
+            LinkedHashMap<Project, List<ZrzysiteLand>> zrzysiteLandMap = new LinkedHashMap<>();
+            for (Project project : landProjectList) {
+                List<ZrzysiteLand> items = codeToLandMap.getOrDefault(project.getCode(), new ArrayList<>());
+                zrzysiteLandMap.put(project, items);
+            }
+            addLandInfoToDataBase(zrzysiteLandMap);
+        }
+        log.info("当前批次执行完毕");
+    }
+
+    @Override
+    public void syncCurrentNodeInfo(String projectId, String nodeTableName) {
+        Project project = projectMapper.get(projectId);
+        if (Objects.isNull(project) || StringUtils.isBlank(project.getCode())) {
+            throw new ServiceException("当前项目不具备同步条件,请检查项目代码是否存在");
+        }
+
+        List<ZrzysiteLand> landList = zrzysiteLandMapper.selectByXmdmList(new ArrayList<>(Collections.singleton(project.getCode())));
+        if (CollectionUtils.isEmpty(landList)) {
+            return;
+        }
+        List<Jsydghxk> jsydghxkList = jsydghxkMapper.getList(projectId);
+        Map<String, String> resSourceIdMap = jsydghxkList.stream()
+                .filter(obj -> StringUtils.isNotBlank(obj.getSourceId()))
+                .collect(Collectors.toMap(Jsydghxk::getSourceId, Jsydghxk::getId));
+        List<String> needUpdateNodeIdList = jsydghxkList.stream()
+                .filter(s -> StringUtils.isBlank(s.getSourceId()))
+                .map(Jsydghxk::getId)
+                .collect(Collectors.toList());
+
+        String addNodeId = "";
+        for (ZrzysiteLand land : landList) {
+            String needUpdateNodeId = "";
+            if (resSourceIdMap.containsKey(land.getSqbh())) {
+                needUpdateNodeId = resSourceIdMap.get(land.getSqbh());
+            } else if (!needUpdateNodeIdList.isEmpty()) {
+                needUpdateNodeId = needUpdateNodeIdList.remove(0);
+            }
+            addNodeId = addOrUpdatToTable(land, projectId, needUpdateNodeId);
+            zrzysiteCommonService.getNodeAttachment(projectId, addNodeId, land.getSqbh(), AloneWorkFlowEnum.NODE_4.getName());
+        }
+    }
+
+    public void addLandInfoToDataBase(Map<Project, List<ZrzysiteLand>> zrzysiteLandMap) {
+        for (Map.Entry<Project, List<ZrzysiteLand>> entry : zrzysiteLandMap.entrySet()) {
+            Project project = entry.getKey();
+            List<ZrzysiteLand> landList = entry.getValue();
+            if (CollectionUtils.isEmpty(landList)) {
+                continue;
+            }
+            String projectId = project.getId();
+            String sourceType = project.getCreatorId();
+
+            String addNodeId = "";
+            if ("2".equals(sourceType)) {
+                List<Jsydghxk> jsydghxkList = jsydghxkMapper.getList(projectId);
+                Optional<Jsydghxk> hasOnchainRes = jsydghxkList.stream().filter(Jsydghxk::getHasOnchain).findFirst();
+                if (hasOnchainRes.isPresent()) {
+                    continue;
+                }
+
+                if (jsydghxkList.stream().anyMatch(obj ->
+                        StringUtils.isNotBlank(obj.getZsbh())
+                                && StringUtils.isNotBlank(obj.getFzDate()))) {
+                    continue;
+                }
+
+                List<String> resSourceIdList = jsydghxkList.stream()
+                        .map(Jsydghxk::getSourceId)
+                        .filter(StringUtils::isNotBlank)
+                        .collect(Collectors.toList());
+                if (!resSourceIdList.isEmpty()) {
+                    continue;
+                }
+
+                List<String> needUpdateNodeIdList = jsydghxkList.stream()
+                        .filter(s -> StringUtils.isBlank(s.getSourceId()))
+                        .map(Jsydghxk::getId)
+                        .collect(Collectors.toList());
+
+                for (ZrzysiteLand land : landList) {
+                    String needUpdateNodeId = "";
+                    if (!needUpdateNodeIdList.isEmpty()) {
+                        needUpdateNodeId = needUpdateNodeIdList.remove(0);
+                    }
+                    addNodeId = addOrUpdatToTable(land, projectId, needUpdateNodeId);
+                    zrzysiteCommonService.getNodeAttachment(projectId, addNodeId, land.getSqbh(), AloneWorkFlowEnum.NODE_4.getName());
+                }
+            } else if ("1".equals(sourceType)) {
+                for (ZrzysiteLand land : landList) {
+                    addNodeId = addOrUpdatToTable(land, projectId, "");
+                    zrzysiteCommonService.getNodeAttachment(projectId, addNodeId, land.getSqbh(), AloneWorkFlowEnum.NODE_4.getName());
+                }
+            }
+        }
+    }
+
+    public String addOrUpdatToTable(ZrzysiteLand land, String projectId, String needUpdateNodeId) {
+        String addNodeId = "";
+        if (StringUtils.isNotBlank(needUpdateNodeId)) {
+            JsydghxkUpdateVo updateVo = new JsydghxkUpdateVo();
+            updateVo.setId(needUpdateNodeId);
+            updateVo.setProjectId(projectId);
+            updateVo.setYddw(land.getXddw());
+            updateVo.setYdwz(land.getYdwz());
+            if (StringUtils.isNotBlank(land.getYdmj())) {
+                try {
+                    updateVo.setYdArea(Float.parseFloat(land.getYdmj()));
+                } catch (NumberFormatException e) {
+                    log.warn("用地面积转换失败: {}", land.getYdmj());
+                }
+            }
+            updateVo.setTdyt(land.getTdyt());
+            updateVo.setTdhqfs(land.getTdhqfs());
+            updateVo.setPzydjg(land.getPzydjg());
+            updateVo.setPzydwh(land.getPzydwh());
+            updateVo.setJsgm(land.getJsgm());
+            updateVo.setZsbh(land.getZsbh());
+            updateVo.setFzjg(land.getFadw());
+            updateVo.setSourceId(land.getSqbh());
+            if (land.getFzrq() != null) {
+                updateVo.setFzDate(sdf.format(land.getFzrq()));
+            }
+            jsydghxkService.update(updateVo);
+            addNodeId = needUpdateNodeId;
+        } else {
+            JsydghxkVo vo = new JsydghxkVo();
+            vo.setProjectId(projectId);
+            vo.setYddw(land.getXddw());
+            vo.setYdwz(land.getYdwz());
+            if (StringUtils.isNotBlank(land.getYdmj())) {
+                try {
+                    vo.setYdArea(Float.parseFloat(land.getYdmj()));
+                } catch (NumberFormatException e) {
+                    log.warn("用地面积转换失败: {}", land.getYdmj());
+                }
+            }
+            vo.setTdyt(land.getTdyt());
+            vo.setTdhqfs(land.getTdhqfs());
+            vo.setPzydjg(land.getPzydjg());
+            vo.setPzydwh(land.getPzydwh());
+            vo.setJsgm(land.getJsgm());
+            vo.setZsbh(land.getZsbh());
+            vo.setFzjg(land.getFadw());
+            vo.setSourceId(land.getSqbh());
+            if (land.getFzrq() != null) {
+                vo.setFzDate(sdf.format(land.getFzrq()));
+            }
+            addNodeId = jsydghxkService.add(vo);
+        }
+        return addNodeId;
+    }
+}

+ 12 - 2
siwei-modules/siwei-apply/src/main/resources/mapper/JsydghxkMapper.xml

@@ -25,6 +25,7 @@
         <result property="creatorId" column="creator_id"/>
         <result property="createdAt" column="created_at"/>
         <result property="updatedAt" column="updated_at"/>
+        <result property="sourceId" column="source_id"/>
     </resultMap>
 
     <select id="isExit" resultType="Boolean">
@@ -36,9 +37,9 @@
     <!-- 添加记录 -->
     <insert id="add" parameterType="com.siwei.apply.domain.Jsydghxk">
         INSERT INTO t_jsydghxk (id, project_id, yddw, ydwz, yd_area, yd_unit, tdyt, tdhqfs, pzydjg, pzydwh,
-                                jsgm, zsbh, fzjg, fz_date, has_onchain, creator_id, created_at, updated_at)
+                                jsgm, zsbh, fzjg, fz_date, has_onchain, creator_id, created_at, updated_at, source_id)
         VALUES (#{id}, #{projectId}, #{yddw}, #{ydwz}, #{ydArea}, #{ydUnit}, #{tdyt}, #{tdhqfs}, #{pzydjg}, #{pzydwh},
-                #{jsgm}, #{zsbh}, #{fzjg}, #{fzDate}, false, #{creatorId}, now(), now())
+                #{jsgm}, #{zsbh}, #{fzjg}, #{fzDate}, false, #{creatorId}, now(), now(), #{sourceId})
     </insert>
 
     <!-- 根据项目ID获取记录 -->
@@ -48,6 +49,14 @@
         WHERE project_id = #{projectId}
     </select>
 
+    <!-- 根据项目ID获取记录列表 -->
+    <select id="getList" resultMap="BaseResultMap" parameterType="String">
+        SELECT *
+        FROM t_jsydghxk
+        WHERE project_id = #{projectId}
+        ORDER BY created_at ASC
+    </select>
+
     <!-- 新增:根据主键ID获取记录 -->
     <select id="getById" resultMap="BaseResultMap" parameterType="String">
         SELECT *
@@ -73,6 +82,7 @@
             <if test="fzjg != null">fzjg = #{fzjg},</if>
             <if test="fzDate != null">fz_date = #{fzDate},</if>
             <if test="hasOnchain != null">has_onchain = #{hasOnchain},</if>
+            <if test="sourceId != null">source_id = #{sourceId},</if>
             updated_at = now()
         </set>
         WHERE id = #{id}

+ 6 - 2
siwei-modules/siwei-apply/src/main/resources/mapper/TdhyhsMapper.xml

@@ -18,6 +18,8 @@
         <result property="creatorId" column="creator_id"/>
         <result property="createdAt" column="created_at"/>
         <result property="updatedAt" column="updated_at"/>
+        <result property="hyyj" column="hyyj"/>
+        <result property="sourceId" column="source_id"/>
     </resultMap>
 
     <select id="isExit" resultType="Boolean">
@@ -31,11 +33,11 @@
         INSERT INTO t_tdhyhs (id, project_id, ydwz, hgzh, fzjg, fz_date,
                                jsdw, gljsgcghxkh,hyyj,
                                has_onchain, creator_id,
-                               created_at, updated_at)
+                               created_at, updated_at, source_id)
         VALUES (#{id}, #{projectId}, #{ydwz}, #{hgzh}, #{fzjg}, #{fzDate},
                 #{jsdw}, #{gljsgcghxkh},#{hyyj},
                 false, #{creatorId},
-                now(), now())
+                now(), now(), #{sourceId})
     </insert>
 
     <!-- 根据项目ID获取记录(返回全部,按创建时间升序) -->
@@ -64,7 +66,9 @@
             <if test="fzDate != null">fz_date = #{fzDate},</if>
             <if test="jsdw != null">jsdw = #{jsdw},</if>
             <if test="gljsgcghxkh != null">gljsgcghxkh = #{gljsgcghxkh},</if>
+            <if test="hyyj != null">hyyj = #{hyyj},</if>
             <if test="hasOnchain != null">has_onchain = #{hasOnchain},</if>
+            <if test="sourceId != null">source_id = #{sourceId},</if>
             updated_at = now()
         </set>
         WHERE id = #{id}