update===>:修改筛查问题。

This commit is contained in:
haown 2023-10-19 13:39:47 +08:00
parent e3099218b1
commit 7b9d49cf1b
2 changed files with 24 additions and 16 deletions

View File

@ -106,10 +106,13 @@ public class AppletScreeningRecordController extends BaseController {
public R<ScreeningRecordVo> detail(@PathVariable String screeningId) { public R<ScreeningRecordVo> detail(@PathVariable String screeningId) {
ScreeningRecordVo screeningRecordVo = screeningRecordService.detail(screeningId); ScreeningRecordVo screeningRecordVo = screeningRecordService.detail(screeningId);
if (screeningRecordVo != null) { if (screeningRecordVo != null) {
File file = new File(screeningRecordVo.getAttachment()); if (StringUtils.isNotBlank(screeningRecordVo.getAttachment())){
if (file.exists() && file.isFile()) { String fileDir = XinELuConfig.getProfile() + screeningRecordVo.getAttachment().replaceAll("/profile", "");
String fileName = file.getName(); File file = new File(fileDir);
screeningRecordVo.setFileType(fileName.substring(fileName.lastIndexOf(".") + 1)); if (file.exists() && file.isFile()) {
String fileName = file.getName();
screeningRecordVo.setFileType(fileName.substring(fileName.lastIndexOf(".") + 1));
}
} }
if (!StringUtils.contains(screeningRecordVo.getProjectName(), ScreeningProjectConstants.ALZHEIMER)) { if (!StringUtils.contains(screeningRecordVo.getProjectName(), ScreeningProjectConstants.ALZHEIMER)) {

View File

@ -286,10 +286,13 @@ public class ScreeningRecordServiceImpl implements IScreeningRecordService {
if(recordVo == null) { if(recordVo == null) {
return null; return null;
} }
File file = new File(recordVo.getAttachment()); if(StringUtils.isNotBlank(recordVo.getAttachment())) {
if (file.exists() && file.isFile()) { String fileDir = XinELuConfig.getProfile() + recordVo.getAttachment().replaceAll("/profile", "");
String fileName = file.getName(); File file = new File(fileDir);
recordVo.setFileType(fileName.substring(fileName.lastIndexOf(".") + 1)); if (file.exists() && file.isFile()) {
String fileName = file.getName();
recordVo.setFileType(fileName.substring(fileName.lastIndexOf(".") + 1));
}
} }
if (!StringUtils.contains(recordVo.getProjectName(), ScreeningProjectConstants.ALZHEIMER)) { if (!StringUtils.contains(recordVo.getProjectName(), ScreeningProjectConstants.ALZHEIMER)) {
getRecordDetail(recordVo); getRecordDetail(recordVo);
@ -432,16 +435,18 @@ public class ScreeningRecordServiceImpl implements IScreeningRecordService {
/** 获取图片附件转base64 */ /** 获取图片附件转base64 */
private void setAttachment(ScreeningRecordVo record) { private void setAttachment(ScreeningRecordVo record) {
if(!StringUtils.isBlank(record.getAttachment())) { if(StringUtils.isNotBlank(record.getAttachment())) {
File file = new File(record.getAttachment()); String fileDir = XinELuConfig.getProfile() + record.getAttachment().replaceAll("/profile", "");
if(file.exists()) { File file = new File(fileDir);
record.setAttachment(FileUtils.PicToBase64(record.getAttachment())); if(file.exists() && file.isFile()) {
record.setAttachment(FileUtils.PicToBase64(fileDir));
} }
} }
if(!StringUtils.isBlank(record.getAttachmentTwo())) { if(StringUtils.isNotBlank(record.getAttachmentTwo())) {
File file = new File(record.getAttachmentTwo()); String fileDir = XinELuConfig.getProfile() + record.getAttachmentTwo().replaceAll("/profile", "");
if (file.exists()) { File file = new File(fileDir);
record.setAttachmentTwo(FileUtils.PicToBase64(record.getAttachmentTwo())); if (file.exists() && file.isFile()) {
record.setAttachmentTwo(FileUtils.PicToBase64(fileDir));
} }
} }
} }