Examples of IUserDAO


Examples of com.agiletec.aps.system.services.user.IUserDAO

    }
        try {
            if (japsUser == null) {
                return this.searchUsers(text);
            }
            IUserDAO userDAO = japsUser.booleanValue() ? super.getUserDAO() : this.getLdapUserDAO();
            if (text == null || text.trim().length() == 0) {
                return userDAO.loadUsers();
            }
            return userDAO.searchUsers(text);
        } catch (Throwable t) {
            ApsSystemUtils.logThrowable(t, this, "searchUsers");
            throw new ApsSystemException("Error loading users", t);
        }
    }
View Full Code Here

Examples of com.lgx8.right.dao.IUserDao

  /**
   * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
   */
  protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    ApplicationContext ac = WebApplicationContextUtils.getWebApplicationContext(this.getServletContext());
    IUserDao userDao = (IUserDao) ac.getBean("userDao");
   
    ICardDao cardDao = (ICardDao) ac.getBean("cardDao");
   
    RunTimeUser rtU = RunTimeUser.getRunTimeUser(request);
   
    String mobile = request.getParameter("mobile");
    String result1 = "0";
    if(mobile != null && !"".equals(mobile))
    {
      result1 =  userDao.checkMobileExists(mobile);
    }
   
    String cardid = request.getParameter("cardid");
   
    String result2 = "0";
View Full Code Here

Examples of com.lgx8.right.dao.IUserDao

    RunTimeUser user = null;
    try {
      user = RunTimeUser.getRunTimeUser(request);
     
      ApplicationContext ac = WebApplicationContextUtils.getWebApplicationContext(this.getServletContext());
      IUserDao userDao = (IUserDao) ac.getBean("userDao");
      User u = userDao.findUserById(user.getId());
      user.getCard().setScore(u.getCard().getScore());
     
    } catch (Exception e1) {
      user = null;
    }
View Full Code Here

