管道基础大数据平台系统开发-【后端】-Server
2
13693261870
2023-01-09 c61573b7222a99a69ff381fac53f4af831030830
2
已修改9个文件
130 ■■■■■ 文件已修改
data/update.sql 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/controller/data/upload/UploadController.java 54 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/entity/all/StaticData.java 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/entity/data/DirEntity.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/mapper/data/UploadMapper.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/service/data/FmeService.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/service/data/UploadService.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/data/DirMapper.xml 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/data/UploadMapper.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
data/update.sql
@@ -105,11 +105,15 @@
select zoning from lf.sys_coord group by zoning;
select id, name from lf.sys_dir where pid = 0 and id > 1;
select * from lf.sys_coord where epsgcode = 'EPSG:4490';
select * from lf.sys_operate;
with recursive rs as(
    select a.*, fullName from lf.sys_dir a where name=#{name}
union
    select a.* from lf.sys_dir a, rs b where a.pid=b.id
)
select * from rs order by order_num;
src/main/java/com/lf/server/controller/data/upload/UploadController.java
@@ -2,15 +2,19 @@
import com.lf.server.annotation.SysLog;
import com.lf.server.entity.all.ResponseMsg;
import com.lf.server.entity.all.StaticData;
import com.lf.server.entity.ctrl.TabMapperEntity;
import com.lf.server.entity.ctrl.UploadEntity;
import com.lf.server.entity.data.DirEntity;
import com.lf.server.entity.data.MetaEntity;
import com.lf.server.entity.data.MetaFileEntity;
import com.lf.server.entity.sys.UserEntity;
import com.lf.server.helper.StringHelper;
import com.lf.server.helper.WebHelper;
import com.lf.server.service.all.BaseUploadService;
import com.lf.server.service.data.DataLoaderService;
import com.lf.server.service.data.DataUploadService;
import com.lf.server.service.data.DirService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
@@ -84,13 +88,29 @@
    @GetMapping(value = "/selectFiles")
    public ResponseMsg<List<MetaFileEntity>> selectFiles(String path) {
        try {
            List<MetaFileEntity> list = baseUploadService.selectFiles(path, EXT_LIST);
            List<MetaFileEntity> list = baseUploadService.selectFiles(path, StaticData.ALL_EXTENSION);
            return success(list);
        } catch (Exception ex) {
            return fail(ex.getMessage(), null);
        }
    }
    @SysLog()
    @ApiOperation(value = "查询文件")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "path", value = "路径", dataType = "String", paramType = "query")
    })
    @GetMapping(value = "/selectFiles2")
    public ResponseMsg<List<MetaFileEntity>> selectFiles2(String path) {
        try {
            List<MetaFileEntity> list = baseUploadService.selectFiles(path, null);
            return success(list);
        } catch (Exception ex) {
            return fail(ex.getMessage(), null);
        }
    }
    @SysLog()
    @ApiOperation(value = "删除文件")
