Examples of IOrderService


Examples of com.lgx8.gateway.service.IOrderService

    //计算查询开始数据下标

    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);
      //总搜索数据量设置
      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");  
          response.setHeader("Pragma", "no-cache");  
          try {  
              response.getWriter().write(jsonStr);  
              response.getWriter().flush();  
              response.getWriter().close();
          } catch (IOException e) {  
              e.printStackTrace();  
          }
     
    }
    else if("2".equals(hidden))
    {
      String idStr = request.getParameter("orderId");
     
//      String[] ids = idStr.split(",");
     
      List<Orders> orderList = orderService.queryOrders("from Orders o where o.id in ("+idStr+")", new Object[]{});
      if(null!=orderList&&orderList.size()>0){
        Orders order = orderList.get(0);
        order.setConfirmtime(new Date());
        order.setStatus(Orders.STATUS_CONFIRM);
        orderService.updateOrder(order);
      }
      //跳转
      response.setContentType("text/html;charset=UTF-8");
      PrintWriter out = response.getWriter();
      out.print("<script type=\"text/javascript\">alert('\"确认收货\"成功');location.href='page/management/member/member_welcome.jsp?url=member_order.jsp'</script>");
View Full Code Here

Examples of com.lgx8.gateway.service.IOrderService

    //处理ajax返回数据乱码
    request.setCharacterEncoding("UTF-8");
    response.setCharacterEncoding("UTF-8");
   
    ApplicationContext ac = WebApplicationContextUtils.getWebApplicationContext(this.getServletContext());
    IOrderService ordersService = (IOrderService) ac.getBean("orderService");
   
    String id = request.getParameter("productid");
    String count = request.getParameter("count");
   
    String reload = request.getParameter("reload");
    String gotopay = request.getParameter("gotopay");
   
    String color = request.getParameter("selectColor");
    if(color==null) {
      color = "";
    }
    String clothesize = request.getParameter("selectClothesize");
    if(clothesize==null) {
      clothesize = "";
    }
    String shoesize = request.getParameter("selectShoesize");
    if(shoesize==null) {
      shoesize = "";
    }
    long productid = -1;
    try {
      productid = new Long(id);
    } catch (Exception e) {
      productid = 0;
    }
   
    int lcount = 0;
    try {
      lcount = new Integer(count);
    } catch (Exception e) {
      lcount = 0;
    }
   
    RunTimeUser user = null;
    try {
      user = RunTimeUser.getRunTimeUser(request);
    } catch (Exception e1) {
      user = null;
    }
    PrintWriter out = response.getWriter();
    //用户没登录,返回0表示失败  检查非法数据
    if(user==null||productid==-1||lcount==0) {
      out.print("0");
      out.flush();
      out.close();
      return;
    }
   
    Orders order = ordersService.createOrderProduct(user.getId(), productid, lcount, color, clothesize, shoesize);
   
    String result = "";
    if(order==null) {
      result = "$(\"#mini-cart-count\").html(0);";
      result += "$(\"#J-mini-cart-full\").hide();";
View Full Code Here

Examples of com.lgx8.gateway.service.IOrderService

  protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    request.setCharacterEncoding("UTF-8");
    response.setCharacterEncoding("UTF-8");
   
    ApplicationContext ac = WebApplicationContextUtils.getWebApplicationContext(this.getServletContext());
    IOrderService ordersService = (IOrderService) ac.getBean("orderService");
   
    String id = request.getParameter("id");
   
    RunTimeUser user = null;
    try {
      user = RunTimeUser.getRunTimeUser(request);
    } catch (Exception e1) {
      user = null;
    }
    PrintWriter out = response.getWriter();
    //用户没登录,返回0表示失败  检查非法数据
    if(user==null) {
      out.print("0");
      out.flush();
      out.close();
      return;
    }
   
    ordersService.deleteOrderProduct(new Long(id));
    Orders order = ordersService.findCartByUserId(user.getId());
    String result = "";
    result = "$(\"#mini-cart-count\").html("+order.getAmount()+");";
    result += "$(\"#optotal\").html('<em>"+order.getAmount()+"</em>件商品 总计<em>"+order.getAmountPrice()+"</em><span>积分</span>');";
   
   
View Full Code Here

Examples of com.lgx8.gateway.service.IOrderService

    } catch (Exception e1) {
      user = null;
    }
   
    ApplicationContext ac = WebApplicationContextUtils.getWebApplicationContext(this.getServletContext());
    IOrderService ordersService = (IOrderService) ac.getBean("orderService");
   
   
    if(user!=null) {
      root.put("user", user);
      Orders order = ordersService.findCartByUserId(user.getId());
      if(order!=null) {
        root.put("order", order);
      }
      root.put("delete_cart_product_url", Constants.DELETE_CART_PRODUCT_URL);
      root.put("show_cart_url", Constants.SHOW_CART_URL);
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.