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

📄 salespriceinfo.java

📁 java阿里巴巴代码
💻 JAVA
字号:
package com.saas.biz.salesPriceMgr;

import java.util.ArrayList;
import java.util.StringTokenizer;
import com.saas.biz.dao.salesPriceDAO.SalesPriceDAO;
import com.saas.biz.dao.salesPriceDAO.SalesPriceExt;
import com.saas.sys.buffer.Buffers;
import com.saas.sys.dbm.Dbtable;
import com.saas.sys.exp.SaasApplicationException;
import com.saas.sys.log.Logger;
import com.saas.biz.commen.commMethodMgr;


public class SalesPriceInfo {
	Dbtable tradeQuery;

	Logger log;

	Buffers inBuffer;

	Buffers outBuffer;

	ArrayList queryResult = new ArrayList();
	commMethodMgr comm;

	public SalesPriceInfo() {
		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 addSaleOnePrice(Buffers inbuffer) {
		log.LOG_INFO("进入addSaleOnePrice方法...");
		this.outBuffer = inbuffer;
		this.inBuffer = inbuffer;
		int iResult = -1;
		String cust_id = inbuffer.getString("SESSION_CUST_ID");
		//String trade_id = inbuffer.getString("TRADE_ID");
		String price_code = inbuffer.getString("PRICE_CODE");
		String product_id = inbuffer.getString("PRODUCT_ID");
		String sale_obj_id = inbuffer.getString("SALE_OBJ_ID");
		String price_type = inbuffer.getString("PRICE_TYPE");
		String fix_type = inbuffer.getString("FIX_TYPE");
		String price = inbuffer.getString("PRICE");
		String price_desc = inbuffer.getString("PRICE_DESC");
		String start_date = inbuffer.getString("START_DATE");
		String ent_date = inbuffer.getString("ENT_DATE");
		String in_date = inbuffer.getString("IN_DATE");
		String oper_user_id = inbuffer.getString("SESSION_USER_ID");
		String remark = inbuffer.getString("REMARK");

		try {
			SalesPriceDAO salepricedao = new SalesPriceDAO();
			salepricedao.setCust_id(cust_id);
			//salepricedao.setTrade_id(trade_id);
			salepricedao.setPrice_code(price_code);
			salepricedao.setProduct_id(product_id);
			salepricedao.setSale_obj_id(sale_obj_id);
			salepricedao.setPrice_type(price_type);
			salepricedao.setFix_type(fix_type);
			salepricedao.setPrice(price);
			salepricedao.setPrice_desc(price_desc);
			salepricedao.setStart_date(start_date);
			salepricedao.setEnt_date(ent_date);
			salepricedao.setIn_date(in_date);
			salepricedao.setOper_user_id(oper_user_id);
			salepricedao.setRemark(remark);

			iResult = addSaleOnePrice(salepricedao);
		} catch (SaasApplicationException e) {
			log.LOG_INFO(e.getMessage());
		}
		if (iResult != 0) {
			this.outBuffer.setInt("RESULT_CODE", -1);
			this.outBuffer.setString("RESULT_INFO", "业务处理失败!");
		} else {
			this.outBuffer.setInt("RESULT_CODE", 0);
			this.outBuffer.setString("RESULT_INFO", "业务处理成功!");
		}
		log.LOG_INFO("退出addSaleOnePrice方法...");
	}

	public int addSaleOnePrice(SalesPriceDAO salepricedao)
			throws SaasApplicationException {
		String trade_id =""; 
		commMethodMgr comm = new commMethodMgr();
		String product_Idx = salepricedao.getProduct_id();
		StringTokenizer st = new StringTokenizer(product_Idx, "|");
		while (st.hasMoreTokens()) {
			trade_id=comm.GenTradeId();
			String product_id = st.nextToken();
			SalesPriceExt salepriceExt = new SalesPriceExt();
			salepriceExt.setParam(":VCUST_ID", salepricedao.getCust_id());
			salepriceExt.setParam(":VTRADE_ID", trade_id);
			salepriceExt.setParam(":VPRICE_CODE", salepricedao.getPrice_code());
			salepriceExt.setParam(":VPRODUCT_ID", product_id);
			salepriceExt.setParam(":VSALE_OBJ_ID", salepricedao
					.getSale_obj_id());
			salepriceExt.setParam(":VPRICE_TYPE", salepricedao.getPrice_type());
			salepriceExt.setParam(":VFIX_TYPE", salepricedao.getFix_type());
			salepriceExt.setParam(":VPRICE", salepricedao.getPrice());
			salepriceExt.setParam(":VPRICE_DESC", salepricedao.getPrice_desc());
			salepriceExt.setParam(":VSTART_DATE", salepricedao.getStart_date());
			salepriceExt.setParam(":VENT_DATE", salepricedao.getEnt_date());
			salepriceExt.setParam(":VIN_DATE", salepricedao.getIn_date());
			salepriceExt.setParam(":VOPER_USER_ID", salepricedao
					.getOper_user_id());
			salepriceExt.setParam(":VREMARK", salepricedao.getRemark());
			// log.LOG_INFO(""+salepriceExt.insBy("INS_PRO_PRI_ID"));
			tradeQuery.executeBy(salepriceExt.insBy("INS_PRO_PRI_ID"));
		}
		return 0;
	}

}

⌨️ 快捷键说明

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