List getSubList() {
   TaxempDetail user = SecurityManager.currentOperator();
   String orgId = String.valueOf(user.getOrg().getId());
   String level = String.valueOf(user.getOrg().getLevel());
   // String filtId = "";
   // if (levels.equals("1")) {
   // filtId = "530100";
   // }
   // if (levels.equals("2")) {
   // filtId = "530122";
   // }
   // String level = String.valueOf(Integer.parseInt(levels) + 1);
   List subList = null;
   Session hbtSession = sessionFactory.openSession();
   String hql = "from Organization where ID = '" + orgId + "'";
   // String hql = "from District where parentid = '" + pid + "' and id
   // like '" + filtId + "%'";
   try {
     Query query = hbtSession.createQuery(hql);
     subList = query.list();
     // System.out.println("-----------" + subList.size());
   } catch (Exception ex) {
     ex.printStackTrace();
   } finally {
     hbtSession.close();
   }
   return subList;
 }
예제 #2
0
 private void setInputInfo(Object main) {
   try {
     PropertyDescriptor pd = BeanUtils.getPropertyDescriptor(superClass, INPUT_PERSON_ID);
     if (pd != null) {
       String username = "";
       TaxempDetail currentOperator = SecurityManager.currentOperator();
       if (currentOperator != null) username = currentOperator.getUsername();
       pd.getWriteMethod().invoke(main, username);
     }
     pd = BeanUtils.getPropertyDescriptor(superClass, INPUT_DATE);
     if (pd != null) {
       pd.getWriteMethod().invoke(main, new Timestamp(System.currentTimeMillis()));
     }
   } catch (Exception e) {
     throw new RuntimeException("Error on setting input person/date.", e);
   }
 }