Przeglądaj źródła

地籍管理相关代码修改

chenendian 3 miesięcy temu
rodzic
commit
1025cecf4c
16 zmienionych plików z 1170 dodań i 19 usunięć
  1. 125 0
      siwei-modules/siwei-apply/pom.xml
  2. 43 0
      siwei-modules/siwei-apply/src/main/java/com/siwei/apply/controller/cadastre/CadastreManageController.java
  3. 284 0
      siwei-modules/siwei-apply/src/main/java/com/siwei/apply/controller/cadastre/MdbController.java
  4. 77 19
      siwei-modules/siwei-apply/src/main/java/com/siwei/apply/controller/cadastre/SupplyController.java
  5. 33 0
      siwei-modules/siwei-apply/src/main/java/com/siwei/apply/domain/CadastreFile.java
  6. 31 0
      siwei-modules/siwei-apply/src/main/java/com/siwei/apply/domain/FzssFxrwrz.java
  7. 16 0
      siwei-modules/siwei-apply/src/main/java/com/siwei/apply/domain/vo/CheckInfoResultVo.java
  8. 16 0
      siwei-modules/siwei-apply/src/main/java/com/siwei/apply/domain/vo/CheckInfoVo.java
  9. 35 0
      siwei-modules/siwei-apply/src/main/java/com/siwei/apply/mapper/CadastreFileMapper.java
  10. 23 0
      siwei-modules/siwei-apply/src/main/java/com/siwei/apply/mapper/FzssFxrwrzMapper.java
  11. 19 0
      siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/cadastre/CadastreManageService.java
  12. 301 0
      siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/cadastre/impl/CadastreManageServiceImpl.java
  13. 38 0
      siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/cadastre/impl/FzssFxrwrzHandleService.java
  14. 1 0
      siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/impl/ThematicImpl.java
  15. 79 0
      siwei-modules/siwei-apply/src/main/resources/mapper/CadastreFileMapper.xml
  16. 49 0
      siwei-modules/siwei-apply/src/main/resources/mapper/FzssFxrwrzMapper.xml

+ 125 - 0
siwei-modules/siwei-apply/pom.xml

@@ -100,6 +100,131 @@
             <artifactId>guava</artifactId>
             <version>31.1-jre</version>
         </dependency>
+
+        <!-- 引入解析GDB矢量数据的jar -->
+        <dependency>
+            <groupId>org.gdal.jni</groupId>
+            <version>3.1.0</version>
+            <artifactId>gdal-jni</artifactId>
+            <scope>system</scope>
+            <systemPath>${project.basedir}/lib/gdal.jar</systemPath>
+        </dependency>
+        <dependency>
+            <groupId>org.json.simple</groupId>
+            <version>1.1.1</version>
+            <artifactId>json-simple</artifactId>
+            <scope>system</scope>
+            <systemPath>${project.basedir}/lib/json-simple-1.1.1.jar</systemPath>
+        </dependency>
+        <!--   ejml     -->
+        <!--   geotools     -->
+        <dependency>
+            <groupId>gt-api</groupId>
+            <artifactId>gt-api</artifactId>
+            <scope>system</scope>
+            <version>19.2</version>
+            <systemPath>${project.basedir}/lib/gt-api-19.2.jar</systemPath>
+        </dependency>
+        <dependency>
+            <groupId>gt-data</groupId>
+            <artifactId>gt-data</artifactId>
+            <scope>system</scope>
+            <version>19.2</version>
+            <systemPath>${project.basedir}/lib/gt-data-19.2.jar</systemPath>
+        </dependency>
+        <dependency>
+            <groupId>gt-geotools</groupId>
+            <artifactId>geojson</artifactId>
+            <scope>system</scope>
+            <version>19.2</version>
+            <systemPath>${project.basedir}/lib/gt-geojson-19.2.jar</systemPath>
+        </dependency>
+        <dependency>
+            <groupId>gt-main</groupId>
+            <artifactId>gt-main</artifactId>
+            <scope>system</scope>
+            <version>19.2</version>
+            <systemPath>${project.basedir}/lib/gt-main-19.2.jar</systemPath>
+        </dependency>
+        <dependency>
+            <groupId>gt-metadata</groupId>
+            <artifactId>gt-metadata</artifactId>
+            <scope>system</scope>
+            <version>19.2</version>
+            <systemPath>${project.basedir}/lib/gt-metadata-19.2.jar</systemPath>
+        </dependency>
+        <dependency>
+            <groupId>gt-opengis</groupId>
+            <artifactId>gt-opengis</artifactId>
+            <scope>system</scope>
+            <version>19.2</version>
+            <systemPath>${project.basedir}/lib/gt-opengis-19.2.jar</systemPath>
+        </dependency>
+        <dependency>
+            <groupId>gt-referencing</groupId>
+            <artifactId>gt-referencing</artifactId>
+            <scope>system</scope>
+            <version>19.2</version>
+            <systemPath>${project.basedir}/lib/gt-referencing-19.2.jar</systemPath>
+        </dependency>
+        <dependency>
+            <groupId>gt-render</groupId>
+            <artifactId>gt-render</artifactId>
+            <scope>system</scope>
+            <version>19.2</version>
+            <systemPath>${project.basedir}/lib/gt-render-19.2.jar</systemPath>
+        </dependency>
+        <dependency>
+            <groupId>gt-shapefile</groupId>
+            <artifactId>gt-shapefile</artifactId>
+            <scope>system</scope>
+            <version>19.2</version>
+            <systemPath>${project.basedir}/lib/gt-shapefile-19.2.jar</systemPath>
+        </dependency>
+        <dependency>
+            <groupId>gt-jts</groupId>
+            <artifactId>gt-jts</artifactId>
+            <scope>system</scope>
+            <version>1.13</version>
+            <systemPath>${project.basedir}/lib/jts-1.13.jar</systemPath>
+        </dependency>
+        <dependency>
+            <groupId>gt-jsr</groupId>
+            <artifactId>gt-jsr</artifactId>
+            <scope>system</scope>
+            <version>1.0</version>
+            <systemPath>${project.basedir}/lib/jsr-275-1.0-beta-2.jar</systemPath>
+        </dependency>
+        <dependency>
+            <groupId>json</groupId>
+            <artifactId>json</artifactId>
+            <scope>system</scope>
+            <version>1.1</version>
+            <systemPath>${project.basedir}/lib/json-simple-1.1.jar</systemPath>
+        </dependency>
+
+        <dependency>
+            <groupId>org.gdal.jni</groupId>
+            <version>3.1.0</version>
+            <artifactId>gdal-jni</artifactId>
+            <scope>system</scope>
+            <systemPath>${project.basedir}/lib/gdal.jar</systemPath>
+        </dependency>
+        <dependency>
+            <groupId>org.json.simple</groupId>
+            <version>1.1.1</version>
+            <artifactId>json-simple</artifactId>
+            <scope>system</scope>
+            <systemPath>${project.basedir}/lib/json-simple-1.1.1.jar</systemPath>
+        </dependency>
+
+        <!-- https://mvnrepository.com/artifact/net.sf.ucanaccess/ucanaccess -->
+        <dependency>
+            <groupId>net.sf.ucanaccess</groupId>
+            <artifactId>ucanaccess</artifactId>
+            <version>5.0.1</version>
+        </dependency>
+
     </dependencies>
 
     <build>

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

