Exemplo n.º 1
0
  /**
   * 支付宝支付
   *
   * @author zhliu
   * @date 2015年6月30日
   * @param request
   * @param subOrderId : 子订单ID
   * @param subOrderNo:子订单号
   * @param payWay :线上支付渠道(1:积分支付;2支付宝支付;3:混合支付)
   * @return
   */
  @RequestMapping("onlinePaySetPayment")
  public String onlinePaySetPayment(
      HttpServletRequest request, String subOrderId, String subOrderNo, String payWay) {

    try {

      // 更新 订单 实付金额
      SubOrder subOrder = new SubOrder();
      subOrder.setSubOrderNo(subOrderNo);
      subOrder = subOrderManager.getBySample(subOrder).get(0);

      if (payWay != null
          && payWay.equals(String.valueOf(IBSConstants.PAY_WAY_ON_LINE_INTEGRAL))) { // 积分支付
        subOrder.setActuallyAmount(0.0);
        subOrder.setActuallyIntegral(subOrder.getPayableAmount());
      } else if (payWay != null
          && payWay.equals(String.valueOf(IBSConstants.PAY_WAY_ON_LINE_ALIPAY))) { // 支付宝支付
        subOrder.setActuallyAmount(subOrder.getPayableAmount());
        subOrder.setActuallyIntegral(0.0);
      } else {
        return null;
      }

      subOrderManager.save(subOrder);

      return "redirect:/onlinePay/aliPay/" + subOrderId;

    } catch (Exception e) {
      e.printStackTrace();
      logger.error(e.getMessage());
    }
    return null;
  }
Exemplo n.º 2
0
  /**
   * 积分支付
   *
   * @author zhliu
   * @date 2015年6月30日
   * @param request
   * @param response
   * @param subOrderNo:子订单号
   * @param payWay :线上支付渠道(1:积分支付;2支付宝支付;3:混合支付)
   * @param password :支付密码
   * @return
   */
  @RequestMapping("integralPaySetPayment")
  public String integralPaySetPayment(
      HttpServletRequest request,
      String subOrderId,
      String subOrderNo,
      String payWay,
      String password,
      Long orderId) {

    try {
      User user = (User) request.getSession().getAttribute(SecurityConstants.SESSION_USER);

      // 更新 订单 实付金额
      SubOrder subOrder = new SubOrder();
      subOrder.setSubOrderNo(subOrderNo);
      subOrder = subOrderManager.getBySample(subOrder).get(0);

      if (payWay != null
          && payWay.equals(String.valueOf(IBSConstants.PAY_WAY_ON_LINE_INTEGRAL))) { // 积分支付
        subOrder.setActuallyAmount(0.0);
        subOrder.setActuallyIntegral(subOrder.getPayableAmount());
      } else if (payWay != null
          && payWay.equals(String.valueOf(IBSConstants.PAY_WAY_ON_LINE_ALIPAY))) { // 支付宝支付
        subOrder.setActuallyAmount(subOrder.getPayableAmount());
        subOrder.setActuallyIntegral(0.0);
      } else {
        return null;
      }
      subOrderManager.save(subOrder);

      // 积分支付
      Map resultMap = orderManager.integralPay(subOrderId, user.getObjectId(), password);

      request.setAttribute("message", resultMap.get("message")); // 支付信息
      /*if(orderId == null){//子订单ID
      	return "redirect:"+"buyWelfareSubOrderSuc/"+subOrderId;
      }else{//总订单ID
      	return "redirect:"+"buyWelfareOrderSuc/"+orderId;
      }*/

      return "redirect:" + "buyWelfareSubOrderSuc/" + subOrderId;

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

    return null;
  }