修改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

@ -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();
} }