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