Package com.lgx8.common.dao

Examples of com.lgx8.common.dao.IMessageRecordDao


  public PageList findSupplierPage(int pageno, int pagesize) {
    String hql = "";
    hql = "from Supplier s where s.isdelete=0 order by s.id desc";
    Object[] values = new Object[]{};
    PageList page = findByPage4Report(hql, values, pageno, pagesize);
    return page;
  }
View Full Code Here


  }

  public PageList findBrandPage(int pageno, int pagesize) {
    String hql = "from Brand b where b.isdelete=0 order by b.id desc";
    Object[] values = new Object[]{};
    PageList page = findByPage4Report(hql, values, pageno, pagesize);
    return page;
  }
View Full Code Here

      }
      hql += ") "+" order by p.createdate desc";
     
    }
    Object[] values = new Object[]{};
    PageList page = findByPage4Report(hql, values, pageno, pagesize);
    return page;
  }
View Full Code Here

      }
    }
    hql += "order by s.id desc";
   
    Object[] values = new Object[]{};
    PageList page = findByPage4Report(hql, values, pageno, pagesize);
    return page;
  }
View Full Code Here

      }
    }
    hql += "order by b.id desc";
   
    Object[] values = new Object[]{};
    PageList page = findByPage4Report(hql, values, pageno, pagesize);
    return page;
  }
View Full Code Here

      hql += conditions ;
    }
   
    hql += " order by orderTime desc";
   
    PageList page = this.findByPage4Report(hql, new Object[]{}, pageNum, pageSize);
   
    return page;
  }
View Full Code Here

      if(sb.toString()!=null&&!sb.toString().equals("")){
        hql = " from Rechargehistory t1 where "+sb.toString().substring(4)+" order by t1.CZSJ desc";
      }else{
        hql = " from Rechargehistory t1 order by t1.CZSJ desc";
      }
      PageList list = rechargehistoryDao.listRechargehistoryByConditions(hql, new Object[]{}, pr);
      printJSON(response, list.toJSON());
    }
    return null;
  }
View Full Code Here

   
    RunTimeUser rtUser = RunTimeUser.getRunTimeUser(request);
    if(rtUser!=null&&rtUser.getUsertype()==User.USER_TYPE_GSYG){
      String hql = "";
        hql = "from Rechargehistory where ifnull(deleteflag,'0')='0' "+sb.toString()+" order by czsj desc";
      PageList list = rechargehistoryDao.listRechargehistoryByConditions(hql, new Object[]{}, pr);
      printJSON(response, list.toJSON());
    }
    return null;
  }
View Full Code Here

        }
      }
     
      hql += " order by o.id desc";
     
      PageList list = orderDao.findByPage4Report(hql, new Object[]{}, Integer.parseInt(page), Integer.parseInt(maxResult));
      //当前页数设置
      pageInfo.put("page", page);
      //当前页数设置
      pageInfo.put("size", maxResult);
      //总搜索数据量设置
      pageInfo.put("total", list.getTotalRecordNum());
     
      String jsonStr = creMessageJSON(list.getDataList(), pageInfo);
      //response相关处理
      response.setContentType("html/txt");
      response.setCharacterEncoding("utf-8");  
          response.setHeader("Pragma", "no-cache");  
          response.setHeader("Cache-Control", "no-cache, must-revalidate");  
View Full Code Here

   
    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);
   
    messageRecordDao.createMessageRecord(record);
   
    response.setContentType("text/html; charset=UTF-8");
        response.setCharacterEncoding("UTF-8");
        request.setCharacterEncoding("UTF-8");
    PrintWriter out = response.getWriter();
View Full Code Here

TOP

Related Classes of com.lgx8.common.dao.IMessageRecordDao

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.