Beispiel #1
0
  @Transactional
  public void payByOnlyCoup(OrderBean orderBean, CoupParm coupParm) {
    couponServiceParty.lockCoup(orderBean.getOrderNo(), coupParm.getCoupId());
    couponServiceParty.useCoup(coupParm.getCoupId(), orderBean.getOrderNo());
    orderService.updateOrderStatus(
        orderBean.getOrderNo(), OrderStatus.INITSTATE, OrderStatus.PAYSUCCESS);

    OrderType orderType = OrderType.getType(orderBean.getOrderType());
    BizType bizType = FundBizEnumConvter.getFundBizType(orderType);

    TradePayment tradePayment = new TradePayment();
    Date curtime = new Date(System.currentTimeMillis());
    tradePayment.setCreateTime(curtime);
    tradePayment.setOrderNo(orderBean.getOrderNo());
    tradePayment.setOrderPrice(orderBean.getPriceChannel());
    tradePayment.setPayActual(0.00d);
    tradePayment.setPayFee(0.00d);
    tradePayment.setPayNo(IDGenerotor.generatePayNo());
    tradePayment.setPaySubject("HBC券支付");
    tradePayment.setPayShould(orderBean.getPriceChannel());
    tradePayment.setPayGetway(GetWayEnum.COUP.value);
    tradePayment.setPayGatewayName(GetWayEnum.COUP.name);
    tradePayment.setUserAccountNo(orderBean.getUserAccount());
    tradePayment.setCoupId(coupParm.getCoupId());
    tradePayment.setCoupPay(
        DoubleUtil.subtractionDouble(orderBean.getPriceChannel(), coupParm.getcActualPrice()));
    tradePayment.setCouponInfo(coupParm.getCoupInfo());
    tradePayment.setPayStatus(PayStatus.SUCCESS.value);
    if (tradePaymentMapper.insert(tradePayment) == 0) {
      throw new PayException(PayReturnCodeEnum.PAY_INSERT_FAILED, orderBean.getOrderNo());
    }

    orderService.updateCoupInfos(orderBean, coupParm.getCoupId(), tradePayment);

    fundAccountService.pay(
        AccountEnums.HBC_COUP.value, tradePayment.getCoupPay(), bizType, orderBean.getOrderNo());
    fundAccountService.pay(
        AccountEnums.HBC_Guarantee.value,
        orderBean.getPriceChannel(),
        bizType,
        orderBean.getOrderNo());

    OrderLogParamBean orderLogParamBean = new OrderLogParamBean();
    orderLogParamBean.setContent(
        OrderLogType.PAYMENT_RESULT_CONTENT(
            orderBean.getAgentName(),
            orderBean.getUserName(),
            coupParm.getCoupId(),
            JSON.toJSONString(coupParm)));
    orderLogParamBean.setLogType(OrderLogType.PAYMENT_RESULT.type);
    orderLogParamBean.setOpType(OperationType.CUSTOMER.value);
    orderLogParamBean.setOpUserId(orderBean.getUserId());
    orderLogParamBean.setOpUserName(orderBean.getUserName());
    orderLogParamBean.setOrderNo(orderBean.getOrderNo());
    orderLogService.insertOrderLog(orderLogParamBean);
  }
Beispiel #2
0
  @Transactional
  public void cancelOrderWithoutMoney(String orderNo, String userId, String userName) {
    updateOrderStatus(orderNo, OrderStatus.INITSTATE, OrderStatus.CANCLE_CLOSE_NOPAY);

    updateOrderCancleTime(orderNo);
    OrderLogParamBean orderLogParamBean = new OrderLogParamBean();
    orderLogParamBean.setContent(
        OrderLogType.CANCEL_CONTENT(userName, TimeConverter.formatDate(new Date())));
    orderLogParamBean.setOpUserId(userId);
    orderLogParamBean.setLogType(OrderLogType.CANCEL.type);
    orderLogParamBean.setOpType(OperationType.CUSTOMER.value);
    orderLogParamBean.setOpUserId(userId);
    orderLogParamBean.setOpUserName(userName);
    orderLogParamBean.setOrderNo(orderNo);
    orderLogService.insertOrderLog(orderLogParamBean);
    orderTrackService.cancelled(orderNo);
  }