paraexammgr.java

来自「java阿里巴巴代码」· Java 代码 · 共 288 行

JAVA
288
字号
package com.saas.biz.commen;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import com.saas.sys.buffer.Buffers;
import com.saas.sys.exp.SaasApplicationException;
import com.saas.sys.log.*;
import com.saas.biz.dao.examDAO.*;
import com.saas.biz.dao.parallDAO.*;
import com.saas.biz.dao.JobDAO.*;
import com.saas.biz.JobMgr.*;

public class ParaexamMgr {
	Logger log;

	ArrayList queryResult = new ArrayList();

	public ParaexamMgr() {
		log = new Logger(this);
	}

	public ArrayList getQueryResult() {
		return this.queryResult;
	}

	public void setQueryResult(ArrayList queryResult) {
		this.queryResult = queryResult;
	}
	public void paraexamList(Buffers inbuffer) {
		String table_flag="";
		table_flag=inbuffer.getString("TABLE_FLAG");
		log.LOG_INFO("@@@@@@@@@@@@@@@@@@@@@@@"+table_flag);
		log.LOG_INFO("进入paraexamList方法...");
		try {
			this.queryResult = paraexamList(table_flag);
			log.LOG_INFO("!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
		} catch (SaasApplicationException e) {
			log.LOG_INFO(e.getMessage());
		}
		log.LOG_INFO("退出paraexamList方法...");
	}

	/**
	 * 获取产品列表
	 * @param inbuffer
	 */
	public ArrayList paraexamList(String table_flag)
			throws SaasApplicationException {
				if(table_flag=="" ||table_flag==null) return null;
		ArrayList paraList = new ArrayList();
		ArrayList paraexamList = new ArrayList();
		ParaexamExt parainfoExt = new ParaexamExt();
		if(table_flag.equals("1"))
		{
		paraexamList = parainfoExt.selByList("SEL_BY_USER_ID");
		
		
		for (Iterator it = paraexamList.iterator(); it.hasNext();) {
			HashMap paraInfo = (HashMap) it.next();
			String userID = null;
			String userName = null;
			String custId = null;
			String userState = null;
			String passwd = null;
			HashMap paraListMap = new HashMap();
			if (paraInfo.get("user_id") != null)
				userID = paraInfo.get("user_id").toString();
			if (paraInfo.get("cust_id") != null)
				custId = paraInfo.get("cust_id").toString();
			if (paraInfo.get("user_name") != null)
				userName = paraInfo.get("user_name").toString();
			if (paraInfo.get("user_state") != null)
				userState = paraInfo.get("user_state").toString();
			if (paraInfo.get("passwd") != null)
				passwd = paraInfo.get("passwd").toString();
			paraListMap.put("user_id", userID);
			paraListMap.put("user_name",userName);
			paraListMap.put("cust_id", custId);
			paraListMap.put("user_state", userState);
			paraListMap.put("passwd", passwd);
			paraList.add(paraListMap);		
		}
}
		if(table_flag.equals("2"))
		{
			EnterPriseExt enterPriseExt = new EnterPriseExt();
			paraexamList = enterPriseExt.selByList("SEL_BY_ENTERPRISE");
			if(paraexamList == null) return null;
			for (Iterator its = paraexamList.iterator(); its.hasNext();)
			{
				HashMap enterPrise = (HashMap) its.next();
				String enterpriseName = null;
				String enterpriseType = null;
				String enterpriseState = null;
				HashMap enterListMap = new HashMap();
				if (enterPrise.get("cust_name") != null)
					enterpriseName = enterPrise.get("cust_name").toString();
				if (enterPrise.get("cust_type") != null)
					enterpriseType = enterPrise.get("cust_type").toString();
				if (enterPrise.get("cust_state") != null)
					enterpriseState = enterPrise.get("cust_state").toString();
				enterListMap.put("cust_name", enterpriseName);
				enterListMap.put("cust_type", enterpriseType);
				enterListMap.put("cust_state", enterpriseState);
				paraList.add(enterListMap);
				log.LOG_INFO("cust_name<<<<<<<<<<<<<<" + enterpriseName);
				log.LOG_INFO("cust_type>>>>>>>>>" + enterpriseType);

			}
			
		}
		if(table_flag.equals("3"))
		{
			StockOrderExt enterPriseExt = new StockOrderExt();
			paraexamList = enterPriseExt.selByList("SEL_BY_STOCKORDERLIST");
			if(paraexamList == null) return null;
			for (Iterator its = paraexamList.iterator(); its.hasNext();)
			{
				HashMap stockOrderMap = (HashMap) its.next();
				String stockOrderId = null;
				String title = null;
				String stockOrderType = null;
				String custId = null;
				String content = null;
				String stockClass = null;
				String startDate = null;
				String endDate = null;
				HashMap stockMap = new HashMap();
				if (stockOrderMap.get("stock_id") != null)
					stockOrderId = stockOrderMap.get("stock_id").toString();
				
				if (stockOrderMap.get("cust_id") != null)
					custId = stockOrderMap.get("cust_id").toString();
				
				if (stockOrderMap.get("stock_type") != null)
					stockOrderType = stockOrderMap.get("stock_type").toString();
				
				if (stockOrderMap.get("title") != null)
					title = stockOrderMap.get("title").toString();
				
				if (stockOrderMap.get("content") != null)
					content = stockOrderMap.get("content").toString();
				
				if (stockOrderMap.get("stock_class") != null)
					stockClass = stockOrderMap.get("stock_class").toString();
				
				if (stockOrderMap.get("start_date") != null)
					startDate = stockOrderMap.get("start_date").toString();
				
				if (stockOrderMap.get("end_date") != null)
					endDate = stockOrderMap.get("end_date").toString();
				
				stockMap.put("stock_id", stockOrderId);
				stockMap.put("cust_id", custId);
				stockMap.put("stock_type", stockOrderType);
				stockMap.put("title", title);
				stockMap.put("content", content);
				stockMap.put("stock_class", stockClass);
				stockMap.put("start_date", startDate);
				stockMap.put("end_date", endDate);
				paraList.add(stockMap);
				

			}
			
		}
		if(table_flag.equals("4"))
		{
			ProduceExt produceExt = new ProduceExt();
			paraexamList = produceExt.selByList("SEL_BY_PRODUCT");
			log.LOG_INFO("hohooho...................");
			if(paraexamList==null) return null;
			for (Iterator its = paraexamList.iterator(); its.hasNext();)
			{
				log.LOG_INFO("ooooooooooooooooooooooo...................");
				HashMap produceMap = (HashMap) its.next();
				String custId = null;
				String produceId = null;
				String produceType = null;
				String productName = null;
				String productClass = null;
				String productSite = null;
				String productAbstract = null;
				String productDesc = null;
				HashMap proMap = new HashMap();
				
				if (produceMap.get("cust_id") != null)
					custId = produceMap.get("cust_id").toString();
				log.LOG_INFO("还有这里...................");
				if (produceMap.get("product_id") != null)
					produceId = produceMap.get("product_id").toString();
				
				if (produceMap.get("product_type") != null)
					produceType = produceMap.get("product_type").toString();
				
				if (produceMap.get("product_name") != null)
					productName = produceMap.get("product_name").toString();
				
				if (produceMap.get("product_class") != null)
					productClass = produceMap.get("product_class").toString();
				
				if (produceMap.get("product_site") != null)
					productSite = produceMap.get("product_site").toString();
				
				if (produceMap.get("product_abstract") != null)
					productAbstract = produceMap.get("product_abstract").toString();			
				if (produceMap.get("product_desc") != null)
					productDesc = produceMap.get("product_desc").toString();
				log.LOG_INFO("我来调试!...................");
				proMap.put("cust_id", custId);
				proMap.put("product_id", produceId);
				proMap.put("product_type", produceType);
				proMap.put("product_name", productName);
				proMap.put("product_class", productClass);
				proMap.put("product_site", productSite);
				proMap.put("product_abstract", productAbstract);
				proMap.put("product_desc", productDesc);
				paraList.add(proMap);
				log.LOG_INFO("11111111111111111111");
			}
		}
		if(table_flag.equals("5"))
		{
			JobExt jobExt=new JobExt();
			paraexamList=jobExt.selByList("SEL_SPEC_JOBLIST");
			if(paraexamList==null)  return null;
			for (Iterator it = paraexamList  .iterator(); it.hasNext();) {
				HashMap JobListMap = (HashMap) it.next();
				String title = "";
				String jobId = "";
				HashMap stockorderMap = new HashMap();
				if (JobListMap.get("job_id") != null)		
					jobId = JobListMap.get("job_id").toString();
				if (JobListMap.get("title") != null)
					title = JobListMap.get("title").toString();
				try
				{	
					title =new String(title.getBytes("ISO8859_1"),"GB2312"); 
				} 
				catch (Exception e)
				{	
					throw new RuntimeException(e);
				}		
				stockorderMap.put("title", title);
				stockorderMap.put("jobId", jobId);
				paraList.add(stockorderMap);
			}
		}
		if(table_flag.equals("6"))
		{
			StoreExt storeExt = new StoreExt();

			// parainfoExt.setParam(":VCUST_TYPE", cust_type);
			paraexamList = storeExt.selByList("SEL_BY_STORE");
			if(paraexamList == null) return null;
			for (Iterator it = paraexamList.iterator(); it.hasNext();) 
			{
				HashMap paraInfo = (HashMap) it.next();
				String custId = null;
				String commodityId = null;
				String commodityType = null;
				String comodityName = null;
				String comondityPrice = null;
				HashMap storeListMap = new HashMap();
				if (paraInfo.get("cust_id") != null)
					custId = paraInfo.get("cust_id").toString();
				if (paraInfo.get("commodity_id") != null)
					commodityId = paraInfo.get("commodity_id").toString();
				if (paraInfo.get("commodity_type") != null)
					commodityType = paraInfo.get("commodity_type").toString();
				if (paraInfo.get("commodity_name") != null)
					comodityName = paraInfo.get("commodity_name").toString();
				if (paraInfo.get("commodity_price") != null)
					comondityPrice = paraInfo.get("commodity_price").toString();
				storeListMap.put("cust_id", custId);
				storeListMap.put("commodity_id", commodityId);
				storeListMap.put("cust_id", commodityType);
				storeListMap.put("user_state", comodityName);
				storeListMap.put("passwd", comondityPrice);
				paraList.add(storeListMap);

			}
		}
		
		return paraList;
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?