Package com.lgx8.gateway.dao

Examples of com.lgx8.gateway.dao.ICardDao


    super.init(config);
    configuration = new Configuration();
        configuration.setServletContextForTemplateLoading(getServletContext(), "ftl/gateway");
        configuration.setDefaultEncoding("UTF-8");
       
        GatewayConfig gatewayConfig = (GatewayConfig) getServletContext().getAttribute("gatewayConfig");
        base.put("gatewayConfig", gatewayConfig);
   
    List<AreaCategory> areaCategorys = (List<AreaCategory>) getServletContext().getAttribute("areaCategorys");
    base.put("areaCategorys", areaCategorys);
   
View Full Code Here


   */
  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";
    if(cardid != null && !"".equals(cardid))
    {
      result2 =  cardDao.checkCardExists(cardid,rtU,(rtU.isMerchant()||rtU.isOrganization()));
    }
   
   
    PrintWriter pw = response.getWriter();
    pw.write(result1+":"+result2);
View Full Code Here

   */
  protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    RunTimeUser rtUser = RunTimeUser.getRunTimeUser(request);
   
    ApplicationContext ac = WebApplicationContextUtils.getWebApplicationContext(this.getServletContext());
    ICardDao cardDao = (ICardDao) ac.getBean("cardDao");
   
    Integer count = Integer.parseInt(request.getParameter("count"));
    String card = request.getParameter("card");
    Double score = Double.parseDouble(request.getParameter("score"));
    String mobile = request.getParameter("mobile");
    String email = request.getParameter("email");
   
    long car3 = Long.parseLong(card);
   
    Card temp = null;
   
    for(int i=1;i<=count;i++,car3++)
    {
      //生成卡号且卡号唯一
      String car = car3+"";
      temp = cardDao.createUserByCard(car.toUpperCase(), score, rtUser.getUsertype(), 1l, rtUser.getOrganizationid(), rtUser, rtUser,count==1?mobile:null,count==1?email:null);
    }
   
    if(count == 1 &&(mobile != null && !"".equals(mobile)) && temp != null)
    {
      //当开卡成功后发短信到手机尊敬的会员您的乐共享登录名13036780222,卡/号818800010022密/码abc123,请登录www.lgx8.com【乐共享】
View Full Code Here

    }
   
    List<Card> cards = new ArrayList<Card>();
   
    ApplicationContext ac = WebApplicationContextUtils.getWebApplicationContext(this.getServletContext());
    ICardDao cardDao = (ICardDao) ac.getBean("cardDao");
   
    cards = cardDao.findCardByConditions(rtUser.getId(), cardStart.toUpperCase(), cardEnd.toUpperCase());
   
    String[] headers = { "卡号", "密码", "积分" };
   
    int size = cards.size();
    int number = Integer.parseInt(numberStr);
View Full Code Here

   
    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)
      {
View Full Code Here

    long car3 = Long.parseLong(card);
   
    Boolean flag = false;
   
    ApplicationContext ac = WebApplicationContextUtils.getWebApplicationContext(this.getServletContext());
    ICardDao cardDao = (ICardDao) ac.getBean("cardDao");
   
    for(int i=1;i<=count;i++,car3++)
    {
      //生成卡号且卡号唯一
      String car = car3 + "";
     
      flag = cardDao.checkCardExists(car.toUpperCase());
     
      if(flag) break;
     
    }
   
View Full Code Here

    return getHibernateTemplate().find(hql);
  }
 
  public static void main(String[] args) {
    ApplicationContext ac = new ClassPathXmlApplicationContext("ApplicationContext.xml");
    ICategoryDao categoryDao = (ICategoryDao) ac.getBean("categoryDao");
    List<Category> list = categoryDao.findAllCategoryList(new Long(5));
    for(int i=0;i<list.size();i++) {
      System.out.println(list.get(i).getName());
    }
  }
View Full Code Here

      PrintWriter pw = response.getWriter();
     
      pw.write("1");
    }else if((!"".equals(categoryType)&&categoryType != null) && categoryId != null)
    {
      IGatewayCategoryDetailDao gatewayCategoryDetailDao = (IGatewayCategoryDetailDao) ac.getBean("gatewayCategoryDetailDao");
      GatewayCategoryDetail detail = gatewayCategoryDetailDao.findGatewayCategoryDetailById(Integer.parseInt(id));
      if(!"null".equals(entityId)&&!"".equals(entityId)&&entityId!=null)detail.setEntityId(entityId);
      if(!"null".equals(entityUrl)&&!"".equals(entityUrl)&&entityUrl!=null)detail.setEntityUrl(entityUrl);
      if(!"null".equals(otherUrl)&&!"".equals(otherUrl)&&otherUrl!=null)detail.setOtherUrl(otherUrl);
      if(!"null".equals(areaNode)&&!"".equals(areaNode)&&areaNode!=null)detail.setAreaNode(areaNode);
      if(!"null".equals(url)&&!"".equals(url)&&url!=null)detail.setUrl(url);
      if(!"null".equals(entityName)&&!"".equals(entityName)&&entityName!=null)detail.setEntityName(entityName);
     
      gatewayCategoryDetailDao.updateGatewayCategoryDetail(detail);
    }
   
  }
View Full Code Here

    //获得查询的条件
    String qtype = request.getParameter("qtype");
    //计算查询开始数据下标

    ApplicationContext ac = WebApplicationContextUtils.getWebApplicationContext(this.getServletContext());
    IOrderDao orderDao = (IOrderDao) ac.getBean("orderDao");
   
    IOrderService orderService = (IOrderService) ac.getBean("orderService");
   
    if("1".equals(hidden) || Integer.parseInt(hidden) == 1)
    {
      if(query!=null && !("").equals(query))
      {
        String[] q1 = qtype.split(",");
        String[] q2 = query.split(",");
        Map<String,Object> map = new HashMap<String, Object>();
        for(int i=0;i<q2.length;i++)
        {
          String[] q22 = q2[i].split("#");
          map.put(q22[0], q22.length > 1?q22[1]:"");
        }
       
        for(int i=0;i<q1.length;i++)
        {
          String q = q1[i].split(":")[0];
          String d = q1[i].split(":").length>1?q1[i].split(":")[1]:"";
          if("date".equals(d) && !"".equals(d))
          {
            String d1 = map.get(q).toString().split("&")[0];
            String d2 = map.get(q).toString().split("&").length >1?map.get(q).toString().split("&")[1]:"";
            hql += " and " + q + " >= str_to_date('"+d1+"','%Y-%m-%d %H:%i:%s')";
            hql += "".equals(d2)?"":" and " + q + " <= str_to_date('"+d2+"','%Y-%m-%d %H:%i:%s')";
          }else if(!"".equals(map.get(q)))
          {
            hql += " and " + q + " like '%"+map.get(q)+"%'";
          }
         
        }
      }
     
      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);
      //总搜索数据量设置
View Full Code Here

    return page;
  }

  public static void main(String[] args) {
    ApplicationContext ac = new ClassPathXmlApplicationContext("ApplicationContext.xml");
    IProductDao productDao = (IProductDao) ac.getBean("productDao");
    PageList page = productDao.findProduct(new Long(12), new String[]{"商品","4"}, 2, 5, "");
    System.out.println(page.getDataList().size());
    System.out.println();
  }
View Full Code Here

TOP

Related Classes of com.lgx8.gateway.dao.ICardDao

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.