修改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链接异常");
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);

View File

@ -323,7 +323,7 @@ public class WjxWjxxServiceImpl extends ServiceImpl<WjxWjxxMapper, WjxWjxx> impl
String vid = wjxWjxx.getVid();
Map<String,Object> 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);

View File

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

View File

@ -274,9 +274,10 @@ public class ZykServiceImpl extends ServiceImpl<ZykMapper, ZykInfo> 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","");
}

View File

@ -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) {