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

📄 addmyinternetinfo.java

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

import java.util.ArrayList;
import java.util.HashMap;
import net.sf.json.JSONArray;
import com.saas.biz.JavaScriptObject.TreeNode;
import com.saas.biz.JavaScriptObject.TreeObject;
import com.saas.biz.commen.commMethodMgr;
import com.saas.biz.dao.addMyInternetDAO.AddMyInternetDAO;
import com.saas.biz.dao.addMyInternetDAO.AddMyInternetExt;
import com.saas.biz.dao.relationccDAO.RelationCcExt;
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 AddMyInternetInfo {
	Logger log;

	Buffers inBuffer;

	Buffers outBuffer;

	Dbtable tradeQuery;

	ArrayList queryResult = new ArrayList();

	public AddMyInternetInfo() {
		log = new Logger(this);
		tradeQuery = new Dbtable();
		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 AddMyInternet(Buffers inbuffer) {
		log.LOG_INFO("进入AddMyInternet方法...");
		this.outBuffer = inbuffer;
		this.inBuffer = inbuffer;
		int iResult = -1;
		String cust_id = inbuffer.getString("SESSION_CUST_ID");
		String user_id = inbuffer.getString("SESSION_USER_ID");
		String name = inbuffer.getString("NAME");
		String type = inbuffer.getString("POS_TYPE");
	 
		String email = "";
		String blog = "";
		String qq = "";
		String msn = "";
		String userwww = "";
		String custwww = "";
		try 
		{
			AddMyInternetDAO addMyInternetDAO = new AddMyInternetDAO();
			addMyInternetDAO.setCust_id(cust_id);
			addMyInternetDAO.setUser_id(user_id);
			log.LOG_INFO("type..."+type);
			if(type == "1" || type.equals("1"))
			{
				email=name;
			}
			addMyInternetDAO.setEmail(email);
			 
			if( type == "2" || type.equals("2"))
			{
				blog=name;
			}
				addMyInternetDAO.setBlog(blog);
			if( type == "3" || type.equals("3"))
			{
			    qq=name;				   
			}
				addMyInternetDAO.setQQ( qq );
			if( type == "4" || type.equals("4"))
			{
			    msn=name;
			}
				addMyInternetDAO.setMSN( msn );
			if( type == "5" || type.equals("5"))
			{
			    userwww = name;	
			}
				addMyInternetDAO.setUserwww(userwww);
			if( type == "6" || type.equals("6"))
			{
			    custwww= name ;				     
			}
				addMyInternetDAO.setCustwww(custwww);
				 
			iResult = AddInternet(addMyInternetDAO, type);
		}
		catch( Exception 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("退出AddMyInternet方法...");
	}
   
	public int AddInternet(AddMyInternetDAO areaDao,  String type)
			throws SaasApplicationException {

		AddMyInternetExt areaExt = new AddMyInternetExt();
		log.LOG_INFO("开始执行SQL:===:");
		areaExt.setParam(":VCUST_ID", areaDao.getCust_id());
		areaExt.setParam(":VUSER_ID", areaDao.getUser_id());
		areaExt.setParam(":VEMAIL", areaDao.getEmail());
		areaExt.setParam(":VBLOG", areaDao.getBlog());
		areaExt.setParam(":VQQ", areaDao.getQQ());
		areaExt.setParam(":VMSN", areaDao.getMSN());
		areaExt.setParam(":VUSERWWW", areaDao.getUserwww());
		areaExt.setParam(":VCUSTWWW", areaDao.getCustwww());
		ArrayList sList=getById(areaDao.getCust_id(),areaDao.getUser_id());
		log.LOG_INFO("开始执行sList===:" + sList );
		
	  if(sList!=null && sList.size()>0 )
	  {
	  	if( type == "1" || type.equals("1")) 
		  	tradeQuery.executeBy(areaExt.insBy("UPDATE_BY_EMAIL"));
		  else if( type == "2" || type.equals("2")) 
		  	tradeQuery.executeBy(areaExt.insBy("UPDATE_BY_BLOG"));
		  else if( type == "3" || type.equals("3")) 
		  	tradeQuery.executeBy(areaExt.insBy("UPDATE_BY_QQ"));
		  else if( type == "4" || type.equals("4")) 
		  	tradeQuery.executeBy(areaExt.insBy("UPDATE_BY_MSN"));
		  else if( type == "5" || type.equals("5")) 
		  	tradeQuery.executeBy(areaExt.insBy("UPDATE_BY_USERWWW"));
		  else if( type == "6" || type.equals("6")) 
		  	tradeQuery.executeBy(areaExt.insBy("UPDATE_BY_CUSTWWW"));
			else
			   return -1;
		}
		else
		{
	   tradeQuery.executeBy(areaExt.insBy("ADD_BY_ATTR"));
	  }
		return 0;
	}


	public ArrayList getById(String cust_id, String user_id)
			throws SaasApplicationException {

		ArrayList relationList = new ArrayList();
		AddMyInternetExt relaExt = new AddMyInternetExt();
		relaExt.setParam(":VCUST_ID", cust_id);
		relaExt.setParam(":VUSER_ID", user_id);
		relationList = relaExt.selByList("SEL_BY_CUST_ID");
		return relationList;
	}
	
	/*	 public void SelectMyInternet(Buffers inbuffer) {
		log.LOG_INFO("SelectMyInternet");
		this.outBuffer = inbuffer;
		this.inBuffer = inbuffer;
		int iResult = -1;
		String cust_id = inbuffer.getString("SESSION_CUST_ID");
		String user_id = inbuffer.getString("SESSION_USER_ID");
		
		HashMap map = getattrById( cust_id, user_id );
	 }

	// 修改 
	public void ModifyMyInternetInfo(Buffers inbuffer) {

		this.outBuffer = inbuffer;
		this.inBuffer = inbuffer;
		log.LOG_INFO("进入modifyMyInternetInfo方法...");
		int iResult = -1;
		String cust_id = inbuffer.getString("SESSION_CUST_ID");
		String user_id = inbuffer.getString("SESSION_USER_ID");
		String email = inbuffer.getString("EMAIL");
		String blog = inbuffer.getString("BLOG");
		String qq = inbuffer.getString("QQ");
		String msn = inbuffer.getString("MSN");
		String userwww = inbuffer.getString("USERWWW");
		String custwww = inbuffer.getString("CUSTWWW");
		 

		try {
			AddMyInternetDAO addMyInternetDAO = new AddMyInternetDAO();
			addMyInternetDAO.setCust_id(cust_id);
			addMyInternetDAO.setUser_id(user_id);
			addMyInternetDAO.setEmail(email);
			addMyInternetDAO.setBlog(blog);
			addMyInternetDAO.setQQ(qq);
			addMyInternetDAO.setMSN(msn);
			addMyInternetDAO.setUserwww(userwww);
			addMyInternetDAO.setCustwww(custwww);

			iResult = modifyMyInternet(addMyInternetDAO);
		} catch (Exception 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("退出modifyproductattrInfo方法...");
	}

	public int modifyMyInternet(AddMyInternetDAO areaDao)
			throws SaasApplicationException {

		AddMyInternetExt areaExt = new AddMyInternetExt();
		areaExt.setParam(":VCUST_ID", areaDao.getCust_id());
		areaExt.setParam(":VUSER_ID", areaDao.getUser_id());
		areaExt.setParam(":VEMAIL", areaDao.getEmail());
		areaExt.setParam(":VBLOG", areaDao.getBlog());
		areaExt.setParam(":VQQ", areaDao.getQQ());
		areaExt.setParam(":VMSN", areaDao.getMSN());
		areaExt.setParam(":VUSERWWW", areaDao.getUserwww());
		areaExt.setParam(":VCUSTWWW", areaDao.getCustwww());

		tradeQuery.executeBy(areaExt.insBy("UPDATE_BY_ID"));
		return 0;
	}

	// 删除产品分类属性资料
	public void deleteProductAttrInfo(Buffers inbuffer) {

		this.outBuffer = inbuffer;
		this.inBuffer = inbuffer;
		log.LOG_INFO("进入deleteProductAttrInfo方法...");
		int iResult = -1;
		String cust_id = inbuffer.getString("SESSION_CUST_ID");
		String attr_id = inbuffer.getString("ATTR_ID");
		try {
			AddProductAttrDAO productattrDao = new AddProductAttrDAO();
			productattrDao.setCust_id(cust_id);
			productattrDao.setAttr_id(attr_id);
			iResult = deleteProductAttrInfo(productattrDao);
		} catch (Exception 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("退出deleteProductAttrInfo方法...");
	}

	public int deleteProductAttrInfo(AddProductAttrDAO productattrDao)
			throws SaasApplicationException {

		AddProductAttrExt productExt = new AddProductAttrExt();
		productExt.setParam(":VCUST_ID", productattrDao.getCust_id());
		productExt.setParam(":VATTR_ID", productattrDao.getAttr_id());
		tradeQuery.executeBy(productExt.insBy("DEL_PRODUCTATTR_BY_ID"));
		return 0;
	}
 */            
	public HashMap getattrById(String cust_id, String user_id)
			throws SaasApplicationException 
	{
			
		HashMap map = new HashMap();
		ArrayList relationList = new ArrayList();
		AddMyInternetExt relaExt = new AddMyInternetExt();
		relaExt.setParam(":VCUST_ID", cust_id);
		relaExt.setParam(":VUSER_ID", user_id);
		relationList = relaExt.selByList("SEL_BY_CUST_ID");
		if (relationList != null && relationList.size() > 0) {
			map = (HashMap) relationList.get(0);
		}
		return map;
	}
       
}

⌨️ 快捷键说明

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