⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 stockorderinfo.java

📁 java阿里巴巴代码
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
package com.saas.biz.stockorderMgr;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;

import com.saas.biz.commen.commMethodMgr;
import com.saas.biz.dao.stockorderDAO.StockorderDAO;
import com.saas.biz.dao.stockorderDAO.StockorderExt;
import com.saas.sys.buffer.Buffers;
import com.saas.sys.dbm.Dbtable;
import com.saas.sys.exp.SaasApplicationException;
import com.saas.sys.log.Logger;

public class Stockorderinfo {
	
	
	Dbtable tradeQuery;
	
	
	Logger log;
	
	
	Buffers inBuffer;
	
	
	Buffers outBuffer;
	
	
	ArrayList queryResult = new ArrayList();
	
	
	commMethodMgr comm;
	
	
	
	public Stockorderinfo() {

		log = new Logger(this);
		tradeQuery = new Dbtable();
		comm = new commMethodMgr();
	}
	
	
	public void setTradeQuery(Dbtable tradeQuery) {

		this.tradeQuery = tradeQuery;
	}
	
	
	public Dbtable getTradeQuery() {

		return this.tradeQuery;
	}
	
	
	public void setOutBuffer(Buffers outBuffer) {

		this.outBuffer = outBuffer;
	}
	
	
	public Buffers getOutBuffer() {

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

		return this.queryResult;
	}
	
	
	public void setQueryResult(ArrayList queryResult) {

		this.queryResult = queryResult;
	}
	
	
	public void genStockorder(Buffers inbuffer) {

		log.LOG_INFO("进入genStockorder方法...");
		try {
			this.queryResult = genStockorder();
		}
		catch (SaasApplicationException e) {
			log.LOG_INFO(e.getMessage());
			
		}
		log.LOG_INFO("退出genStockorder方法...");
	}
	
	
	public ArrayList genStockorder() throws SaasApplicationException {

		ArrayList stockorderList = new ArrayList();
		ArrayList itemsList = new ArrayList();
		StockorderExt stockorderExt = new StockorderExt();
		stockorderList = stockorderExt.selByList("SEL_BY_ALL");
		if (stockorderList == null)
			return null;
		for (Iterator it = stockorderList.iterator(); it.hasNext();) {
			HashMap stockorderListMap = (HashMap) it.next();
			String title = "";
			String stockId = "";
			HashMap stockorderMap = new HashMap();
			if (stockorderListMap.get("stock_id") != null)
				stockId = stockorderListMap.get("stock_id").toString();
			
			if (stockorderListMap.get("title") != null)
				title = stockorderListMap.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("stockId", stockId);
			itemsList.add(stockorderMap);
		}
		return itemsList;
	}
	
	
	public ArrayList genStockorderLimit(int num) throws SaasApplicationException {

		ArrayList stockorderList = new ArrayList();
		StockorderExt stockorderExt = new StockorderExt();
		stockorderList = stockorderExt.selByList("SEL_BY_Limit", 0, num);
		if (stockorderList == null)
			return null;
		
		return stockorderList;
	}
	
	
	public ArrayList genStockEmergency(int num) throws SaasApplicationException {

		ArrayList stockorderList = new ArrayList();
		StockorderExt stockorderExt = new StockorderExt();
		stockorderList = stockorderExt.selByList("SEL_BY_EMERGENCY", 0, num);
		if (stockorderList == null)
			return null;
		
		return stockorderList;
	}
	
	
	
	// get spec list
	public void genSpecStockorder(Buffers inbuffer) {

		log.LOG_INFO("进入genSpecStockorder方法...");
		String cust_id = inbuffer.getString("CUST_ID");
		try {
			this.queryResult = genSpecStockorder("cust_id");
		}
		catch (SaasApplicationException e) {
			log.LOG_INFO(e.getMessage());
			
		}
		log.LOG_INFO("退出genSpecStockorder方法...");
	}
	
	
	public ArrayList genSpecStockorder(String cust_id) throws SaasApplicationException {

		ArrayList stockorderList = new ArrayList();
		ArrayList itemsList = new ArrayList();
		StockorderExt stockorderExt = new StockorderExt();
		stockorderExt.setParam(":VCUST_ID", cust_id);
		stockorderList = stockorderExt.selByList("SEL_SPEC_STOCKORDER");
		if (stockorderList == null)
			return null;
		for (Iterator it = stockorderList.iterator(); it.hasNext();) {
			HashMap stockorderListMap = (HashMap) it.next();
			String title = "";
			String stockId = "";
			HashMap stockorderMap = new HashMap();
			if (stockorderListMap.get("stock_id") != null)
				stockId = stockorderListMap.get("stock_id").toString();
			if (stockorderListMap.get("title") != null)
				title = stockorderListMap.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("stockId", stockId);
			itemsList.add(stockorderMap);
		}
		return itemsList;
	}
	
	
	
	// 主键查找
	public void genPKStockorder(Buffers inbuffer) {

		log.LOG_INFO("进入genPKStockorder方法...");
		String stock_id = inbuffer.getString("STOCK_ID");
		try {
			this.queryResult = genPKStockorder("STOCK_ID");
		}
		catch (SaasApplicationException e) {
			log.LOG_INFO(e.getMessage());
			
		}
		log.LOG_INFO("退出genPKStockorder方法...");
	}
	
	
	public ArrayList genPKStockorder(String stock_id) throws SaasApplicationException {

		ArrayList stockorderList = new ArrayList();
		ArrayList itemsList = new ArrayList();
		StockorderExt stockorderExt = new StockorderExt();
		stockorderExt.setParam(":VSTOCK_ID", stock_id);
		stockorderList = stockorderExt.selByList("SEL_BY_PK");
		if (stockorderList == null)
			return null;
		for (Iterator it = stockorderList.iterator(); it.hasNext();) {
			HashMap stockorderListMap = (HashMap) it.next();
			String title = "";
			String stockId = "";
			HashMap stockorderMap = new HashMap();
			if (stockorderListMap.get("stock_id") != null)
				stockId = stockorderListMap.get("stock_id").toString();
			if (stockorderListMap.get("title") != null)
				title = stockorderListMap.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("stock_id", stockId);
			itemsList.add(stockorderMap);
		}
		return itemsList;
	}
	
	
	
	// **************************shijun add**************************//
	/*
	 * modify by sjp
	 */
	public void addAddstockorder(Buffers inbuffer) {

		this.outBuffer = inbuffer;
		this.inBuffer = inbuffer;
		log.LOG_INFO("进入addstockorder方法...");
		int iResult = -1;
		StockorderDAO stockorderDao = new StockorderDAO();
		stockorderDao.setCust_id(inbuffer.getString("SESSION_CUST_ID"));
		stockorderDao.setTitle(inbuffer.getString("TITLE"));
		stockorderDao.setContent(inbuffer.getString("CONTENT"));
		stockorderDao.setStock_addr(inbuffer.getString("STOCK_ADDR"));
		stockorderDao.setStock_id(inbuffer.getString("STOCK_ID"));
		stockorderDao.setStart_date(inbuffer.getString("START_DATE"));
		stockorderDao.setEnd_date(inbuffer.getString("END_DATE"));
		stockorderDao.setPublish_user_id(inbuffer.getString("SESSION_USER_ID"));
		try {
			iResult = addStockorderinfo(stockorderDao);
		}
		catch (SaasApplicationException e) {

⌨️ 快捷键说明

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