Package com.lgx8.management.entities

Examples of com.lgx8.management.entities.Custmerxf


  protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
   
    Map<Object, Object> root = new HashMap<Object, Object>();
    root.putAll(super.root);
    ApplicationContext ac = WebApplicationContextUtils.getWebApplicationContext(this.getServletContext());
    IGatewayService gatewayService = (IGatewayService) ac.getBean("gatewayService");
   
    List<Advertisement> advertisements = gatewayService.findAllAdvertisement();
   
    Template temp = getConfiguration().getTemplate("listAdvertisement.ftl");
   
    root.put("advertisements", advertisements);
   
View Full Code Here


    Map<Object, Object> root = new HashMap<Object, Object>();
    root.putAll(super.root);
    Template temp = getConfiguration().getTemplate("selectImage.ftl");
   
    ApplicationContext ac = WebApplicationContextUtils.getWebApplicationContext(this.getServletContext());
    IGatewayService gatewayService = (IGatewayService) ac.getBean("gatewayService");
   
    List<ProductImage> productImages = gatewayService.findProductImageListOrderByTime("desc");
   
    if(productImages!=null&&productImages.size()>0) {
      root.put("productImages", productImages);
    }
   
View Full Code Here

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

    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

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

  }

  public Custmerxf createCustmerXF(Merchant m, User u,double xfje,double hdjfs) {
    long p_type = 0l;
    long p_id = 0l;
    Custmerxf _xf = new Custmerxf();
    if(u.getUsertype()==User.USER_TYPE_NORMAL){
      p_type = u.getParenttype();
      p_id = u.getOrganizationid();
    }
   
    if(p_type == 0&& p_id == 0)
    {
      p_type = 2l;
      p_id = m.getID();
    }
   
    if(u!=null&&u.getCard()!=null){
      double sc = u.getCard().getScore();
      u.getCard().setScore(sc+hdjfs);
      cardDao.updateCard(u.getCard());
    }
   
    Date date = new Date();
   
    if(p_id!=0&&p_type!=0){
      Rebate re = new Rebate();
      Rebaterule re_rule = null;
      double flje = 0.0;
      if(p_type==3){
        Organization or = organizationDao.getOrganizationById(p_id);
        double qbsj = or.getFlqb();
        _xf.setXFLX("02");
        re_rule = rebateRuleDao.findRebateRuleByLx("02");
        if(re_rule!=null){
        flje = xfje*re_rule.getFLLV();
          re.setFLED(flje);
          re.setFLSJ(date);
          re.setFLSYFBH(p_id);
          re.setFLLX("02");
          or.setFlqb(qbsj+flje);
          re.setRESERVATION01(u.getTruename());
          re.setRESERVATION02(u.getId()+"");
          re.setRESERVATION03(or.getJGMC());
          organizationDao.updateOrganization(or);
          rebateDao.createRebate(re);
        }
      }
      if(p_type==2){
        if(p_id!=m.getID()){
          re_rule = rebateRuleDao.findRebateRuleByLx("01");
          Merchant _m = merchantDao.getMerchantById(p_id);
          double qbsj = m.getFlqb();
          if(re_rule!=null){
            flje = xfje*re_rule.getFLLV();
            re.setFLED(flje);
            re.setFLSJ(date);
            re.setFLSYFBH(p_id);
            re.setFLLX("01");
            re.setRESERVATION01(u.getTruename());
            re.setRESERVATION02(u.getId()+"");
            re.setRESERVATION03(_m.getSJMC());
            _m.setFlqb(qbsj+flje);
            merchantDao.updateMerchant(_m);
            rebateDao.createRebate(re);
          }
          _xf.setXFLX("02");
        }else{
          _xf.setXFLX("01");
        }
      }
      /**
       * kou chu jf
       */
      double syjfs = m.getSYJFSL();
      m.setSYJFSL(syjfs-hdjfs);
      merchantDao.updateMerchant(m);
      _xf.setXfhy(u);
      _xf.setXFJE(xfje);
      _xf.setHDJFS(xfje);
      _xf.setXFSJ(date);
      _xf.setMerchant(m);
      custmerXFDao.createCustmerXF(_xf);
      return _xf;
    }
    return null;
  }
View Full Code Here

  @RequestMapping("/recharge/initrecharge.do")
  public String initRechargePage(HttpServletRequest request,HttpServletResponse response){
    RunTimeUser rtUser = RunTimeUser.getRunTimeUser(request);
    if(rtUser!=null&&rtUser.getUsertype()==User.USER_TYPE_MERCHANT){
      long _mid = rtUser.getOrganizationid();
      Merchant _m = merchantDao.getMerchantById(_mid);
      request.setAttribute("merchant", _m);
    }
    return "/management/recharge/create_rechargehistory";
  }
View Full Code Here

  @RequestMapping("/recharge/initrechargeapply.do")
  public String initRechargePageApply(HttpServletRequest request,HttpServletResponse response){
    RunTimeUser rtUser = RunTimeUser.getRunTimeUser(request);
    if(rtUser!=null&&rtUser.getUsertype()==User.USER_TYPE_MERCHANT){
      long _mid = rtUser.getOrganizationid();
      Merchant _m = merchantDao.getMerchantById(_mid);
      request.setAttribute("merchant", _m);
    }
    return "/management/recharge/create_rechargeapply";
  }
View Full Code Here

    String czje = request.getParameter("czje");
    String czjf = "";
    String[] is_nore = request.getParameterValues("is_nore");
    if(rtUser!=null&&rtUser.getUsertype()==User.USER_TYPE_MERCHANT){
      long _mid = rtUser.getOrganizationid();
      Merchant _m = merchantDao.getMerchantById(_mid);
      Rechargehistory rechargeh = new Rechargehistory();
      rechargeh.setCZYHBH(rtUser);
      rechargeh.setCZSJ(new Date());
      rechargeh.setRESERVATION01(Rechargehistory.RECHARGEHISTORY_CZLX_SDCZ);
      rechargeh.setCzzt(Rechargehistory.RECHARGEHISTORY_INIT);
View Full Code Here

    RunTimeUser rtUser = RunTimeUser.getRunTimeUser(request);
    String czje = request.getParameter("czje");
    String czjf = "";
    String[] is_nore = request.getParameterValues("is_nore");
    if(rtUser!=null&&rtUser.getUsertype()==User.USER_TYPE_MERCHANT){
      Merchant _m = merchantDao.getMerchantById(rtUser.getOrganizationid());
      Rechargehistory rechargeh = new Rechargehistory();
      rechargeh.setCZYHBH(rtUser);
      rechargeh.setCZSJ(new Date());
      rechargeh.setCzzt(Rechargehistory.RECHARGEHISTORY_INIT);
      rechargeh.setCZJE(Double.parseDouble(czje==null?"0":czje));
View Full Code Here

    int curPage = Integer.parseInt(str_curPage==null?"1":str_curPage);
    User user = RunTimeUser.getRunTimeUser(request);
    if(user.getUsertype()==User.USER_TYPE_MERCHANT){
      long m_id = user.getOrganizationid();
      if(m_id!=0){
        Merchant m = merchantDao.getMerchantById(m_id);
        name = m.getSJMC();
      }
    }
    List<RechargeHistoryCount> list = rechargeHistoryCountService.getRechargeHistoryCount(name, st_time, ed_time, curPage-1);
    int count = rechargeHistoryCountService.getRechargeHistoryCountPageCount(name, st_time, ed_time);
    request.setAttribute("list", list);
View Full Code Here

TOP

Related Classes of com.lgx8.management.entities.Custmerxf

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.