管道基础大数据平台系统开发-【后端】-Server
1
13693261870
2023-02-18 3e1416bffcb3761d06261e327edcbfe10a5443fb
1
已修改18个文件
116 ■■■■ 文件已修改
data/db_tab.sql 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/controller/data/MetaController.java 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/controller/data/upload/CheckController.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/controller/data/upload/QueryController.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/controller/data/upload/UploadController.java 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/controller/show/DataLibController.java 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/entity/data/MetaEntity.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/entity/data/MetaFileEntity.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/mapper/data/MetaMapper.java 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/service/all/BaseUploadService.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/service/data/DownloadService.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/service/data/MetaService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/service/data/UploadService.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/service/show/DataLibService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/service/show/ExportService.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/service/show/MarkService.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/service/show/PipelineService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/service/sys/ReportService.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
data/db_tab.sql
@@ -577,7 +577,7 @@
comment on table lf.sys_meta is '源数据表';
comment on column lf.sys_meta.id is '主键ID';
comment on column lf.sys_meta.eventid is 'GUID';
comment on column lf.sys_meta.metaid is '父元数据ID:0-没有';
comment on column lf.sys_meta.metaid is '父源数据ID:0-没有';
comment on column lf.sys_meta.dirid is '目录ID';
comment on column lf.sys_meta.depid is '单位ID';
comment on column lf.sys_meta.depcode is '目录编码';
src/main/java/com/lf/server/controller/data/MetaController.java
@@ -38,7 +38,7 @@
import java.util.List;
/**
 * 元数据
 * 源数据
 * @author WWW
 */
@Api(tags = "数据管理\\源数据管理")
@@ -117,19 +117,6 @@
    }
    @SysLog()
    @ApiOperation(value = "查询所有")
    @GetMapping(value = "/selectAll")
    public ResponseMsg<List<MetaEntity>> selectAll() {
        try {
            List<MetaEntity> list = metaService.selectAll();
            return success(list);
        } catch (Exception ex) {
            return fail(ex.getMessage(), null);
        }
    }
    @SysLog()
    @ApiOperation(value = "根据ID查询")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id", value = "ID", dataType = "int", paramType = "query", example = "1")
@@ -148,7 +135,7 @@
    @SysLog()
    @ApiOperation(value = "查询表中数据")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id", value = "元数据ID", dataType = "Integer", paramType = "query", example = "115"),
            @ApiImplicitParam(name = "id", value = "源数据ID", dataType = "Integer", paramType = "query", example = "115"),
            @ApiImplicitParam(name = "pageIndex", value = "分页数(从1开始)", dataType = "Integer", paramType = "query", example = "1"),
            @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "Integer", paramType = "query", example = "10")
    })
@@ -157,12 +144,12 @@
        // noinspection AlibabaRemoveCommentedCode
        try {
            if (null == id || id < 0) {
                return fail("元数据ID不能为空或小于0", null);
                return fail("源数据ID不能为空或小于0", null);
            }
            MetaEntity meta = metaService.selectById(id);
            if (null == meta || null == meta.getTab() || !meta.getTab().contains(StaticData.POINT)) {
                return fail("找不到元数据信息", null);
                return fail("找不到源数据信息", null);
            }
            String entity = meta.getTab().substring(meta.getTab().indexOf(".") + 1).replace("_", "").toLowerCase();
@@ -388,7 +375,7 @@
            List<MetaEntity> list = metaService.selectMetaFiles(reqEntity.getIds());
            if (null == list || list.isEmpty()) {
                return fail("没有找到元数据");
                return fail("没有找到源数据");
            }
            UserEntity ue = tokenService.getCurrentUser(req);
src/main/java/com/lf/server/controller/data/upload/CheckController.java
@@ -394,7 +394,7 @@
    }
    @SysLog()
    @ApiOperation(value = "查询元数据检查")
    @ApiOperation(value = "查询源数据检查")
    @GetMapping(value = "/selectCheckMeta")
    public ResponseMsg<Object> selectCheckMeta(HttpServletRequest req) {
        try {
@@ -402,7 +402,7 @@
            fme.name = StringHelper.getGuid();
            fme.xmmc = "西气东输四线天然气管道工程(吐鲁番-中卫)(00116BT02)";
            fme.sjzy = "测量专业";
            fme.zipPath = "D:\\Project\\Data\\LF\\temp\\20230107010101\\元数据检查.zip";
            fme.zipPath = "D:\\Project\\Data\\LF\\temp\\20230107010101\\源数据检查.zip";
            String rs = fmeService.checkMeta(fme, req);
            if (StringHelper.isEmpty(rs)) {
src/main/java/com/lf/server/controller/data/upload/QueryController.java
@@ -168,7 +168,7 @@
    @SysLog()
    @ApiOperation(value = "查询表中数据")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id", value = "元数据ID", dataType = "Integer", paramType = "query", example = "115"),
            @ApiImplicitParam(name = "id", value = "源数据ID", dataType = "Integer", paramType = "query", example = "115"),
            @ApiImplicitParam(name = "pageIndex", value = "分页数(从1开始)", dataType = "Integer", paramType = "query", example = "1"),
            @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "Integer", paramType = "query", example = "10")
    })
