From ed8c7a5effd0d423ce1118b680ecdca6fe732609 Mon Sep 17 00:00:00 2001 From: 13693261870 <252740454@qq.com> Date: 星期三, 02 七月 2025 16:43:13 +0800 Subject: [PATCH] Merge branch 'master' of http://192.168.11.205:9000/r/P2022036_Service --- src/main/java/com/lf/server/controller/show/PipelineController.java | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++------ 1 files changed, 51 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/lf/server/controller/show/PipelineController.java b/src/main/java/com/lf/server/controller/show/PipelineController.java index eb12823..c57fc39 100644 --- a/src/main/java/com/lf/server/controller/show/PipelineController.java +++ b/src/main/java/com/lf/server/controller/show/PipelineController.java @@ -58,7 +58,7 @@ return success(rs); } catch (Exception ex) { - return fail(ex.getMessage(), null); + return fail(ex, null); } } @@ -89,7 +89,52 @@ return success(map); } catch (Exception ex) { - return fail(ex.getMessage(), null); + return fail(ex, null); + } + } + + @SysLog() + @ApiOperation(value = "璇锋眰绠¢亾鍒嗘瀽缁撴灉涓嬭浇") + @ApiImplicitParams({ + @ApiImplicitParam(name = "pe", value = "绠¢亾鍒嗘瀽瀹炰綋绫�", dataType = "PipelineEntity", paramType = "body") + }) + @ResponseBody + @PostMapping(value = "/downloadReq") + public ResponseMsg<Object> downloadReq(@RequestBody PipelineEntity pe, HttpServletRequest req) { + try { + if (null == pe || StringHelper.isEmpty(pe.getPwd())) { + return fail("瀵嗙爜涓嶈兘涓虹┖"); + } + if (null == pe.getTabs() || 0 == pe.getTabs().size()) { + return fail("璇疯緭鍏ヨ〃鍚�"); + } + if (!checkTabs(pe.getTabs())) { + return fail("瀛樺湪闈炴硶琛ㄥ悕"); + } + if (!DownloadService.decryptPwd(pe)) { + return fail("瀵嗙爜瑙e瘑澶辫触", null); + } + if (StringHelper.isPwdInvalid(pe.getPwd())) { + return fail("瀵嗙爜涓嶇鍚堣姹�"); + } + + Map<String, List<PipelineEntity>> map = new HashMap<>(4); + for (String tab : pe.getTabs()) { + List<PipelineEntity> rs = pipelineService.selectPipeAnalysis(tab, pe.getGid()); + if (null != rs && rs.size() > 0) { + map.put(tab, rs); + } + } + if (map.size() == 0) { + return fail("鏌ユ棤鏁版嵁"); + } + + UserEntity ue = tokenService.getCurrentUser(req); + String guid = pipelineService.createZipFile(ue, map, pe.getPwd()); + + return success(guid); + } catch (Exception ex) { + return fail(ex, null); } } @@ -112,15 +157,15 @@ return fail("鐢ㄦ埛鏈櫥褰�", null); } - int count = downloadService.selectCountForUser(ue.getCreateUser(), 4, name); + int count = downloadService.selectCountForUser(ue.getId(), "5", name); if (count == 0) { return success(0, null); } - List<DownloadEntity> rs = downloadService.selectByPageForUser(ue.getCreateUser(), 3, name, pageSize, pageSize * (pageIndex - 1)); + List<DownloadEntity> rs = downloadService.selectByPageForUser(ue.getId(), "5", name, pageSize, pageSize * (pageIndex - 1)); return success(count, rs); } catch (Exception ex) { - return fail(ex.getMessage(), null); + return fail(ex, null); } } @@ -158,7 +203,7 @@ return success(file.exists()); } catch (Exception ex) { - return fail(ex.getMessage(), false); + return fail(ex, false); } } -- Gitblit v1.9.3