5系列
就是要注意对附件,使用jdk自带工具,进行压缩后保存(否则nc端打开附件会出现乱码)
AttachmentVO attachmentVO = new AttachmentVO();
attachmentVO.setPk_corp(info.getString("pk_corp"));
attachmentVO.setPk_user(info.getString("pk_user"));
attachmentVO.setUpload_date(new UFDate());
attachmentVO.setAttachment_name(strFileName);
attachmentVO.setPk_object(billid);
attachmentVO.setObject_type("hi_stapplyb_h");
attachmentVO.setView_times(Integer.valueOf(0));
attachmentVO.setStatus(2);
int iAttachmentSize = iFileLength / 1024;
attachmentVO.setAttachment_size(Integer.valueOf(iAttachmentSize != 0 ? iAttachmentSize : 1));
attachmentVO.setAttachment(parseByte);
PubDelegator.getIAttachment().upload(attachmentVO);
注意单据的附件字段值需要自己进行跟新
具体的方法可参考AttachmentDialog
6系列
进行附件查询的伪sql(版本差异略有不同,但数据库表就是以下几张了):
select sm_filestoreview.FILEDATA from
SM_PUB_FILESYSTEM.pk_doc = sm_document_fil