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

📄 register.java

📁 电信的网厅的整站代码
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
			}

			if (name != null && !name.equals("")) {
				sql.append(" and t.name like ?");
				_linkList.add("%" + name.trim() + "%");
			}


			if (email != null && !email.equals("")) {
				sql.append(" and t.email like ?");
				_linkList.add("%" + email.trim() + "%");
			}

			// 开始时间
			if (starttime != null && !starttime.equals("")) {
				sql.append(" and t.createtime >= to_date(?,'YYYY-MM-DD HH24:MI:SS')");
				_linkList.add(starttime);
			}
			// 结束时间
			if (endtime != null && !endtime.equals("")) {
				sql.append(" and t.createtime <= to_date(?,'YYYY-MM-DD HH24:MI:SS')");
				_linkList.add(endtime);
			}

			sql.append(" order by t.createtime asc");
			
			if (_linkList.size() == 0) {
				return _dac.executeQuery(sql.toString());
			} else {
				return _dac.executeQuery(sql.toString(), _linkList.toArray());
			}
		} catch (java.sql.SQLException sqlx) {
			throw sqlx;
		} catch (RuntimeException rux) {
			_logger.warn(rux.getMessage(), rux);
			throw rux;
		}
	}

	/**
	 * <code>解锁过期账号</code>
	 * 
	 * @param _map
	 */
	public static int activeOverDueAccount(java.util.Map _map)
			throws java.sql.SQLException {
		try {
			String userid = (String) _map.get("USERID");// 客户账号
			String name = (String) _map.get("NAME");// 客户名称
			String email = (String) _map.get("EMAIL");// email
			String areaCode = (String) _map.get("AREA");// 地域编码
			String cityCode = (String) _map.get("CITY");// 地市编码
			String starttime = (String) _map.get("STARTTIME");// 开始时间
			String endtime = (String) _map.get("ENDTIME");// 结束时间

			StringBuffer sql = new StringBuffer();
			LinkedList _linkList = new LinkedList();

			sql.append("UPDATE tf_custinfoweb t SET t.state='E',t.userstate='N',t.createtime=sysdate ");
			sql.append("WHERE t.state='D' AND t.custtypeid='2' AND t.userstate='L'");

			if (cityCode != null && !cityCode.equals("")
					&& !cityCode.equals("0590")) {
				sql.append(" and t.citycode=?");
				_linkList.add(cityCode);
				// 地区
				if (areaCode != null && !areaCode.equals("")) {
					sql
							.append(" and decode(t.areacode,null,t.citycode||'00',t.areacode)=?");
					_linkList.add(areaCode);
				}
			}

			if (userid != null && !userid.equals("")) {
				sql.append(" and t.accountid like ?");
				_linkList.add("%" + userid.trim() + "%");
			}

			if (name != null && !name.equals("")) {
				sql.append(" and t.name like ?");
				_linkList.add("%" + name.trim() + "%");
			}

			if (email != null && !email.equals("")) {
				sql.append(" and t.email like ?");
				_linkList.add("%" + email.trim() + "%");
			}

			// 开始时间
			if (starttime != null && !starttime.equals("")) {
				sql
						.append(" and t.createtime >= to_date(?,'YYYY-MM-DD HH24:MI:SS')");
				_linkList.add(starttime);
			}
			// 结束时间
			if (endtime != null && !endtime.equals("")) {
				sql
						.append(" and t.createtime <= to_date(?,'YYYY-MM-DD HH24:MI:SS')");
				_linkList.add(endtime);
			}
			
			//System.out.println("activeOverDueAccount(Map) sql\n:" + sql.toString());
			
			if (_linkList.size() == 0) {
				return _dac.executeUpdate(sql.toString(), 2000, null);
			} else {
				return _dac.executeUpdate(sql.toString(), 2000, _linkList
						.toArray());
			}
		} catch (java.sql.SQLException sqlx) {
			throw sqlx;
		} catch (RuntimeException rux) {
			_logger.warn(rux.getMessage(), rux);
			throw rux;
		}
	}
	
	/**
	 * <code>添加新账号</code>
	 * 
	 * @param _map
	 */
	public static int activeNewAccount(java.util.Map _map){
		try {			
			String accountid = (String) _map.get("USERID");// 客户账号
			String name = (String) _map.get("NAME");// 客户名称
			String email = (String) _map.get("EMAIL");// email
			String areaCode = (String) _map.get("AREA");// 地域编码
			String cityCode = (String) _map.get("CITY");// 地市编码
			String pwd = (String) _map.get("PWD");// 密码
			pwd=UserFactory.getEncryptPassword(pwd);//  加密

			//String custType=(String)_map.get("CUSTTYPE");
			//System.out.println("userid:"+userid+"__name:"+name+"__cityCode:"+cityCode+"__areaCode:"+areaCode);
			DacClient client= new DacClient();
			Account account = new AccountImpl(client) ;
			account.setUserId(client.getSequence("seq_userid"));
			account.setUpUserId(0);
			account.setState("E");
			account.setUserState("A");
			account.setActNum("ur4Qq/IpZLMWosKeEEpr80z4w=");
			account.setPwdQuestion("-1");
			account.setPwdAnswer("-1");
			account.setCreateTime(new Date());
			account.setAreaCode(getString(areaCode));
			account.setCityCode(getString(cityCode));
			account.setCustTypeId(14); //目前只能添加网上报税用户
			account.setEmail(getString(email));
			account.setName(getString(name));
			account.setPwd(getString(pwd));
			account.setAccountId(getString(accountid));
			
			
			return account.newAccount();	
			
		} catch (RuntimeException rux) {
			_logger.warn(rux.getMessage(), rux);
			throw rux;
		}
	}
	/**
	 * <code>修改账号</code>
	 * 
	 * @param _map
	 */
	public static int activeUpdateAccount(java.util.Map _map){
		try {
			//String accountid = (String) _map.get("USERID");// 客户账号	
			String id=(String)_map.get("ID");			
			String name = (String) _map.get("NAME");// 客户名称		
			String pwd = (String) _map.get("PWD");// 新密码	
			if(pwd!=null && !pwd.equals("")){
				pwd=UserFactory.getEncryptPassword(pwd);//  加密
			}
			String email = (String) _map.get("EMAIL");// EMAIL		
			String areaCode = (String) _map.get("AREA");// 地域编码
			String cityCode = (String) _map.get("CITY");// 地市编码	
			
			DacClient client= new DacClient();
			AccountImpl account = new AccountImpl(client,Long.parseLong(id));
			if(pwd!=null)
				account.setPwd(getString(pwd));
			account.setEmail(getString(email));
			account.setName(getString(name));
			account.setCityCode(getString(cityCode));
			account.setAreaCode(getString(areaCode));
			
			account.save();	
			return 1;
			
		} catch (RuntimeException rux) {			
			_logger.warn(rux.getMessage(), rux);
			throw rux;
		}
	}
	public static String getString(String str)
	{
		if(str==null)
			str="";
		return str;		
	}
	
	
	/**
	 * <code>查询此账号是否存在</code>
	 * 
	 * @param _map
	 */
	public static DataTable selectExistAccount(java.util.Map _map)
	throws java.sql.SQLException {
		try {
			String userid = (String) _map.get("USERID");// 客户账号			
			
			StringBuffer sql = new StringBuffer();
			LinkedList _linkList = new LinkedList();
			
			sql.append("SELECT ACCOUNTID FROM tf_custinfoweb t ");
			sql.append("WHERE t.accountid=?");
			_linkList.add(userid.trim());			
			
			
			if (_linkList.size() == 0) {
				return _dac.executeQuery(sql.toString());
			} else {
				return _dac.executeQuery(sql.toString(), _linkList.toArray());
			}
		} catch (java.sql.SQLException sqlx) {
			throw sqlx;
		} catch (RuntimeException rux) {
			_logger.warn(rux.getMessage(), rux);
			throw rux;
		}
	}
	/**
	 * <code>取账号类型</code>
	 * <desc></desc>
	 * 
	 */	
	public static DataTable getCustType()
	throws java.sql.SQLException {
		try {			
			StringBuffer sql = new StringBuffer();
			sql.append("SELECT * FROM tf_custtype t ");
			
			return _dac.executeQuery(sql.toString());			
		} catch (java.sql.SQLException sqlx) {
			throw sqlx;
		} catch (RuntimeException rux) {
			_logger.warn(rux.getMessage(), rux);
			throw rux;
		}
	}
	/**
	 * <code>取四川报税故障用户详细信息</code>
	 */	
	public static DataTable getAccInfo(java.util.Map _map)
	throws Exception {
		AccountImpl impl=null;
		try {	
			long userId=new Long((String)_map.get("USERID")).longValue();
			impl=new AccountImpl(new DacClient(),userId);			
			return impl.queryAccountDataTable();			
		} catch(Exception ex){
			_logger.warn(ex.getMessage(), ex);
			throw ex;
		}finally{
			impl=null;
		}
	}
	
	/**
	 * <code>查询账号类型是否存在</code>
	 * 
	 * @param _map
	 */
	public static int selectExistCustType(java.util.Map _map){
		try {
			TF_CustTypeImpl impl=new TF_CustTypeImpl(new DacClient());
			impl.setDescrictpion((String) _map.get("DESCRICTPION"));
			DataTable dt=(DataTable)impl.queryObj();
			if(dt!=null && dt.getRows().getCount()>0)
				return 1;			
		} catch (RuntimeException rux) {			
			_logger.warn(rux.getMessage(), rux);
			throw rux;
		}
		return 0;
	}
	
	/**
	 * <code>添加帐号类型</code>
	 */	
	public static int addCustType(java.util.Map _map){		
		DacClient dac=null;
		try {			
			dac=new DacClient();
			long id=dac.getSequence("SEQ_CUSTTYPEID");
			TF_CustTypeImpl impl=new TF_CustTypeImpl(new DacClient());	
			impl.setCustTypeId(String.valueOf(id));
			impl.setDescrictpion((String)_map.get("DESCRICTPION"));
			impl.setRoleType((String)_map.get("ROLETYPE"));	
			impl.setState("E");
			impl.setCreateTime(new Date());
			impl.save();			
			return 1;			
		} catch(Exception ex){
			ex.printStackTrace();
			_logger.warn(ex.getMessage(), ex);			
			return 0;
		}finally{
			
		}
	}
}

⌨️ 快捷键说明

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