Package com.lgx8.right.entities

Examples of com.lgx8.right.entities.RunTimeUser


   * */
  @RequestMapping(value="/member/addressQuery.do")
  public ModelAndView showAddress(HttpServletRequest request,HttpServletResponse response){
    System.out.println("--------------------Address------------------");
   
    RunTimeUser currentUser = RunTimeUser.getRunTimeUser(request);
    String receiver = request.getParameter("receiver");
    String mobile = request.getParameter("mobile");
    if(null==currentUser) {
      this.printJSON(response, (new PageList()).toJSON());
      return null;
    }
    String hql = " from Address a where a.user.id = ?";
    List list = new ArrayList();
    list.add(currentUser.getId());
    if(receiver!=null&&!"".equals(receiver.trim())){
      hql += " and a.name like ?";
      list.add("%"+receiver+"%");
    }
    if(mobile!=null&&!"".equals(mobile.trim())){
View Full Code Here


    String fromDate = request.getParameter("fromDate");
    String toDate = request.getParameter("toDate");
    AccountDetailQueryForm form = new AccountDetailQueryForm();
    form.setFromDate(fromDate);
    form.setToDate(toDate);
    RunTimeUser currentUser = RunTimeUser.getRunTimeUser(request);
    PageArgument argment = this.getPageInfo(request);
    PageList pageList = accountDetailService.queryAccountDetails(currentUser, argment, form);
    this.printJSON(response, pageList.toJSON());
    return null;
  }
View Full Code Here

  /**
   * 修改个人密码
   * */
  @RequestMapping(value="/member/modifypwd.do")
  public ModelAndView modifyLoginPasswd(HttpServletRequest request,HttpServletResponse response){
    RunTimeUser currentUser = RunTimeUser.getRunTimeUser(request);
    String paramId = request.getParameter("rd");
    String rd = (String)request.getSession().getAttribute("rd");
    if(rd!=null&&paramId.equals(rd)){
      request.setAttribute("url", MemberURLConst.URL_PWD_MODIFY);
      return new ModelAndView(MemberURLConst.URL_BASE);
    }
    if(null==currentUser) {
      return new ModelAndView("error");
    }
    String orignalPasswd = request.getParameter("orignalPasswd");
    User authuser = userCardService.auth(new User(currentUser.getUsername(),orignalPasswd));
    if(authuser==null){
      request.setAttribute("url", MemberURLConst.URL_PWD_MODIFY);
      request.setAttribute("errmsg", "原始密码不正确");
      if (currentUser.getUsertype() != User.USER_TYPE_NORMAL) {
        return new ModelAndView("/management/member/member_pwdmodify");
      }else{
        return new ModelAndView(MemberURLConst.URL_BASE);
      }
     
    }
    String confirmPasswd = request.getParameter("confirmPasswd");
    String newPwd  = EncryptUtil.toMD5(confirmPasswd);
    if(null!=newPwd){
      newPwd = newPwd.toUpperCase();
    }
    authuser.setPassword(newPwd);
    try{
      userCardService.updateUser(authuser);
    }catch (Exception e) {
      e.printStackTrace();
      request.setAttribute("errmsg", "密码修改失败");
      request.setAttribute("url", MemberURLConst.URL_PWD_MODIFY);
     
      if (currentUser.getUsertype() != User.USER_TYPE_NORMAL) {
        return new ModelAndView("/management/member/member_pwdmodify");
      }else{
        return new ModelAndView(MemberURLConst.URL_BASE);
      }

    }
    RunTimeUser.getRunTimeUser(request).updateUser(authuser);
    if (currentUser.getUsertype() != User.USER_TYPE_NORMAL) {
      return new ModelAndView("/management/member/member_pwdmodify");
    }
    request.setAttribute("url", MemberURLConst.URL_PWD_MODIFY);
    request.setAttribute("errmsg", "密码修改成功");
    return new ModelAndView(MemberURLConst.URL_BASE);
View Full Code Here

    Template temp = getConfiguration().getTemplate("miniNav.ftl");
   
    Map<Object, Object> root = new HashMap<Object, Object>();
    root.putAll(super.root);
   
    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;
    }
    root.put("user", user);
View Full Code Here

  @RequestMapping("/listMyMem.do")
  public ModelAndView queryMembersByMerchant(HttpServletRequest request,HttpServletResponse response){
    String st_time = request.getParameter("open_st");
    String ed_time = request.getParameter("open_ed");
    PageArgument pageArgment = getPageInfo(request);
    RunTimeUser rtUser = RunTimeUser.getRunTimeUser(request);
    long _orid = 0;
    long _type = 0l;
    if(rtUser!=null){
      _type = rtUser.getUsertype();
      if(_type==2){
        Merchant _or = (Merchant)userOrganizationMerchantService.getOrganizationOrMerchantByUser(rtUser);
        if(_or!=null){
          _orid = _or.getID();
        }
View Full Code Here

    String password = request.getParameter("password");
    String realName = request.getParameter("realName");
    String sex = request.getParameter("sex");
    String phoneNum = request.getParameter("phoneNum");
    String cardNum = request.getParameter("cardNum");
    RunTimeUser rtUser = RunTimeUser.getRunTimeUser(request);
    long _orid = 0;
    long _type = 0l;
    if(rtUser!=null){
      _type = rtUser.getUsertype();
      if(_type==2){
        Merchant _or = (Merchant)userOrganizationMerchantService.getOrganizationOrMerchantByUser(rtUser);
        if(_or!=null){
          _orid = _or.getID();
        }
View Full Code Here

    String st_time = request.getParameter("xf_st");
    String ed_time = request.getParameter("xf_ed");
    String xflx = request.getParameter("xf_hidden_lx");
    String hy_phone = request.getParameter("tel_phone");
    String hy_cardNum = request.getParameter("car_num");
    RunTimeUser rtUser = RunTimeUser.getRunTimeUser(request);
    PageArgument pageArgment = getPageInfo(request);
    StringBuffer sb = new StringBuffer();
    if(st_time!=null&&!st_time.equals("")){
      sb.append(" and t1.XFSJ>=str_to_date('"+st_time+"','%Y-%m-%d %H:%i:%s')");
    }
    if(ed_time!=null&&!ed_time.equals("")){
      sb.append(" and t1.XFSJ<=str_to_date('"+st_time+"','%Y-%m-%d %H:%i:%s')");
    }
    if(xflx!=null&&!xflx.equals("")){
      sb.append(" and t1.XFLX='"+xflx+"'");
    }
    if(hy_phone!=null&&hy_phone.length()>0){
      sb.append(" and t1.xfhy.mobile='"+hy_phone+"'");
    }
    if(hy_cardNum!=null&&hy_cardNum.length()>0){
      sb.append(" and t1.xfhy.card.id='"+hy_cardNum+"'");
    }
    long _type = 0l;
    if(rtUser!=null){
      _type = rtUser.getUsertype();
      if(_type==User.USER_TYPE_MERCHANT){
        Merchant _or = (Merchant)userOrganizationMerchantService.getOrganizationOrMerchantByUser(rtUser);
        if(_or!=null){
          sb.append(" and t1.merchant.id="+_or.getID());
        }
View Full Code Here

   */
  @RequestMapping("/listcustmerxf_tgz.do")
  public ModelAndView queryCustmerXFByOrganization(HttpServletRequest request,HttpServletResponse response){
    String st_time = request.getParameter("xf_st");
    String ed_time = request.getParameter("xf_ed");
    RunTimeUser rtUser = RunTimeUser.getRunTimeUser(request);
    PageArgument pageArgment = getPageInfo(request);
    long _orid = 0;
    long _type = 0l;
    if(rtUser!=null){
      _type = rtUser.getUsertype();
      if(_type==3){
        Organization _or = (Organization)userOrganizationMerchantService.getOrganizationOrMerchantByUser(rtUser);
        if(_or!=null){
          _orid = _or.getID();
        }
View Full Code Here

   */
  @RequestMapping("/savecustmerxf.do")
  public String saveCustmerXF(HttpServletRequest request,HttpServletResponse response) throws IOException{
    String xfje = request.getParameter("xfje");
    String cardNum = request.getParameter("cardNum");
    RunTimeUser rtUser = RunTimeUser.getRunTimeUser(request);
    if(xfje==null||xfje.equals("")){
      request.setAttribute("custmerxf", null);
    }
    if(cardNum!=null||cardNum.equals("")){
      request.setAttribute("custmerxf", null);
    }
    //long _orid = 0;
    long _type = 0l;
    Merchant _m = null;
    Custmerxf _xf = null;
    if(rtUser!=null){
      _type = rtUser.getUsertype();
      if(_type==2){
        _m = (Merchant)userOrganizationMerchantService.getOrganizationOrMerchantByUser(rtUser);
      }
    }
    User _u = userDao.findUserByPhone(cardNum,cardNum);
View Full Code Here

    String merchantIds = request.getParameter("merchantIds");
    String uts = request.getParameter("uts");
    String mobiles = request.getParameter("mobiles");
    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();
         
          if(!StringUtil.isEmptyStr(users))users += ",";
          users += u.getTruename();
        }
      }
     
    }
   
    MessageRecord record = new MessageRecord();
    record.setContent(content);
    record.setMobiles(mobiles);
    record.setRecordDate(new Date());
    record.setSendDate(new Date());
    record.setSender(rtUser.getTruename());
    record.setSendId(rtUser.getId()+"");
    record.setSendType("1");
    record.setState("2");
    record.setUserIds(userIds);
    if("1".equals(sendType))record.setUsers(mobiles);
    else record.setUsers(users);
View Full Code Here

TOP

Related Classes of com.lgx8.right.entities.RunTimeUser

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.