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/data/upload/CheckController.java | 30 +++++++++++++++++++++++++----- 1 files changed, 25 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/lf/server/controller/data/upload/CheckController.java b/src/main/java/com/lf/server/controller/data/upload/CheckController.java index 66b9850..f0837a5 100644 --- a/src/main/java/com/lf/server/controller/data/upload/CheckController.java +++ b/src/main/java/com/lf/server/controller/data/upload/CheckController.java @@ -5,6 +5,7 @@ import com.lf.server.entity.all.ResponseMsg; import com.lf.server.entity.all.StaticData; import com.lf.server.entity.ctrl.FmeReqEntity; +import com.lf.server.helper.HttpHelper; import com.lf.server.helper.PathHelper; import com.lf.server.helper.StringHelper; import com.lf.server.service.data.FmeService; @@ -13,6 +14,9 @@ import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.ResponseBody; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -60,7 +64,10 @@ try { if (!StringHelper.isEmpty(id)) { String url = fmeService.getDownloadUrl(id, req); - res.sendRedirect(url); + + HttpHelper httpHelper = new HttpHelper(); + // res.sendRedirect(url) + httpHelper.service(req, res, url, null); } } catch (Exception ex) { log.error(ex.getMessage(), ex); @@ -69,8 +76,12 @@ @SysLog() @ApiOperation(value = "鎻愪氦鏁版嵁璐ㄦ") - @GetMapping(value = "/uploadChecks") - public ResponseMsg<Object> uploadChecks(FmeReqEntity entity, HttpServletRequest req) { + @ApiImplicitParams({ + @ApiImplicitParam(name = "entity", value = "FME璇锋眰瀹炰綋绫�", dataType = "FmeReqEntity", paramType = "body") + }) + @ResponseBody + @PostMapping(value = "/uploadChecks") + public ResponseMsg<Object> uploadChecks(@RequestBody FmeReqEntity entity, HttpServletRequest req) { try { if (StringHelper.isEmpty(entity.names)) { return fail("浠诲姟鍚嶇О涓嶈兘涓虹┖"); @@ -102,10 +113,16 @@ } } + /** + * 鑾峰彇鏂囦欢璺緞 + */ private String getFullPath(String filePath) { return null == filePath ? null : pathHelper.getConfig().getTempPath() + File.separator + filePath; } + /** + * 鏄�/鍚︿负Zip鏂囦欢 + */ private boolean isZipFile(String filePath) { if (null == filePath || !filePath.toLowerCase().endsWith(StaticData.ZIP)) { return false; @@ -116,6 +133,9 @@ return zipFile.exists() && !zipFile.isDirectory(); } + /** + * 鏄�/鍚︿负Excel鏂囦欢 + */ private boolean isXlsFile(String filePath) { if (null == filePath) { return false; @@ -374,7 +394,7 @@ } @SysLog() - @ApiOperation(value = "鏌ヨ鍏冩暟鎹鏌�") + @ApiOperation(value = "鏌ヨ婧愭暟鎹鏌�") @GetMapping(value = "/selectCheckMeta") public ResponseMsg<Object> selectCheckMeta(HttpServletRequest req) { try { @@ -382,7 +402,7 @@ fme.name = StringHelper.getGuid(); fme.xmmc = "瑗挎皵涓滆緭鍥涚嚎澶╃劧姘旂閬撳伐绋嬶紙鍚愰瞾鐣�-涓崼锛夛紙00116BT02锛�"; fme.sjzy = "娴嬮噺涓撲笟"; - fme.zipPath = "D:\\Project\\Data\\LF\\temp\\20230107010101\\鍏冩暟鎹鏌�.zip"; + fme.zipPath = "D:\\Project\\Data\\LF\\temp\\20230107010101\\婧愭暟鎹鏌�.zip"; String rs = fmeService.checkMeta(fme, req); if (StringHelper.isEmpty(rs)) { -- Gitblit v1.9.3