From e049a36116cb7c260e41a6f3e40da039101ce511 Mon Sep 17 00:00:00 2001 From: yangjun <1173114630@qq.com> Date: Wed, 17 Jul 2024 10:05:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/org/jeecg/common/util/SFTPUtil.java | 4 ++- .../service/impl/WjxWjxxServiceImpl.java | 2 +- .../impl/ZyInfoStudentServiceImpl.java | 1 - .../zyk/service/impl/ZykServiceImpl.java | 5 +-- .../system/controller/CommonController.java | 36 +++++++++---------- 5 files changed, 25 insertions(+), 23 deletions(-) diff --git a/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/SFTPUtil.java b/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/SFTPUtil.java index 80a4158a..0fc861be 100644 --- a/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/SFTPUtil.java +++ b/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/SFTPUtil.java @@ -307,6 +307,8 @@ public class SFTPUtil { map.put("msg","sftp链接异常:"); return map; } + }else{ + sftp.cd(sftpConfig.getFullpath()); } OutputStream output = null; try { @@ -505,7 +507,7 @@ public class SFTPUtil { String newname = list.get(item)[1]; String newpath = directory.concat(newname); String newfullpath = sftpConfig.getFullpath().concat("/").concat(newpath); - String moveCommand = "mv " + oldfullpath + " " + newfullpath; // 移动文件的命令 + String moveCommand = "cp " + oldfullpath + " " + newfullpath; // 移动文件的命令 channel = sshSession.openChannel("exec"); ((ChannelExec) channel).setCommand(moveCommand); channel.setInputStream(null); diff --git a/jeecg-module-main/src/main/java/org/jeecg/modules/kc/wjxWjxx/service/impl/WjxWjxxServiceImpl.java b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/wjxWjxx/service/impl/WjxWjxxServiceImpl.java index fea4b3d6..00dfe6e9 100644 --- a/jeecg-module-main/src/main/java/org/jeecg/modules/kc/wjxWjxx/service/impl/WjxWjxxServiceImpl.java +++ b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/wjxWjxx/service/impl/WjxWjxxServiceImpl.java @@ -323,7 +323,7 @@ public class WjxWjxxServiceImpl extends ServiceImpl impl String vid = wjxWjxx.getVid(); Map map = new HashMap<>(); map.put("vid",Integer.valueOf(vid)); -// map.put("suffix",2); + map.put("suffix",0); //调用接口,提交 String result = wjxUtil.openapi(map,"1001004"); JSONObject jsonResult = JSONObject.parseObject(result); diff --git a/jeecg-module-main/src/main/java/org/jeecg/modules/kc/zyInfoStudent/service/impl/ZyInfoStudentServiceImpl.java b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/zyInfoStudent/service/impl/ZyInfoStudentServiceImpl.java index af708e24..b2b51636 100644 --- a/jeecg-module-main/src/main/java/org/jeecg/modules/kc/zyInfoStudent/service/impl/ZyInfoStudentServiceImpl.java +++ b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/zyInfoStudent/service/impl/ZyInfoStudentServiceImpl.java @@ -491,7 +491,6 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl"); int index = imgPath.lastIndexOf("/"); String path = "temp"; if(index != -1){ diff --git a/jeecg-module-main/src/main/java/org/jeecg/modules/zyk/service/impl/ZykServiceImpl.java b/jeecg-module-main/src/main/java/org/jeecg/modules/zyk/service/impl/ZykServiceImpl.java index aba005fe..8663b019 100644 --- a/jeecg-module-main/src/main/java/org/jeecg/modules/zyk/service/impl/ZykServiceImpl.java +++ b/jeecg-module-main/src/main/java/org/jeecg/modules/zyk/service/impl/ZykServiceImpl.java @@ -274,9 +274,10 @@ public class ZykServiceImpl extends ServiceImpl implements I return uploadMap; } zykInfo.setPdfName(uploadMap.get("data")); - if(StringUtils.isNotNull(map.get("pdfData"))){ - String pdfName = map.get("pdfData"); + if(StringUtils.isNotNull(uploadMap.get("data"))){ + String pdfName = uploadMap.get("data"); zykInfo.setPdfName(pdfName); + map.put("pdfData",uploadMap.get("data")); }else{ map.put("pdfData",""); } diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/CommonController.java b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/CommonController.java index ec7f24ea..fe01db28 100644 --- a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/CommonController.java +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/CommonController.java @@ -109,12 +109,12 @@ public class CommonController { } return result; } - /** - * 文件上传统一方法 - * @param bizPath - * @param file - * @return - */ + /** + * 文件上传统一方法 + * @param bizPath + * @param file + * @return + */ public String upload(String bizPath, MultipartFile file) throws Exception { String savePath = ""; if(oConvertUtils.isEmpty(bizPath)){ @@ -136,16 +136,16 @@ public class CommonController { savePath = this.uploadLocal(file,bizPath); //update-begin-author:lvdandan date:20200928 for:修改JEditor编辑器本地上传 /** 富文本编辑器及markdown本地上传时,采用返回链接方式 - //针对jeditor编辑器如何使 lcaol模式,采用 base64格式存储 - String jeditor = request.getParameter("jeditor"); - if(oConvertUtils.isNotEmpty(jeditor)){ - result.setMessage(CommonConstant.UPLOAD_TYPE_LOCAL); - result.setSuccess(true); - return result; - }else{ - savePath = this.uploadLocal(file,bizPath); - } - */ + //针对jeditor编辑器如何使 lcaol模式,采用 base64格式存储 + String jeditor = request.getParameter("jeditor"); + if(oConvertUtils.isNotEmpty(jeditor)){ + result.setMessage(CommonConstant.UPLOAD_TYPE_LOCAL); + result.setSuccess(true); + return result; + }else{ + savePath = this.uploadLocal(file,bizPath); + } + */ }else if(CommonConstant.UPLOAD_TYPE_SFTP.equals(uploadType)) { FileTypeFilter.fileTypeFilter(file); savePath = this.uploadSftp(file,bizPath); @@ -361,7 +361,7 @@ public class CommonController { if (orgName != null) { orgName = CommonUtils.getFileName(orgName); if(orgName.contains(SymbolConstant.SPOT)){ - fileName = orgName.substring(0, orgName.lastIndexOf(".")) + orgName.substring(orgName.lastIndexOf(".")); + fileName = orgName.substring(0, orgName.lastIndexOf(".")) + "_" + System.currentTimeMillis() + orgName.substring(orgName.lastIndexOf(".")); }else{ fileName = orgName+ "_" + System.currentTimeMillis(); } @@ -435,7 +435,7 @@ public class CommonController { , true , file.getName()); try (InputStream input = Files.newInputStream(file.toPath()); - OutputStream os = item.getOutputStream()) { + OutputStream os = item.getOutputStream()) { // 流转移 IOUtils.copy(input, os); } catch (Exception e) {