新增文件

This commit is contained in:
tangfutang 2020-08-25 09:22:00 +08:00
parent ebee50cba6
commit 1f15e8995f
2 changed files with 176 additions and 0 deletions

View File

@ -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<BusinessObject> 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();
%>
<html>
<head>
<style>
.black9pt { font-size: 9pt; color: #000000; text-decoration: none}
</style>
<!-- 为了页面美观,请不要删除下面 TITLE 中的空格 -->
<title>请选择所需信息
                                                     
                                                     
</title>
</head>
<body class="pagebackground" style="overflow: auto;overflow-x:visible;overflow-y:visible">
<table width="100%" border='0' height="100%" cellspacing='0' align=center bordercolor='#999999' bordercolordark='#FFFFFF'>
<form name="buff" align=center>
<tr>
<td id="selectPage">
<iframe name="left" width=100% height=100% frameborder=0 ></iframe>
</td>
</tr>
<tr style="height:40px;">
<td nowarp bgcolor="#e8e8e8" height="35" align=center valign="middle" colspan="2" style="border-top:1px solid #d8d8d8">
<%if(!"1".equals(readOnlyFlag)){out.println(new Button("确认", "", "returnSelection()").getHtmlText());}%>
<%=new Button("取消", "", "doCancel()").getHtmlText()%>
</td>
</tr>
</form>
</table>
</body>
</html>
<script type="text/javascript">
function returnSelection(){
var selectedValue = "";
if(<%=tviTemp.MultiSelect%>){
var nodes = getCheckedTVItems("root","Top");
//if(nodes.length < 1) return;
for(var i = 0; i < nodes.length; i++){
selectedValue += nodes[i].value+"@"+nodes[i].name+"~";
}
}else{
var node = getCurTVItem();
if(!node) return;
var sType = node.type;
selectedValue = node.value+"@"+node.name;
}
if(selectedValue == ""){
if(confirm("您尚未进行选择,确认要返回吗?")){
selectedValue = "~";
}else{
return;
}
}
selectedValue+="";
parent.AsDialog.ClosePage(selectedValue);
}
function doCancel(){
parent.AsDialog.ClosePage('_CANCEL_');
}
//新增树图双击事件响应函数 add by hwang 20090601
function TreeViewOnDBLClick(){
returnSelection();
}
//新增树图双击事件响应函数 add by hwang 20090601
function TreeViewOnClick(){
}
function startMenu(){
selectedTreeNodeIDs="<%=selectedValues%>".split(",");
<%
out.println(tviTemp.generateHTMLTreeView());
%>
expandAll();
if(<%=tviTemp.MultiSelect%> && typeof(selectedTreeNodeIDs) != "undefined" && selectedTreeNodeIDs !=""){
for(var i = 0; i < selectedTreeNodeIDs.length;i++)
{
if(typeof(selectedTreeNodeIDs[i]) != "undefined" && selectedTreeNodeIDs[i].length != 0)
setCheckTVItem(selectedTreeNodeIDs[i],true);
}
}
}
startMenu();
</script>
<%@ include file="/IncludeEnd.jsp"%>

View File

@ -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<BusinessObject> loadBusinessObjects_SQL() throws Exception{
List<BusinessObject> lst=new ArrayList<BusinessObject>();
List<Map<String, String>> 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<String, String> 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<Map<String, String>> 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<String, String> 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+"";
}
}
}