From 56c25bcb0dc03aae78aba23f32ebbf548b866332 Mon Sep 17 00:00:00 2001 From: xing <xingjs@qq.com> Date: 星期三, 22 二月 2023 14:11:09 +0800 Subject: [PATCH] 20230221@xingjs@提交官网一张图相关内容接口 --- src/main/java/com/lf/server/controller/all/CrdsController.java | 55 ++++++++++++++++++++++++++++++++++++++++++++++++------- 1 files changed, 48 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/lf/server/controller/all/CrdsController.java b/src/main/java/com/lf/server/controller/all/CrdsController.java index 2506d1b..d2b7bfc 100644 --- a/src/main/java/com/lf/server/controller/all/CrdsController.java +++ b/src/main/java/com/lf/server/controller/all/CrdsController.java @@ -2,6 +2,7 @@ import com.lf.server.annotation.SysLog; import com.lf.server.entity.all.ResponseMsg; +import com.lf.server.entity.all.StaticData; import com.lf.server.entity.data.DirEntity; import com.lf.server.helper.HttpHelper; import com.lf.server.helper.StringHelper; @@ -32,7 +33,7 @@ DirService dirService; @Autowired - protected FmeService fmeService; + FmeService fmeService; @SysLog() @ApiOperation(value = "鏌ヨ椤圭洰") @@ -61,13 +62,54 @@ } @SysLog() - @ApiOperation(value = "璇锋眰鎵撳寘") - @GetMapping(value = "/uploadReqPackaging") - public ResponseMsg<Object> uploadReqPackaging() { + @ApiOperation(value = "鏌ヨ浠诲姟鐘舵��") + @ApiImplicitParams({ + @ApiImplicitParam(name = "id", value = "浠诲姟ID", dataType = "String", paramType = "query", example = "29db09ee-2aae-4c62-bec0-0b5c5d8084e4") + }) + @GetMapping(value = "/selectTaskStatus") + public Object selectTaskStatus(String id, HttpServletRequest req) { try { - List<DirEntity> list = dirService.selectDirsForPrj(); + if (StringHelper.isEmpty(id)) { + return fail("id涓嶈兘涓虹┖"); + } - return success(list); + return fmeService.getTaskStatus(id, req); + } catch (Exception ex) { + return fail(ex.getMessage(), null); + } + } + + @SysLog() + @ApiOperation(value = "璇锋眰鎵撳寘") + @ApiImplicitParams({ + @ApiImplicitParam(name = "dirCode", value = "鐩綍缂栫爜", dataType = "String", paramType = "01"), + @ApiImplicitParam(name = "major", value = "涓撲笟", dataType = "String", paramType = "绌胯法瓒�"), + @ApiImplicitParam(name = "isCut", value = "鏄惁瑁佸壀", dataType = "String", paramType = "NO") + }) + @GetMapping(value = "/uploadReqPackaging") + public ResponseMsg<Object> uploadReqPackaging(String dirCode, String major, String isCut, HttpServletRequest req) { + try { + boolean isMajor = StaticData.CROSSING.equals(major) || StaticData.ROUTE.equals(major); + if (!isMajor) { + return fail("涓撲笟鍙兘鏄�滅┛璺ㄨ秺鈥濇垨鈥滅嚎璺��"); + } + + boolean bCut = StaticData.YES.equals(isCut) || StaticData.NO.equals(isCut); + if (!bCut) { + return fail("鏄惁瑁佸壀鍙兘鏄�淵ES鈥濇垨鈥淣O鈥�"); + } + + if (StringHelper.isEmpty(dirCode)) { + return fail("鐩綍缂栫爜涓嶈兘涓虹┖"); + } + DirEntity dir = dirService.selectByCode(dirCode); + if (null == dir) { + return fail("鐩綍缂栫爜涓�" + dirCode + "鐨勭洰褰曚笉瀛樺湪"); + } + + String id = fmeService.crdsPackaging(dirCode, major, isCut, req); + + return success(id); } catch (Exception ex) { return fail(ex.getMessage(), null); } @@ -85,7 +127,6 @@ String url = fmeService.getDownloadUrl(id, req); HttpHelper httpHelper = new HttpHelper(); - // res.sendRedirect(url) httpHelper.service(req, res, url, null); } } catch (Exception ex) { -- Gitblit v1.9.3