@@ -177,12 +177,12 @@
        // noinspection AlibabaRemoveCommentedCode
        try {
            if (null == id || id < 0) {
                return fail("元数据ID不能为空或小于0", null);
                return fail("源数据ID不能为空或小于0", null);
            }
            MetaEntity meta = metaService.selectById(id);
            if (null == meta || null == meta.getTab() || !meta.getTab().contains(StaticData.POINT)) {
                return fail("找不到元数据信息", null);
                return fail("找不到源数据信息", null);
            }
            String entity = meta.getTab().substring(meta.getTab().indexOf(".") + 1).replace("_", "").toLowerCase();
src/main/java/com/lf/server/controller/data/upload/UploadController.java
@@ -82,7 +82,7 @@
    @ApiOperation(value = "上传Excel附件")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "path", value = "路径", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "ids", value = "元数据集合", dataType = "Integer", paramType = "query")
            @ApiImplicitParam(name = "ids", value = "源数据集合", dataType = "Integer", paramType = "query")
    })
    @ResponseBody
    @PostMapping(value = "/uploadXlsAnnex")
@@ -93,12 +93,12 @@
                return fail("用户未登录", null);
            }
            if (null == ids || ids.length == 0) {
                return fail("找不到元数据的ID集合");
                return fail("找不到源数据的ID集合");
            }
            List<MetaEntity> ms = metaService.selectXlsAnnex(ids, UploadAttachService.getTabs());
            if (null == ms || ms.isEmpty()) {
                return fail("找不到要上传附件的元数据");
                return fail("找不到要上传附件的源数据");
            }
            List<MetaFileEntity> list = uploadService.uploadData(null, path, req, res);
@@ -108,7 +108,7 @@
            List<KeyValueEntity> rs = uploadAttachService.uploadXlsAnnex(ue, ms, list, path);
            if (null == rs || rs.size() == 0) {
                return fail("没有要更新的元数据");
                return fail("没有要更新的源数据");
            }
            return success(rs);
@@ -196,7 +196,7 @@
    @SysLog()
    @ApiOperation(value = "插入文件")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "list", value = "元数据文件集合", dataType = "MetaFileEntity", paramType = "body")
            @ApiImplicitParam(name = "list", value = "源数据文件集合", dataType = "MetaFileEntity", paramType = "body")
    })
    @ResponseBody
    @PostMapping(value = "/insertFiles")
@@ -207,7 +207,7 @@
                return fail("用户未登录", null);
            }
            if (null == list || list.isEmpty()) {
                return fail("元数据文件集合为空", null);
                return fail("源数据文件集合为空", null);
            }
            uploadService.insertFiles(ue, list, req);
@@ -219,7 +219,7 @@
    }
    @SysLog()
    @ApiOperation(value = "删除元数据")
    @ApiOperation(value = "删除源数据")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "ids", value = "ID数组", dataType = "Integer", paramType = "query", example = "1,2")
    })
src/main/java/com/lf/server/controller/show/DataLibController.java
@@ -67,7 +67,7 @@
    VerService verService;
    @SysLog()
    @ApiOperation(value = "分页查询元数据 *")
    @ApiOperation(value = "分页查询源数据 *")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "depcode", value = "单位编码", dataType = "String", paramType = "query", example = "00"),
            @ApiImplicitParam(name = "dircode", value = "目录编码", dataType = "String", paramType = "query", example = "00"),
@@ -120,7 +120,7 @@
    }
    @SysLog()
    @ApiOperation(value = "分页查询元数据")
    @ApiOperation(value = "分页查询源数据")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "depcode", value = "单位编码", dataType = "String", paramType = "query", example = "00"),
            @ApiImplicitParam(name = "dirs", value = "目录编码", dataType = "String", paramType = "query", example = "00,01"),
@@ -152,7 +152,7 @@
    @SysLog()
    @ApiOperation(value = "查询表中数据")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id", value = "元数据ID", dataType = "Integer", paramType = "query", example = "115"),
            @ApiImplicitParam(name = "id", value = "源数据ID", dataType = "Integer", paramType = "query", example = "115"),
            @ApiImplicitParam(name = "pageIndex", value = "分页数(从1开始)", dataType = "Integer", paramType = "query", example = "1"),
            @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "Integer", paramType = "query", example = "10")
    })
