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

📄 collectionsinfo.java

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

import java.util.ArrayList;
import java.util.*;
import com.saas.biz.commen.commMethodMgr;
import com.saas.biz.dao.CollectionDAO.CollectionDAO;
import com.saas.biz.dao.CollectionDAO.CollectionExt;
import com.saas.biz.dao.repositoryDAO.RepositoryExt;
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.dao.userDAO.UserDAO;
import com.saas.biz.dao.userDAO.UserExt;
import com.saas.biz.userMgr.UserCheckMgr;
public class CollectionsInfo {
	Dbtable tradeQuery;

	Logger log;

	Buffers inBuffer;

	Buffers outBuffer;

	ArrayList queryResult = new ArrayList();

	public CollectionsInfo()
		{
			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 addCollectionsInfo(Buffers inbuffer) 
	{
		log.LOG_INFO("进入addCollectionsInfo方法...");
		this.outBuffer = inbuffer;
		CollectionDAO  collectionDAO =new CollectionDAO();
		//UserDAO userDAO = new UserDAO();
		//userDAO.setUser_name(inbuffer.getString("USER_NAME"));	
		//userDAO.setPasswd(inbuffer.getString("PASSWD"));
		int iResult=-1 ;
		 
		
		try
			{  	
				HashMap userMap=new UserCheckMgr().Exists(inbuffer.getString("USER_NAME"),inbuffer.getString("PASSWD"));
				log.LOG_INFO("33333333333333333333");
				if(userMap !=null && userMap.size()>0)
				{ 
					String cust_id = userMap.get("cust_id").toString();
					String user_id = userMap.get("user_id").toString();
					String link_name = inbuffer.getString("LINK_NAME");
					String link = inbuffer.getString("LINK");
					String link_type = inbuffer.getString("LINK_TYPE");
					String link_desc = inbuffer.getString("LINK_DESC");
					log.LOG_INFO("11111111111111111111111111111");
					 
					iResult=addCollectionsInfo(cust_id,user_id,link_name,link,link_type,link_desc);
 	    	 }
			}
		 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", "业务处理成功!");
		}
	}
	public int addCollectionsInfo(String cust_id,String user_id,String link_name,String link,String link_type,String link_desc) throws SaasApplicationException 
	{
		
		  log.LOG_INFO("进入addCollectionsInfo22222方法...");
			CollectionExt  collectionExt = new CollectionExt();
			 
			
			collectionExt.setParam(":VCUST_ID",cust_id);
			collectionExt.setParam(":VUSER_ID",user_id);
			collectionExt.setParam(":VLINK_NAME",link_name);
			collectionExt.setParam(":VLINK",link);			
			collectionExt.setParam(":VLINK_TYPE",link_type);
			collectionExt.setParam(":VLINK_CLASS", "");			
			collectionExt.setParam(":VLINK_DESC",link_desc);
			collectionExt.setParam(":VLINK_NO", "");
			collectionExt.setParam(":VFROM_WEB", "");
			collectionExt.setParam(":VRSRV_STR1", "");
			collectionExt.setParam(":VRSRV_STR2", "");
			collectionExt.setParam(":VRSRV_STR3", "");
			collectionExt.setParam(":VRSRV_STR4", "");
			collectionExt.setParam(":VRSRV_STR5", "");
			collectionExt.setParam(":VRSRV_STR6", "");
			collectionExt.setParam(":VRSRV_STR7", "");
			collectionExt.setParam(":VRSRV_STR8", "");
			collectionExt.setParam(":VRSRV_STR9", "");
			collectionExt.setParam(":VRSRV_STR10", "");			
			collectionExt.setParam(":VOPER_USER_ID",user_id);
			 
			collectionExt.setParam(":VREMARK", "");
			
			tradeQuery.executeBy(collectionExt.insBy("INS_BY_ALL"));
			log.LOG_INFO("退出addCollectionsInfo22222方法...");
			return  0;
	}
/*	//修改广告
	public void updateAdvertiseInfo(Buffers inbuffer) 
	{
		log.LOG_INFO("进入updateAdvertiseInfo方法...");
		this.outBuffer = inbuffer;
		CollectionDAO  collectionDAO =new CollectionDAO();
		collectionDAO.setAdv_id(inbuffer.getString("ADV_ID"));
		collectionDAO.setAdv_type(inbuffer.getString("ADV_TYPE"));
		collectionDAO.setContent(inbuffer.getString("CONTENT"));
		collectionDAO.setStart_date(inbuffer.getString("START_DATE"));
		collectionDAO.setEnd_date(inbuffer.getString("END_DATE"));
		collectionDAO.setShow_no(inbuffer.getString("SHOW_NO"));
		collectionDAO.setOwn_range(inbuffer.getString("OWN_RANGE"));
		collectionDAO.setCust_id(inbuffer.getString("SESSION_CUST_ID"));		
		int iResult=-1 ;
		try
			{  	
				iResult=updateAdvertiseInfo(collectionDAO);
			}
		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", "业务处理成功!");
		}
	}
	public int updateAdvertiseInfo(CollectionDAO collectionDAO) throws SaasApplicationException 
	{
			AdvertiseExt  collectionExt = new AdvertiseExt();
			collectionExt.setParam(":VADV_ID", collectionDAO.getAdv_id());
			collectionExt.setParam(":VADV_TYPE",collectionDAO.getAdv_type() );
			collectionExt.setParam(":VCONTENT", collectionDAO.getContent());
			collectionExt.setParam(":VSTART_DATE",collectionDAO.getStart_date() );
			collectionExt.setParam(":VEND_DATE", collectionDAO.getEnd_date());
			collectionExt.setParam(":VSHOW_NO", collectionDAO.getShow_no());
			collectionExt.setParam(":VOWN_RANGE", collectionDAO.getOwn_range());
			tradeQuery.executeBy(collectionExt.insBy("UPDATE_BY_ALL"));
			return  0;
	}
 
 	//查询客户广告
	public void genCustCollections(Buffers inbuffer) 
	{
		log.LOG_INFO("进入genCustCollections方法...");
		this.outBuffer = inbuffer;
		String cust_id = inbuffer.getString("SESSION_CUST_ID");
		String  query_param = inbuffer.getString("QUERY_PARAM");
		try 
		{
			if(query_param.equals(""))
				this.queryResult = genCustCollections( cust_id );
			else
			 this.queryResult = searchAdv( query_param, cust_id );
		} 
		catch (SaasApplicationException e)
		{
			log.LOG_INFO(e.getMessage());

		}
		log.LOG_INFO("退出Gencustadvertise方法...");
	}
/*
	public HashMap genCustCollections(String cust_id )	throws SaasApplicationException 
	{			
		HashMap map = new HashMap();
		ArrayList relationList = new ArrayList();
		CollectionExt  collectionExt = new CollectionExt();
		collectionExt.setParam(":VCUST_ID",cust_id);
		relationList = collectionExt.selByList("SEL_BY_CUST");	 
		if (relationList != null && relationList.size() > 0)
		{
			map = (HashMap) relationList.get(0);
		}
		return map;
	}
*/
	public ArrayList genCustCollections(String cust_id,String link_type) throws SaasApplicationException 
	{
		ArrayList itemsList = new ArrayList();
		CollectionExt  collectionExt = new CollectionExt();
		collectionExt.setParam(":VCUST_ID",cust_id);
		collectionExt.setParam(":VLINK_TYPE",link_type);
		itemsList = collectionExt.selByList("SEL_BY_CUST");	 
		return itemsList;
	}
	
	
	
