From 90dc6281dfa713e34d530048826d8ce271b508f1 Mon Sep 17 00:00:00 2001 From: yexuan Date: Mon, 25 Jun 2018 13:53:47 +0800 Subject: [PATCH] =?UTF-8?q?WEB=E4=B8=AD=20=20APP=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AppFresh/AppVersion/AppVersionFile.jsp | 88 ++++++++++++++++++ .../AppFresh/AppVersion/AppVersionInfo.jsp | 45 +++++++++ .../AppFresh/AppVersion/AppVersionList.jsp | 91 +++++++++++++++++++ .../AppFresh/AppVersion/AttachmentUpload.jsp | 81 +++++++++++++++++ 4 files changed, 305 insertions(+) create mode 100644 WebContent/AppFresh/AppVersion/AppVersionFile.jsp create mode 100644 WebContent/AppFresh/AppVersion/AppVersionInfo.jsp create mode 100644 WebContent/AppFresh/AppVersion/AppVersionList.jsp create mode 100644 WebContent/AppFresh/AppVersion/AttachmentUpload.jsp diff --git a/WebContent/AppFresh/AppVersion/AppVersionFile.jsp b/WebContent/AppFresh/AppVersion/AppVersionFile.jsp new file mode 100644 index 000000000..a604c87d3 --- /dev/null +++ b/WebContent/AppFresh/AppVersion/AppVersionFile.jsp @@ -0,0 +1,88 @@ +<%@ page contentType="text/html; charset=GBK"%><%@ +include + file="/Frame/resources/include/include_begin_info.jspf"%> +<% + //获得参数 + String id = CurPage.getParameter("id"); + if (id == null) + id = ""; + + String sUserID = CurPage.getParameter("UserID"); + if (sUserID == null) + sUserID = ""; + + java.util.Date dateNow = new java.util.Date(); + SimpleDateFormat sdfTemp = new SimpleDateFormat( + "yyyy/MM/dd"); + String date = sdfTemp.format(dateNow); + + ASObjectModel doTemp = new ASObjectModel("APP_VERSION_FILE"); + ASObjectWindow dwTemp = new ASObjectWindow(CurPage, doTemp, + request); + dwTemp.Style = "2"; //设置DW风格 1:Grid 2:Freeform + dwTemp.ReadOnly = "0"; //设置是否只读 1:只读 0:可写 + dwTemp.genHTMLObjectWindow(id); + + String sButtons[][] = {{"true", "All", "Button", "保存", + "开始上传", "uploadApp()", "", "", "", "btn_icon_up"},}; +%><%@ include file="/Frame/resources/include/ui/include_info.jspf"%> + +<%@ include file="/Frame/resources/include/include_end.jspf"%> diff --git a/WebContent/AppFresh/AppVersion/AppVersionInfo.jsp b/WebContent/AppFresh/AppVersion/AppVersionInfo.jsp new file mode 100644 index 000000000..833e7536e --- /dev/null +++ b/WebContent/AppFresh/AppVersion/AppVersionInfo.jsp @@ -0,0 +1,45 @@ +<%@ page contentType="text/html; charset=GBK"%><%@ +include + file="/Frame/resources/include/include_begin_info.jspf"%> +<% + //获得参数 + String id = CurPage.getParameter("id"); + if (id == null) + id = ""; + + String sUserID = CurPage.getParameter("UserID"); + if (sUserID == null) + sUserID = ""; + + java.util.Date dateNow = new java.util.Date(); + SimpleDateFormat sdfTemp = new SimpleDateFormat( + "yyyy/MM/dd"); + String date = sdfTemp.format(dateNow); + + ASObjectModel doTemp = new ASObjectModel("APP_VERSION_INFO"); + ASObjectWindow dwTemp = new ASObjectWindow(CurPage, doTemp, + request); + dwTemp.Style = "2"; //设置DW风格 1:Grid 2:Freeform + dwTemp.ReadOnly = "0"; //设置是否只读 1:只读 0:可写 + dwTemp.genHTMLObjectWindow(id); + + String sButtons[][] = {{"true", "All", "Button", "保存", + "保存所有修改", "saveRecord()", "", "", "", "btn_icon_save"},}; +%><%@ include file="/Frame/resources/include/ui/include_info.jspf"%> + +<%@ include file="/Frame/resources/include/include_end.jspf"%> diff --git a/WebContent/AppFresh/AppVersion/AppVersionList.jsp b/WebContent/AppFresh/AppVersion/AppVersionList.jsp new file mode 100644 index 000000000..d47f3e815 --- /dev/null +++ b/WebContent/AppFresh/AppVersion/AppVersionList.jsp @@ -0,0 +1,91 @@ +<%@ page contentType="text/html; charset=GBK"%><%@ + include + file="/Frame/resources/include/include_begin_list.jspf"%> +<% + ASObjectModel doTemp = new ASObjectModel("APP_VERSION_LIST"); + doTemp.setLockCount(2); //锁定两列 + ASObjectWindow dwTemp = new ASObjectWindow(CurPage,doTemp,request); + + dwTemp.Style="1"; //设置为Grid风格 + dwTemp.ReadOnly = "1";//编辑模式 + dwTemp.setPageSize(10); + dwTemp.ConvertCode2Title = "1"; + dwTemp.genHTMLObjectWindow(""); + + String sButtons[][] = { + {"true","","Button","新增APP应用","新增一个版本","newRecord()","","","","btn_icon_add"}, + {"true","","Button","APP应用信息","查看版本信息","viewAndEdit()","","","","btn_icon_detail"}, + {"true","","Button","上传APP应用","查看版本信息","uploadApp()","","","","btn_icon_up"}, + {"true","","Button","删除该应用","删除该版本","if(confirm('确实要删除吗?'))as_delete(0,'')","","","","btn_icon_delete"}, + {"true","","Button","下载应用到本地","下载该版本","downloadFile()","","","","btn_icon_down"} + }; +%><%@include file="/Frame/resources/include/ui/include_list.jspf"%> + +<%@ include file="/Frame/resources/include/include_end.jspf"%> \ No newline at end of file diff --git a/WebContent/AppFresh/AppVersion/AttachmentUpload.jsp b/WebContent/AppFresh/AppVersion/AttachmentUpload.jsp new file mode 100644 index 000000000..c69ee1639 --- /dev/null +++ b/WebContent/AppFresh/AppVersion/AttachmentUpload.jsp @@ -0,0 +1,81 @@ +<%@page import="jbo.app.APP_VERSION"%> +<%@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=UTF-8"%> +<%@ include file="/IncludeBegin.jsp"%> +<% + AmarsoftUpload myAmarsoftUpload = new AmarsoftUpload(); + myAmarsoftUpload.initialize(pageContext); + myAmarsoftUpload.upload(); + + // 鐢ㄦ埛ID + String USER_ID = (String) myAmarsoftUpload.getRequest() + .getParameter("usreid"); + // 涓婁紶鏈湴鏂囦欢鍚嶇О + String sFileName = (String) myAmarsoftUpload.getRequest() + .getParameter("FILENAME"); + + String id = CurPage.getParameter("id"); + + BizObjectManager bom = JBOFactory + .getBizObjectManager(APP_VERSION.CLASS_NAME); + BizObjectQuery boq = bom.createQuery("id=:id").setParameter( + "id", id); + BizObject bo = boq.getSingleResult(true); + + if (null == bo) { +%> + +<% + return; + } + + // 褰撳墠鏃堕棿 + java.util.Date dateNow = new java.util.Date(); + SimpleDateFormat sdfTemp = new SimpleDateFormat("yyyy/MM/dd"); + String date = sdfTemp.format(dateNow); + String date1 = date; + date1 = date1.replace("/", ""); + + String RandomName = date1 + "_" + sFileName; + String sFileSaveMode = CurConfig.getConfigure("FileSaveMode"); + String sFileSavePath = CurConfig.getConfigure("FileSavePath"); + String sFileNameType = CurConfig.getConfigure("FileNameType"); + String sFullPath = ""; + if (!myAmarsoftUpload.getFiles().getFile(0).isMissing()) { + try { + if (sFileSaveMode.equals("Disk")) { + // 鑾峰彇鍏ㄨ矾寰 + sFullPath = sFileSavePath + "/" + RandomName; + // 淇濆瓨鏈嶅姟鍣ㄦ枃浠 + myAmarsoftUpload.getFiles().getFile(0) + .saveAs(sFullPath); + bo.setAttributeValue("FILE_NAME", sFileName); + bo.setAttributeValue("IMAGE_PATH", sFullPath); + bo.setAttributeValue("MODIFICATOR", USER_ID); + bo.setAttributeValue("MODIFY_DATE", date); + bom.saveObject(bo); + } + } catch (Exception e) { + out.println("An error occurs : " + e.toString()); + myAmarsoftUpload = null; +%> + +<% + } + } +%> + +<%@ include file="/IncludeEnd.jsp"%>