|
@@ -7,6 +7,7 @@ import kd.bos.entity.operate.result.OperationResult;
|
|
|
import kd.bos.ext.fi.bei.util.EmptyUtil;
|
|
|
import kd.bos.fileservice.FileService;
|
|
|
import kd.bos.fileservice.FileServiceFactory;
|
|
|
+import kd.bos.fileservice.extension.FileServiceExtFactory;
|
|
|
import kd.bos.form.events.AfterDoOperationEventArgs;
|
|
|
import kd.bos.list.BillList;
|
|
|
import kd.bos.list.IListView;
|
|
@@ -18,7 +19,9 @@ import kd.bos.metadata.dao.MetadataDao;
|
|
|
import kd.bos.metadata.form.ControlAp;
|
|
|
import kd.bos.metadata.form.FormMetadata;
|
|
|
import kd.bos.metadata.form.control.AttachmentPanelAp;
|
|
|
+import kd.bos.servicehelper.AttachmentDto;
|
|
|
import kd.bos.servicehelper.AttachmentServiceHelper;
|
|
|
+import kd.bos.servicehelper.attachment.AttachmentFieldServiceHelper;
|
|
|
import kd.bos.util.StringUtils;
|
|
|
import kd.sdk.plugin.Plugin;
|
|
|
|
|
@@ -59,11 +62,13 @@ public class AttachmentDownloadListPlugin extends AbstractListPlugin implements
|
|
|
return;
|
|
|
}
|
|
|
List<Map<String, Object>> list = AttachmentServiceHelper.getAttachments(billForm, billid, attForm);
|
|
|
+
|
|
|
for (Map map : list) {
|
|
|
- String url = map.get("url").toString();//获取到url
|
|
|
+ //String url = map.get("url").toString();//获取到url
|
|
|
+ String realUrl = map.get("relativeUrl").toString();
|
|
|
FileService fileService = FileServiceFactory.getAttachmentFileService();
|
|
|
- String path = fileService.getFileServiceExt().getRealPath(url);
|
|
|
- InputStream inputStream = fileService.getInputStream(url);
|
|
|
+ String path = FileServiceExtFactory.getAttachFileServiceExt().getRealPath(realUrl);
|
|
|
+ InputStream inputStream = fileService.getInputStream(realUrl);
|
|
|
String downloadUrl = FileSECUtils.getFileUrlByEncodeSEC(path,inputStream);
|
|
|
this.getView().download(downloadUrl);
|
|
|
}
|