From 1f15e8995fec0e882ffcddb7fb8f7a850093208a Mon Sep 17 00:00:00 2001 From: tangfutang Date: Tue, 25 Aug 2020 09:22:00 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ParameterSqlCodeSelector.jsp | 122 ++++++++++++++++++ .../base/businessobject/FtpDownloadFile.java | 54 ++++++++ 2 files changed, 176 insertions(+) create mode 100644 WebContent/Tenwa/Lease/Flow/Comm/LBAssetTransferRegistration/ParameterSqlCodeSelector.jsp create mode 100644 src_base/com/amarsoft/app/base/businessobject/FtpDownloadFile.java diff --git a/WebContent/Tenwa/Lease/Flow/Comm/LBAssetTransferRegistration/ParameterSqlCodeSelector.jsp b/WebContent/Tenwa/Lease/Flow/Comm/LBAssetTransferRegistration/ParameterSqlCodeSelector.jsp new file mode 100644 index 000000000..491ce227d --- /dev/null +++ b/WebContent/Tenwa/Lease/Flow/Comm/LBAssetTransferRegistration/ParameterSqlCodeSelector.jsp @@ -0,0 +1,122 @@ +<%@page import="com.amarsoft.app.base.config.impl.BusinessComponentConfig"%> +<%@page import="com.amarsoft.app.base.businessobject.*"%> +<%@page import="com.tenwa.comm.util.jboutil.DataOperatorUtil"%> +<%@ page contentType="text/html; charset=GBK"%><%@ + include file="/IncludeBeginMD.jsp"%><% + String readOnlyFlag = CurPage.getParameter("ReadOnly"); + String multiFlag = CurPage.getParameter("MultiFlag"); + String selectedValues = CurPage.getParameter("SelectedValues"); + if(selectedValues==null)selectedValues=""; + //定义Treeview + HTMLTreeView tviTemp = new HTMLTreeView(SqlcaRepository,CurComp,sServletURL,"选择","right"); + tviTemp.TriggerClickEvent=true; //是否自动触发选中事件 + if("true".equalsIgnoreCase(multiFlag)) + tviTemp.MultiSelect = true;//设置树图为多选 + + String idcol="ID"; + String namecol="Name"; + String sortNocol="SortNo"; + List list = FtpDownloadFile.loadBusinessObjects_SQL(); + if(list!=null){ + int i=0; + for(BusinessObject bo:list){ + String sortNo=bo.getString(sortNocol); + String id = bo.getString(idcol); + String name = bo.getString(namecol); + if(sortNo==null||sortNo.length()==0) + sortNo=id; + tviTemp.insertPage(sortNo,"root", name , id, "", i++); + } + } + tviTemp.packUpItems(); +%> + + + + +请选择所需信息 +                                                       +                                                       + + + + + + + + + + + + +
+ +
+ <%if(!"1".equals(readOnlyFlag)){out.println(new Button("确认", "", "returnSelection()").getHtmlText());}%> + <%=new Button("取消", "", "doCancel()").getHtmlText()%> +
+ + + +<%@ include file="/IncludeEnd.jsp"%> \ No newline at end of file diff --git a/src_base/com/amarsoft/app/base/businessobject/FtpDownloadFile.java b/src_base/com/amarsoft/app/base/businessobject/FtpDownloadFile.java new file mode 100644 index 000000000..14bad4b39 --- /dev/null +++ b/src_base/com/amarsoft/app/base/businessobject/FtpDownloadFile.java @@ -0,0 +1,54 @@ +package com.amarsoft.app.base.businessobject; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +import com.tenwa.comm.util.jboutil.DataOperatorUtil; + +public class FtpDownloadFile { + + public static List loadBusinessObjects_SQL() throws Exception{ + List lst=new ArrayList(); + List> docList = DataOperatorUtil.getDataBySql("select itemname from CODE_LIBRARY where CodeNo='DocList' and IsInUse='1' and length(itemno)=6 group by itemname"); + if(docList!=null){ + int docInt = 1; + for (Map map : docList) { + String itemname = map.get("itemname"); + String SortNo = getNo(docInt); + BusinessObject bo = BusinessObject.createBusinessObject(); + bo.setAttributeValue("ID", SortNo); + bo.setAttributeValue("SortNo", SortNo); + bo.setAttributeValue("Name",itemname); + lst.add(bo); + docInt++; + int docNameInt = 1; + List> docNameList = DataOperatorUtil.getDataBySql("SELECT doc_name as docName FROM LB_DOCCONFIG WHERE DOC_CLASS_ITEMNO IN (SELECT itemno FROM CODE_LIBRARY WHERE CodeNo='DocList' AND IsInUse='1' AND itemname='"+ + itemname+"') GROUP BY doc_name"); + if(docNameList!=null){ + for (Map map2 : docNameList) { + String docNameno = SortNo+getNo(docNameInt); + BusinessObject docNameBo = BusinessObject.createBusinessObject(); + docNameBo.setAttributeValue("ID", docNameno); + docNameBo.setAttributeValue("SortNo", docNameno); + docNameBo.setAttributeValue("Name",map2.get("docName")); + lst.add(docNameBo); + docNameInt++; + } + } + + } + } + return lst; + } + + private static String getNo (int number){ + if(number<10){ + return "00"+ number; + }else if(number<100){ + return "0"+ number; + }else { + return number+""; + } + } +}