Package com.lgx8.right.dao

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


    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

    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

    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

   
    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

   */
  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

    String tj_st = request.getParameter("tj_st");
    String tj_ed = request.getParameter("tj_ed");
    String fllx = request.getParameter("fllx");
    StringBuffer sb = new StringBuffer();
    PageArgument pr = getPageInfo(request);
    RunTimeUser rtUser = RunTimeUser.getRunTimeUser(request);
    if(tj_st!=null&&!tj_st.equals("")){
      sb.append(" and createdtime>=str_to_date('"+tj_st+"','%Y-%m-%d %H:%i:%s')");
    }
    if(tj_ed!=null&&!tj_ed.equals("")){
      sb.append(" and createdtime<=str_to_date('"+tj_ed+"','%Y-%m-%d %H:%i:%s')");
View Full Code Here

  }
 
  @RequestMapping("/rebate/modifyrebateruleinit.do")
  public ModelAndView modifyRebateruleInit(HttpServletRequest request,HttpServletResponse response){
    String re_id = request.getParameter("rrid");
    RunTimeUser rtUser = RunTimeUser.getRunTimeUser(request);
    if(re_id!=null&&re_id.length()>0){
      if(rtUser.getUsertype()==User.USER_TYPE_GSYG){
        Rebaterule rr = rechargeRebateService.getRebateRule(Long.parseLong(re_id));
        request.setAttribute("rebaterule", rr);
        return  new ModelAndView("/management/rebate/create_rebaterule");
      }else{
        return new ModelAndView("/management/rebate/list_rebaterule");
View Full Code Here

  }
 
  @RequestMapping("/rebate/deleterebaterule.do")
  public ModelAndView deleteRebateruleInit(HttpServletRequest request,HttpServletResponse response){
    String re_id = request.getParameter("rrid");
    RunTimeUser rtUser = RunTimeUser.getRunTimeUser(request);
    if(re_id!=null&&re_id.length()>0){
      if(rtUser.getUsertype()==User.USER_TYPE_GSYG){
        Rebaterule rr = rechargeRebateService.getRebateRule(Long.parseLong(re_id));
        rechargeRebateService.deleteRebateRule(rr);
      }
    }
    return new ModelAndView("/management/rebate/list_rebaterule");
View Full Code Here

    return new ModelAndView("/management/rebate/list_rebaterule");
  }
 
  @RequestMapping("/rebate/saverebate.do")
  public String saveRebateRule(HttpServletRequest request,HttpServletResponse response){
    RunTimeUser rtUser = RunTimeUser.getRunTimeUser(request);
    String fllv = request.getParameter("fllv");
    String fllx = request.getParameter("fllx");
    String flzt = request.getParameter("flzt");
    String flid = request.getParameter("rrid");
    Rebaterule rr = null;
    if(rtUser.getUsertype()==User.USER_TYPE_GSYG){
      if(flid!=null&&flid.length()>0&&!flid.equals("0")){
        long id = Long.parseLong(flid);
        rr = rechargeRebateService.getRebateRule(id);
        rr.setDELETEFLAG(flzt);
        rr.setFLLX(fllx);
View Full Code Here

TOP

Related Classes of com.lgx8.right.dao.IUserDao

Copyright © 2018 www.massapicom. 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.