?? servicemapping.java~4~
字號:
package com.sztheater.framework.util;
import java.sql.*;
import java.util.*;
public class ServiceMapping {
private static HashMap m_service_map = null;//保存業務映射關系
/*
* 取得業務執行信息
* @param busi_id 業務編碼
* @return 業務執行信息
*/
public static synchronized HashMap getServiceInfo(Connection conn,
String service_id,String Action_ID){
if(conn==null ) return null;
if(service_id==null || service_id.trim().equals("")) return null;
HashMap hashServ = null;
String strSQL = null;
String s_service_id = null;
String service_type = null;
if(Action_ID==null) Action_ID = "";
service_id = service_id.trim();
Action_ID = Action_ID.trim();
s_service_id = service_id;
if(m_service_map==null) {
m_service_map = new HashMap();
}
if(Action_ID.equals("psql")) service_id = "psql";
hashServ = (HashMap)m_service_map.get(service_id);
if(hashServ!=null) return hashServ;
System.out.println("com.sztheater.web.taglib.ResultTag->doStartTag"+
" Action_ID["+Action_ID+"]\n");
if(Action_ID.equals("psql")){
hashServ = new HashMap();
hashServ.put("service_id" ,service_id);
hashServ.put("service_desc" ,"動態SQL服務");
hashServ.put("class_name" ,"com.sztheater.framework.util.ParseSQLBusi");
m_service_map.put(service_id,hashServ);
return hashServ;
}
if(service_id.equals("login")){
hashServ = new HashMap();
hashServ.put("service_id" ,service_id);
hashServ.put("service_desc" ,"會員登錄");
hashServ.put("class_name" ,"com.sztheater.biz.system.Login");
m_service_map.put(service_id,hashServ);
return hashServ;
}
if(service_id.equals("portal_enable")){
hashServ = new HashMap();
hashServ.put("service_id" ,service_id);
hashServ.put("service_desc" ,"會員激活");
hashServ.put("class_name" ,"com.sztheater.biz.register.CRegister");
m_service_map.put(service_id,hashServ);
return hashServ;
}
if(service_id.equals("sys_login")){
hashServ = new HashMap();
hashServ.put("service_id" ,service_id);
hashServ.put("service_desc" ,"系統登錄");
hashServ.put("class_name" ,"com.sztheater.biz.system.SysLogin");
m_service_map.put(service_id,hashServ);
return hashServ;
}
if(service_id.equals("DtreeMenu")){
hashServ = new HashMap();
hashServ.put("service_id" ,service_id);
hashServ.put("service_desc" ,"系統菜單");
hashServ.put("class_name" ,"com.sztheater.biz.system.DtreeMenu");
m_service_map.put(service_id,hashServ);
return hashServ;
}
if(service_id.equals("DICT")){
hashServ = new HashMap();
hashServ.put("service_id" ,service_id );
hashServ.put("service_desc","字典服務" );
hashServ.put("class_name" ,"com.sztheater.framework.system.StaticDict");
m_service_map.put(service_id,hashServ);
return hashServ;
}
if(service_id.startsWith("ST_")) s_service_id = "TAB_SERV";
strSQL = "select distinct service_id,service_desc,class_name,service_type \n"
+ "from tsm_service \n"
+ "where service_id='"+service_id+"'";
Statement stmt = null;
ResultSet RSTemp = null;
String service_desc= null;
String class_name = null;
try{
stmt = conn.createStatement();
RSTemp = stmt.executeQuery( strSQL);
while (RSTemp != null && RSTemp.next()) {
service_id = RSTemp.getString("service_id" );
class_name = RSTemp.getString("class_name" );
service_desc = RSTemp.getString("service_desc");
service_type = RSTemp.getString("service_type");
if(service_id ==null) service_id = "";
if(class_name ==null) class_name = "";
if(service_desc==null) service_desc = "";
if(service_type==null) service_type = "";
service_id = service_id.trim();
class_name = class_name.trim();
service_desc = service_desc.trim();
service_type = service_type.trim();
if(class_name.equals("")) continue;
if(service_desc.equals("")) service_desc = service_id;
hashServ = new HashMap();
hashServ.put("service_id" ,service_id );
hashServ.put("service_desc" ,service_desc );
hashServ.put("class_name" ,class_name );
hashServ.put("service_type" ,service_type );
m_service_map.put(service_id,hashServ);
}
}catch(Exception e){
System.out.println("依據["+service_id+"]取得服務異常\n" + e.getMessage());
}finally{
try{
if(stmt!=null) stmt.close();
}catch(Exception e){
}
try{
if(RSTemp!=null) RSTemp.close();
}catch(Exception e){
System.out.println("依據["+service_id+"]取得服務異常\n" + e.getMessage());
}
stmt = null;
RSTemp = null;
}
hashServ = (HashMap)m_service_map.get(service_id);
if(hashServ!=null) return hashServ;
if(s_service_id.equals("TAB_SERV")){
hashServ = new HashMap();
hashServ.put("service_id" ,"TAB_SERV" );
hashServ.put("service_desc","單表服務" );
hashServ.put("class_name" ,"com.sztheater.framework.util.TabServBusi");
m_service_map.put("TAB_SERV",hashServ);
return hashServ;
}
return null;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -