管道基础大数据平台系统开发-【后端】-Server
1
13693261870
2023-02-04 56e1717bfe1971ff0a392d5411a9d0ce61170993
src/main/java/com/lf/server/controller/data/upload/UploadController.java
@@ -65,6 +65,42 @@
        }
    }
    /**
     * 接收数组1:@RequestParam(value = "ids")List<Integer> ids
     *          &ids=1209&ids=1180&ids=1387
     * 接收数据2:Integer[] ids
     *          formData.append("ids", 1209); formData.append("ids", 1180); formData.append("ids", 1387);
     */
    @SysLog()
    @ApiOperation(value = "上传Excel附件")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "path", value = "路径", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "ids", value = "元数据集合", dataType = "Integer", paramType = "query")
    })
    @ResponseBody
    @PostMapping(value = "/uploadXlsAnnex")
    public ResponseMsg<Object> uploadXlsAnnex(String path, Integer[] ids, HttpServletRequest req, HttpServletResponse res) {
        try {
            if (null == ids || ids.length == 0) {
                return fail("找不到元数据的ID集合");
            }
            List<MetaEntity> ms = metaService.selectXlsAnnex(ids);
            if (null == ms || ms.isEmpty()) {
                return fail("找不到要上传附件的元数据");
            }
            List<MetaFileEntity> list = uploadService.uploadData(null, path, req, res);
            if (null == list || list.isEmpty()) {
                return fail("没有找到上传文件", null);
            }
            return success(list);
        } catch (Exception ex) {
            return fail(ex.getMessage(), null);
        }
    }
    @SysLog()
    @ApiOperation(value = "查询文件")
    @ApiImplicitParams({