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++; } } } } //添加租金计划显示 BusinessObject docRent = BusinessObject.createBusinessObject(); docRent.setAttributeValue("ID", "RentPlan"); docRent.setAttributeValue("SortNo", "RentPlan"); docRent.setAttributeValue("Name","租金计划表"); lst.add(docRent); return lst; } private static String getNo (int number){ if(number<10){ return "00"+ number; }else if(number<100){ return "0"+ number; }else { return number+""; } } }