@@ -161,12 +161,12 @@
        // noinspection AlibabaRemoveCommentedCode
        try {
            if (null == id || id < 0) {
                return fail("元数据ID不能为空或小于0", null);
                return fail("源数据ID不能为空或小于0", null);
            }
            MetaEntity meta = metaService.selectById(id);
            if (null == meta || null == meta.getTab() || !meta.getTab().contains(StaticData.POINT)) {
                return fail("找不到元数据信息", null);
                return fail("找不到源数据信息", null);
            }
            String entity = meta.getTab().substring(meta.getTab().indexOf(".") + 1).replace("_", "").toLowerCase();
@@ -189,7 +189,7 @@
    }
    @SysLog()
    @ApiOperation(value = "请求元数据下载")
    @ApiOperation(value = "请求源数据下载")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "reqEntity", value = "请求下载实体", dataType = "DownloadReqEntity", paramType = "body")
    })
@@ -212,7 +212,7 @@
            List<MetaEntity> list = metaService.selectMetaFiles(reqEntity.getIds());
            if (null == list || list.isEmpty()) {
                return fail("没有找到元数据");
                return fail("没有找到源数据");
            }
            UserEntity ue = tokenService.getCurrentUser(req);
src/main/java/com/lf/server/entity/data/MetaEntity.java
@@ -4,7 +4,7 @@
import java.sql.Timestamp;
/**
 * 元数据
 * 源数据
 * @author WWW
 */