@@ -121,30 +141,24 @@
    @ApiOperation(value = "查询映射")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "path", value = "路径", dataType = "String", paramType = "query", example = "20230109010101"),
            @ApiImplicitParam(name = "dirid", value = "目录ID", dataType = "Integer", paramType = "query", example = "1")
            @ApiImplicitParam(name = "dirid", value = "目录ID", dataType = "Integer", paramType = "query", example = "1"),
            @ApiImplicitParam(name = "epsgCode", value = "坐标编码", dataType = "String", paramType = "query", example = "EPSG:4490")
    })
    @GetMapping(value = "/selectMappers")
    public ResponseMsg<List<TabMapperEntity>> selectMappers(String path, Integer dirid) {
    public ResponseMsg<Object> selectMappers(String path, Integer dirid, String epsgCode) {
        try {
            if (StringHelper.isEmpty(path) || StringHelper.isEmpty(epsgCode) || null == dirid) {
                return fail("路径、目录ID和坐标编码不能为空");
            }
            if (1 > uploadService.selectCount4Coord(epsgCode)) {
                return fail("坐标编码" + epsgCode + "不存在");
            }
            DirEntity dir = dirService.selectDir(dirid);
            if (null == dir) {
                return fail("目录ID=" + dirid + "不存在");
            }
            List<TabMapperEntity> list = dataLoaderService.selectMappers(path);
            return success(list);
        } catch (Exception ex) {
            return fail(ex.getMessage(), null);
        }
    }
    @SysLog()
    @ApiOperation(value = "查询文件")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "path", value = "路径", dataType = "String", paramType = "query")
    })
    @GetMapping(value = "/selectFiles2")
    public ResponseMsg<List<MetaFileEntity>> selectFiles2(String path) {
        try {
            List<MetaFileEntity> list = baseUploadService.selectFiles(path, null);
            return success(list);
        } catch (Exception ex) {
src/main/java/com/lf/server/entity/all/StaticData.java
@@ -142,7 +142,12 @@
    /**
     * TIF文件扩展名
     */
    public final static List<String> TIF_EXTENSION = new ArrayList<>(Arrays.asList(".tif", ".prj", ".tfw", ".tfw", ".tif.ovr", ".tif.aux.xml", ".tif.enp", ".tif.xml"));
    public final static List<String> TIF_EXTENSION = new ArrayList<>(Arrays.asList(".tif", ".prj", ".tfw", ".tif.ovr", ".tif.aux.xml", ".tif.enp", ".tif.xml"));
    /**
     * TIFF文件扩展名
     */
    public final static List<String> TIFF_EXTENSION = new ArrayList<>(Arrays.asList(".tiff", ".prj", ".tfw", ".tiff.ovr", ".tiff.aux.xml", ".tiff.enp", ".tiff.xml"));
    /**
     * SHP文件扩展名
@@ -152,7 +157,7 @@
    /**
     * 所有文件扩展名
     */
    public final static List<String> ALL_EXTENSION = new ArrayList<>(Arrays.asList(".txt", ".xml", ".pdf", ".xls", ".xlsx", ".doc", ".docx", ".ppt", ".pptx", ".shp", ".gdb", ".mdb", ".dwg", ".las", ".laz", ".cpt", ".mpt", ".fly", ".efb", ".g3d", ".fbx", ".obj", ".3dm", ".3dml", ".osgb", ".rvt", ".ifc", ".jpg", ".png", ".img", ".tif", ".bmp", ".gif", ".rmvb", ".rm", ".mp3", ".mp4", ".avi", ".wma", ".wmv", ".7z", ".rar", ".zip"));
    public final static List<String> ALL_EXTENSION = new ArrayList<>(Arrays.asList(".txt", ".xml", ".pdf", ".xls", ".xlsx", ".doc", ".docx", ".ppt", ".pptx", ".shp", ".gdb", ".mdb", ".dwg", ".las", ".laz", ".cpt", ".mpt", ".fly", ".efb", ".g3d", ".fbx", ".obj", ".3dm", ".3dml", ".osgb", ".rvt", ".ifc", ".jpg", ".png", ".img", ".tif", ".tiff", ".bmp", ".gif", ".rmvb", ".rm", ".mp3", ".mp4", ".avi", ".wma", ".wmv", ".7z", ".rar", ".zip"));
    /**
     * 插入排除字段
src/main/java/com/lf/server/entity/data/DirEntity.java
@@ -43,6 +43,8 @@
    private String bak;
    private String fullName;
    public int getId() {
        return id;
    }
@@ -138,4 +140,12 @@
    public void setBak(String bak) {
        this.bak = bak;
    }
    public String getFullName() {
        return fullName;
    }
    public void setFullName(String fullName) {
        this.fullName = fullName;
    }
}
src/main/java/com/lf/server/mapper/data/UploadMapper.java
@@ -24,6 +24,14 @@
    public List<CoordEntity> selectCoords(String zoning);
    /**
     * 根据EPSG编码统计
     *
     * @param epsgCode
     * @return
     */
    public Integer selectCount4Coord(String epsgCode);
    /**
     * 查询项目名称
     *
     * @return
src/main/java/com/lf/server/service/data/FmeService.java
@@ -2,7 +2,6 @@
import com.lf.server.entity.ctrl.FmeReqEntity;
import com.lf.server.entity.ctrl.NameValueEntity;
import com.lf.server.entity.data.MetaEntity;
import com.lf.server.entity.data.MetaFileEntity;
import com.lf.server.helper.RestHelper;
import com.lf.server.helper.StringHelper;
src/main/java/com/lf/server/service/data/UploadService.java
@@ -24,6 +24,11 @@
    }
    @Override
    public Integer selectCount4Coord(String epsgCode) {
        return uploadMapper.selectCount4Coord(epsgCode);
    }
    @Override
    public List<DirEntity> selectProject() {
        return uploadMapper.selectProject();
    }
src/main/resources/mapper/data/DirMapper.xml
@@ -1,34 +1,25 @@
<?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.lf.server.mapper.data.DirMapper">
    <resultMap id="resultMap" type="com.lf.server.entity.data.DirEntity">
        <id property="id" column="id"></id>
        <result property="orderNum" column="order_num"></result>
        <result property="createUser" column="create_user"></result>
        <result property="createTime" column="create_time"></result>
        <result property="updateUser" column="update_user"></result>
        <result property="updateTime" column="update_time"></result>
    </resultMap>
    <select id="selectDir" resultMap="resultMap" resultType="com.lf.server.entity.data.DirEntity">
        select * from lf.sys_dir where id = #{id}
    <select id="selectDir" resultType="com.lf.server.entity.data.DirEntity">
        select a.*, fn_rec_query(a.id, 'dir') fullName from lf.sys_dir a where id = #{id}
    </select>
    <select id="selectDirAll" resultMap="resultMap" resultType="com.lf.server.entity.data.DirEntity">
        select * from lf.sys_dir order by order_num;
    <select id="selectDirAll" resultType="com.lf.server.entity.data.DirEntity">
        select a.*, fn_rec_query(a.id, 'dir') fullName from lf.sys_dir a order by order_num;
    </select>
    <select id="selectDirRoot" resultType="com.lf.server.entity.data.DirEntity">
        select * from lf.sys_dir where pid=0 order by order_num;
        select a.*, fn_rec_query(a.id, 'dir') fullName from lf.sys_dir a where pid=0 order by order_num;
    </select>
    <select id="selectDirRecursive" resultMap="resultMap" resultType="com.lf.server.entity.data.DirEntity">
    <select id="selectDirRecursive" resultType="com.lf.server.entity.data.DirEntity">
        with recursive rs as(
            select * from lf.sys_dir where name=#{name}
        select a.*, fn_rec_query(a.id, 'dir') fullName from lf.sys_dir a where name = #{name}
        union
            select a.* from lf.sys_dir a, rs b where a.pid=b.id
            select b.*, fn_rec_query(b.id, 'dir') fullName from lf.sys_dir b, rs c where b.pid = c.id
        )
        select * FROM rs order by order_num;
        select * from rs order by order_num;
    </select>
    <insert id="insertDir" parameterType="com.lf.server.entity.data.DirEntity">
src/main/resources/mapper/data/UploadMapper.xml
@@ -12,6 +12,10 @@
        order by id
    </select>
    <select id="selectCount4Coord" resultType="java.lang.Integer">
        select count(*) from lf.sys_coord where epsgcode = #{epsgCode}
    </select>
    <select id="selectProject" resultType="com.lf.server.entity.data.DirEntity">
        select * from lf.sys_dir where pid = 0 and id > 1
    </select>