管道基础大数据平台系统开发-【后端】-Server
1
13693261870
2023-02-26 4464987abeec8b11b68ab9a03e0f36e5cc59390f
src/main/java/com/lf/server/controller/data/upload/UploadController.java
@@ -46,6 +46,7 @@
            return success(pathName);
        } catch (Exception ex) {
            log.error(ex.getMessage(), ex);
            return fail(ex.getMessage(), null);
        }
    }
@@ -59,7 +60,7 @@
    @PostMapping(value = "/uploadFiles")
    public ResponseMsg<Object> uploadFiles(String path, HttpServletRequest req, HttpServletResponse res) {
        try {
            List<MetaFileEntity> list = uploadService.uploadData(null, path, req, res);
            List<MetaFileEntity> list = uploadService.uploadData(null, path, false, req, res);
            if (null == list || list.isEmpty()) {
                return fail("没有找到上传文件", null);
            }
@@ -82,7 +83,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,22 +94,22 @@
                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);
            List<MetaFileEntity> list = uploadService.uploadData(null, path, false, req, res);
            if (null == list || list.isEmpty()) {
                return fail("没有找到上传文件", null);
            }
            List<KeyValueEntity> rs = uploadAttachService.uploadXlsAnnex(ue, ms, list, path);
            if (null == rs || rs.size() == 0) {
                return fail("没有要更新的元数据");
                return fail("没有要更新的源数据");
            }
            return success(rs);
@@ -196,7 +197,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 +208,7 @@
                return fail("用户未登录", null);
            }
            if (null == list || list.isEmpty()) {
                return fail("元数据文件集合为空", null);
                return fail("源数据文件集合为空", null);
            }
            uploadService.insertFiles(ue, list, req);
@@ -219,7 +220,7 @@
    }
    @SysLog()
    @ApiOperation(value = "删除元数据")
    @ApiOperation(value = "删除源数据")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "ids", value = "ID数组", dataType = "Integer", paramType = "query", example = "1,2")
    })