public class MetaEntity implements Serializable {
src/main/java/com/lf/server/entity/data/MetaFileEntity.java
@@ -4,7 +4,7 @@
import java.sql.Timestamp;
/**
 * 元数据文件
 * 源数据文件
 * @author WWW
 */
public class MetaFileEntity implements Serializable {
src/main/java/com/lf/server/mapper/data/MetaMapper.java
@@ -7,7 +7,7 @@
import java.util.List;
/**
 * 元数据
 * 源数据
 * @author WWW
 */
@Mapper
@@ -106,19 +106,19 @@
    public MetaEntity selectByGuid(String guid, String tab);
    /**
     * 查询元数据文件
     * 查询源数据文件
     *
     * @param ids 元数据ID集合
     * @return 元数据文件集合
     * @param ids 源数据ID集合
     * @return 源数据文件集合
     */
    public List<MetaEntity> selectMetaFiles(List<Integer> ids);
    /**
     * 查询Excel元数据
     * 查询Excel源数据
     *
     * @param ids  元数据ID集合
     * @param ids  源数据ID集合
     * @param tabs 表名字符串
     * @return 元数据文件集合
     * @return 源数据文件集合
     */
    public List<MetaEntity> selectXlsAnnex(Integer[] ids, String tabs);
src/main/java/com/lf/server/service/all/BaseUploadService.java
@@ -327,7 +327,7 @@
    }
    /**
     * 创建元数据文件实体类
     * 创建源数据文件实体类
     */
    private MetaFileEntity createMetaFileEntity(MetaFileEntity meta) {
        MetaFileEntity mf = new MetaFileEntity();
@@ -486,7 +486,7 @@
    }
    /**
     * 设置元数据文件的类型
     * 设置源数据文件的类型
     */
    private void setMetaType(List<MetaFileEntity> list) {
        for (MetaFileEntity mf : list) {
src/main/java/com/lf/server/service/data/DownloadService.java
@@ -181,7 +181,7 @@
     * 打包文件
     *
     * @param ue   用户实体
     * @param list 元数据文件集合
     * @param list 源数据文件集合
     * @param pwd  密码
     * @return 下载文件GUID
     */
@@ -204,7 +204,7 @@
    }
    /**
     * 移除重复的元数据文件
     * 移除重复的源数据文件
     */
    private void rmRepeatMetaFiles(List<MetaEntity> list) {
        List<String> guidList = new ArrayList<>();
@@ -223,7 +223,7 @@
    }
    /**
     * 添加元数据文件至Zip包
     * 添加源数据文件至Zip包
     */
    private void addMetaFiles(ZipFile zip, ZipParameters params, List<MetaEntity> list) {
        int i = 1;
@@ -318,14 +318,14 @@
    private DownloadEntity getDownloadEntity(UserEntity ue, String file, String pwd) throws Exception {
        DownloadEntity de = new DownloadEntity();
        de.setName(FileHelper.getFileName(file));
        // 1-Shp文件,2-专题图,3-元数据
        // 1-Shp文件,2-专题图,3-源数据,4-业务数据,5-管道分析,6-统计报告
        de.setType(3);
        de.setSizes(FileHelper.sizeToMb(new File(file).length()));
        de.setDepid(ue.getDepid());
        de.setDcount(0);
        de.setPwd(pwd);
        de.setUrl(FileHelper.getRelativePath(file));
        de.setDescr("元数据文件");
        de.setDescr("源数据文件");
        de.setGuid(FileHelper.getFileMd5(file));
        de.setCreateUser(ue.getId());
        // de.setGeom(null)
src/main/java/com/lf/server/service/data/MetaService.java
@@ -9,7 +9,7 @@
import java.util.List;
/**
 * 元数据
 * 源数据
 * @author WWW
 */
@Service
src/main/java/com/lf/server/service/data/UploadService.java
@@ -75,7 +75,7 @@
    }
    /**
     * 检查元数据文件
     * 检查源数据文件
     */
    private void checkMetaFiles(UserEntity ue, List<MetaFileEntity> list) {
        Timestamp createTime = WebHelper.getCurrentTimestamp();
@@ -121,7 +121,7 @@
    }
    /**
     * 获取Excel元数据文件
     * 获取Excel源数据文件
     */
    private List<MetaFileEntity> getExcelFiles(List<MetaFileEntity> list) {
        List<MetaFileEntity> xlsList = new ArrayList<>();
@@ -138,7 +138,7 @@
    }
    /**
     * 获取Excel的元数据
     * 获取Excel的源数据
     */
    private MetaFileEntity getExcelMeta(List<MetaFileEntity> xlsList) {
        List<String> pathList = new ArrayList<>();
@@ -518,7 +518,7 @@
    }
    /**
     * 插入元数据
     * 插入源数据
     */
    private void insertMetas(List<MetaFileEntity> list) {
        for (MetaFileEntity mf : list) {
@@ -534,7 +534,7 @@
    }
    /**
     * 创建元数据
     * 创建源数据
     */
    private MetaEntity createMeta(MetaFileEntity mf) {
        MetaEntity me = new MetaEntity();
src/main/java/com/lf/server/service/show/DataLibService.java
@@ -189,7 +189,7 @@
    private DownloadEntity getDownloadEntity(UserEntity ue, String file, String pwd) throws Exception {
        DownloadEntity de = new DownloadEntity();
        de.setName(FileHelper.getFileName(file));
        // 1-Shp文件,2-专题图,3-元数据,4-业务数据
        // 1-Shp文件,2-专题图,3-源数据,4-业务数据,5-管道分析,6-统计报告
        de.setType(4);
        de.setSizes(FileHelper.sizeToMb(new File(file).length()));
        de.setDepid(ue.getDepid());
src/main/java/com/lf/server/service/show/ExportService.java
@@ -100,6 +100,7 @@
    private DownloadEntity getDownloadEntity(UserEntity ue, ExportEntity entity, String file) throws Exception {
        DownloadEntity de = new DownloadEntity();
        de.setName(FileHelper.getFileName(file));
        // 1-Shp文件,2-专题图,3-源数据,4-业务数据,5-管道分析,6-统计报告
        de.setType(2);
        de.setSizes(FileHelper.sizeToMb(new File(file).length()));
        de.setDepid(ue.getDepid());
src/main/java/com/lf/server/service/show/MarkService.java
@@ -189,13 +189,14 @@
    private DownloadEntity getDownloadEntity(UserEntity ue, String file) throws Exception {
        DownloadEntity de = new DownloadEntity();
        de.setName(FileHelper.getFileName(file));
        // 1-Shp文件,2-专题图,3-源数据,4-业务数据,5-管道分析,6-统计报告
        de.setType(1);
        de.setSizes(FileHelper.sizeToMb(new File(file).length()));
        de.setDepid(ue.getDepid());
        de.setDcount(0);
        // de.setPwd(null)
        de.setUrl(FileHelper.getRelativePath(file));
        de.setDescr("shp文件");
        de.setDescr("Shp文件");
        de.setGuid(FileHelper.getFileMd5(file));
        de.setCreateUser(ue.getId());
        // de.setGeom(null)
src/main/java/com/lf/server/service/show/PipelineService.java
@@ -207,7 +207,7 @@
    private DownloadEntity getDownloadEntity(UserEntity ue, String file, String pwd) throws Exception {
        DownloadEntity de = new DownloadEntity();
        de.setName(FileHelper.getFileName(file));
        // 1-Shp文件,2-专题图,3-元数据,4-业务数据,5-管道分析
        // 1-Shp文件,2-专题图,3-源数据,4-业务数据,5-管道分析,6-统计报告
        de.setType(5);
        de.setSizes(FileHelper.sizeToMb(new File(file).length()));
        de.setDepid(ue.getDepid());
src/main/java/com/lf/server/service/sys/ReportService.java
@@ -289,6 +289,7 @@
    private DownloadEntity getDownloadEntity(UserEntity ue, String file) {
        DownloadEntity de = new DownloadEntity();
        de.setName(FileHelper.getFileName(file));
        // 1-Shp文件,2-专题图,3-源数据,4-业务数据,5-管道分析,6-统计报告
        de.setType(6);
        de.setSizes(FileHelper.sizeToMb(new File(file).length()));
        de.setDepid(ue.getDepid());