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

📄 custaccount.java

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

import com.saas.biz.commen.commMethodMgr;
import com.saas.biz.dao.acctDAO.AccountDAO;
import com.saas.biz.dao.acctDAO.AccountExt;
import com.saas.sys.buffer.Buffers;
import com.saas.sys.dbm.*;
import com.saas.sys.exp.SaasApplicationException;
import com.saas.sys.log.Logger;

public class CustAccount {
	Logger log;

	Buffers inBuffer;

	Buffers outBuffer;

	Dbtable tradeQuery;

	commMethodMgr comm;

	public CustAccount() {
		log = new Logger(this);
		tradeQuery = new Dbtable();
		comm = new commMethodMgr();
	}

	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 void addCustAccount(Buffers inbuffer) {
		String userId = null;
		this.outBuffer = inbuffer;
		this.inBuffer = inbuffer;
		userId = inbuffer.getString("USER_ID");
		log.LOG_INFO("进入addcustaccount方法...");
		int iResult = -1;
		try {
			AccountDAO accountDAO = new AccountDAO();
			accountDAO.setAccount_name(inbuffer.getString("ACCOUNT_NAME"));
			accountDAO.setContract_no(inbuffer.getString("CONTRACT_NO"));
			accountDAO.setUser_id(userId);
			accountDAO.setBank_code(inbuffer.getString("BANK_CODE"));

			iResult = addCustAccount(accountDAO);
		} 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("退出addcustaccount方法...");
	}

	public int addCustAccount(AccountDAO accountDAO) throws SaasApplicationException {
		commMethodMgr comm = new commMethodMgr();
		AccountExt accountExt = new AccountExt();
		String genbank_id = comm.GenTradeId();
		accountExt.setParam(":VACCOUNT_ID", comm.GenTradeId());
		accountExt.setParam(":VACCOUNT_NAME", accountDAO.getAccount_name());
		accountExt.setParam(":VBANK_ID", genbank_id);
		accountExt.setParam(":VCONTRACT_NO", accountDAO.getContract_no());
		accountExt.setParam(":VUSER_ID", accountDAO.getUser_id());
		accountExt.setParam(":VACCOUNT_STATE", "0");
		accountExt.setParam(":VBANK_CODE", accountDAO.getBank_code());
		tradeQuery.executeBy(accountExt.insBy("INS_BY_ALL"));
		return 0;
	}

	/**
	 * 记录客户交易次数
	 * 
	 * @param inbuffer
	 */
	public void addServerAccount(Buffers inbuffer) {
		log.LOG_INFO("进入addServerAccount方法...");
		this.outBuffer = inbuffer;
		this.inBuffer = inbuffer;
		int iResult = -1;
		String value_num = inbuffer.getString("VALUE_NUM");// 总费用
		String cust_id = inbuffer.getString("OBJ_CUST_ID");
		String account_name = "xsaas 服务平台";
		String contract_no = "";
		String user_id = "";
		String account_id = inbuffer.getString("ACCOUNT_ID");
		try {
			AccountDAO accountDAO = new AccountDAO();
			accountDAO.setAccount_money(value_num);
			accountDAO.setCust_id(cust_id);
			accountDAO.setUser_id(user_id);
			accountDAO.setAccount_id(account_id);
			accountDAO.setAccount_name(account_name);
			accountDAO.setContract_no(contract_no);
			iResult = addServerAccount(accountDAO);
		} 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("退出addServerAccount方法...");
	}

	public int addServerAccount(AccountDAO accountDAO) throws SaasApplicationException {
		AccountExt accountExt = new AccountExt();
		String genbank_id = comm.GenTradeId();
		accountExt.setParam(":VACCOUNT_ID", accountDAO.getAccount_id());
		accountExt.setParam(":VACCOUNT_NAME", accountDAO.getAccount_name());
		accountExt.setParam(":VBANK_ID", genbank_id);
		accountExt.setParam(":VCONTRACT_NO", accountDAO.getContract_no());
		accountExt.setParam(":VCUST_ID", accountDAO.getCust_id());
		accountExt.setParam(":VUSER_ID", accountDAO.getUser_id());
		accountExt.setParam(":VACCOUNT_STATE", "0");
		accountExt.setParam(":VACCOUNT_MONEY", accountDAO.getAccount_money());
		tradeQuery.executeBy(accountExt.insBy("INS_BY_ALL"));
		return 0;
	}

	/**
	 * 会员退费
	 * 
	 * @param inbuffer
	 */
	public void addRefundAccount(Buffers inbuffer) {
		log.LOG_INFO("进入addRefundAccount方法...");
		this.outBuffer = inbuffer;
		this.inBuffer = inbuffer;
		int iResult = -1;
		String value_num = inbuffer.getString("VALUE_NUM");// 总费用
		String cust_id = inbuffer.getString("OBJ_CUST_ID");
		String account_name = "xsaas 服务平台 会员退费";
		String contract_no = inbuffer.getString("REG_TYPE");//存放退费类型
		String user_id = inbuffer.getString("SESSION_USER_ID");;
		String account_id = inbuffer.getString("ACCOUNT_ID");
		try {
			AccountDAO accountDAO = new AccountDAO();
			accountDAO.setAccount_money(value_num);
			accountDAO.setCust_id(cust_id);
			accountDAO.setUser_id(user_id);
			accountDAO.setAccount_id(account_id);
			accountDAO.setAccount_name(account_name);
			accountDAO.setContract_no(contract_no);
			iResult = addServerAccount(accountDAO);
		} 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("退出addRefundAccount方法...");
	}
}

⌨️ 快捷键说明

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