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

📄 familybranddao.java

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

		if (_param == null || _param.length == 0) {
			return _dac.executeQuery(_sb.toString());
		}
		else {
			return _dac.executeQuery(_sb.toString(), _param);
		}
	}
	/**
	 * ****************客户品牌********************** linfei
	 * 2006-12-27******************************
	 * 
	 * @param _map
	 * @param statu
	 * @return
	 * @throws java.sql.SQLException
	 * @throws RuntimeException
	 */
	static public DataTable geFamilyBrandMethod(java.util.Map _map, String statu)
			throws java.sql.SQLException, RuntimeException {

		try {
			String citycode = (String) _map.get("CITY");
			String orderid = (String) _map.get("ORDERID");
			String starttime = (String) _map.get("STARTTIME");
			String endtime = (String) _map.get("ENDTIME");
			String staffID = (String) _map.get("USERID");
			// 增加计费号码
			String phonenum = (String) _map.get("PHONENUM");
			String FUNAUTO = (String) _map.get("FUNAUTO");
			String SERVICETYPE = (String) _map.get("SERVICETYPE");
			String PRODUCTID = (String) _map.get("PRODUCTID");
			// PRODUCTID

			citycode = citycode == null || citycode.equals("") ? "0590"
					: citycode;

			StringBuffer sql = new StringBuffer();
			// 当前所存在的所有条件
			LinkedList _linkList = new LinkedList();

			// 基本条件
			sql.append(" select count(t.FUNORDERID) as count");
			sql.append(" from tf_funorder t ,td_prodfun f,ts_configsub c");
			sql.append(" where t.PRODFUNID=f.PRODFUNID and c.PARANAME='FunFailureStateLogDsec' ");
			sql.append(" and t.PROGRESSSTATE=c.PARAVALUE(+) ");
			// 权限值
			if (!citycode.equals("0590")) {
				sql.append(" and t.citycode=?");
				_linkList.add(citycode);
				sql.append(" and t.citycode=?");
				_linkList.add(citycode);
				
			}
			
			// 是否人工或自助
			if (FUNAUTO != null && !"null".equals(FUNAUTO)
					&& !"".equals(FUNAUTO)) {
				sql.append(" and t.FUNORDERAUTO=?");
				_linkList.add(FUNAUTO);
			}

			// 程控类型:fun tao
			if (SERVICETYPE != null && !SERVICETYPE.equals("")) {
				sql.append(" and f.SERVICETYPE=?");
				_linkList.add(SERVICETYPE);
			}

			// STATE 受理状态。如果BSS返回全部为0
//			 STATE 受理状态。如果BSS返回全部为0
			
			if (statu != null && !statu.equals("")) {
				if (statu.equals("L")) {
					sql.append(" and t.lockstaffid=? ");
					_linkList.add(staffID);
				}
				else {
					if(statu.equals("4")){
						//处理失败与异常单并归.
						sql.append(" and t.PROGRESSSTATE not in('1','2','3','911')");
					}else{
						sql.append(" and t.PROGRESSSTATE=?");
						_linkList.add(statu);
					}
				}
			}
			// 产品类型
			if (PRODUCTID != null && !PRODUCTID.equals("")) {
				sql.append(" and f.PRODUCTID=?");
				_linkList.add(PRODUCTID);
			}

			// 流水号
			if (orderid != null && !orderid.equals("")) {
				sql.append(" and t.WEBORDER like ?");
				_linkList.add("%" + orderid.trim() + "%");
			}

			// 客户名称 wull改为计费号码
			if (phonenum != null && !phonenum.equals("")) {
				sql.append(" and t.PHONENUM like ?");
				_linkList.add("%" + phonenum.trim() + "%");
			}

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

				return _dac.executeQuery(sql.toString());
			}

		} catch (java.sql.SQLException sqlx) {
			throw sqlx;
		} catch (RuntimeException rux) {
			_logger.warn(rux.getMessage(), rux);
			throw rux;
		}
	}
	/**
	 * <title>获取单张程控工单的数据.</title> <body>为了以后扩展,现在作冗鱼处理.</body>
	 * 
	 * @param orderId
	 * @return
	 */
	public DataTable singleOrder(String orderId) {

		try {
			String sql = "select * from tf_order f where f.orderid=?";
			return _dac.executeQuery(sql, new Object[] { orderId });
		} catch (Exception ex) {
			_logger.warn("isLock  " + ex.getMessage());
		}

		return null;
	}
	/**
	 * <title>锁定一张工单.</title>
	 * 
	 * @param funid
	 * @return 失败:
	 */
	public boolean isLockOrder(String funid, String lockid) {

		String queryID = lockID(funid);
		if (lockid.equals(queryID)) {
			return true;
		}

		if (queryID.equals("") && lockOrderSelf(funid, lockid)) {
			return true;
		}
		return false;

	}
	/**
	 * <title>审核员工锁定一张工单.</title>
	 * 
	 * @param funid
	 * @param lockid
	 * @return
	 */
	private boolean lockOrderSelf(String orderid, String lockid) {
		try {

			String sql = "update tf_order f set f.lockstaffid=? where f.orderid=?";
			int i = _dac.executeUpdate(sql, 1000,
					new Object[] { lockid, orderid });
			if (i > 0) {
				return true;
			}
			return false;

		} catch (Exception ex) {
			_logger.warn("isLock  " + ex.getMessage());
		}
		return false;
	}
	/**
	 * <title>工单是否被锁定.</title>
	 * 
	 * @param funid
	 * @return
	 */
	public String lockID(String orderid) {
		try {
			String sql = "select f.lockstaffid from tf_order f where f.orderid=?";

			DataTable dt = _dac.executeQuery(sql, new Object[] { orderid });
			if (dt == null || dt.getRows().getCount() == 0) {
				return "";
			}

			String lockId = dt.getRow(0).getString("lockstaffid");
			if (lockId == null || lockId.equals("")) {
				return "";
			}
			return lockId;

		} catch (Exception ex) {
			_logger.warn("isLock  " + ex.getMessage());
		}
		return "";
	}
	/**
	 * **************程控工单修改程控信息********************** wull
	 * 2006-6-14***********************
	 * 
	 * @param OtherMSG
	 * @param funorderid
	 * @return
	 */
	public boolean updateFunMSG(Map OtherMSG, String funorderid) {
		LinkedList _linkList = new LinkedList();
		_linkList.add(OtherMSG.get("PROGRESSSTATE"));
		_linkList.add(OtherMSG.get("THIRDMSG"));
		_linkList.add(OtherMSG.get("OTHERORDER"));
		_linkList.add(OtherMSG.get("FINISHTIME"));
		_linkList.add(OtherMSG.get("FUNORDERID"));
		String sql = "update tf_order set BOSOMPROGRESSSTATE=?,THIRDMSG=?,OTHERORDER=?,FINISHTIME= to_date(?,'YYYY-MM-DD HH24:MI') where ORDERID=?";
		
		try {
			if (OtherMSG.size() >= 1) {
				int i = _dac.executeUpdate(sql, 10000, _linkList.toArray());
				if (i > 0)
					return true;
			}
		} catch (Exception e) {
			_logger.warn("updateFunMSG  " + e.getMessage());
		}
		return false;
	}
	
	/**
	 * <title>设置工单信息.</title>
	 * 
	 * @param funid
	 * @param state
	 * @return
	 */
	public boolean setOrderMsg(java.util.Map _map) {
			String sId = (String) _map.get("ID");
			String sThirdmsg = (String) _map.get("THIRDMSG");
		try {

			String sql = "update tf_order f set f.THIRDMSG = ? where f.orderid=?";
			int i = _dac
					.executeUpdate(sql, 1000, new Object[] { sThirdmsg, sId });
			if (i > 0) {
				return true;
			}
			return false;

		} catch (Exception ex) {
			_logger.warn("isLock  " + ex.getMessage());
		}
		return false;
	}
	/**
	 * <title>设置工单状态.</title>
	 * 
	 * @param funid
	 * @param state
	 * @return
	 */
	public boolean setOrderState(String funid, String state) {
		try {

			String sql = "update tf_order f set f.BOSOMPROGRESSSTATE = ? where f.orderid=?";
			int i = _dac
					.executeUpdate(sql, 1000, new Object[] { state, funid });
			if (i > 0) {
				return true;
			}
			return false;

		} catch (Exception ex) {
			_logger.warn("isLock  " + ex.getMessage());
		}
		return false;
	}
	/**
	 * <title>撤消工单.</title>
	 * 
	 * @param funid
	 * @return
	 */
	public boolean cancelOrder(String funid) {
		return setOrderState(funid, "911");
	}

	/**
	 * <title>解锁工单.</title>
	 * 
	 * @param orderid
	 * @return
	 */
	public boolean unLock(String orderid) {
		try {

			String sql = "update tf_order f set f.lockstaffid = '' where f.orderid=?";
			int i = _dac.executeUpdate(sql, 1000, new Object[] { orderid });
			if (i > 0) {
				return true;
			}
			return false;

		} catch (Exception ex) {
			_logger.warn("isLock  " + ex.getMessage());
		}
		return false;
	}
	/**
	 * <title>工单是否升降排序</title> <body>true : 升序 1: 待处理 3: 暂存 2: 转派 6: 自己锁定 7:回退</body>
	 * <body>false : 降序 0: 所有订单 4: 已作废 5: 已完成 8:归档
	 * 
	 * </body>
	 * 
	 * @param active
	 * @return
	 */
	private static boolean isCompositor(String active) {
		if (active == null || active.equals("")) {
			return false;
		}
		if (active.equals("1")) {
			return true;
		}
		if (active.equals("3")) {
			return true;
		}
		if (active.equals("2")) {
			return true;
		}
		if (active.equals("4")) {
			return false;
		}
		if (active.equals("5")) {
			return false;
		}
		if (active.equals("6")) {
			return true;
		}
		if (active.equals("7")) {
			return true;
		}
		if (active.equals("8")) {
			return false;
		}
		return false;
	}
}
	

⌨️ 快捷键说明

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