Example #1
0
  /**
   * 购买福利-生成订单 -- 根据子订单 ID 进行支付
   *
   * @author zhliu
   * @date 2015年7月3日
   * @parm
   * @param request
   * @param response
   * @param objectId : 子订单ID
   * @return
   */
  @RequestMapping("/buyWelfareSubOrderSuc/{objectId}")
  public String buyWelfareSubOrderSuc(HttpServletRequest request, @PathVariable Long objectId) {

    User user = (User) request.getSession().getAttribute(SecurityConstants.SESSION_USER);
    SubOrder subOrder = new SubOrder();
    double totalAmount = 0.0; // 应付总额
    Double sumPoint = 0.0; // 员工 积分
    Order order = new Order(); // 总订单
    try {
      // 查询剩余积分
      sumPoint = userManager.getUserBalance(user.getObjectId());
      subOrder = subOrderManager.getByObjectId(objectId);
      order = orderManager.getByObjectId(subOrder.getGeneralOrderId());
      totalAmount = subOrder.getPayableAmount();

      request.setAttribute("sumPoint", sumPoint);
      request.setAttribute("subOrder", subOrder);
      request.setAttribute("totalAmount", totalAmount);

      if (order.getPaymentWay() != null && order.getPaymentWay() == 2) {
        return HOME_DIR + "/buyWelfareOrder";
      } else {
        return HOME_DIR + "/buyWelfareOrderPayOffline";
      }

    } catch (Exception e) {
      e.printStackTrace();
      logger.error(e.getMessage());
    }

    return HOME_DIR + "/buyWelfareOrder";
  }
Example #2
0
  @RequestMapping("detail/{noticeId}")
  public String detail(
      HttpServletRequest request, HttpServletResponse response, @PathVariable Long noticeId) {
    Infomation infomation = infomationManager.getByObjectId(noticeId);
    User user = userManager.getUserByUserId(infomation.getCreatedBy());
    infomation.setCreateUserName(user.getUserName());
    request.setAttribute("infomation", infomation);

    InfomationNotice sample = new InfomationNotice();
    sample.setInfomationId(noticeId);
    List<InfomationNotice> notices = infomationNoticeManager.getBySample(sample);
    request.setAttribute("notices", notices);
    return getFileBasePath() + "detail";
  }