From c9927c06a608b4baf85669d9cbe570d7fffc361d Mon Sep 17 00:00:00 2001 From: liusheng <337615773@qq.com> Date: 星期二, 08 八月 2023 16:14:49 +0800 Subject: [PATCH] 获取fileID的方法进行修改 --- ruoyi-project/src/main/java/com/ruoyi/project/service/impl/ServiceReimbursementServiceImpl.java | 9 +++++++-- 1 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ruoyi-project/src/main/java/com/ruoyi/project/service/impl/ServiceReimbursementServiceImpl.java b/ruoyi-project/src/main/java/com/ruoyi/project/service/impl/ServiceReimbursementServiceImpl.java index 3cd071b..bd69001 100644 --- a/ruoyi-project/src/main/java/com/ruoyi/project/service/impl/ServiceReimbursementServiceImpl.java +++ b/ruoyi-project/src/main/java/com/ruoyi/project/service/impl/ServiceReimbursementServiceImpl.java @@ -241,11 +241,16 @@ List<RbDetailFile> parseArray = JSON.parseArray(remShare.getAnnexfiles(), RbDetailFile.class); for (int i = 0; i < parseArray.size(); i++) { RbDetailFile rbDetailFile = parseArray.get(i); + log.info("filePath鐨勪慨鏀�:{}", filePath); - String strFile = rbDetailFile.getUrl().replaceAll("/profile/upload", filePath); - File filetest = new File(strFile); + String url = rbDetailFile.getUrl(); + //file鐢ㄧ殑鏄粷瀵逛綅缃� + String substring = url.substring(url.indexOf("/profile/upload") + "/profile/upload".length()); + String strFile = rbDetailFile.getUrl().replace(filePath, "/profile/upload"); + File filetest = new File(filePath + substring); try { log.info("璇锋眰绗笁鏂圭殑鍏ュ弬strFile : {}, strFUrl : {}", strFile, filePath); + System.out.println("璇锋眰绗笁鏂圭殑鍏ュ弬:" + filePath + substring); String struploadResult = HttpClientKit.sendPostWithFile(filetest, strFUrl); log.info("绗笁鏂逛紶鍥炵殑鏁版嵁: {}", struploadResult); if (StringUtils.isEmpty(struploadResult)) { -- Gitblit v1.9.3