|
|
|
@ -35,19 +35,20 @@ public class FileServiceImpl implements FileService {
|
|
|
|
|
throw new BaseException("未找到产品条码"+sfc);
|
|
|
|
|
}
|
|
|
|
|
String itemBo = sfcServiceById.getItemBo();
|
|
|
|
|
String path="/"+ StringUtil.trimHandle(itemBo)+"_"+StringUtil.trimRevision(itemBo);
|
|
|
|
|
String path="/"+ StringUtil.trimHandle(itemBo)+"_"+StringUtil.trimRevision(itemBo)+"/";
|
|
|
|
|
FTPClient connect = null;
|
|
|
|
|
Map<String,String> pathMap = new HashMap<>();
|
|
|
|
|
try {
|
|
|
|
|
connect = cappFtpClient.connect();
|
|
|
|
|
//更换目录到当前目录
|
|
|
|
|
connect.enterLocalPassiveMode();
|
|
|
|
|
connect.changeWorkingDirectory(path);
|
|
|
|
|
FTPFile[] files = connect.listFiles();
|
|
|
|
|
if(files!=null){
|
|
|
|
|
for (int i = 0; i < files.length; i++) {
|
|
|
|
|
if(files[i].isFile()){
|
|
|
|
|
String filename=files[i].getName();
|
|
|
|
|
pathMap.put(filename,address+path+"/"+filename);
|
|
|
|
|
pathMap.put(filename,address+path+filename);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -55,7 +56,8 @@ public class FileServiceImpl implements FileService {
|
|
|
|
|
}catch (Exception e){
|
|
|
|
|
ExceptionUtil.throwException(e);
|
|
|
|
|
}finally {
|
|
|
|
|
if (connect!=null){
|
|
|
|
|
if (connect!=null&&connect.isConnected()){
|
|
|
|
|
connect.logout();
|
|
|
|
|
connect.disconnect();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|