|
@@ -574,18 +574,24 @@ public class EventProcessServiceImpl extends BaseServiceImpl implements EventPro
|
|
|
boolean flag = true;
|
|
|
|
|
|
for (EventAttach attach : attachList) {
|
|
|
- MultipartFile multipartFile = FilePrefixUtils.urlToMultipartFile(attach.getPath(), System.currentTimeMillis() + ".jpg");
|
|
|
- if (null != multipartFile) {
|
|
|
- R<SysFile> upload = fileService.upload(multipartFile);
|
|
|
- if (HttpStatus.SUCCESS == upload.getCode()) {
|
|
|
- newPathList.add(upload.getData().getUrl());
|
|
|
- ids.add(attach.getId());
|
|
|
- } else {
|
|
|
- logger.error("获取图片失败,{}{}", attach.getId(), attach.getPath());
|
|
|
- flag = false;
|
|
|
- break;
|
|
|
+ if(FILE_URL.equals(attach.getSourceType())){
|
|
|
+ newPathList.add(attach.getPath());
|
|
|
+ ids.add(attach.getId());
|
|
|
+ }else{
|
|
|
+ MultipartFile multipartFile = FilePrefixUtils.urlToMultipartFile(attach.getPath(), System.currentTimeMillis() + ".jpg");
|
|
|
+ if (null != multipartFile) {
|
|
|
+ R<SysFile> upload = fileService.upload(multipartFile);
|
|
|
+ if (HttpStatus.SUCCESS == upload.getCode()) {
|
|
|
+ newPathList.add(upload.getData().getUrl());
|
|
|
+ ids.add(attach.getId());
|
|
|
+ } else {
|
|
|
+ logger.error("获取图片失败,{}{}", attach.getId(), attach.getPath());
|
|
|
+ flag = false;
|
|
|
+ break;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
|
|
|
//存储附件信息
|