云苍穹附件携带

1.通过AttachmentServiceHelper.getAttachments()获取源附件:

List<Map<String,Object>> attachments = AttachmentServiceHelper.getAttachments("cas_claimbill",claimbillPK,"attachmentpanel");

2.附件地址和最近修改时间不能直接使用:

if(attachment.get("lastModified") instanceof Date){
  Date date = (Date)attachment.get("lastModified");
  attachment.put("lastModified",date.getTime());
}
if(attachment.containsKey("attPkId")){
  DynamicObject dbAttachment = BusinessDataServiceHelper.londSingle(attachment.get("attkId")," bos_attachment","ffileid");
  attachment.put("url",dbAttachment.getstring("ffileid"));
}

3.上传附件到目标单:

AttachmentServiceHelper.upload("cas_recbill", recbillPK,"attachmentpanel", attachments);

posted @ 2021-04-19 10:33  LJ9197  阅读(117)  评论(0编辑  收藏  举报