|
@@ -32,29 +32,37 @@ public class SalaryFileUploadEditPlugin extends AbstractBillPlugIn implements Up
|
|
|
public void registerListener(EventObject e) {
|
|
|
|
|
|
super.registerListener(e);
|
|
|
- //按钮面板
|
|
|
- Toolbar toolbar = this.getControl("tbmain");
|
|
|
- toolbar.addUploadListener(this);
|
|
|
- //附件面板
|
|
|
- AttachmentPanel attachmentPanel = getControl("nckd_attachment_xc");
|
|
|
+ Toolbar attachmentPanel = this.getControl("advcontoolbarap");
|
|
|
attachmentPanel.addUploadListener(this);
|
|
|
+ Toolbar attachmentPanel1 = this.getControl("nckd_advcontoolbarap1");
|
|
|
+ attachmentPanel1.addUploadListener(this);
|
|
|
+ Toolbar attachmentPanel2 = this.getControl("nckd_advcontoolbarap12");
|
|
|
+ attachmentPanel2.addUploadListener(this);
|
|
|
+ Toolbar attachmentPanel3 = this.getControl("nckd_advcontoolbarap11");
|
|
|
+ attachmentPanel3.addUploadListener(this);
|
|
|
+ Toolbar attachmentPanel4 = this.getControl("nckd_advcontoolbarap13");
|
|
|
+ attachmentPanel4.addUploadListener(this);
|
|
|
}
|
|
|
|
|
|
|
|
|
@Override
|
|
|
public void afterUpload(UploadEvent evt) {
|
|
|
- //获取当前操作单据
|
|
|
- DynamicObject dynamicObject=this.getModel().getDataEntity(true);
|
|
|
- String nckd_entrytype=dynamicObject.getString("nckd_entrytype");
|
|
|
+ String nckd_entrytype=this.getModel().getValue("nckd_entrytype")+"";
|
|
|
//解析附件面板
|
|
|
- AttachmentPanel attachmentPanel=this.getControl("nckd_attachment_xc");
|
|
|
- List<Map<String,Object>> attachmentData=attachmentPanel.getAttachmentData();
|
|
|
+ // AttachmentPanel attachmentPanel=this.getControl("nckd_attachment_xc");
|
|
|
+ // List<Map<String,Object>> attachmentData=attachmentPanel.getAttachmentData();
|
|
|
//获取最新上传的文件路径
|
|
|
- String fileurl = (String) attachmentData.get(attachmentData.size()-1).get("url");
|
|
|
+ String fileurl = evt.getUrls()[0]+"";
|
|
|
+ File ff = new File(fileurl);
|
|
|
//获取文件缓存
|
|
|
TempFileCache cache = CacheFactory.getCommonCacheFactory().getTempFileCache();
|
|
|
//从缓存中拿到输入流
|
|
|
- InputStream inputStream = cache.getInputStream(fileurl);
|
|
|
+ InputStream inputStream = null;
|
|
|
+ try {
|
|
|
+ inputStream = new FileInputStream(ff);
|
|
|
+ } catch (FileNotFoundException e) {
|
|
|
+ throw new RuntimeException(e);
|
|
|
+ }
|
|
|
String billtype="";
|
|
|
//根据分录类型获取对应分录标识
|
|
|
if ("A".equals(nckd_entrytype)) {
|