2018-06-03 22:26:41 +08:00

29 lines
1.4 KiB
Plaintext

<%@ page language="java" contentType="text/html; charset=GBK" %><%@
include file="/Frame/resources/include/include_begin_ajax.jspf"%><script><%
try{
// ObjectType="+ObjectType+"&ObjectNo="+sObjectNo+"&ReportScope="+sReportScope+"&ReportDate="+sReportDate
String sObjectType = CurPage.getParameter("ObjectType");
String sObjectNo = CurPage.getParameter("ObjectNo");
String sReportScope = CurPage.getParameter("ReportScope");
String sReportDate = CurPage.getParameter("ReportDate");
com.amarsoft.awe.common.attachment.AmarsoftUpload upload = new com.amarsoft.awe.common.attachment.AmarsoftUpload();
upload.initialize(pageContext);
upload.upload();
com.amarsoft.awe.common.attachment.File file = upload.getFiles().getFile("importfsfile");
if(file.getSize() > 3){
com.amarsoft.app.util.ExcelImport ei = new com.amarsoft.app.util.ExcelImport(sObjectType, sObjectNo, sReportScope, sReportDate);
InputStream is = file.toInputStream();
String sReturn = ei.run(is);
is.close();
if(com.amarsoft.app.util.ExcelImport.SUCCESS.equals(sReturn)){%>alert("导入成功");parent.afterUpload(true);<%}
else {%>alert("<%=sReturn%>");parent.afterUpload();<%}
}else{
%>alert("未上传文档");parent.afterUpload();<%
}
}catch(Exception e){
ARE.getLog().debug(e);
%>alert("文档不符合规范:<%=e.getMessage()%>");parent.afterUpload();<%
}
%></script><%@ include file="/Frame/resources/include/include_end_ajax.jspf"%>