管道基础大数据平台系统开发-【后端】-Server
1
13693261870
2023-08-01 949ed3d404270a99e4c682eddcb18cf057734119
1
已修改3个文件
14 ■■■■■ 文件已修改
src/main/java/com/lf/server/controller/data/upload/UploadController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/service/all/BaseUploadService.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/service/data/UploadService.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/controller/data/upload/UploadController.java
@@ -125,7 +125,7 @@
    @GetMapping(value = "/selectFiles")
    public ResponseMsg<List<MetaFileEntity>> selectFiles(String path) {
        try {
            List<MetaFileEntity> list = uploadService.selectFiles(path);
            List<MetaFileEntity> list = uploadService.selectFiles(path, false);
            return success(list);
        } catch (Exception ex) {
src/main/java/com/lf/server/service/all/BaseUploadService.java
@@ -129,8 +129,7 @@
    /**
     * 查询文件
     */
    @SuppressWarnings("AlibabaRemoveCommentedCode")
    public List<MetaFileEntity> selectFiles(String subPath) {
    public List<MetaFileEntity> selectFiles(String subPath, boolean hasMd5) {
        String root = pathHelper.getConfig().getTempPath() + File.separator + subPath;
        File file = new File(root);
@@ -155,9 +154,9 @@
            mf.setExtName(extName);
            mf.setSizes(FileHelper.sizeToMb(f.length()));
            mf.setPath(subPath + File.separator + fileName);
            /*if (!StaticData.ZIP.equals(extName)) {
            if (hasMd5 && !StaticData.ZIP.equals(extName)) {
                mf.setGuid(FileHelper.getFileMd5(f.getPath()));
            }*/
            }
            list.add(mf);
        }
@@ -191,7 +190,7 @@
     * 查询映射
     */
    public List<MetaFileEntity> selectMappers(UserEntity ue, String path, DirEntity dir, VerEntity ver, String epsgCode) {
        List<MetaFileEntity> metas = selectFiles(path);
        List<MetaFileEntity> metas = selectFiles(path, true);
        if (null == metas || metas.isEmpty()) {
            return null;
        }
src/main/java/com/lf/server/service/data/UploadService.java
@@ -95,6 +95,9 @@
            if (!f.exists()) {
                mf.setMsg("文件丢失");
            }
            if (f.exists() && StringHelper.isNull(mf.getGuid())) {
                mf.setGuid(FileHelper.getFileMd5(f.getPath()));
            }
            MetaEntity old = metaService.selectByGuid(mf.getGuid(), getDirCode(mf), null);
            if (null != old) {