diff --git a/WebContent/Tenwa/Lease/Flow/FileManager/MortgageFile/FileUpload.jsp b/WebContent/Tenwa/Lease/Flow/FileManager/MortgageFile/FileUpload.jsp new file mode 100644 index 000000000..db68babc7 --- /dev/null +++ b/WebContent/Tenwa/Lease/Flow/FileManager/MortgageFile/FileUpload.jsp @@ -0,0 +1,86 @@ +<%@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 FileSizejs=(String)myAmarsoftUpload.getRequest().getParameter("FileSize2"); + String docType=(String)myAmarsoftUpload.getRequest().getParameter("DOC_TYPE"); + String oneClassfiy=(String)myAmarsoftUpload.getRequest().getParameter("ONE_CLASSIFY"); + String twoClassfiy=(String)myAmarsoftUpload.getRequest().getParameter("TWO_CLASSIFY"); + String objectType=(String)myAmarsoftUpload.getRequest().getParameter("OBJECTTYPE"); +// String sFileName =URLDecoder.decode((String)myAmarsoftUpload.getRequest().getParameter("FILENAMEX"),"UTF-8"); //文件名称 + String sFileName = myAmarsoftUpload.getFiles().getFile(0).getFileName(); +// System.out.println("文件名==="+ URLDecoder.decode((String)myAmarsoftUpload.getRequest().getParameter("FILENAMEX"),"UTF-8")); +// String Remark=URLDecoder.decode((String)myAmarsoftUpload.getRequest().getParameter("REMARK2"),"UTF-8"); //备注InputTime + String Remark= (String)myAmarsoftUpload.getRequest().getParameter("REMARK"); //备注InputTime + String libraryId= (String)myAmarsoftUpload.getRequest().getParameter("ID"); //附件编号 + String InputTime= StringFunction.getTodayNow(); //附件编号上传时间 + + BizObjectManager libBm=JBOFactory.getBizObjectManager("jbo.app.tenwa.doc.LB_DOCLIBRARY"); + BizObjectManager attrBm=JBOFactory.getBizObjectManager("jbo.app.tenwa.doc.LB_DOCATTRIBUTE"); + BizObject lib=libBm.createQuery("id=:id").setParameter("id", libraryId).getSingleResult(true); +// lib.setAttributeValue("Remark", Remark); +// libBm.saveObject(lib); + BizObject attr=attrBm.newObject(); + attr.setAttributeValue("Library_Id", libraryId); + attr.setAttributeValue("FileName", sFileName); + attr.setAttributeValue("InputUserId", CurUser.getUserID()); + attr.setAttributeValue("InputOrgId", CurUser.getOrgID()); + attr.setAttributeValue("InputTime",InputTime); + attr.setAttributeValue("objectType", objectType); + + //得到不带路径的文件名 + sFileName = StringFunction.getFileName(sFileName); + sFileName = URLDecoder.decode(URLDecoder.decode(sFileName,"UTF-8"),"UTF-8"); + //定义数据库操作变量 + SqlObject so = null; + String sNewSql = ""; + String sFileSaveMode = CurConfig.getConfigure("FileSaveMode"); + String sFileSavePath = CurConfig.getConfigure("FileSavePath"); + String sFileNameType = CurConfig.getConfigure("FileNameType"); + + String trueTable = ((BizObjectTableMapper)attrBm).getTable(); //取得真实的表名 + String sAttachmentNo = DBKeyHelp.getSerialNo(trueTable,"Id"); + + if (!myAmarsoftUpload.getFiles().getFile(0).isMissing()){ + try { + //System.out.println("sDocNo="+libraryId+"--sAttachmentNo="+sAttachmentNo+"--sFileName="+sFileName+"--sFileSavePath="+sFileSavePath); + //System.out.println("sFileNameType="+sFileNameType+"--application="+application); + //String sFullPath = com.amarsoft.awe.common.attachment.FileNameHelper.getFullPath(libraryId, sAttachmentNo,sFileName, sFileSavePath, sFileNameType, application); + String uuid=java.util.UUID.randomUUID().toString().replaceAll("-", ""); + String sFullPath =com.tenwa.officetempalte.util.FileOperatorUtil.getuploadFileDir(sFileSavePath) +uuid+"_"+sFileName; +// if(myAmarsoftUpload.getFiles().getFile(0).getSize()!=Integer.parseInt(FileSizejs)){ +// throw new Exception("上传文件失败,请联系管理员!"); +// } + myAmarsoftUpload.getFiles().getFile(0).saveAs(sFullPath); + //得到带相对路径的文件名 + String sFilePath = sFullPath.replace(sFileSavePath, ""); + attr.setAttributeValue("FilePath",sFilePath); + attr.setAttributeValue("FullPath",sFullPath); + attr.setAttributeValue("Content_Type",DataConvert.toString(myAmarsoftUpload.getFiles().getFile(0).getContentType())); + attr.setAttributeValue("FileSize",DataConvert.toString(String.valueOf(myAmarsoftUpload.getFiles().getFile(0).getSize()))); + attrBm.saveObject(attr); + myAmarsoftUpload = null; + }catch(Exception e){ + e.printStackTrace(); + out.println("An error occurs : " + e.toString()); + attrBm.deleteObject(attr); + myAmarsoftUpload = null; +%> + +<% + } + } +%> + +<%@ include file="/IncludeEnd.jsp"%> \ No newline at end of file diff --git a/WebContent/Tenwa/Lease/Flow/FileManager/MortgageFile/LbDoclibraryInfo.jsp b/WebContent/Tenwa/Lease/Flow/FileManager/MortgageFile/LbDoclibraryInfo.jsp new file mode 100644 index 000000000..10c179595 --- /dev/null +++ b/WebContent/Tenwa/Lease/Flow/FileManager/MortgageFile/LbDoclibraryInfo.jsp @@ -0,0 +1,99 @@ +<%@ page contentType="text/html; charset=GBK"%> +<%@ include file="/Frame/resources/include/include_begin_info.jspf"%><% + /* + Author: undefined 2018-06-07 + Content: 示例详情页面 + History Log: + */ + String sPrevUrl = CurPage.getParameter("PrevUrl"); + if(sPrevUrl == null) sPrevUrl = ""; + + String sTempletNo = "LbDoclibraryInfo";//--模板号-- + ASObjectModel doTemp = new ASObjectModel(sTempletNo); + doTemp.setColTips("", ""); + ASObjectWindow dwTemp = new ASObjectWindow(CurPage, doTemp,request); + dwTemp.Style = "2";//freeform + //dwTemp.ReadOnly = "-2";//只读模式 + dwTemp.genHTMLObjectWindow(CurPage.getParameter("SerialNo")); + + String sButtons[][] = { + {"true","All","Button","保存","保存所有修改","as_save(0)","","","",""}, + {String.valueOf(!com.amarsoft.are.lang.StringX.isSpace(sPrevUrl)),"All","Button","返回","返回列表","returnList()","","","",""} + }; + sButtonPosition = "south"; +%><%@ include file="/Frame/resources/include/ui/include_info.jspf"%> + +<%@ include file="/Frame/resources/include/include_end.jspf"%> \ No newline at end of file diff --git a/WebContent/Tenwa/Lease/Flow/FileManager/MortgageFile/LbDoclibraryList.jsp b/WebContent/Tenwa/Lease/Flow/FileManager/MortgageFile/LbDoclibraryList.jsp index 8e0fa30a7..e961bf2c7 100644 --- a/WebContent/Tenwa/Lease/Flow/FileManager/MortgageFile/LbDoclibraryList.jsp +++ b/WebContent/Tenwa/Lease/Flow/FileManager/MortgageFile/LbDoclibraryList.jsp @@ -61,7 +61,6 @@ //上传 function upload(id){ - debugger; var param="Library_id="+id; var sUrl="/Tenwa/Lease/Flow/FileManager/MortgageFile/LbDoclibraryInfo.jsp"; AsDialog.PopView(sUrl,param,"dialogWidth=480px;dialogHeight=400px;resizable=no;scrollbars=no;status:yes;maximize:no;help:no;",function(message){