修改bug

This commit is contained in:
yangjun 2024-07-17 10:05:45 +08:00
parent 747746a781
commit e049a36116
5 changed files with 25 additions and 23 deletions

View File

@ -307,6 +307,8 @@ public class SFTPUtil {
map.put("msg","sftp链接异常"); map.put("msg","sftp链接异常");
return map; return map;
} }
}else{
sftp.cd(sftpConfig.getFullpath());
} }
OutputStream output = null; OutputStream output = null;
try { try {
@ -505,7 +507,7 @@ public class SFTPUtil {
String newname = list.get(item)[1]; String newname = list.get(item)[1];
String newpath = directory.concat(newname); String newpath = directory.concat(newname);
String newfullpath = sftpConfig.getFullpath().concat("/").concat(newpath); String newfullpath = sftpConfig.getFullpath().concat("/").concat(newpath);
String moveCommand = "mv " + oldfullpath + " " + newfullpath; // 移动文件的命令 String moveCommand = "cp " + oldfullpath + " " + newfullpath; // 移动文件的命令
channel = sshSession.openChannel("exec"); channel = sshSession.openChannel("exec");
((ChannelExec) channel).setCommand(moveCommand); ((ChannelExec) channel).setCommand(moveCommand);
channel.setInputStream(null); channel.setInputStream(null);

View File

@ -323,7 +323,7 @@ public class WjxWjxxServiceImpl extends ServiceImpl<WjxWjxxMapper, WjxWjxx> impl
String vid = wjxWjxx.getVid(); String vid = wjxWjxx.getVid();
Map<String,Object> map = new HashMap<>(); Map<String,Object> map = new HashMap<>();
map.put("vid",Integer.valueOf(vid)); map.put("vid",Integer.valueOf(vid));
// map.put("suffix",2); map.put("suffix",0);
//调用接口,提交 //调用接口,提交
String result = wjxUtil.openapi(map,"1001004"); String result = wjxUtil.openapi(map,"1001004");
JSONObject jsonResult = JSONObject.parseObject(result); JSONObject jsonResult = JSONObject.parseObject(result);

View File

@ -491,7 +491,6 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
InputStream inputStream = null; InputStream inputStream = null;
OutputStream outputStream = null; OutputStream outputStream = null;
try{ try{
log.info("getFileName----------->");
int index = imgPath.lastIndexOf("/"); int index = imgPath.lastIndexOf("/");
String path = "temp"; String path = "temp";
if(index != -1){ if(index != -1){

View File

@ -274,9 +274,10 @@ public class ZykServiceImpl extends ServiceImpl<ZykMapper, ZykInfo> implements I
return uploadMap; return uploadMap;
} }
zykInfo.setPdfName(uploadMap.get("data")); zykInfo.setPdfName(uploadMap.get("data"));
if(StringUtils.isNotNull(map.get("pdfData"))){ if(StringUtils.isNotNull(uploadMap.get("data"))){
String pdfName = map.get("pdfData"); String pdfName = uploadMap.get("data");
zykInfo.setPdfName(pdfName); zykInfo.setPdfName(pdfName);
map.put("pdfData",uploadMap.get("data"));
}else{ }else{
map.put("pdfData",""); map.put("pdfData","");
} }

View File

@ -109,12 +109,12 @@ public class CommonController {
} }
return result; return result;
} }
/** /**
* 文件上传统一方法 * 文件上传统一方法
* @param bizPath * @param bizPath
* @param file * @param file
* @return * @return
*/ */
public String upload(String bizPath, MultipartFile file) throws Exception { public String upload(String bizPath, MultipartFile file) throws Exception {
String savePath = ""; String savePath = "";
if(oConvertUtils.isEmpty(bizPath)){ if(oConvertUtils.isEmpty(bizPath)){
@ -136,16 +136,16 @@ public class CommonController {
savePath = this.uploadLocal(file,bizPath); savePath = this.uploadLocal(file,bizPath);
//update-begin-author:lvdandan date:20200928 for:修改JEditor编辑器本地上传 //update-begin-author:lvdandan date:20200928 for:修改JEditor编辑器本地上传
/** 富文本编辑器及markdown本地上传时采用返回链接方式 /** 富文本编辑器及markdown本地上传时采用返回链接方式
//针对jeditor编辑器如何使 lcaol模式采用 base64格式存储 //针对jeditor编辑器如何使 lcaol模式采用 base64格式存储
String jeditor = request.getParameter("jeditor"); String jeditor = request.getParameter("jeditor");
if(oConvertUtils.isNotEmpty(jeditor)){ if(oConvertUtils.isNotEmpty(jeditor)){
result.setMessage(CommonConstant.UPLOAD_TYPE_LOCAL); result.setMessage(CommonConstant.UPLOAD_TYPE_LOCAL);
result.setSuccess(true); result.setSuccess(true);
return result; return result;
}else{ }else{
savePath = this.uploadLocal(file,bizPath); savePath = this.uploadLocal(file,bizPath);
} }
*/ */
}else if(CommonConstant.UPLOAD_TYPE_SFTP.equals(uploadType)) { }else if(CommonConstant.UPLOAD_TYPE_SFTP.equals(uploadType)) {
FileTypeFilter.fileTypeFilter(file); FileTypeFilter.fileTypeFilter(file);
savePath = this.uploadSftp(file,bizPath); savePath = this.uploadSftp(file,bizPath);
@ -361,7 +361,7 @@ public class CommonController {
if (orgName != null) { if (orgName != null) {
orgName = CommonUtils.getFileName(orgName); orgName = CommonUtils.getFileName(orgName);
if(orgName.contains(SymbolConstant.SPOT)){ 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{ }else{
fileName = orgName+ "_" + System.currentTimeMillis(); fileName = orgName+ "_" + System.currentTimeMillis();
} }
@ -435,7 +435,7 @@ public class CommonController {
, true , true
, file.getName()); , file.getName());
try (InputStream input = Files.newInputStream(file.toPath()); try (InputStream input = Files.newInputStream(file.toPath());
OutputStream os = item.getOutputStream()) { OutputStream os = item.getOutputStream()) {
// 流转移 // 流转移
IOUtils.copy(input, os); IOUtils.copy(input, os);
} catch (Exception e) { } catch (Exception e) {