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

📄 shopneedinfo.java

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

import java.util.ArrayList;
import java.util.*;
import com.saas.biz.commen.commMethodMgr;
import com.saas.biz.dao.shopneedDAO.ShopneedExt;
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 ShopneedInfo{
	Logger log;

	Buffers inBuffer;

	Buffers outBuffer;

	Dbtable tradeQuery;

	commMethodMgr commen;

	ArrayList queryResult = new ArrayList();

	public ShopneedInfo() {
		log = new Logger(this);
		tradeQuery = new Dbtable();
		commen = new commMethodMgr();
		outBuffer = new Buffers();
	}

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

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

	public void setTradeQuery(Dbtable tradeQuery) {
		this.tradeQuery = tradeQuery;
	}

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

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

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

	public void addShopneed(Buffers inbuffer) {
		log.LOG_INFO("进入addShopneed方法...");
		this.outBuffer = inbuffer;
		String cust_id=inbuffer.getString("SESSION_CUST_ID");                
		String form_id=inbuffer.getString("FORM_ID");                
		String need_id=inbuffer.getString("NEED_ID");                
		String need_title=inbuffer.getString("NEED_TITLE");                   
		String quo_id=inbuffer.getString("QUO_ID");               
		String need_no=inbuffer.getString("NEED_NO");                
		String pre_date=inbuffer.getString("PRE_DATE");                 
		String act_date=inbuffer.getString("ACT_DATE");                 
		String from_addr =inbuffer.getString("FROM_ADDR");                  
		String to_addr=inbuffer.getString("TO_ADDR");                
		String log_type=inbuffer.getString("LOG_TYPE");                 
		String ship_type=inbuffer.getString("SHIP_TYPE");                  
		String need_num=inbuffer.getString("NEED_NUM");                 
		String unit=inbuffer.getString("UNIT");             
		String state_code=inbuffer.getString("STATE_CODE");                   
		String state_code_date=inbuffer.getString("STATE_CODE_DATE");                            
		String user_id=inbuffer.getString("SESSION_USER_ID");                
		String publish_date=inbuffer.getString("PUBLISH_DATE");                     
		String remark=inbuffer.getString("REMARK");
		int iResult = -1;
		try {
				iResult = addShopneed(cust_id,form_id,need_id,need_title,quo_id,need_no,pre_date,
						act_date,from_addr,to_addr,log_type,ship_type,need_num,unit,state_code,
						state_code_date,user_id,publish_date,remark);
				
		} 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("退出addShopneed方法...");
	}
	


	public int addShopneed(String cust_id,String form_id,String need_id,String need_title,String quo_id,String need_no,String pre_date,
			String act_date,String from_addr,String to_addr,String log_type,String ship_type,String need_num,String unit,String state_code,
			String state_code_date,String user_id,String publish_date,String remark)
			throws SaasApplicationException {
		ShopneedExt shopneedExt = new ShopneedExt();
		shopneedExt.setParam(":VCUST_ID",cust_id);         
		shopneedExt.setParam(":VFORM_ID",form_id);      
		shopneedExt.setParam(":VNEED_ID",need_id);      
		shopneedExt.setParam(":VNEED_TITLE",need_title);          
		shopneedExt.setParam(":VQUO_ID",quo_id);      
		shopneedExt.setParam(":VNEED_NO",need_no);      
		shopneedExt.setParam(":VPRE_DATE",pre_date);      
		shopneedExt.setParam(":VACT_DATE",act_date);      
		shopneedExt.setParam(":VFROM_ADDR",from_addr);        
		shopneedExt.setParam(":VTO_ADDR",to_addr);      
		shopneedExt.setParam(":VLOG_TYPE",log_type);      
		shopneedExt.setParam(":VSHIP_TYPE",ship_type);       
		shopneedExt.setParam(":VNEED_NUM",need_num);      
		shopneedExt.setParam(":VUNIT",unit);      
		shopneedExt.setParam(":VSTATE_CODE",state_code);          
		shopneedExt.setParam(":VSTATE_CODE_DATE",state_code_date);                             
		shopneedExt.setParam(":VUSER_ID",user_id);      
		shopneedExt.setParam(":VPUBLISH_DATE",publish_date);                
		shopneedExt.setParam(":VREMARK",remark);
		tradeQuery.executeBy(shopneedExt.insBy("INS_SHOPNEED_ALL"));
		return 0;
	}
	
	public void updateShopneed(Buffers inbuffer) {
		log.LOG_INFO("进入updateShopneed方法...");
		this.outBuffer = inbuffer;
		String cust_id=inbuffer.getString("SESSION_CUST_ID");                
		String form_id=inbuffer.getString("FORM_ID");                
		String need_id=inbuffer.getString("NEED_ID");                
		String need_title=inbuffer.getString("NEED_TITLE");                   
		String quo_id=inbuffer.getString("QUO_ID");               
		String need_no=inbuffer.getString("NEED_NO");                
		String pre_date=inbuffer.getString("PRE_DATE");                 
		String act_date=inbuffer.getString("ACT_DATE");                 
		String from_addr =inbuffer.getString("FROM_ADDR");                  
		String to_addr=inbuffer.getString("TO_ADDR");                
		String log_type=inbuffer.getString("LOG_TYPE");                 
		String ship_type=inbuffer.getString("SHIP_TYPE");                  
		String need_num=inbuffer.getString("NEED_NUM");                 
		String unit=inbuffer.getString("UNIT");             
		String state_code=inbuffer.getString("STATE_CODE");                   
		String state_code_date=inbuffer.getString("STATE_CODE_DATE");                            
		String user_id=inbuffer.getString("SESSION_USER_ID");                
		String publish_date=inbuffer.getString("PUBLISH_DATE");                     
		String remark=inbuffer.getString("REMARK");
		int iResult = -1;
		try {
				iResult = updateShopneed(cust_id,form_id,need_id,need_title,quo_id,need_no,pre_date,
						act_date,from_addr,to_addr,log_type,ship_type,need_num,unit,state_code,
						state_code_date,user_id,publish_date,remark);
				
		} 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("退出updateShopneed方法...");
	}



	public int updateShopneed(String cust_id,String form_id,String need_id,String need_title,String quo_id,String need_no,String pre_date,
			String act_date,String from_addr,String to_addr,String log_type,String ship_type,String need_num,String unit,String state_code,
			String state_code_date,String user_id,String publish_date,String remark)
			throws SaasApplicationException {
		ShopneedExt shopneedExt = new ShopneedExt();
		shopneedExt.setParam(":VCUST_ID",cust_id);         
		shopneedExt.setParam(":VFORM_ID",form_id);      
		shopneedExt.setParam(":VNEED_ID",need_id);      
		shopneedExt.setParam(":VNEED_TITLE",need_title);          
		shopneedExt.setParam(":VQUO_ID",quo_id);      
		shopneedExt.setParam(":VNEED_NO",need_no);      
		shopneedExt.setParam(":VPRE_DATE",pre_date);      
		shopneedExt.setParam(":VACT_DATE",act_date);      
		shopneedExt.setParam(":VFROM_ADDR",from_addr);        
		shopneedExt.setParam(":VTO_ADDR",to_addr);      
		shopneedExt.setParam(":VLOG_TYPE",log_type);      
		shopneedExt.setParam(":VSHIP_TYPE",ship_type);       
		shopneedExt.setParam(":VNEED_NUM",need_num);      
		shopneedExt.setParam(":VUNIT",unit);      
		shopneedExt.setParam(":VSTATE_CODE",state_code);          
		shopneedExt.setParam(":VSTATE_CODE_DATE",state_code_date);                             
		shopneedExt.setParam(":VUSER_ID",user_id);      
		shopneedExt.setParam(":VPUBLISH_DATE",publish_date);                
		shopneedExt.setParam(":VREMARK",remark);
		tradeQuery.executeBy(shopneedExt.insBy("UPDATE_SHOPNEED"));
		return 0;
	}
	
	
	public void delOneShopneed(Buffers inbuffer) {
		log.LOG_INFO("进入delOneShopneed方法...");
		this.outBuffer = inbuffer;
		String cust_id=inbuffer.getString("SESSION_CUST_ID");                                
		String need_id=inbuffer.getString("NEED_ID");                
		int iResult = -1;
		try {
				iResult = delOneShopneed(cust_id,need_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("退出delOneShopneed方法...");
	}

	public int delOneShopneed(String cust_id,String need_id)
			throws SaasApplicationException {
		ShopneedExt shopneedExt = new ShopneedExt();
		shopneedExt.setParam(":VCUST_ID",cust_id);              
		shopneedExt.setParam(":VNEED_ID",need_id);      
		tradeQuery.executeBy(shopneedExt.insBy("DEL_ONE_SHOPNEED"));
		return 0;
	}
	
	
	public ArrayList getAllShopneedByCustId(String cust_id,int iStart,String state_code) throws SaasApplicationException 
	{
		
		ArrayList list = new ArrayList();
		ShopneedExt shopneedExt = new ShopneedExt();
		try {
			
			iStart = iStart *20;
			
			shopneedExt.setParam(":VCUST_ID",cust_id);
			shopneedExt.setParam(":VSTATE_CODE",state_code);
			list = shopneedExt.selByList("SEL_ALL_SHOPNEED",iStart, 20);
		}
		catch (RuntimeException e) {
			log.LOG_INFO(e.getMessage());
		}
		return list;
	}
	
	public int getAllShopneedByCustId(String cust_id,String state_code) throws SaasApplicationException 
	{
		int count=0;
		ArrayList list = new ArrayList();
		ShopneedExt shopneedExt = new ShopneedExt();
		try {
			shopneedExt.setParam(":VCUST_ID",cust_id);
			shopneedExt.setParam(":VSTATE_CODE",state_code);
			list = shopneedExt.selByList("SEL_ALL_SHOPNEED");
		}
		catch (RuntimeException e) {
			log.LOG_INFO(e.getMessage());
		}
		if(list != null && list.size()>0){
			count = list.size();
		}
		return count;
	}
	
	public ArrayList getOneShopNeed(String cust_id,String need_id) throws SaasApplicationException 
	{
		ArrayList list = new ArrayList();
		ShopneedExt shopneedExt = new ShopneedExt();
		shopneedExt.setParam(":VCUST_ID",cust_id);
		shopneedExt.setParam(":VNEED_ID",need_id);
		list = shopneedExt.selByList("SEL_ONE_SHOPNEED");
		return list;
	}
	
	public ArrayList getOneShopNeedAndState(String cust_id,String need_id,String state_code) throws SaasApplicationException 
	{
		ArrayList list = new ArrayList();
		ShopneedExt shopneedExt = new ShopneedExt();
		shopneedExt.setParam(":VCUST_ID",cust_id);
		shopneedExt.setParam(":VNEED_ID",need_id);
		shopneedExt.setParam(":VSTATE_CODE",state_code);
		list = shopneedExt.selByList("SEL_ONE_SHOPNEED_STATE_CODE");
		return list;
	}
	
	public void updateShopneedStateCode(Buffers inbuffer) {
		log.LOG_INFO("进入updateShopneedStateCode方法...");
		this.outBuffer = inbuffer;
		String cust_id=inbuffer.getString("SESSION_CUST_ID");                                
		String need_id2=inbuffer.getString("NEED_ID");   
		String state_code=inbuffer.getString("CODE"); 
		String state_code_date=inbuffer.getString("STATE_CODE_DATE"); 
		
		StringTokenizer need_id1 = new StringTokenizer(need_id2,"|");
		String need_id="";
		int iResult = -1;
		try {
			while (need_id1.hasMoreTokens()) {
				need_id = need_id1.nextToken();
				iResult = updateShopneedStateCode(cust_id,need_id,state_code,state_code_date);
			}
				
		} 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("退出updateShopneedStateCode方法...");
	}

	public int updateShopneedStateCode(String cust_id,String need_id,String state_code,String state_code_date)
			throws SaasApplicationException {
		ShopneedExt shopneedExt = new ShopneedExt();
		shopneedExt.setParam(":VCUST_ID",cust_id);              
		shopneedExt.setParam(":VNEED_ID",need_id);   
		shopneedExt.setParam(":VSTATE_CODE",state_code); 
		shopneedExt.setParam(":VSTATE_CODE_DATE",state_code_date); 
		tradeQuery.executeBy(shopneedExt.insBy("UPDATE_NEED_CODE"));
		return 0;
	}
	
}

⌨️ 快捷键说明

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