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

📄 quoteinfo.java

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

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import com.saas.biz.commen.commMethodMgr;
import com.saas.biz.dao.quoteDAO.QuoteExt;
import com.saas.biz.dao.quoteDAO.*;
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 QuoteInfo {
	Dbtable tradeQuery;

	Logger log;

	Buffers inBuffer;

	Buffers outBuffer;

	ArrayList queryResult = new ArrayList();

	public QuoteInfo() {
		log = new Logger(this);
		tradeQuery = new Dbtable();
	}

	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 addQuoteInfo(Buffers inbuffer) {
		log.LOG_INFO("进入addQuoteInfo方法...");
		this.outBuffer = inbuffer;
		String cust_id = inbuffer.getString("SESSION_CUST_ID");
		String form_id = inbuffer.getString("FORM_ID");
		String prep_id = inbuffer.getString("PREP_ID");
		String query_id = inbuffer.getString("QUERY_ID");
		String prep_name = inbuffer.getString("PREP_NAME");
		String obj_cust_id = inbuffer.getString("OBJ_CUST_ID");
		String obj_cust_name = inbuffer.getString("OBJ_CUST_NAME");
		String prep_obj_id = inbuffer.getString("PREP_OBJ_ID");
		String contact_man = inbuffer.getString("CONTACT_MAN");
		String contact = inbuffer.getString("CONTACT");
		String give_date = inbuffer.getString("GIVE_DATE");
		String give_addr = inbuffer.getString("GIVE_ADDR");
		String ship_type = inbuffer.getString("SHIP_TYPE");
		String currency_code = inbuffer.getString("CURRENCY_CODE");
		String off_count = inbuffer.getString("OFF_COUNT");
		String off_rate = inbuffer.getString("OFF_RATE");
		String ship_fee = inbuffer.getString("SHIP_FEE");
		String tax = inbuffer.getString("TAX");
		String all_fee = inbuffer.getString("ALL_FEE");
		String prep_count = inbuffer.getString("PREP_COUNT");
		String part_delivery_tag = inbuffer.getString("PART_DELIVERY_TAG");
		String oper_user_id = inbuffer.getString("SESSION_USER_ID");
		String in_date = inbuffer.getString("IN_DATE");
		String remark2 = inbuffer.getString("REMARK2");

		int iResult = -1;
		try {
			iResult = addQuoteInfo(cust_id, form_id, prep_id, query_id,
					prep_name, obj_cust_id,obj_cust_name, prep_obj_id, contact_man, contact,
					give_date, give_addr, ship_type, currency_code, off_count,
					off_rate, ship_fee, tax, all_fee, prep_count,
					part_delivery_tag, oper_user_id, in_date, remark2);
		} 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("退出addProduInfo方法...");
	}

	public int addQuoteInfo(String cust_id, String form_id, String prep_id,
			String query_id, String prep_name, String obj_cust_id,String obj_cust_name,
			String prep_obj_id, String contact_man, String contact,
			String give_date, String give_addr, String ship_type,
			String currency_code, String off_count, String off_rate,
			String ship_fee, String tax, String all_fee, String prep_count,
			String part_delivery_tag, String oper_user_id, String in_date,
			String remark2) throws SaasApplicationException {
		QuoteExt quoteExt = new QuoteExt();
		quoteExt.setParam(":VCUST_ID", cust_id);
		quoteExt.setParam(":VFORM_ID", form_id);
		quoteExt.setParam(":VPREP_ID", prep_id);
		quoteExt.setParam(":VQUERY_ID", query_id);
		quoteExt.setParam(":VPREP_NAME", prep_name);
		quoteExt.setParam(":VOBJ_CUST_ID", obj_cust_id);
		quoteExt.setParam(":VOBJ_CUST_NAME", obj_cust_name);
		quoteExt.setParam(":VPREP_OBJ_ID", prep_obj_id);
		quoteExt.setParam(":VCONTACT_MAN", contact_man);
		quoteExt.setParam(":VCONTACT", contact);
		quoteExt.setParam(":VGIVE_DATE", give_date);
		quoteExt.setParam(":VGIVE_ADDR", give_addr);
		quoteExt.setParam(":VSHIP_TYPE", ship_type);
		quoteExt.setParam(":VCURRENCY_CODE", currency_code);
		quoteExt.setParam(":VOFF_COUNT", off_count);
		quoteExt.setParam(":VOFF_RATE", off_rate);
		quoteExt.setParam(":VSHIP_FEE", ship_fee);
		quoteExt.setParam(":VTAX", tax);
		quoteExt.setParam(":VALL_FEE", all_fee);
		quoteExt.setParam(":VPREP_COUNT", prep_count);
		quoteExt.setParam(":VPART_DELIVERY_TAG", part_delivery_tag);
		quoteExt.setParam(":VOPER_USER_ID", oper_user_id);
		quoteExt.setParam(":VIN_DATE", in_date);
		quoteExt.setParam(":VREMARK2", remark2);
		quoteExt.setParam(":VOBJ_CUST_NAME", obj_cust_name);
		tradeQuery.executeBy(quoteExt.insBy("INS_ONE_QUOTE"));
		log.LOG_INFO("开始执行SQL:================="+quoteExt.insBy("INS_ONE_QUOTE"));
		return 0;
	}


	public void updateQuoteInfo(Buffers inbuffer) {
		log.LOG_INFO("进入updateQuoteInfo方法...");
		this.outBuffer = inbuffer;
		String cust_id = inbuffer.getString("SESSION_CUST_ID");
		String form_id = inbuffer.getString("FORM_ID");
		String prep_id = inbuffer.getString("PREP_ID");
		//String query_id = inbuffer.getString("QUERY_ID");
		String prep_name = inbuffer.getString("PREP_NAME");
		String obj_cust_id = inbuffer.getString("OBJ_CUST_ID");
		String prep_obj_id = inbuffer.getString("PREP_OBJ_ID");
		String contact_man = inbuffer.getString("CONTACT_MAN");
		String contact = inbuffer.getString("CONTACT");
		String give_date = inbuffer.getString("GIVE_DATE");
		String give_addr = inbuffer.getString("GIVE_ADDR");
		String ship_type = inbuffer.getString("SHIP_TYPE");
		String currency_code = inbuffer.getString("CURRENCY_CODE");
		String off_count = inbuffer.getString("OFF_COUNT");
		String off_rate = inbuffer.getString("OFF_RATE");
		String ship_fee = inbuffer.getString("SHIP_FEE");
		String tax = inbuffer.getString("TAX");
		String all_fee = inbuffer.getString("ALL_FEE");
		String prep_count = inbuffer.getString("PREP_COUNT");
		String part_delivery_tag = inbuffer.getString("PART_DELIVERY_TAG");
		//String oper_user_id = inbuffer.getString("SESSION_USER_ID");
		String in_date = inbuffer.getString("IN_DATE");
		String remark2 = inbuffer.getString("REMARK2");

		int iResult = -1;
		try {
			iResult = updateQuoteInfo(cust_id, form_id, prep_id,
					prep_name, obj_cust_id, prep_obj_id, contact_man, contact,
					give_date, give_addr, ship_type, currency_code, off_count,
					off_rate, ship_fee, tax, all_fee, prep_count,
					part_delivery_tag,in_date, remark2);
		} 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("退出updateQuoteInfo方法...");
	}

	public int updateQuoteInfo(String cust_id, String form_id, String prep_id,
			String prep_name, String obj_cust_id,
			String prep_obj_id, String contact_man, String contact,
			String give_date, String give_addr, String ship_type,
			String currency_code, String off_count, String off_rate,
			String ship_fee, String tax, String all_fee, String prep_count,
			String part_delivery_tag,String in_date,
			String remark2) throws SaasApplicationException {
		QuoteExt quoteExt = new QuoteExt();
		quoteExt.setParam(":VCUST_ID", cust_id);
		quoteExt.setParam(":VFORM_ID", form_id);
		quoteExt.setParam(":VPREP_ID", prep_id);
		//quoteExt.setParam(":VQUERY_ID", query_id);
		quoteExt.setParam(":VPREP_NAME", prep_name);
		quoteExt.setParam(":VOBJ_CUST_ID", obj_cust_id);
		quoteExt.setParam(":VPREP_OBJ_ID", prep_obj_id);
		quoteExt.setParam(":VCONTACT_MAN", contact_man);
		quoteExt.setParam(":VCONTACT", contact);
		quoteExt.setParam(":VGIVE_DATE", give_date);
		quoteExt.setParam(":VGIVE_ADDR", give_addr);
		quoteExt.setParam(":VSHIP_TYPE", ship_type);
		quoteExt.setParam(":VCURRENCY_CODE", currency_code);
		quoteExt.setParam(":VOFF_COUNT", off_count);
		quoteExt.setParam(":VOFF_RATE", off_rate);
		quoteExt.setParam(":VSHIP_FEE", ship_fee);
		quoteExt.setParam(":VTAX", tax);
		quoteExt.setParam(":VALL_FEE", all_fee);
		quoteExt.setParam(":VPREP_COUNT", prep_count);
		quoteExt.setParam(":VPART_DELIVERY_TAG", part_delivery_tag);
		//quoteExt.setParam(":VOPER_USER_ID", oper_user_id);
		quoteExt.setParam(":VIN_DATE", in_date);
		quoteExt.setParam(":VREMARK2", remark2);
		tradeQuery.executeBy(quoteExt.insBy("UPDATE_ONE_QUOTE"));
		return 0;
	}
	

	public void delQuoteInfo(Buffers inbuffer) {
		log.LOG_INFO("进入delQuoteInfo方法...");
		this.outBuffer = inbuffer;
		String cust_id = inbuffer.getString("SESSION_CUST_ID");
		String prep_id = inbuffer.getString("PREP_ID");
	
		int iResult = -1;
		try {
			iResult = delQuoteInfo(cust_id,prep_id);
		} 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("退出delQuoteInfo方法...");
	}
	
	public int delQuoteInfo(String cust_id,String prep_id) throws SaasApplicationException {
		QuoteExt quoteExt = new QuoteExt();
		quoteExt.setParam(":VCUST_ID", cust_id);
		quoteExt.setParam(":VPREP_ID", prep_id);
		tradeQuery.executeBy(quoteExt.insBy("DEL_ONE_QUOTE"));
		return 0;
	}
	
	
	public ArrayList getOneQuote(String cust_id, String prep_id,String form_id) throws SaasApplicationException {
		HashMap map = new HashMap();
		ArrayList list = new ArrayList();
		QuoteExt quoteExt = new QuoteExt();
		quoteExt.setParam(":VCUST_ID", cust_id);
		quoteExt.setParam(":VPREP_ID", prep_id);
		quoteExt.setParam(":VFORM_ID", form_id);
		list = quoteExt.selByList("SEL_ONE_QUOTE");
		return list;
	}
	
	
	public ArrayList getQuoteList(int iStart,String cust_id,String query_id) throws SaasApplicationException{
		QuoteExt quoteExt = new QuoteExt();
		ArrayList list = new ArrayList();
		try {
			if (iStart == 0) {
				iStart = 0;
			}
			else {
				iStart = (iStart - 1) * 20;
			}
			quoteExt.setParam(":VCUST_ID",cust_id);
			quoteExt.setParam(":VQUERY_ID",query_id);
			list = quoteExt.selByList("SEL_ALL_QUOTE", iStart, 20);
		}
		catch (RuntimeException e) {
			log.LOG_INFO(e.getMessage());
		}
		return list;
	}
	
	
	public ArrayList getQuoteListAll(int iStart,String cust_id) throws SaasApplicationException{
		QuoteExt quoteExt = new QuoteExt();
		ArrayList list = new ArrayList();
		try {
			if (iStart == 0) {
				iStart = 0;
			}
			else {
				iStart = (iStart - 1) * 20;
			}
			quoteExt.setParam(":VCUST_ID",cust_id);
//			quoteExt.setParam(":VQUERY_ID",query_id);
			list = quoteExt.selByList("SEL_ALL_QUOTE1", iStart, 20);
		}
		catch (RuntimeException e) {
			log.LOG_INFO(e.getMessage());
		}
		return list;
	}
	//取出所有的采购单
	public int getQuoteList(String cust_id,String query_id) throws SaasApplicationException{
		QuoteExt quoteExt = new QuoteExt();
		ArrayList list = new ArrayList();
		int count = 0;
		try {
			quoteExt.setParam(":VCUST_ID",cust_id);
			quoteExt.setParam(":VQUERY_ID",query_id);
			list = quoteExt.selByList("SEL_ALL_QUOTE1");
		}
		catch (RuntimeException e) {
			log.LOG_INFO(e.getMessage());
		}
		if(list != null && list.size()>0){
			count = list.size();
		}
		return count;
	}
	
	
	public int getQuoteListAll(String cust_id) throws SaasApplicationException{
		QuoteExt quoteExt = new QuoteExt();
		ArrayList list = new ArrayList();
		int count = 0;
		try {
			quoteExt.setParam(":VCUST_ID",cust_id);
//			quoteExt.setParam(":VQUERY_ID",query_id);
			list = quoteExt.selByList("SEL_ALL_QUOTE1");
		}
		catch (RuntimeException e) {
			log.LOG_INFO(e.getMessage());
		}
		if(list != null && list.size()>0){
			count = list.size();
		}
		return count;
	}
	
}

⌨️ 快捷键说明

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