Examples of com.lgx8.right.dao.IUserDao

    String areaNode = request.getParameter("areaNode");
   
    RunTimeUser rtUser = RunTimeUser.getRunTimeUser(request);
   
    ApplicationContext ac = WebApplicationContextUtils.getWebApplicationContext(this.getServletContext());
    IUserDao userDao = (IUserDao) ac.getBean("userDao");
    IMessageRecordDao messageRecordDao = (IMessageRecordDao) ac.getBean("messageRecordDao");
    if("1".equals(sendType))
    {
      String[] mbs = mobiles.split(",");
     
      for(String sendMobile : mbs)
      {
        SendSms.sendSms(sendMobile, content);
      }
    }else if("2".equals(sendType))
    {
      List<User> us = userDao.listUser(" from User u where u.id in ("+userIds+")");
      for(User u : us)
      {
        SendSms.sendSms(u.getMobile(), content);
        if(!StringUtil.isEmptyStr(mobiles))mobiles += ",";
        mobiles += u.getMobile();
      }
    }else if("3".equals(sendType))
    {
      String[] mids = merchantIds.split(",");
      for(int i =0 ; i < mids.length; i++)
      {
        List<User> us = userDao.listUser(" from User u where u.id in ("+userIds+") and u.usertype = " + uts.split(",")[i] +" and u.organizationid = " + mids[i]);
        for(User u : us)
        {
          SendSms.sendSms(u.getMobile(), content);
          if(!StringUtil.isEmptyStr(mobiles))mobiles += ",";
          mobiles += u.getMobile();
        }
      }
    }else if("4".equals(sendType))
    {
      String hql = " from User u where u.enabled = true and u.locked = false";
     
      String hql1 = "";
      String hql2 = "";
     
      if(rtUser.isMerchant())
      {
        hql1 += " and u.usertype = 2 and u.organizationid = " +rtUser.getOrganizationid() ;
        if(!StringUtil.isEmptyStr(areaNode))
        {
          hql1 += " and exists(from Merchant m where m.id = "+rtUser.getOrganizationid()+"  and m.areaNode = '"+areaNode+"')";
        }
       
        hql += hql1;
      }else if(rtUser.isOrganization())
      {
        hql2 += " and u.usertype = 3 and u.organizationid = " +rtUser.getOrganizationid() ;
       
        if(!StringUtil.isEmptyStr(areaNode))
        {
          hql2 += " and exists(from Organization o where o.id = "+rtUser.getOrganizationid()+"  and o.JGSZQY = '"+areaNode+"')";
        }
       
        hql += hql2;
      }else
      {
        hql1 += " and u.usertype = 2 ";
        if(!StringUtil.isEmptyStr(areaNode))
        {
          hql1 += " and exists(from Merchant m where m.id = u.organizationid  and m.areaNode = '"+areaNode+"')";
        }
        hql2 += " and u.usertype = 3 ";
        if(!StringUtil.isEmptyStr(areaNode))
        {
          hql2 += " and exists(from Organization o where o.id = u.organizationid  and o.JGSZQY = '"+areaNode+"')";
        }
       
        hql = hql + hql1 + " union " +hql + hql2;
      }
     
      List<User> us = userDao.listUser(hql);
      for(User u : us)
      {
        SendSms.sendSms(u.getMobile(), content);
        if(!StringUtil.isEmptyStr(mobiles))mobiles += ",";
        mobiles += u.getMobile();
       
        if(!StringUtil.isEmptyStr(users))users += ",";
        users += u.getTruename();
      }
    }else if("5".equals(sendType))
    {
      String hql = " from User u where u.enabled = true and u.locked = false and u.sex = 1";
     
      String hql1 = "";
      String hql2 = "";
     
      if(rtUser.isMerchant())
      {
        hql1 += " and u.usertype = 2 and u.organizationid = " +rtUser.getOrganizationid() ;
        if(!StringUtil.isEmptyStr(areaNode))
        {
          hql1 += " and exists(from Merchant m where m.id = "+rtUser.getOrganizationid()+"  and m.areaNode = '"+areaNode+"')";
        }
       
        hql += hql1;
      }else if(rtUser.isOrganization())
      {
        hql2 += " and u.usertype = 3 and u.organizationid = " +rtUser.getOrganizationid() ;
       
        if(!StringUtil.isEmptyStr(areaNode))
        {
          hql2 += " and exists(from Organization o where o.id = "+rtUser.getOrganizationid()+"  and o.JGSZQY = '"+areaNode+"')";
        }
       
        hql += hql2;
      }else
      {
        hql1 += " and u.usertype = 2 ";
        if(!StringUtil.isEmptyStr(areaNode))
        {
          hql1 += " and exists(from Merchant m where m.id = u.organizationid  and m.areaNode = '"+areaNode+"')";
        }
        hql2 += " and u.usertype = 3 ";
        if(!StringUtil.isEmptyStr(areaNode))
        {
          hql2 += " and exists(from Organization o where o.id = u.organizationid  and o.JGSZQY = '"+areaNode+"')";
        }
       
        hql = hql + hql1 + " union  " +hql + hql2;
      }
     
      List<User> us = userDao.listUser(hql);
      for(User u : us)
      {
        SendSms.sendSms(u.getMobile(), content);
        if(!StringUtil.isEmptyStr(mobiles))mobiles += ",";
        mobiles += u.getMobile();
       
        if(!StringUtil.isEmptyStr(users))users += ",";
        users += u.getTruename();
      }
    }else if("6".equals(sendType))
    {
      String hql = " from User u where u.enabled = true and u.locked = false  and u.sex = 2";
     
      String hql1 = "";
      String hql2 = "";
     
      if(rtUser.isMerchant())
      {
        hql1 += " and u.usertype = 2 and u.organizationid = " +rtUser.getOrganizationid() ;
        if(!StringUtil.isEmptyStr(areaNode))
        {
          hql1 += " and exists(from Merchant m where m.id = "+rtUser.getOrganizationid()+"  and m.areaNode = '"+areaNode+"')";
        }
       
        hql += hql1;
      }else if(rtUser.isOrganization())
      {
        hql2 += " and u.usertype = 3 and u.organizationid = " +rtUser.getOrganizationid() ;
       
        if(!StringUtil.isEmptyStr(areaNode))
        {
          hql2 += " and exists(from Organization o where o.id = "+rtUser.getOrganizationid()+"  and o.JGSZQY = '"+areaNode+"')";
        }
       
        hql += hql2;
      }else
      {
        hql1 += " and u.usertype = 2 ";
        if(!StringUtil.isEmptyStr(areaNode))
        {
          hql1 += " and exists(from Merchant m where m.id = u.organizationid  and m.areaNode = '"+areaNode+"')";
        }
        hql2 += " and u.usertype = 3 ";
        if(!StringUtil.isEmptyStr(areaNode))
        {
          hql2 += " and exists(from Organization o where o.id = u.organizationid  and o.JGSZQY = '"+areaNode+"')";
        }
       
        hql = hql + hql1 + " union " +hql + hql2;
      }
     
      List<User> us = userDao.listUser(hql);
      for(User u : us)
      {
        SendSms.sendSms(u.getMobile(), content);
        if(!StringUtil.isEmptyStr(mobiles))mobiles += ",";
        mobiles += u.getMobile();
       
        if(!StringUtil.isEmptyStr(users))users += ",";
        users += u.getTruename();
      }
    }else
    {
      String hql =  "";
      if("7".equals(sendType))
      {
         hql = " from User u where u.enabled = true and u.locked = false ";
        hql += " and u.usertype = 4 ";
       
        if(!StringUtil.isEmptyStr(areaNode))
        {
          hql += " and exists(from Organization o where o.jgfzr.id = u.id  and o.JGSZQY = '"+areaNode+"')";
        }else
        {
          hql += " and exists (from Organization o where o.jgfzr.id = u.id)";
        }
      }else if("8".equals(sendType))
      {
        hql = " from User u where u.enabled = true and u.locked = false ";
        hql += " and u.usertype = 3 ";
       
        if(!StringUtil.isEmptyStr(areaNode))
        {
          hql += " and exists(from Organization o where o.jgfzr.id = u.id  and o.JGSZQY = '"+areaNode+"')";
        }else
        {
          hql += " and exists (from Organization o where o.jgfzr.id = u.id)";
        }
      }else if("9".equals(sendType))
      {
        hql = " from User u where u.enabled = true and u.locked = false ";
       
        if(!StringUtil.isEmptyStr(areaNode))
        {
          hql += " and exists(from Merchant m where m.SJFRDB.id = u.id  and m.areaNode = '"+areaNode+"')";
        }else
        {
          hql += " and exists (from Merchant m where m.SJFRDB.id = u.id)";
        }
      }
     
      if(!StringUtil.isEmptyStr(hql))
      {
        List<User> us = userDao.listUser(hql);
        for(User u : us)
        {
          SendSms.sendSms(u.getMobile(), content);
          if(!StringUtil.isEmptyStr(mobiles))mobiles += ",";
          mobiles += u.getMobile();
View Full Code Here

Examples of com.lgx8.right.dao.IUserDao

    String phoneOrCard = request.getParameter("phoneOrCard");
    String score = request.getParameter("score");
    String content = request.getParameter("content");
   
    ApplicationContext ac = WebApplicationContextUtils.getWebApplicationContext(this.getServletContext());
    IUserDao userDao =  (IUserDao) ac.getBean("userDao");
   
    User to = userDao.findUserByPhone(phoneOrCard, phoneOrCard);
    PrintWriter out = response.getWriter();
    if(to == null)
    {
      out.print(1);
    }else
View Full Code Here

Examples of com.lgx8.right.dao.IUserDao

    String cardStart = request.getParameter("cardStart");
    String cardEnd = request.getParameter("cardEnd");
   
    ApplicationContext ac = WebApplicationContextUtils.getWebApplicationContext(this.getServletContext());
   
    IUserDao userDao = (IUserDao) ac.getBean("userDao");
   
    User user = userDao.findUserById(Long.parseLong(userId));
   
    PrintWriter out = response.getWriter();
   
    ICardDao cardDao = (ICardDao) ac.getBean("cardDao");
    List<Card> cards = cardDao.findCardByConditions(null, cardStart, cardEnd);
   
    if(user != null)
    {
      if(cards.size() == 0)
      {
        user.setCardStart((!"0".equals(user.getCardStart())||user.getCardStart() != null)?(user.getCardStart()+","+cardStart):cardStart);
        user.setCardEnd((!"0".equals(user.getCardEnd())||user.getCardEnd() != null)?(user.getCardEnd()+","+cardEnd):cardEnd);
       
        userDao.updateUser(user);
       
        out.println("1");
      }else
      {
        out.println("2");
View Full Code Here

Examples of com.lgx8.right.dao.IUserDao

   
    String str = "";
   
    if(count == 1 &&(mobile != null && !"".equals(mobile)))
    {
      IUserDao userDao = (IUserDao) ac.getBean("userDao");
      str = userDao.checkMobileExists(mobile);
    }
   
    try {
      PrintWriter out = response.getWriter();
      if(flag)
View Full Code Here

Examples of com.lgx8.right.dao.IUserDao

   */
  protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    String params = request.getParameter("params");
   
    ApplicationContext ac = WebApplicationContextUtils.getWebApplicationContext(this.getServletContext());
    IUserDao userDao = (IUserDao) ac.getBean("userDao");
   
    User user = userDao.getUserByMobileOrCard(params);
    response.setCharacterEncoding("UTF-8");
    PrintWriter pw = response.getWriter();
    if(user != null)
    {
      pw.write(user.getTruename() != null ? user.getTruename() : user.getUsername());
View Full Code Here

Examples of org.libreplan.business.users.daos.IUserDAO

    }

    @AssertTrue(message = "username is already being used by another user")
    public boolean isUniqueLoginNameConstraint() {

        IUserDAO userDAO = Registry.getUserDAO();

        if (isNewObject()) {
            return !userDAO.existsByLoginNameAnotherTransaction(loginName);
        } else {
            try {
                User u = userDAO.findByLoginNameAnotherTransaction(loginName);
                return u.getId().equals(getId());
            } catch (InstanceNotFoundException e) {
                return true;
            }
View Full Code Here

Examples of org.libreplan.business.users.daos.IUserDAO

    public boolean isUserNotBoundToOtherWorkerConstraint() {
        if (user == null || user.isNewObject()) {
            return true;
        }

        IUserDAO userDAO = Registry.getUserDAO();
        User foundUser = userDAO.findOnAnotherTransaction(user.getId());
        if (foundUser == null) {
            return true;
        }

        Worker worker = foundUser.getWorker();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.