管道基础大数据平台系统开发-【后端】-Server
1
13693261870
2023-03-30 19bc36532c48b1161fc3c4f4818a5f9f631cb426
src/main/java/com/lf/server/controller/all/BaseQueryController.java
@@ -574,7 +574,7 @@
    }
    @SysLog()
    @ApiOperation(value = "请求DB数据下载")
    @ApiOperation(value = "下载DB数据")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "dr", value = "请求下载实体", dataType = "DownloadReqEntity", paramType = "body")
    })
@@ -600,72 +600,6 @@
            UserEntity ue = tokenService.getCurrentUser(req);
            String guid = dataLibService.downloadDbReq(ue, dr);
            return success(guid);
        } catch (Exception ex) {
            return fail(ex, null);
        }
    }
    @SysLog()
    @ApiOperation(value = "请求DB数据下载")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "dr", value = "请求下载实体", dataType = "DownloadReqEntity", paramType = "body")
    })
    @ResponseBody
    @PostMapping(value = "/downloadDbReq")
    public ResponseMsg<Object> downloadDbReq(@RequestBody DownloadReqEntity dr, HttpServletRequest req, HttpServletResponse res) {
        try {
            if (null == dr || StringHelper.isEmpty(dr.getPwd())) {
                return fail("密码不能为空");
            }
            if (null == dr.getEntities() || dr.getEntities().isEmpty()) {
                return fail("请选择要下载的实体名");
            }
            dr.setWkt(AesHelper.decrypt(dr.getWkt()));
            if (StringHelper.isEmpty(dr.getWkt())) {
                return fail("请选择要下载的WKT范围");
            }
            if (!DownloadService.decryptPwd(dr)) {
                return fail("密码解密失败", null);
            }
            if (StringHelper.isPwdInvalid(dr.getPwd())) {
                return fail("密码不符合要求");
            }
            UserEntity ue = tokenService.getCurrentUser(req);
            String guid = dataLibService.downloadDbReq(ue, dr);
            return success(guid);
        } catch (Exception ex) {
            return fail(ex, null);
        }
    }
    @SysLog()
    @ApiOperation(value = "请求实体数据下载")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "dre", value = "请求下载实体", dataType = "DownloadReqEntity", paramType = "body")
    })
    @ResponseBody
    @PostMapping(value = "/downloadEntityReq")
    public ResponseMsg<Object> downloadEntityReq(@RequestBody DownloadReqEntity dr, HttpServletRequest req, HttpServletResponse res) {
        try {
            if (null == dr || StringHelper.isEmpty(dr.getPwd())) {
                return fail("密码不能为空");
            }
            if (null == dr.getEntities() || dr.getEntities().isEmpty()) {
                return fail("请选择要下载的实体名");
            }
            if (!DownloadService.decryptPwd(dr)) {
                return fail("密码解密失败", null);
            }
            if (StringHelper.isPwdInvalid(dr.getPwd())) {
                return fail("密码不符合要求");
            }
            UserEntity ue = tokenService.getCurrentUser(req);
            String guid = dataLibService.downloadDbReq4Prop(ue, dr);
            return success(guid);
        } catch (Exception ex) {