|
|
|
@ -95,7 +95,7 @@ public class ZxjhBusinessServiceImpl implements ZxjhBusinessService {
|
|
|
|
|
List<FileDto> fileDtos = getFileDtos(result);
|
|
|
|
|
log.info("同步病案主键:{},jzh:{},文件数量:{}",patientId,jzh,fileDtos.size());
|
|
|
|
|
if(Func.isEmpty(fileDtos)){
|
|
|
|
|
return;
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
String downPath=config.getDownPath()+File.separator+patientId;
|
|
|
|
|
List<TScanAssort> tScanAssorts=new ArrayList<TScanAssort>();
|
|
|
|
@ -325,18 +325,17 @@ public class ZxjhBusinessServiceImpl implements ZxjhBusinessService {
|
|
|
|
|
}
|
|
|
|
|
String path = uri.getPath();
|
|
|
|
|
FTPClient ftpClient = new FTPClient();
|
|
|
|
|
OutputStream outputStream=null;
|
|
|
|
|
try {
|
|
|
|
|
ftpClient.connect(host, port);
|
|
|
|
|
ftpClient.login(username, password);
|
|
|
|
|
ftpClient.enterLocalPassiveMode();
|
|
|
|
|
|
|
|
|
|
File localFile = new File(localFilePath);
|
|
|
|
|
OutputStream outputStream = new FileOutputStream(localFile);
|
|
|
|
|
outputStream = new FileOutputStream(localFile);
|
|
|
|
|
|
|
|
|
|
ftpClient.retrieveFile(path, outputStream);
|
|
|
|
|
|
|
|
|
|
outputStream.close();
|
|
|
|
|
|
|
|
|
|
int numberOfPages=0;
|
|
|
|
|
// 判断文件类型并获取页数
|
|
|
|
|
if (isPdf(localFilePath)) {
|
|
|
|
@ -361,6 +360,9 @@ public class ZxjhBusinessServiceImpl implements ZxjhBusinessService {
|
|
|
|
|
log.error(ex.getMessage(),ex);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if ( outputStream!=null){
|
|
|
|
|
outputStream.close();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -379,8 +381,8 @@ public class ZxjhBusinessServiceImpl implements ZxjhBusinessService {
|
|
|
|
|
PdfReader reader = new PdfReader(filePath);
|
|
|
|
|
return reader.getNumberOfPages();
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
return 0;
|
|
|
|
|
log.info(e.getMessage(),e);
|
|
|
|
|
throw new BaseException("获取文件页码出错");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|