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

📄 custinfo.java

📁 java阿里巴巴代码
💻 JAVA
📖 第 1 页 / 共 5 页
字号:
		updatestate.setParam(":VCUST_STATE", "1");
		tradeQuery.executeBy(updatestate.insBy("STATE_CHANGE"));
		return 0;
	}
	
	
	
	// 客户状态 注销
	public void CustStateLogout(Buffers inbuffer) throws SaasApplicationException {

		this.outBuffer = inbuffer;
		String cust_id = inbuffer.getString("CUST_ID");
		String session_user_id = inbuffer.getString("SESSION_USER_ID");
		int iResult = -1;
		
		log.LOG_INFO("进入CustStateLogout方法.....");
		try {
			iResult = CustStateLogout(cust_id, session_user_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("退出CustStateLogout方法...");
	}
	
	
	public int CustStateLogout(String cust_id, String session_user_id) throws SaasApplicationException {

		CustomerExt updatestate = new CustomerExt();
		changUserState(cust_id, "2", session_user_id);
		updatestate.setParam(":VCUST_ID", cust_id);
		updatestate.setParam(":VCUST_STATE", "2");
		tradeQuery.executeBy(updatestate.insBy("STATE_CHANGE"));
		return 0;
	}
	
	
	
	/*
	 * 客户推荐
	 */
	public void CustCommend(Buffers inbuffer) throws SaasApplicationException {

		this.outBuffer = inbuffer;
		String cust_id = inbuffer.getString("CUST_ID");
		int iResult = -1;
		
		log.LOG_INFO("进入CustCommend方法.....");
		try {
			iResult = CustCommend(cust_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("退出CustCommend方法...");
	}
	
	
	public int CustCommend(String cust_id) throws SaasApplicationException {

		CustomerExt updatestate = new CustomerExt();
		updatestate.setParam(":VCUST_ID", cust_id);
		updatestate.setParam(":VCUST_STATE", "3");
		tradeQuery.executeBy(updatestate.insBy("STATE_CHANGE"));
		return 0;
	}
	
	
	
	/*
	 * 客户冻结或注销时,该客户下的用户状态也做相应修改
	 */

	public void changUserState(Buffers inbuffer) throws SaasApplicationException {

		this.outBuffer = inbuffer;
		String session_user_id = inbuffer.getString("SESSION_USER_ID");
		int iResult = -1;
		log.LOG_INFO("进入changUserState方法.....");
		String cust_id = inbuffer.getString("CUST_ID");
		String state = inbuffer.getString("CUST_STATE");
		String user_id = inbuffer.getString("SESSION_USER_ID");
		try {
			iResult = changUserState(cust_id, state, user_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("退出changUserState方法...");
	}
	
	
	public int changUserState(String cust_id, String user_state, String session_user_id) throws SaasApplicationException {

		log.LOG_INFO("进入changUserState.....方法");
		UserExt userExt = new UserExt();
		userExt.setParam(":VCUST_ID", cust_id);
		userExt.setParam(":VUSER_STATE", user_state);
		userExt.setParam(":VSTAFF_ID", session_user_id);
		tradeQuery.executeBy(userExt.insBy("USER_STATE_CHANGE"));
		log.LOG_INFO("退出changUserState.....方法");
		return 0;
	}
	
	
	
	// 供应商查询 add by sjp date:2007-06-08
	public void searchCust(Buffers inbuffer) {

		log.LOG_INFO("进入searchCust方法...");
		this.outBuffer = inbuffer;
		String saler_name = inbuffer.getString("SALER_NAME");
		try {
			this.queryResult = searchCust(saler_name);
		}
		catch (SaasApplicationException e) {
			log.LOG_INFO(e.getMessage());
		}
		log.LOG_INFO("退出searchCust方法...");
	}
	
	
	public ArrayList searchCust(String saler_name) throws SaasApplicationException {

		ArrayList itemsList = new ArrayList();
		CustomerExt customerExt = new CustomerExt();
		customerExt.setParam(":VCUST_NAME", "%" + saler_name + "%");
		itemsList = customerExt.selByList("SEL_BY_SEARCH");
		return itemsList;
	}
	
	
	
	// 会员管理
	public void getCustomerByCustIdOrAdmin(Buffers inbuffer) throws SaasApplicationException {

		log.LOG_INFO("进入getCustomerByCustIdOrAdmin方法...");
		this.outBuffer = inbuffer;
		String cust_id = inbuffer.getString("SESSION_CUST_ID");
		String cust_name = inbuffer.getString("SESSION_USER_NAME");
		try {
			if (cust_name == "admin" || cust_name.equals("admin")) {
				log.LOG_INFO("超级管理员............");
				this.queryResult = getAllCust();
			}
			else {
				log.LOG_INFO("进入普通客户..............");
				this.queryResult = getCustInfo(cust_id);
			}
		}
		catch (SaasApplicationException e) {
			log.LOG_INFO(e.getMessage());
		}
		log.LOG_INFO("退出getCustomerByCustIdOrAdmin方法...");
	}
	
	
	
	// 获取客户名称
	public String getCustomerNameById(String cust_id) throws SaasApplicationException {

		String cust_name = "";
		ArrayList custList = genSpecCustInfo(cust_id);
		if (custList != null && custList.size() > 0) {
			HashMap map = (HashMap) custList.get(0);
			cust_name = map.get("cust_name").toString();
		}
		return cust_name;
	}
	
	
	
	// 修改客户类型
	public void updateCustomerTypeById(Buffers inbuffer) throws SaasApplicationException {

		this.outBuffer = inbuffer;
		this.inBuffer = inbuffer;
		String cust_id = inbuffer.getString("CUST_ID");
		String cust_class = inbuffer.getString("CUST_CLASS");
		int iResult = -1;
		
		log.LOG_INFO("进入updateCustomerTypeById方法.....");
		try {
			iResult = updateCustomerTypeById(cust_id, cust_class);
		}
		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("退出updateCustomerTypeById方法...");
	}
	
	
	public int updateCustomerTypeById(String cust_id, String cust_class) throws SaasApplicationException {

		CustomerExt updatestate = new CustomerExt();
		updatestate.setParam(":VCUST_ID", cust_id);
		updatestate.setParam(":VCUST_TYPE", cust_class);
		tradeQuery.executeBy(updatestate.insBy("UPDATE_TYPE_CLASS"));
		return 0;
	}
	
	
	
	// 推荐招聘
	public void getCustListByResume(Buffers inbuffer) {

		log.LOG_INFO("进入getCustList方法...");
		this.outBuffer = inbuffer;
		String query_param = inbuffer.getString("QUERY_PARAM");
		log.LOG_INFO("QUERY_PARAM..................." + query_param);
		try {
			if (query_param.equals("")) {
				this.queryResult = getCustListByResume();
			}
			else {
				this.queryResult = searchCust(query_param);
			}
		}
		catch (SaasApplicationException e) {
			log.LOG_INFO(e.getMessage());
			
		}
		log.LOG_INFO("退出getCustList方法...");
	}
	
	
	public ArrayList getCustListByResume() throws SaasApplicationException {

		ArrayList customerList = new ArrayList();
		ArrayList itemsList = new ArrayList();
		CustomerExt customerExt = new CustomerExt();
		customerList = customerExt.selByList("SEL_BY_RESUME");
		return customerList;
	}
	
	
	
	// 推广中心
	public ArrayList getPromotionCustList() throws SaasApplicationException {

		ArrayList customerList = new ArrayList();
		CustomerExt customerExt = new CustomerExt();
		customerList = customerExt.selByList("SEL_PROMOTION_CUSTLIST");
		return customerList;
	}
	
	
	public ArrayList getCustListByCode(String code) throws SaasApplicationException {

		ArrayList customerList = new ArrayList();
		ArrayList itemsList = new ArrayList();
		CustomerExt customerExt = new CustomerExt();
		customerExt.setParam(":VDEVELOPE_MAN", code);
		customerList = customerExt.selByList("SEL_BY_CODE");
		return customerList;
	}
	
	
	public ArrayList getCustListByDev(String dev_man) throws SaasApplicationException {

		ArrayList customerList = new ArrayList();
		ArrayList itemsList = new ArrayList();
		CustomerExt customerExt = new CustomerExt();
		customerExt.setParam(":VDEVELOPE_CHANNEL", dev_man);
		customerList = customerExt.selByList("SEL_BY_DEV");
		return customerList;
	}
	
	
	
	// 客户级别管理
	public ArrayList getCustListByAll(int iStart) throws SaasApplicationException {

		ArrayList customerList = new ArrayList();
		ArrayList itemsList = new ArrayList();
		CustomerExt customerExt = new CustomerExt();
		customerExt.setParam(":VCUST_STATE", "0");
		if (iStart == 0) {
			iStart = 0;
		}
		else {
			iStart = (iStart - 1) * 30;
		}
		customerList = customerExt.selByList("SEL_SPEC_CUST_STATE", iStart, 30);
		return customerList;
	}
	
	
	public ArrayList getCustListByLevel(int num) throws SaasApplicationException {

		ArrayList customerList = new ArrayList();
		CustomerExt customerExt = new CustomerExt();
		customerExt.setParam(":VCUST_STATE", "0");
		customerList = customerExt.selByList("SEL_CUST_BYLEVEL", 0, num);
		return customerList;
	}
	
	
	public int getCustListNumber() throws SaasApplicationException {

		int size = 0;
		ArrayList customerList = new ArrayList();
		CustomerExt customerExt = new CustomerExt();
		customerExt.setParam(":VCUST_STATE", "0");
		customerList = customerExt.selByList("SEL_CUST_COUNT");
		if (customerList != null && customerList.size() > 0) {
			HashMap map = (HashMap) customerList.get(0);
			size = Integer.parseInt(map.get("root_id").toString());
		}
		return size;
		
	}
	
	
	
	// 采购管理-->供应商查询
	public ArrayList getCustomByStockSeach

⌨️ 快捷键说明

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