fix(oaProject) change attachment path

approve-sys
bob 2 years ago
parent 13a0ce1cf5
commit d095d76460

@ -127,4 +127,4 @@ flowable:
# 关闭定时任务JOB # 关闭定时任务JOB
async-executor-activate: false async-executor-activate: false
attachment: attachment:
path: /tmp path: /data/attachment

@ -1,6 +1,7 @@
package com.ruoyi.flowable.domain.vo; package com.ruoyi.flowable.domain.vo;
import cn.hutool.core.img.ImgUtil; import cn.hutool.core.img.ImgUtil;
import cn.hutool.core.io.FileUtil;
import lombok.Data; import lombok.Data;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
@ -23,8 +24,8 @@ public class AttachmentInfoVO {
this.isImg = false; this.isImg = false;
} }
public void setBase64ByFile(String path, String type) { public void parseImageBase64(String path, String type) {
if (this.isImg) { if (this.isImg && FileUtil.exist(path)) {
this.base64 = ImgUtil.toBase64(ImgUtil.read(path), type); this.base64 = ImgUtil.toBase64(ImgUtil.read(path), type);
} }
} }

@ -840,7 +840,7 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
List<AttachmentInfoVO> list = attachmentIds.stream().map(e -> sysAttachmentService.selectSysAttachmentById(e)).map(e->{ List<AttachmentInfoVO> list = attachmentIds.stream().map(e -> sysAttachmentService.selectSysAttachmentById(e)).map(e->{
AttachmentInfoVO vo = new AttachmentInfoVO(); AttachmentInfoVO vo = new AttachmentInfoVO();
vo.setIsImgByContentType(e.getContentType()); vo.setIsImgByContentType(e.getContentType());
vo.setBase64ByFile(e.getPath(),e.getType()); vo.parseImageBase64(e.getPath(),e.getType());
vo.setId(e.getId()); vo.setId(e.getId());
vo.setName(e.getName()); vo.setName(e.getName());
vo.setType(e.getType()); vo.setType(e.getType());

Loading…
Cancel
Save