@@ -0,0 +1,43 @@
+package com.siwei.apply.controller.cadastre;
+
+import com.siwei.apply.domain.vo.CheckInfoResultVo;
+import com.siwei.apply.service.cadastre.CadastreManageService;
+import com.siwei.common.core.domain.R;
+import com.siwei.common.core.web.controller.BaseController;
+import org.gdal.ogr.*;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import java.util.*;
+
+@Controller
+@RequestMapping("/cadastre/manage")
+/**
+ * 地籍库管理模块
+ */
+public class CadastreManageController extends BaseController {
+
+    @Autowired
+    private CadastreManageService cadastreManageService;
+
+    @PostMapping("/checkUploadDquality")
+    public R<CheckInfoResultVo> checkData(String shpFileName, String shpFilePath, String fromRoute) {
+        try {
+            //1.先获取相关信息,进行入库
+            //2.日志记录写入
+            //3.读取文件进行录入
+            //4.质量进行检查
+            CheckInfoResultVo res = cadastreManageService.checkFileData(shpFileName, shpFilePath, fromRoute);
+            return R.ok(res);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return R.fail(e.getMessage());
+        }
+    }
+
+
+
+
+}

+ 284 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/controller/cadastre/MdbController.java

@@ -0,0 +1,284 @@
+package com.siwei.apply.controller.cadastre;
+import com.siwei.common.core.utils.StringUtils;
+import com.siwei.common.core.web.controller.BaseController;
+import org.json.simple.JSONObject;
+import org.json.simple.parser.JSONParser;
+import org.json.simple.parser.ParseException;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.sql.*;
+import java.util.*;
+
+@Controller
+@RequestMapping("/mdb")
+public class MdbController extends BaseController {
+
+    /**
+     *
+     * 获取mdb下的属性表
+     *
+     * @param request
+     * @return
+     * @throws IOException
+     * @throws ParseException
+     */
+    @PostMapping("/gettables")
+    public void gettables(HttpServletRequest request, HttpServletResponse response) {
+        try {
+            response.setCharacterEncoding("UTF-8"); //告诉服务器用UTF-8进行编码解析
+            //告诉浏览器使用什么编码去解析
+            //response.setHeader("content-type", "text/html; charset=UTF-8");
+            String folderURL = null;
+            JSONObject layerJson = null;
+            String strContentType = request.getContentType();
+            if (strContentType != null && strContentType.equalsIgnoreCase("application/json")) {
+                JSONObject reqJson = (JSONObject) new JSONParser().parse(request.getReader());
+                if (reqJson != null) {
+                    folderURL = (String) reqJson.get("DATAURI");
+                }
+            }
+            if (StringUtils.isEmpty(folderURL)) {
+                return;
+            }
+            List<Map<String, Object>> res = MdbTables(folderURL, null, null);
+            JSONObject respJSON = new JSONObject();
+            respJSON.put("data", res);
+            respJSON.put("code", 200);
+            respJSON.put("msg", "获取成功");
+            respJSON.writeJSONString(response.getWriter());
+            response.setContentType("application/json;charset=UTF-8");
+            response.setStatus(200);
+        } catch (Exception e) {
+            e.printStackTrace();
+            JSONObject respJSON = new JSONObject();
+            respJSON.put("data", null);
+            respJSON.put("msg", "获取失败");
+            respJSON.put("code", 500);
+            try {
+                respJSON.writeJSONString(response.getWriter());
+            } catch (IOException e1) {
+                e1.printStackTrace();
+            }
+            response.setContentType("application/json;charset=UTF-8");
+            response.setStatus(500);
+        }
+        return;
+    }
+
+    /**
+     * 获取mdb下的指定表
+     *
+     * @param request
+     * @return
+     * @throws IOException
+     * @throws ParseException
+     */
+    @PostMapping("/gettable")
+    public void gettable(HttpServletRequest request, HttpServletResponse response) {
+        try {
+            response.setCharacterEncoding("UTF-8"); //告诉服务器用UTF-8进行编码解析
+            String folderURL = null;
+            String tablename = null;
+            Integer page = 1;
+            Integer limit = 20;
+            String strContentType = request.getContentType();
+            if (strContentType != null && strContentType.equalsIgnoreCase("application/json")) {
+                JSONObject reqJson = (JSONObject) new JSONParser().parse(request.getReader());
+                if (reqJson != null) {
+                    folderURL = reqJson.get("DATAURI").toString();
+                    tablename = reqJson.get("TABLENAME").toString();
+                    if (reqJson.get("PAGE") != null) {
+                        page = Long.valueOf(reqJson.get("PAGE").toString()).intValue();
+                    }
+                    if (reqJson.get("LIMIT") != null) {
+                        limit = Long.valueOf(reqJson.get("LIMIT").toString()).intValue();
+                    }
+                }
+            }
+            if (StringUtils.isEmpty(folderURL)) {
+                return;
+            }
+            Map<String, Object> res = MdbTableContent(folderURL, tablename, null, null, page, limit);
+            JSONObject respJSON = new JSONObject();
+            respJSON.put("data", res);
+            respJSON.put("code", 200);
+            respJSON.put("msg", "获取成功");
+            respJSON.writeJSONString(response.getWriter());
+            response.setContentType("application/json;charset=UTF-8");
+            response.setStatus(200);
+        } catch (Exception e) {
+            e.printStackTrace();
+            JSONObject respJSON = new JSONObject();
+            respJSON.put("data", null);
+            respJSON.put("msg", "获取失败");
+            respJSON.put("code", 500);
+            try {
+                respJSON.writeJSONString(response.getWriter());
+            } catch (IOException e1) {
+                e1.printStackTrace();
+            }
+            response.setContentType("application/json;charset=UTF-8");
+            response.setStatus(500);
+        }
+        return;
+    }
+
+    /**
+     * 读取.mdb文件下面的所有表名
+     *
+     * @param mdbPath  mdb文件地址
+     * @param username 用户名
+     * @param password 密码
+     */
+    public List<Map<String, Object>> MdbTables(String mdbPath, String username, String password) throws Exception {
+        List<Map<String, Object>> list = new ArrayList<>();
+        Properties Prop = new Properties();
+        //设置编码
+        Prop.put("charSet", "UTF-8");
+        if (!StringUtils.isEmpty(username)) {
+            Prop.put("user", username);
+        }
+        if (!StringUtils.isEmpty(password)) {
+            Prop.put("password", password);
+        }
+        //数据地址
+        String dbUrl = "jdbc:ucanaccess://" + mdbPath;
+        //引入驱动
+        Class.forName("net.ucanaccess.jdbc.UcanaccessDriver").newInstance();
+        Connection conn = null;
+        ResultSet tables = null;
+        PreparedStatement preparedStatement = null;
+        ResultSet rs = null;
+        try {
+            //连接数据库资源
+            conn = DriverManager.getConnection(dbUrl, Prop);
+            tables = conn.getMetaData().getTables(mdbPath, null, null, new String[]{"TABLE"});
+            //遍历表
+            while (tables.next()) {
+                Map<String, Object> tableMap = new HashMap<>();
+                String tableName = tables.getString(3);
+                String tableAlias = tables.getString(4);
+                tableMap.put("name", tableName);
+                tableMap.put("alias", tableName);
+                if (!tableName.contains("GDB_")) {
+                    list.add(tableMap);
+                }
+                String cur = "";
+                for (int u = 0; u < tables.getMetaData().getColumnCount(); u++) {
+                    String key = tables.getMetaData().getColumnLabel(u + 1);
+                    cur += ";" + key + ":" + tables.getString(key);
+                }
+                System.out.println(cur);
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+            System.out.println("resolverMdb is error!!!");
+        } finally {
+            closeA1l(conn, preparedStatement, tables, rs);
+        }
+        return list;
+    }
+
+
+    /**
+     * 读取.mdb文件中指定表
+     *
+     * @param mdbPath  mdb文件地址
+     * @param username 用户名
+     * @param password 密码
+     */
+    public Map<String, Object> MdbTableContent(String mdbPath, String tablename, String username, String password, Integer page, Integer limit) throws Exception {
+        Map<String, Object> tableMap = new HashMap<>(16);
+        Properties Prop = new Properties();
+        //设置编码
+        Prop.put("charSet", "UTF-8");
+        if (!StringUtils.isEmpty(username)) {
+            Prop.put("user", username);
+        }
+        if (!StringUtils.isEmpty(password)) {
+            Prop.put("password", password);
+        }
+        //数据地址
+        String dbUrl = "jdbc:ucanaccess://" + mdbPath;
+        //引入驱动
+        Class.forName("net.ucanaccess.jdbc.UcanaccessDriver").newInstance();
+        Connection conn = null;
+        ResultSet tables = null;
+        PreparedStatement preparedStatement = null;
+        ResultSet rs = null;
+        PreparedStatement countPreparedStatement = null;
+        ResultSet currs = null;
+        try {
+            //连接数据库资源
+            conn = DriverManager.getConnection(dbUrl, Prop);
+            Integer RowStart = (page - 1) * limit;
+            Integer RowEnd = (page - 0) * limit;
+            preparedStatement = conn.prepareStatement("select * from " + tablename + " t limit " + RowStart + "," + limit);
+            List<String> columnList = new ArrayList<>();
+            List<Map<String, String>> dataList = new ArrayList<>();
+            rs = preparedStatement.executeQuery();
+            ResultSetMetaData data = rs.getMetaData();
+            for (int i = 1; i <= data.getColumnCount(); i++) {
+                //列名
+                String columnName = data.getColumnName(i);
+                columnList.add(columnName);
+            }
+            while (rs.next()) {
+                Map<String, String> map = new HashMap<>();
+                for (int i = 1; i <= data.getColumnCount(); i++) {
+                    //列名
+                    String columnName = data.getColumnName(i);
+                    map.put(columnName, rs.getString(i));
+                }
+                dataList.add(map);
+            }
+            //查询总记录数
+            countPreparedStatement = conn.prepareStatement("select count(1) from " + tablename + " t ");
+            currs = countPreparedStatement.executeQuery();
+            while (currs.next()) {
+                tableMap.put("count", Integer.valueOf(currs.getString(1)));
+            }
+            tableMap.put("name", tablename);
+            tableMap.put("column", columnList);
+            tableMap.put("rows", dataList);
+        } catch (Exception e) {
+            e.printStackTrace();
+            System.out.println("resolverMdb is error!!!");
+        } finally {
+            closeA1l(conn, preparedStatement, tables, rs);
+            closeA1l(conn, countPreparedStatement, null, currs);
+        }
+        return tableMap;
+    }
+
+    /**
+     * 关闭所有的资源链接
+     *
+     * @param conn              连接
+     * @param preparedStatement 初始化 执行语句
+     * @param tables            结果集
+     * @param rs                结果集
+     */
+    public void closeA1l(Connection conn, PreparedStatement preparedStatement, ResultSet tables, ResultSet rs) {
+        try {
+            if (null != rs) {
+                rs.close();
+            }
+            if (null != tables) {
+                tables.close();
+            }
+            if (null != preparedStatement) {
+                preparedStatement.close();
+            }
+            if (null != conn) {
+                conn.close();
+            }
+        } catch (Exception ignore) {
+        }
+    }
+}

+ 77 - 19
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/controller/cadastre/SupplyController.java

@@ -4,10 +4,13 @@ import com.siwei.apply.domain.res.*;
 import com.siwei.apply.service.cadastre.IZymlService;
 import com.siwei.common.core.domain.R;
 import com.siwei.common.core.web.controller.BaseController;
+import org.gdal.ogr.*;
+import org.gdal.osr.SpatialReference;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
 import java.util.HashMap;
+import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
 
@@ -23,8 +26,13 @@ public class SupplyController extends BaseController {
     @Autowired
     private IZymlService zymlService;
 
+    private final LinkedHashMap<String, OGRVectorTiler> m_TilerMap = new LinkedHashMap<String, OGRVectorTiler>();
+
+
     /**
+     *
      * 年度统计
+     *
      */
     @GetMapping("/yearStatistics/{year}")
     public R<SupplyYearStatisticsRes> getYearStatistics(@PathVariable String year) {
@@ -92,7 +100,7 @@ public class SupplyController extends BaseController {
 
                 // --------------土地用途分析----------------------
                 // 城镇住宅用地,教育用地,商业用地,工业用地,物流仓储用地,公路用地,工业绿地
-                String[] landTypes = { "城镇住宅用地", "教育用地", "商业用地", "工业用地", "物流仓储用地", "公路用地", "工业绿地" };
+                String[] landTypes = {"城镇住宅用地", "教育用地", "商业用地", "工业用地", "物流仓储用地", "公路用地", "工业绿地"};
                 for (String type : landTypes) {
                     LandUseRes landUse = new LandUseRes();
                     landUse.setLandUseTypeName(type);
@@ -186,36 +194,86 @@ public class SupplyController extends BaseController {
         }
     }
 
-    /*
-    */
+
+    @GetMapping("/getTestList")
+    public R<String> getTestList(String param) {
+        //ogr.RegisterAll();
+        Driver driver = ogr.GetDriverByName("OpenFileGDB");
+        String gdbPath = "C:\\Users\\Administrator\\Desktop\\06\\KJGH.gdb";
+        DataSource ds = driver.Open(gdbPath, 0);
+        if (ds == null) {
+            System.out.println("无法打开 gdb");
+            return null;
+        }
+
+        System.out.println("图层数量: " + ds.GetLayerCount());
+        for (int i = 0; i < ds.GetLayerCount(); i++) {
+            Layer layer = ds.GetLayer(i);
+            printLayerInfo(layer);
+        }
+        ds.delete();
+        return null;
+    }
+
+    private static void printLayerInfo(Layer layer) {
+        System.out.println("=============");
+        System.out.println("图层名: " + layer.GetName());
+        System.out.println("要素数: " + layer.GetFeatureCount());
+        System.out.println("几何类型: " + layer.GetGeomType());
+
+        // 字段信息
+        FeatureDefn defn = layer.GetLayerDefn();
+        System.out.println("字段数: " + defn.GetFieldCount());
+        for (int i = 0; i < defn.GetFieldCount(); i++) {
+            FieldDefn field = defn.GetFieldDefn(i);
+            System.out.println(
+                    field.GetName() + " | " +
+                            field.GetFieldTypeName(field.GetFieldType())
+            );
+        }
+
+        // 坐标系
+        SpatialReference sr = layer.GetSpatialRef();
+        if (sr != null) {
+            System.out.println("EPSG: " + sr.GetAuthorityCode(null));
+            System.out.println(sr.ExportToWkt());
+        }
+    }
+
+
+
+
+
+
+
     /**
      * 获取资源目录列表
      *
      * @param param 预留
      * @return
      *//*
-        * 
-        * @GetMapping("/GetList")
-        * public R GetList(String param) {
-        * R list = zymlService.GetList(param);
-        * return list;
-        * }
-        * 
-        */
+     *
+     * @GetMapping("/GetList")
+     * public R GetList(String param) {
+     * R list = zymlService.GetList(param);
+     * return list;
+     * }
+     *
+     */
     /**
      * 获取资源目录列表
      *
      * @param param 预留
      * @return
      *//*
-        * 
-        * @GetMapping("/GetTree")
-        * public R GetTree(String param) {
-        * R list = zymlService.GetTree(param);
-        * return list;
-        * }
-        * 
-        */
+     *
+     * @GetMapping("/GetTree")
+     * public R GetTree(String param) {
+     * R list = zymlService.GetTree(param);
+     * return list;
+     * }
+     *
+     */
 
     // /**
     // * 根据标识码获取资源详情

+ 33 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/domain/CadastreFile.java

@@ -0,0 +1,33 @@
+package com.siwei.apply.domain;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * CadastreFile对象 t_cadastre_file
+ *
+ * @author siwei
+ * @date 2025-01-07
+ */
+@Data
+public class CadastreFile extends BaseId {
+    private String name;
+    private String uploadUser;
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date uploadTime;
+    private String filePath;
+    private String proxyPath;
+    private String unzipPath;
+    //1 为矢量,2为表格属性
+    private String fileType;
+    private String storage;
+    private String status;
+    private String readStatus;
+    private String readMessage;
+    private String fileStorageTime;
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date updateTime;
+    private Long fileSize;
+}

+ 31 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/domain/FzssFxrwrz.java

@@ -0,0 +1,31 @@
+package com.siwei.apply.domain;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * 地籍库操作任务日志对象 t_fzss_fxrwrz
+ *
+ * @author siwei
+ * @date 2026-01-07
+ */
+@Data
+public class FzssFxrwrz {
+    /** 标识码 */
+    private String bsm;
+    /** 任务类型 */
+    private String rwlx;
+    /** 任务标识码 */
+    private String rwbsm;
+    /** 信息类型 */
+    private String rzlx;
+    /** 任务时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date rzsj;
+    /** 分析结果 */
+    private String fxjg;
+    /** 日志内容 */
+    private String rzlr;
+}

+ 16 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/domain/vo/CheckInfoResultVo.java

@@ -0,0 +1,16 @@
+package com.siwei.apply.domain.vo;
+
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * 建设工程规划许可 视图对象
+ */
+@Data
+public class CheckInfoResultVo {
+    private Boolean resultStatus; //检查是否通过
+    private List<CheckInfoVo> checkSuccessList; // 用地位置
+    private List<CheckInfoVo> checkFailList; // 用地位置
+
+}

+ 16 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/domain/vo/CheckInfoVo.java

@@ -0,0 +1,16 @@
+package com.siwei.apply.domain.vo;
+
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * 建设工程规划许可 视图对象
+ */
+@Data
+public class CheckInfoVo {
+    private Boolean checkStatus; // 是否检查通过
+    private String uploadFileTableName; //当前标识名称
+    private List<String> checkInfoList; // 信息
+
+}

+ 35 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/mapper/CadastreFileMapper.java

@@ -0,0 +1,35 @@
+package com.siwei.apply.mapper;
+
+import com.siwei.apply.domain.CadastreFile;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+@Mapper
+public interface CadastreFileMapper {
+    /**
+     * 新增
+     */
+    void add(CadastreFile cadastreFile);
+
+    /**
+     * 根据ID查询
+     */
+    CadastreFile get(String id);
+
+    /**
+     * 更新
+     */
+    void update(CadastreFile cadastreFile);
+
+    /**
+     * 删除
+     */
+    void delete(String id);
+
+    /**
+     * 列表查询
+     */
+    List<CadastreFile> getList(CadastreFile cadastreFile);
+}

+ 23 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/mapper/FzssFxrwrzMapper.java

@@ -0,0 +1,23 @@
+package com.siwei.apply.mapper;
+
+import com.siwei.apply.domain.FzssFxrwrz;
+import org.apache.ibatis.annotations.Mapper;
+import java.util.List;
+
+@Mapper
+public interface FzssFxrwrzMapper {
+    /**
+     * 新增
+     */
+    void add(FzssFxrwrz fzssFxrwrz);
+
+    /**
+     * 根据BSM查询
+     */
+    FzssFxrwrz get(String bsm);
+
+    /**
+     * 列表查询
+     */
+    List<FzssFxrwrz> getList(FzssFxrwrz fzssFxrwrz);
+}

+ 19 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/cadastre/CadastreManageService.java

@@ -0,0 +1,19 @@
+package com.siwei.apply.service.cadastre;
+
+
+import com.siwei.apply.domain.CadastreFile;
+import com.siwei.apply.domain.vo.CheckInfoResultVo;
+import com.siwei.apply.domain.vo.CheckInfoVo;
+import com.siwei.apply.domain.vo.JsydghxkVo;
+import com.siwei.common.core.domain.R;
+
+import java.util.List;
+import java.util.Map;
+
+public interface CadastreManageService {
+
+    CadastreFile saveUploadFile(String theFileName, String theFilePath, String fromRoute);
+
+    CheckInfoResultVo checkFileData(String theFileName, String theFilePath, String fromRoute);
+
+}

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

@@ -0,0 +1,301 @@
+package com.siwei.apply.service.cadastre.impl;
+
+import com.siwei.apply.domain.CadastreFile;
+import com.siwei.apply.domain.vo.CheckInfoResultVo;
+import com.siwei.apply.domain.vo.CheckInfoVo;
+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.common.core.exception.ServiceException;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.gdal.ogr.*;
+import org.gdal.osr.SpatialReference;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.*;
+
+
+/**
+ * 地籍管理系统主业务逻辑
+ */
+@Slf4j
+@Service
+public class CadastreManageServiceImpl implements CadastreManageService {
+    static {
+        ogr.RegisterAll();
+    }
+
+    @Autowired
+    private CadastreFileMapper cadastreFileMapper;
+
+    @Autowired
+    private FzssFxrwrzHandleService fzssFxrwrzHandleService;
+
+    /**
+     * 文件入库
+     *
+     * @param theFileName
+     * @param theFilePath
+     * @param fromRoute
+     * @return
+     */
+    @Override
+    public CadastreFile saveUploadFile(String theFileName, String theFilePath, String fromRoute) {
+        try {
+            if (theFilePath == null || theFilePath.trim().isEmpty()) {
+                log.warn("处理文件失败:filePath不能为空");
+                return null;
+            }
+            Path file = Paths.get(theFilePath);
+            if (!Files.exists(file)) {
+                log.warn("处理文件失败:文件不存在: {}", theFilePath);
+                return null;
+            }
+
+            //文件解压到当前目录
+            String unZipPath = file.getParent().toAbsolutePath().toString();
+            // 判断是否为压缩文件
+            if (FileExtractUtil.isCompressedFile(theFilePath)) {
+                // 解压文件到同名文件夹并获取目录结构
+                boolean extractRes = FileExtractUtil.extractFile(theFilePath, unZipPath);
+                //解压成功文件保存
+                if (extractRes == true) {
+                    CadastreFile cadastreFile = new CadastreFile();
+                    cadastreFile.generateId();//生成id
+                    cadastreFile.setName(theFileName);
+                    cadastreFile.setFilePath(theFilePath);
+                    cadastreFile.setUnzipPath(unZipPath);
+                    cadastreFile.setFileType("1");//矢量/表格
+                    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 fromRoute
+     * @return
+     */
+    @Override
+    public CheckInfoResultVo checkFileData(String theFileName, String theFilePath, String fromRoute) {
+        CheckInfoResultVo checkInfoResult = new CheckInfoResultVo();
+        checkInfoResult.setResultStatus(true);
+        List<CheckInfoVo> checkInfoSuccessList = new ArrayList<>();
+        List<CheckInfoVo> checkInfoFailList = new ArrayList<>();
+
+        CadastreFile uploadFile = this.saveUploadFile(theFileName, theFilePath, fromRoute);
+        if (Objects.nonNull(uploadFile)) {
+            //入库成功
+            fzssFxrwrzHandleService.insertFxrwrz(uploadFile.getId(), "info", "上传文件成功", "地籍库管理");
+            String gdbPath = uploadFile.getUnzipPath();
+            DataSource ds = ogr.Open(gdbPath, 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);
+                //这里做质量检查
+                CheckInfoVo checkRes = checkLayerInfo(layer, null);
+                if (checkRes.getCheckStatus().equals(false)) { //检查出错
+                    checkInfoFailList.add(checkRes);
+                    checkInfoResult.setResultStatus(false);
+                } else if (checkRes.getCheckStatus().equals(true)) {
+                    checkInfoSuccessList.add(checkRes);
+                }
+            }
+            ds.delete();
+            checkInfoResult.setCheckFailList(checkInfoFailList);
+            checkInfoResult.setCheckSuccessList(checkInfoSuccessList);
+        }
+        return checkInfoResult;
+    }
+
+
+    /**
+     * 对每个图层进行数据格式校验
+     *
+     * @param layer
+     * @param allTableList
+     * @return
+     */
+    private CheckInfoVo checkLayerInfo(Layer layer, List<String> allTableList) {
+        //总返回对象
+        CheckInfoVo checkInfoVo = new CheckInfoVo();
+        checkInfoVo.setCheckStatus(true);//初始化检查通过
+
+        List<String> checkInfoList = new ArrayList<>();
+        String name = layer.GetName();
+        checkInfoVo.setUploadFileTableName(name);
+
+        //检查表名对应
+        if (!allTableList.contains(name)) {
+            checkInfoList.add(name + ":图层名称不在地籍库范围内!");
+            checkInfoVo.setCheckStatus(false);
+        }
+
+        //检查坐标系
+        if(checkCoordinateSystem(layer).equals(false)){
+            checkInfoList.add(name + ":坐标系不正确,确认是否CGCS2000!");
+            checkInfoVo.setCheckStatus(false);
+        }
+
+        //todo  查询库中的当前表字段;
+        List<String> dbFieldNameList =  new ArrayList<>();
+        List<String> layerFieldNameList =   getFieldName(layer);
+        // 判断是否包含相同的元素(不考虑顺序)
+        boolean areCollectionsEqual = CollectionUtils.isEqualCollection(dbFieldNameList, layerFieldNameList);
+        if(!areCollectionsEqual){
+            checkInfoList.add(name + ":字段数据不一致!-"+dbFieldNameList);
+            checkInfoVo.setCheckStatus(false);
+        }
+
+        //todo 检查字段数据是否为空
+        //仅仅获取图层属性
+        List<Map<String, String>> theValueList =  getValueList(layer,false);
+        //todo 这里根据表名获取相关校验字段信息
+        List<String> checkFieldList = new ArrayList<>();
+        checkFieldList.add("111");
+
+        for (Map<String, String> theMap : theValueList) {
+            for(String fieldName : checkFieldList){
+                if(com.siwei.common.core.utils.StringUtils.isBlank(theMap.get(fieldName))){
+                    checkInfoList.add(name + "--"+fieldName+"字段不能为空!");
+                    checkInfoVo.setCheckStatus(false);
+                }
+            }
+        }
+        checkInfoVo.setCheckInfoList(checkInfoList);
+        return checkInfoVo;
+    }
+
+
+
+
+    /**
+     * 获取当前图层的所有属性字段名
+     *
+     * @param layer
+     * @return
+     */
+    private List<String> getFieldName(Layer layer) {
+        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());
+        }
+        return nameList;
+    }
+
+
+    /**
+     * 获取当前图层的所有字段名称和值
+     *
+     * @param layer
+     * @return
+     */
+    private List<Map<String, String>> getValueList(Layer layer, Boolean haveGeom) {
+        List<Map<String, String>> list = new ArrayList<>();
+        Map<String, String> map = new LinkedHashMap<>();
+        layer.ResetReading();
+        Feature feature;
+        while ((feature = layer.GetNextFeature()) != null) {
+            for (int i = 0; i < feature.GetFieldCount(); i++) {
+                map.put(feature.GetFieldDefnRef(i).GetName(), feature.GetFieldAsString(i));
+            }
+            if (haveGeom.equals(true)) {
+                Geometry geom = feature.GetGeometryRef();
+                if (geom != null) {
+                    // 将几何对象转换为 WKT 格式
+                    String wkt = geom.ExportToWkt();
+                    map.put("geom", wkt);
+                }
+            }
+            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;
+    }
+
+
+}

+ 38 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/cadastre/impl/FzssFxrwrzHandleService.java

@@ -0,0 +1,38 @@
+package com.siwei.apply.service.cadastre.impl;
+
+import com.siwei.apply.domain.FzssFxrwrz;
+import com.siwei.apply.mapper.FzssFxrwrzMapper;
+import com.siwei.common.core.utils.StringUtils;
+import com.siwei.common.core.utils.uuid.IdUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+
+import java.util.*;
+
+@Service
+public class FzssFxrwrzHandleService {
+
+    @Autowired
+    private FzssFxrwrzMapper fzssFxrwrzMapper;
+
+    //insertFxrwrz(StringUtils.getUUID(), tTdzzyj.getBsm(), tTdzzyj.getXmmc(), "整治预判分析中" + fxxx + "分析结束。。。", "info");
+
+    public void insertFxrwrz(String rwbsm, String scxName, String rznr, String rzlx) {
+        //添加记录
+        FzssFxrwrz fzssFxrwrz = new FzssFxrwrz();
+        String bsm  = IdUtils.fastSimpleUUID();
+        fzssFxrwrz.setBsm(bsm);
+        fzssFxrwrz.setRwbsm(rwbsm);
+        fzssFxrwrz.setRwlx(scxName);
+        if (StringUtils.isNotEmpty(rznr)) {
+            fzssFxrwrz.setRzlr(rznr);
+        } else {
+            fzssFxrwrz.setRzlr(scxName + "完成");
+        }
+        fzssFxrwrz.setRzlx(rzlx);
+        fzssFxrwrz.setRzsj(new Date());
+        fzssFxrwrzMapper.add(fzssFxrwrz);
+    }
+
+}

+ 1 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/impl/ThematicImpl.java

@@ -38,6 +38,7 @@ public class ThematicImpl implements ThematicService {
     private String temppath;
     @Value("${python.home}")
     private String pythonHome;
+
     @Value("${python.cadastralmap}")
     private String cadastralmapPy;
     @Value("${python.parcelmap}")

+ 79 - 0
siwei-modules/siwei-apply/src/main/resources/mapper/CadastreFileMapper.xml

@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.siwei.apply.mapper.CadastreFileMapper">
+    <resultMap id="cadastreFileMap" type="com.siwei.apply.domain.CadastreFile">
+        <id column="id" property="id"/>
+        <result column="name" property="name"/>
+        <result column="upload_user" property="uploadUser"/>
+        <result column="upload_time" property="uploadTime"/>
+        <result column="file_path" property="filePath"/>
+        <result column="proxy_path" property="proxyPath"/>
+        <result column="unzip_path" property="unzipPath"/>
+        <result column="file_type" property="fileType"/>
+        <result column="storage" property="storage"/>
+        <result column="status" property="status"/>
+        <result column="read_status" property="readStatus"/>
+        <result column="read_message" property="readMessage"/>
+        <result column="file_storage_time" property="fileStorageTime"/>
+        <result column="update_time" property="updateTime"/>
+        <result column="file_size" property="fileSize"/>
+    </resultMap>
+
+    <sql id="Base_Column_List">
+        id, name, upload_user, upload_time, file_path, proxy_path, unzip_path, file_type, storage, status, read_status, read_message, file_storage_time, update_time, file_size
+    </sql>
+
+    <insert id="add" parameterType="com.siwei.apply.domain.CadastreFile">
+        INSERT INTO t_cadastre_file (
+            id, name, upload_user, upload_time, file_path, proxy_path, unzip_path, file_type, storage, status, read_status, read_message, file_storage_time, update_time, file_size
+        ) VALUES (
+            #{id}, #{name}, #{uploadUser}, #{uploadTime}, #{filePath}, #{proxyPath}, #{unzipPath}, #{fileType}, #{storage}, #{status}, #{readStatus}, #{readMessage}, #{fileStorageTime}, #{updateTime}, #{fileSize}
+        )
+    </insert>
+
+    <select id="get" resultMap="cadastreFileMap">
+        SELECT <include refid="Base_Column_List"/>
+        FROM t_cadastre_file
+        WHERE id = #{id}
+    </select>
+
+    <update id="update" parameterType="com.siwei.apply.domain.CadastreFile">
+        UPDATE t_cadastre_file
+        <set>
+            <if test="name != null">name = #{name},</if>
+            <if test="uploadUser != null">upload_user = #{uploadUser},</if>
+            <if test="uploadTime != null">upload_time = #{uploadTime},</if>
+            <if test="filePath != null">file_path = #{filePath},</if>
+            <if test="proxyPath != null">proxy_path = #{proxyPath},</if>
+            <if test="unzipPath != null">unzip_path = #{unzipPath},</if>
+            <if test="fileType != null">file_type = #{fileType},</if>
+            <if test="storage != null">storage = #{storage},</if>
+            <if test="status != null">status = #{status},</if>
+            <if test="readStatus != null">read_status = #{readStatus},</if>
+            <if test="readMessage != null">read_message = #{readMessage},</if>
+            <if test="fileStorageTime != null">file_storage_time = #{fileStorageTime},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="fileSize != null">file_size = #{fileSize},</if>
+        </set>
+        WHERE id = #{id}
+    </update>
+
+    <delete id="delete">
+        DELETE FROM t_cadastre_file WHERE id = #{id}
+    </delete>
+
+    <select id="getList" resultMap="cadastreFileMap">
+        SELECT <include refid="Base_Column_List"/>
+        FROM t_cadastre_file
+        <where>
+            <if test="name != null and name != ''">
+                AND name LIKE CONCAT('%', #{name}, '%')
+            </if>
+            <if test="status != null and status != ''">
+                AND status = #{status}
+            </if>
+        </where>
+    </select>
+</mapper>

+ 49 - 0
siwei-modules/siwei-apply/src/main/resources/mapper/FzssFxrwrzMapper.xml

@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.siwei.apply.mapper.FzssFxrwrzMapper">
+    <resultMap id="fzssFxrwrzMap" type="com.siwei.apply.domain.FzssFxrwrz">
+        <id column="bsm" property="bsm"/>
+        <result column="rwlx" property="rwlx"/>
+        <result column="rwbsm" property="rwbsm"/>
+        <result column="rzlx" property="rzlx"/>
+        <result column="rzsj" property="rzsj"/>
+        <result column="fxjg" property="fxjg"/>
+        <result column="rzlr" property="rzlr"/>
+    </resultMap>
+
+    <sql id="Base_Column_List">
+        bsm, rwlx, rwbsm, rzlx, rzsj, fxjg, rzlr
+    </sql>
+
+    <insert id="add" parameterType="com.siwei.apply.domain.FzssFxrwrz">
+        INSERT INTO t_fzss_fxrwrz (
+            bsm, rwlx, rwbsm, rzlx, rzsj, fxjg, rzlr
+        ) VALUES (
+            #{bsm}, #{rwlx}, #{rwbsm}, #{rzlx}, #{rzsj}, #{fxjg}, #{rzlr}
+        )
+    </insert>
+
+    <select id="get" resultMap="fzssFxrwrzMap">
+        SELECT <include refid="Base_Column_List"/>
+        FROM t_fzss_fxrwrz
+        WHERE bsm = #{bsm}
+    </select>
+
+    <select id="getList" resultMap="fzssFxrwrzMap">
+        SELECT <include refid="Base_Column_List"/>
+        FROM t_fzss_fxrwrz
+        <where>
+            <if test="rwlx != null and rwlx != ''">
+                AND rwlx = #{rwlx}
+            </if>
+            <if test="rzlx != null and rzlx != ''">
+                AND rzlx = #{rzlx}
+            </if>
+             <if test="rwbsm != null and rwbsm != ''">
+                AND rwbsm = #{rwbsm}
+            </if>
+        </where>
+    </select>
+</mapper>