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

📄 lanflowservice.java

📁 电信的网厅的整站代码
💻 JAVA
📖 第 1 页 / 共 5 页
字号:
				}
				
			}
			return "0";
		} catch (Exception rux) {
			FileLogger.getLogger().info(rux.getMessage(), rux);
			return "";
		}
	}
	
	/**判断两个协议是否依赖
	 * 
	 * @param protocolId
	 * @param prodOrderId
	 * @return
	 */
	public static String relaBProtoBySelect(String protocolId,String prodOrderId) {
		try {
			String intfo = "";
			boolean isPass = true;
			if (prodOrderId != null) {
				TF_BSSFlowRecord tf_BSSFlowRecord = TF_BSSFlowRecord.getBSSFlowRecord(new DacClient(),
						Long.parseLong(prodOrderId));
				DataTable select_protocol_dt = tf_BSSFlowRecord.getRecordFrom(BssParameter.SELECT_PROTOCOL_TABLE);
				String reProtocolId = "";
				String reProtocolName = "";
				String[] reProtocolNames = null;
				if(select_protocol_dt != null && select_protocol_dt.getRows().getCount() > 0) {
					for(int j=0;j<select_protocol_dt.getRows().getCount();j++) {
						reProtocolId = select_protocol_dt.getRow(j).getString(BssParameter.PROTOCOLID);
						reProtocolName = AdslFlowService.getInfoByField_value(tf_BSSFlowRecord.getRecordFrom("LANPROTOCOL_TABLE"),
								reProtocolId,"PROT_INFO_SYSiPROTOCOL_ID","PROT_INFO_SYSiPROTOCOL_NAME");
						for(int i=0;i<reProtocolName.length();i++) {
							if(reProtocolName.charAt(i) == '{') {
								intfo = reProtocolName.substring(i+1, i+4);
								if(intfo.equals("依赖于")) {
									intfo = reProtocolName.substring(i+6,reProtocolName.length()-1);
									reProtocolNames = ExtString.split(intfo,"或",null,0);
									String reProtocolId1 = "";
									for(int l=0;l<reProtocolNames.length;l++) {
										reProtocolId1 = AdslFlowService.getInfoByField_value(tf_BSSFlowRecord.getRecordFrom("LANPROTOCOL_TABLE"),
												reProtocolNames[l],"PROT_INFO_SYSiPROTOCOL_NAME","PROT_INFO_SYSiPROTOCOL_ID");
										if(protocolId.equals(reProtocolId1)) {
											isPass = false;
											break;
										}
									}
									if(isPass == false) break;
								}
							}
						}
					}
				}
				if(isPass == false) {
					return "“" + AdslFlowService.getInfoByField_value(tf_BSSFlowRecord.getRecordFrom("LANPROTOCOL_TABLE"),
							reProtocolId,"PROT_INFO_SYSiPROTOCOL_ID","PROT_INFO_SYSiPROTOCOL_NAME") + "[" +
							protocolId+"]”";
				}
				else {
					return "0";
				}
			}
			return "0";
		} catch (Exception rux) {
			FileLogger.getLogger().warn(rux.getMessage(), rux);
			return "";
		}
	}
	
	/**判断两个协议是否互斥
	 * 
	 * @param protocolId
	 * @param prodOrderId
	 * @return
	 */
	public static String mutexProto(String protocolId,String prodOrderId) {
		try {
			if (prodOrderId != null) {
				TF_BSSFlowRecord tf_BSSFlowRecord = TF_BSSFlowRecord.getBSSFlowRecord(new DacClient(),
						Long.parseLong(prodOrderId));
				DataTable select_protocol_dt = tf_BSSFlowRecord.getRecordFrom(BssParameter.SELECT_PROTOCOL_TABLE);
				String reProtocolId = "";
				String cityCode = tf_BSSFlowRecord.getRecordIDS("CITYCODE");
				if(select_protocol_dt != null && select_protocol_dt.getRows().getCount() > 0){
					for(int i=0;i<select_protocol_dt.getRows().getCount();i++) {
						reProtocolId = select_protocol_dt.getRow(i).getString(BssParameter.PROTOCOLID);
						DataTable dt = BssInter6.callWebMutexProto(protocolId,reProtocolId,cityCode);
						if(dt.getRow(0).getString("SO_DISCT_PROTOCOLiSEQ").equals("1")) {
							return "“" +AdslFlowService.getInfoByField_value(tf_BSSFlowRecord.getRecordFrom("LANPROTOCOL_TABLE"),
									reProtocolId,"PROT_INFO_SYSiPROTOCOL_ID","PROT_INFO_SYSiPROTOCOL_NAME") + "[" +
									reProtocolId + "]”";
						}	
					}
				}
				else {
					return "";
				}
			}
			return "0";
		} catch (Exception rux) {
			FileLogger.getLogger().info(rux.getMessage(), rux);
			return "";
		}
	}
	
	/**添加一条选中的协议
	 * 
	 * @param request
	 * @param response
	 * @param _map
	 * @return
	 */
	public static String moveSingleProtocol(ServletRequest request, ServletResponse response, Map _map) {
		StringBuffer _sb = new StringBuffer();
		try {
			if (_map != null) {
				String prodOrderId = (String) _map.get("PRODORDERID");
				String protocolId = (String) _map.get("PROTOCOLID");
				String protocolIds[] = new String[1];
				protocolIds[0] = protocolId;
				DataRow dataRow = null;
				TF_BSSFlowRecord tf_BSSFlowRecord = TF_BSSFlowRecord.getBSSFlowRecord(new DacClient(),
						Long.parseLong(prodOrderId));
				DataTable select_protocol_dt = tf_BSSFlowRecord.getRecordFrom(BssParameter.SELECT_PROTOCOL_TABLE);
				
				String level = AdslFlowService.getInfoByField_value(tf_BSSFlowRecord.getRecordFrom("LANPROTOCOL_TABLE"),
						protocolId,"PROT_INFO_SYSiPROTOCOL_ID","PROT_INFO_SYSIPROTOCOL_LEVEL");
				if(level.equals("2")) {
					return "3";
				}
				
				if(select_protocol_dt == null) {
//					判断依赖
					String isrelaBProto = relaBProto(protocolId,prodOrderId);
					if(!isrelaBProto.equals("0")) {
						return "1"+isrelaBProto;
					}
					select_protocol_dt = AdslFlowService.getNewTable(BssParameter.SELECT_PROTOCOL_TABLE,
							BssParameter.PROTOCOLID,protocolIds);
				}
				else if(select_protocol_dt.getRows().getCount() == 0) {
//					判断依赖
					String isrelaBProto = relaBProto(protocolId,prodOrderId);
					if(!isrelaBProto.equals("0")) {
						return "1"+isrelaBProto;
					}
					select_protocol_dt = AdslFlowService.addRows(select_protocol_dt,
							BssParameter.PROTOCOLID,protocolIds);
				}
				else {
					//判断依赖
					String isrelaBProto = relaBProto(protocolId,prodOrderId);
					if(!isrelaBProto.equals("0")) {
						return "1"+isrelaBProto;
					}
//					判断互斥
					String isMutexProto = AdslFlowService.mutexProto(protocolId,prodOrderId);
					if(!isMutexProto.equals("0")) {
						return "2"+isMutexProto;
					}
					select_protocol_dt = AdslFlowService.addRows(select_protocol_dt,
							BssParameter.PROTOCOLID,protocolIds);
				}
				tf_BSSFlowRecord.setRecordFrom(select_protocol_dt,BssParameter.SELECT_PROTOCOL_TABLE);
				tf_BSSFlowRecord.save();
				DataTable protocol_dt = tf_BSSFlowRecord.getRecordFrom("LANPROTOCOL_TABLE");
				String protocoName = "";
				String reProtocolId = "";
				_sb.append("<table>");
				for(int i=0;i<protocol_dt.getRows().getCount();i++){
					dataRow = protocol_dt.getRow(i);
					reProtocolId = dataRow.getString("PROT_INFO_SYSiPROTOCOL_ID");
					if(protocolId.equals(reProtocolId)){
						protocoName = dataRow.getString("PROT_INFO_SYSiPROTOCOL_NAME");
						_sb.append("<tr key='");
						_sb.append(reProtocolId);
						_sb.append("'>");
						_sb.append("<td class=\"body_td\" align=\"center\" nowrap>");
						_sb.append(protocoName);
						_sb.append("</td>");
						_sb.append("<td class=\"body_td\" align=\"center\" nowrap>");
						_sb.append(dataRow.getString("PROT_INFO_SYSiEXCLUDE"));
						_sb.append("</td>");
						_sb.append("<td class=\"body_td\" align=\"center\" nowrap>");
						_sb.append("&nbsp;");
						_sb.append("</td>");
						_sb.append("<td class=\"body_td\" align=\"center\" nowrap>");
						_sb.append("&nbsp;");
						_sb.append("</td>");
						_sb.append("<td class=\"body_td\" align=\"center\" nowrap>");
						_sb.append("&nbsp;");
						_sb.append("</td>");
						_sb.append("<td class=\"body_td\" align=\"center\" nowrap>");
						_sb.append(dataRow.getString("PROT_INFO_SYSiEFF_DATE"));
						_sb.append("</td>");
						_sb.append("<td class=\"body_td\" align=\"center\" nowrap>");
						_sb.append(dataRow.getString("PROT_INFO_SYSiEXP_DATE"));
						_sb.append("</td></tr>");
					}
				}
				_sb.append("</table>");
			}
		} catch (Exception rux) {
			FileLogger.getLogger().info(rux.getMessage(), rux);
		}
		
		return _sb.toString();
	}
	
	/**删除一条选中的协议
	 * 
	 * @param request
	 * @param response
	 * @param _map
	 * @return
	 */
	public static String removeSingleProtocol(ServletRequest request, ServletResponse response, Map _map) {
		String info = "";
		try {
			if (_map != null) {
				
				String prodOrderId = (String) _map.get("PRODORDERID");
				String protocolId = (String) _map.get("PROTOCOLID");
				//判断依赖
				String isrelaBProto = relaBProtoBySelect(protocolId,prodOrderId);
				if(!isrelaBProto.equals("0")) {
					return "2"+isrelaBProto;
				}
				DataRow dataRow = null;
				TF_BSSFlowRecord tf_BSSFlowRecord = TF_BSSFlowRecord.getBSSFlowRecord(new DacClient(),
						Long.parseLong(prodOrderId));
				DataTable select_protocol_dt = tf_BSSFlowRecord.getRecordFrom(BssParameter.SELECT_PROTOCOL_TABLE);

				String reProtocolId = "";
				for(int i=0;i<select_protocol_dt.getRows().getCount();i++){
					dataRow = select_protocol_dt.getRow(i);
					reProtocolId = dataRow.getString(BssParameter.PROTOCOLID);
					if(protocolId.equals(reProtocolId)){
						dataRow.delete();
					}
				}
				select_protocol_dt.acceptChanges();
				tf_BSSFlowRecord.setRecordFrom(select_protocol_dt,BssParameter.SELECT_PROTOCOL_TABLE);
				tf_BSSFlowRecord.save();
				info = "1";
			}
		} catch (Exception rux) {
			info = "0";
			FileLogger.getLogger().warn(rux.getMessage(), rux);
		}
		
		return info;
	}
	
	public static DataTable callQryAddr(String preAddId,String prodOrderId) {
		TF_BSSFlowRecord tf_BSSFlowRecord = null;
		DataTable addrTree = null;
		try {
			tf_BSSFlowRecord = TF_BSSFlowRecord.getBSSFlowRecord(new DacClient(),Long.parseLong(prodOrderId));
			DataTable custArchives_dt = tf_BSSFlowRecord.getRecordFrom(BssParameter.CUST_ARCHIVES_TABLE);
			CustArchivesBean custArchivesBean = AdslFlow.setfirstflow(custArchives_dt);
			String cityCode = tf_BSSFlowRecord.getRecordIDS("CITYCODE"); //城市编号
			String areaId = custArchivesBean.getSERVIAREA_ID();//受理地区
			if (preAddId != null) {
				addrTree = BssInter2.callWebQryAddr(areaId, preAddId, cityCode);
			} else {
				addrTree = BssInter2.callWebQryAddrRoot(areaId, cityCode);
			}
		} catch (Exception ex) {
			FileLogger.getLogger().info(ex.getMessage(), ex);
		}
		
		return addrTree;
	}
	
	public static DataTable callQryExch(String prodOrderId) {
		TF_BSSFlowRecord tf_BSSFlowRecord = null;
		DataTable exchTree = null;
		try {
			tf_BSSFlowRecord = TF_BSSFlowRecord.getBSSFlowRecord(new DacClient(),Long.parseLong(prodOrderId));
			DataTable custArchives_dt = tf_BSSFlowRecord.getRecordFrom(BssParameter.CUST_ARCHIVES_TABLE);
			CustArchivesBean custArchivesBean = AdslFlow.setfirstflow(custArchives_dt);
			String cityCode = tf_BSSFlowRecord.getRecordIDS("CITYCODE"); //城市编号
			String areaId = custArchivesBean.getSERVIAREA_ID();//受理地区
			exchTree = BssInter2.callWebQryExch(areaId, "", "", cityCode);
		} catch (Exception ex) {
			FileLogger.getLogger().warn(ex.getMessage(), ex);
		}
		return exchTree;
	}
	
	/**
	 * 通过分段地址编码,查询局向、业务接入点编码。
	 * 
	 * @param request
	 * @param response
	 * @param _map
	 * @return
	 */

⌨️ 快捷键说明

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