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

📄 creditinfo.java

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

import java.util.ArrayList;

import com.saas.biz.commen.commMethodMgr;
import com.saas.biz.dao.creditDAO.CreditDAO;
import com.saas.biz.dao.creditDAO.CreditExt;
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 CreditInfo {

	Dbtable tradeQuery;

	Logger log;

	Buffers inBuffer;

	Buffers outBuffer;

	ArrayList queryResult = new ArrayList();

	public CreditInfo()
		{
			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 addCreditInfo(Buffers inbuffer) 
	{
		log.LOG_INFO("进入addCreditInfo方法...");
		this.outBuffer = inbuffer;
		CreditDAO creditdao = new CreditDAO();
		this.outBuffer = inbuffer;
		creditdao.setCredit_title(inbuffer.getString("CREDIT_TITLE"));
		creditdao.setCredit_id(inbuffer.getString("CREDIT_ID"));
	    creditdao.setCredit_type(inbuffer.getString("CREDIT_TYPE"));
		creditdao.setCredit_desc(inbuffer.getString("CREDIT_DESC"));
		creditdao.setCredit_start_date(inbuffer.getString("CREDIT_START_DATE"));
		creditdao.setCredit_end_date(inbuffer.getString("CREDIT_END_DATE"));
		creditdao.setCredit_department(inbuffer.getString("CREDIT_DEPARTMENT"));
		//creditdao.setAffix_id(inbuffer.getString("AFFIX_ID"));
		creditdao.setCust_id(inbuffer.getString("SESSION_CUST_ID"));
		creditdao.setCredit_publish_person(inbuffer.getString("SESSION_USER_NAME"));
		int iResult=-1 ;
		try
			{  	
				iResult=addCreditInfo(creditdao);
			}
		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("退出addCreditInfo方法...");
     }
	public int addCreditInfo(CreditDAO creditdao) throws SaasApplicationException 
	{
			CreditExt creditExt = new CreditExt();
			creditExt.setParam(":VCREDIT_ID",creditdao.getCredit_id());
			creditExt.setParam(":VCUST_ID", creditdao.getCust_id());
			creditExt.setParam(":VAFFIX_ID", "0");
			creditExt.setParam(":VCREDIT_DEPARTMENT", creditdao.getCredit_department());
			creditExt.setParam(":VCREDIT_END_DATE", creditdao.getCredit_end_date());
			creditExt.setParam(":VCREDIT_START_DATE", creditdao.getCredit_start_date());
			creditExt.setParam(":VCREDIT_DESC",creditdao.getCredit_desc());
			creditExt.setParam(":VCREDIT_TYPE", creditdao.getCredit_type());
			creditExt.setParam(":VCREDIT_TITLE", creditdao.getCredit_title());
			creditExt.setParam(":VCREDIT_PUBLISH_PERSON", creditdao.getCredit_publish_person());
			creditExt.setParam(":VCREDIT_CLASS", "0");
			creditExt.setParam(":VCREDIT_VALIDITY", "0");
			creditExt.setParam(":VCREDIT_AUDIT_PERSON", "");
			creditExt.setParam(":VCREDIT_RSRV", "");
			log.LOG_INFO("参数完成..................");
			tradeQuery.executeBy(creditExt.insBy("INS_BY_ALL"));			
			return 0;
	}
	//查询指定客户的资质证书
	public void genCustCredit(Buffers inbuffer) 
	{
		log.LOG_INFO("进入genCustCredit方法...");
		this.outBuffer = inbuffer;
		String cust_id = inbuffer.getString("SESSION_CUST_ID");
		try 
		{
			this.queryResult = genCustCredit(cust_id);
		} 
		catch (SaasApplicationException e)
		{
			log.LOG_INFO(e.getMessage());

		}
		log.LOG_INFO("退出genCustCredit方法...");
	}
	public ArrayList genCustCredit(String cust_id) throws SaasApplicationException 
	{
		ArrayList itemsList = new ArrayList();
		CreditExt creditExt = new CreditExt();
		creditExt.setParam(":VCUST_ID",cust_id);
		creditExt.setParam(":VCREDIT_VALIDITY","0");
		itemsList = creditExt.selByList("SEL_BY_CUST");	 
		return itemsList;
	}
	//查询单个资质证书
	public void genOneCredit(Buffers inbuffer) 
	{
		log.LOG_INFO("进入genOneCredit方法...");
		this.outBuffer = inbuffer;
		String credit_id = inbuffer.getString("CREDIT_ID");
		try 
		{
			this.queryResult = genOneCredit(credit_id);
		} 
		catch (SaasApplicationException e)
		{
			log.LOG_INFO(e.getMessage());

		}
		log.LOG_INFO("退出genOneCredit方法...");
	}
	public ArrayList genOneCredit(String credit_id) throws SaasApplicationException 
	{
		ArrayList itemsList = new ArrayList();
		CreditExt creditExt = new CreditExt();
		creditExt.setParam(":VCREDIT_ID",credit_id);
		itemsList = creditExt.selByList("SEL_BY_ONE");	 
		return itemsList;
	}
	//取消证书的有效信 
	public void invalidinfo(Buffers inbuffer)
	{
		log.LOG_INFO("进入invalidinfo方法...");
		this.outBuffer = inbuffer;
		this.inBuffer = inbuffer;
		int iResult = -1;
		String credit_id = inbuffer.getString("CREDIT_ID");
		try
		{                                               
			iResult = invalidinfo(credit_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("退出invalidinfo方法...");
	}
	public int invalidinfo(String credit_id) throws SaasApplicationException
	{
		CreditExt creditExt = new CreditExt();
		creditExt.setParam(":VCREDIT_ID",credit_id); 
         creditExt.setParam(":VCREDIT_VALIDITY", "1");
         tradeQuery.executeBy(creditExt.insBy("INVALID_BY_ONE"));
         return 0; 
	}
	//分页查询
	public ArrayList getCustCredit(int iStart,String cust_id) throws SaasApplicationException 
	{   
	   if(iStart==0)
	    {
			iStart=0;
		}
		else 
		{
		    iStart = (iStart-1)*30;
		}
		ArrayList creditList = new ArrayList();
		CreditExt creditExt = new CreditExt();
		creditExt.setParam(":VCUST_ID",cust_id);
		creditExt.setParam(":VCREDIT_VALIDITY","0");
		creditList = creditExt.selByList("SEL_BY_CUST",iStart,30);	 
		return creditList;
	}
	//统计总数
	public int getCreditNumber(String cust_id) throws SaasApplicationException
	{
	    ArrayList creditList = new ArrayList();
		CreditExt creditExt = new CreditExt();
		creditExt.setParam(":VCUST_ID",cust_id);
		creditExt.setParam(":VCREDIT_VALIDITY","0");
		creditList = creditExt.selByList("SEL_BY_CUST");			
		if(creditList != null)
		{
			return creditList.size();
		}	 
		else 
		{
			return 0;
		}
	}	    
}

⌨️ 快捷键说明

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