示例#1
0
 static JCompanyCache newInstance(Connection con) {
   JCompanyCache cache = new JCompanyCache();
   try {
     cache.init(con);
   } catch (Throwable e) {
     JLog.getLogger().error("", e);
   }
   return cache;
 }
示例#2
0
  public JCompany getCompanyById(String com_id) {
    if (com_id == null || com_id.length() == 0) return null;

    if (JUnit.getUnit(com_id) == null) {
      Exception e = new Exception("部门没找到 com_id=" + com_id);
      JLog.getLogger().error("", e);
      return null;
    }
    String code = JUnit.getUnit(com_id).getUnit_code();

    if (mapCompany.get(code) == null) {
      try {
        loadCompany(code);
      } catch (Exception e) {
        JLog.getLogger().error("", e);
      }
    }
    return mapCompany.get(code);
  }
示例#3
0
 public void loadCompany(String unit_code) throws Exception {
   Connection con = null;
   try {
     con = com.gemway.igo.JDatabase.getJDatabase().getConnection();
     loadCompany(con, unit_code);
   } catch (Exception e) {
     JLog.getLogger().error("", e);
   } finally {
     if (con != null)
       try {
         con.close();
       } catch (Exception e) {
       }
   }
 }
示例#4
0
  public JCompany getCompanyByCode(String code) throws Exception {
    JCompany obj = mapCompany.get(code.toUpperCase());
    if (obj == null) JLog.getLogger().info("公司没找到code=" + code);

    return obj;
  }