	/*/查询单个广告 
	public void genOneAdvertise(Buffers inbuffer) 
	{
		log.LOG_INFO("进入genCustCollections方法...");
		this.outBuffer = inbuffer;
		String adv_id = inbuffer.getString("ADV_ID");
		try 
		{
			this.queryResult = genOneAdvertise(adv_id);
		} 
		catch (SaasApplicationException e)
		{
			log.LOG_INFO(e.getMessage());

		}
		log.LOG_INFO("退出genCustCollections方法...");
	}
	public ArrayList genOneAdvertise(String adv_id) throws SaasApplicationException 
	{
		ArrayList itemsList = new ArrayList();
		AdvertiseExt  collectionExt = new AdvertiseExt();
		collectionExt.setParam(":VADV_ID",adv_id);
		itemsList = collectionExt.selByList("SEL_BY_ONE");	 
		return itemsList;
	}
	
	
	
	
	//删除单条广告
	public void deloneinfo(Buffers inbuffer)
	{
		log.LOG_INFO("进入deloneinfo方法...");
		this.outBuffer = inbuffer;
		this.inBuffer = inbuffer;
		int iResult = -1;
		String adv_id = inbuffer.getString("ADV_ID");
		try
		{                                               
			iResult = deloneinfo(adv_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("退出deloneinfo方法...");
	}
	public int deloneinfo(String adv_id) throws SaasApplicationException
	{
		AdvertiseExt  collectionExt = new AdvertiseExt();
		collectionExt.setParam(":VADV_ID",adv_id); 
        tradeQuery.executeBy(collectionExt.insBy("DEL_BY_ONE"));
        return 0; 
	}
	 
	 
	*/
	/// * @查找用户
	 
	public ArrayList searchCust( String  cust_id ) throws SaasApplicationException 
	{
		ArrayList itemsList = new ArrayList();
		CollectionExt  collectionExt = new CollectionExt();
		collectionExt.setParam(":VCUST_ID",cust_id);
		itemsList = collectionExt.selByList("SEL_BY_SEARCH");	 
		return itemsList;
	}
	/*/分页查询
	public ArrayList genCustCollections(int iStart,String cust_id) throws SaasApplicationException 
	{   
	   if(iStart==0)
	    {
			iStart=0;
		}
		else 
		{
		    iStart = (iStart-1)*30;
		}
		ArrayList itemsList = new ArrayList();
		AdvertiseExt  collectionExt = new AdvertiseExt();
		collectionExt.setParam(":VCUST_ID",cust_id);
		itemsList = collectionExt.selByList("SEL_BY_CUST",iStart,30);	 
		return itemsList;
	}
	//统计总数
	public int getAdvertNumber(String cust_id) throws SaasApplicationException
	{
	    ArrayList advertList = new ArrayList();
		AdvertiseExt  collectionExt = new AdvertiseExt();
		collectionExt.setParam(":VCUST_ID",cust_id);
		advertList = collectionExt.selByList("SEL_BY_CUST");			
		if(advertList != null)
		{
			return advertList.size();
		}	 
		else 
		{
			return 0;
		}
	}	   
	*/ 
}

⌨️ 快捷键说明

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