apzl_leasing/WebContent/Tenwa/Comm/Document/UpdateDocumentUpload.jsp
2018-06-03 22:26:41 +08:00

55 lines
2.0 KiB
Plaintext

<%@page import="java.net.URLDecoder"%>
<%@page import="com.amarsoft.are.jbo.impl.BizObjectTableMapper"%>
<%@page import="com.amarsoft.awe.util.DBKeyHelp"%>
<%@page import="com.amarsoft.awe.common.attachment.*"%>
<%@ page contentType="text/html; charset=GBK"%>
<%@ include file="/IncludeBegin.jsp"%><%
AmarsoftUpload myAmarsoftUpload = new AmarsoftUpload();
myAmarsoftUpload.initialize(pageContext);
myAmarsoftUpload.upload();
String id = (String)myAmarsoftUpload.getRequest().getParameter("attrid"); //文档编号
System.out.println("文档Id="+id);
List<BizObject> list = JBOFactory.createBizObjectQuery("jbo.app.tenwa.doc.LB_DOCATTRIBUTE",
"select * from O where id=:id ")
.setParameter("id", id).getResultList(false);
BizObject attchment=list.get(0);
//定义数据库操作变量
SqlObject so = null;
String sNewSql = "";
String sFileSaveMode = CurConfig.getConfigure("FileSaveMode");
String sFileSavePath = CurConfig.getConfigure("FileSavePath");
String sFileNameType = CurConfig.getConfigure("FileNameType");
if (!myAmarsoftUpload.getFiles().getFile(0).isMissing()){
try {
if(sFileSaveMode.equals("Disk")){ //存放文件服务器中
String sFilePath=attchment.getAttribute("fullpath").getString();
System.out.println(sFilePath);
myAmarsoftUpload.getFiles().getFile(0).saveAs(sFilePath);
}
if(sFileSaveMode.equals("Table")){ //存放数据表中
//myAmarsoftUpload.getFiles().getFile(0).fileToField(Sqlca,"update "+trueTable+" set DocContent=? where DocNo='"+sDocNo+"' and AttachmentNo='"+sAttachmentNo+"'");
}
myAmarsoftUpload = null;
}catch(Exception e){
myAmarsoftUpload = null;
%>
<script type="text/javascript">
alert(getMessageText('AWEW1010'));//上传文件失败!
parent.AsDialog.ClosePage();
</script>
<%
}
}
%>
<script type="text/javascript">
alert(getMessageText('AWEW1013'));//上传文件成功!
// parent.AsDialog.ClosePage();
parent.reloadAttachment();
</script>
<%@ include file="/IncludeEnd.jsp"%>