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

📄 productattr.java

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

import java.util.ArrayList;

import com.saas.biz.commen.commMethodMgr;
import com.saas.biz.dao.productattrDAO.*;
import com.saas.biz.dao.productclassDAO.ProductclassExt;
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 productattr {
	Dbtable tradeQuery;

	Logger log;

	Buffers inBuffer;

	Buffers outBuffer;

	ArrayList queryResult = new ArrayList();

	public productattr()
	{
			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 addProductAttr(Buffers inbuffer)
	{
			log.LOG_INFO("进入addClassInfo方法...");
			this.outBuffer = inbuffer;
			this.inBuffer = inbuffer;
			int iResult = -1;
			ProductattrDAO productattrDAO = new ProductattrDAO();
			productattrDAO.setClass_id(inbuffer.getString("CLASS_ID"));
			productattrDAO.setAttr_name(inbuffer.getString("ATTR_NAME"));
			productattrDAO.setAttr_no(inbuffer.getString("ATTR_NO"));
			productattrDAO.setEnable_tag(inbuffer.getString("ENABLE_TAG"));
			productattrDAO.setAttr_desc(inbuffer.getString("ATTR_DESC"));
			productattrDAO.setDefault_tag(inbuffer.getString("DEFAULT_TAG"));
			productattrDAO.setDefault_value(inbuffer.getString("DEFAULT_VALUE"));
			productattrDAO.setRsrv_str3(inbuffer.getString("RSRV_STR3"));
			try
			{                                               
				iResult = addProductAttr(productattrDAO);
			} 
			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("退出addClassInfo方法...");
	}
	public int addProductAttr(ProductattrDAO productattrDAO) throws SaasApplicationException
	{
		ProductattrExt productattrExt = new ProductattrExt();
	    commMethodMgr comm = new commMethodMgr();
		String attr_id = comm.GenTradeId();
		String  short_id =comm.GenShortTradeId();
		productattrExt.setParam(":VCLASS_ID", productattrDAO.getClass_id());
		productattrExt.setParam(":VATTR_NAME", productattrDAO.getAttr_name());
		productattrExt.setParam(":VATTR_DESC", productattrDAO.getAttr_desc());
		productattrExt.setParam(":VATTR_NO", productattrDAO.getAttr_no());
		productattrExt.setParam(":VENABLE_TAG", productattrDAO.getEnable_tag());
		productattrExt.setParam(":VATTR_ID", attr_id);
		productattrExt.setParam(":VDEFAULT_TAG", productattrDAO.getDefault_tag());
		productattrExt.setParam(":VDEFAULT_VALUE", productattrDAO.getDefault_value());		
		productattrExt.setParam(":VRSRV_STR1", "");
		productattrExt.setParam(":VRSRV_STR2", "");
		productattrExt.setParam(":VRSRV_STR3", productattrDAO.getRsrv_str3());
		productattrExt.setParam(":VRSRV_STR4", short_id);
		productattrExt.setParam(":VRSRV_STR5", "");
		productattrExt.setParam(":VRSRV_STR6", "");
		productattrExt.setParam(":VRSRV_STR7", "");
		productattrExt.setParam(":VRSRV_STR8", "");
		productattrExt.setParam(":VRSRV_STR9", "");
		productattrExt.setParam(":VRSRV_STR10", "");
		productattrExt.setParam(":VREMARK", ""); 
        tradeQuery.executeBy(productattrExt.insBy("INS_BY_ALL"));
        return 0; 
	}
	public void delByAttrId(Buffers inbuffer)
	{
			log.LOG_INFO("进入delByAttrId方法...");
			this.outBuffer = inbuffer;
			this.inBuffer = inbuffer;
			int iResult = -1;
			String  attrId= inbuffer.getString("ATTR_ID");
			try
			{                                               
				iResult = delByAttrId(attrId);
			} 
			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("退出delByAttrId方法...");
	}
	public int delByAttrId(String  attrId) throws SaasApplicationException
	{
			ProductattrExt productattrExt = new ProductattrExt();
			productattrExt.setParam(":VATTR_ID",attrId);	
			tradeQuery.executeBy(productattrExt.insBy("DEL_BY_ATTRID"));
              return 0; 
	}
     //通过CLASS_ID找出产品的属性
     public ArrayList getProductAttrByClassId(String class_id)throws SaasApplicationException
     {
     	    ProductattrExt productattrExt = new ProductattrExt();
     	    ArrayList attrList=new ArrayList();
			productattrExt.setParam(":VCLASS_ID",class_id);	
			productattrExt.setParam(":VENABLE_TAG","0");	
			attrList=productattrExt.selByList("SEL_BY_CLASSID");
              return attrList; 
     }
}

⌨️ 快捷键说明

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