/**
  * 展示修改人数.
  *
  * @param ordOrder
  */
 public void showTotalQuantity(List<OrdOrderItemMeta> orderItemMetas) {
   long child = 0;
   long adult = 0;
   long totalPrice = 0;
   OrdOrder ordOrder =
       orderServiceProxy.queryOrdOrderByOrderId(orderItemMetas.get(0).getOrderId());
   for (OrdOrderItemMeta orderItemMeta : orderItemMetas) {
     adult += orderItemMeta.getTotalAdultQuantity();
     child += orderItemMeta.getTotalChildQuantity();
     long price = 0;
     for (OrdOrderItemProd ordOrderItemProd : ordOrder.getOrdOrderItemProds()) {
       if (ordOrderItemProd.getOrderItemProdId().equals(orderItemMeta.getOrderItemId())) {
         price = ordOrderItemProd.getPrice();
         break;
       }
     }
     totalPrice += price * orderItemMeta.getQuantity();
   }
   showTotalQuantity.setValue(
       "总人数:" + (child + adult) + "            (成人" + adult + " 儿童" + child + ")");
   passPortInfo.setAdult(adult);
   passPortInfo.setChild(child);
   passPortInfo.setPrice(totalPrice);
   passPortInfo.setPriceYuan(String.valueOf((totalPrice / 100)));
   this.showTotalPrice.setValue(passPortInfo.getPriceYuan());
 }
  /** @return */
  @Action(value = "/offlinePay/onlinePaySave")
  public void doSave() {
    JSONResult result = new JSONResult();
    try {
      Assert.hasText(paymentTradeNo, "对账流水号不可以为空");
      Assert.hasText(gatewayTradeNo, "银行交易流水号不可以为空");
      Assert.hasText(refundSerial, "退款流水号不可以为空");
      Assert.notNull(callbackTime, "交易时间不可以为空");

      PayPayment payment =
          payPaymentService.selectByPaymentTradeNoAndObjectId(paymentTradeNo, orderId + "");
      payment.setStatus(Constant.PAYMENT_SERIAL_STATUS.SUCCESS.name());
      payment.setCallbackTime(callbackTime);
      payment.setRefundSerial(refundSerial.trim());
      payment.setGatewayTradeNo(gatewayTradeNo.trim());
      payment.setCallbackInfo("[线下支付]" + memo.trim());
      payment.setStatus(Constant.PAYMENT_SERIAL_STATUS.SUCCESS.name());
      payment.setOperator(getOperatorName());
      payPaymentService.updatePayment(payment);
      if (payment.isPrePayment()) {
        // 更新预授权支付数据
        payPaymentService.updatePrePayment(payment);
      }
      paymentId = payment.getPaymentId();
      if (payment != null && payment.isSuccess()) {
        if (Constant.PAYMENT_BIZ_TYPE.SUPER_ORDER.name().equalsIgnoreCase(payment.getBizType())) {
          OrdOrder order = orderServiceProxy.queryOrdOrderByOrderId(payment.getObjectId());
          if (payment.isPrePayment() && order.isApprovePass()) {
            Message msg = MessageFactory.newOrderApproveBeforePrepayMessage(order.getOrderId());
            msg.setAddition(Constant.PAYMENT_BIZ_TYPE.SUPER_ORDER.name());
            orderMessageProducer.sendMsg(msg);
          } else if (order.isApproveFail()) {
            orderServiceProxy.autoCreateOrderFullRefund(order, super.getOperatorName(), "资源审核不通过");
          }
        }
        ComLog log = new ComLog();
        log.setObjectId(payment.getPaymentId());
        log.setObjectType("PAY_PAYMENT");
        log.setParentId(payment.getObjectId());
        log.setParentType("ORD_ORDER");
        log.setLogType("PAYMENT_TYPE_OFFLINE");
        log.setLogName("手工线下支付");
        log.setOperatorName(this.getOperatorName());
        log.setContent("由操作人员" + getOperatorName() + "使用" + payment.getPayWayZh() + "线下支付方式支付");
        log.setCreateTime(new Date());
        comLogService.addComLog(log);
        resourceMessageProducer.sendMsg(
            MessageFactory.newPaymentSuccessCallMessage(payment.getPaymentId()));
      }
      result.put("paymentId", paymentId);
    } catch (Exception ex) {
      result.raise(new JSONResultException(ex.getMessage()));
    }
    result.output(getResponse());
  }
 @Override
 public Long getDiscountAmount(OrdOrder order, Long discountAmount) {
   if (isApply(order, discountAmount)) {
     return order.getMainProduct().getPrice()
         * order.getMainProduct().getQuantity()
         * (100 - (null == this.discountAmount ? this.getArgumentY() : this.discountAmount))
         / 100;
   } else {
     return 0L;
   }
 }
  private String buildOrderInfo(PassCode passCode) {
    OrdOrder ordorder = orderServiceProxy.queryOrdOrderByOrderId(passCode.getOrderId());
    // 取票人/联系人的证件号
    cardNum = ordorder.getContact().getCertNo();
    List<PayPayment> payList =
        payPaymentService.selectByObjectIdAndBizType(
            ordorder.getOrderId(), Constant.PAYMENT_BIZ_TYPE.SUPER_ORDER.name());
    for (PayPayment payment : payList) {
      if (payment.isSuccess()) {
        GugongOrder gugongorder = new GugongOrder(payment, ordorder, passCode.getSerialNo());
        return gugongorder.getJSON();
      }
    }

    return null;
  }
 @Override
 Map<String, Object> getContentData() {
   Map<String, Object> data = new HashMap<String, Object>();
   data.put("orderId", objectId);
   Date theTime = DateUtil.getDateAfterMinutes(order.getWaitPayment());
   data.put("time", DateUtil.getFormatDate(theTime, "yyyy-MM-dd HH:mm"));
   String waitPaymentRemind = "";
   if (OrderUitl.hasWaitpaymentChange(order)) {
     waitPaymentRemind = MSG;
   }
   data.put("waitPaymentRemind", waitPaymentRemind);
   return data;
 }
 @Override
 public void continueData(OrdOrder order, ProdProduct product, Map<String, Object> result) {
   Object traveller = result.get("traveller");
   Object orderPersonCount = result.get("orderPersonCount");
   boolean isAddCount = false;
   if (null != orderPersonCount) {
     String count = orderPersonCount.toString();
     Long amount = Long.parseLong(count);
     if (amount > 1) {
       isAddCount = true;
     }
   }
   if (null != traveller && isAddCount) {
     result.put("traveller", traveller + "(等共" + orderPersonCount + "人)");
   }
   // 团号:计调中订单所对应的团号
   result.put("groupNo", order.getTravelGroupCode());
 }
  @Override
  Map<String, Object> getContentData() {
    Map<String, Object> data = new HashMap<String, Object>();

    StringBuffer content = new StringBuffer();
    content.append(productName);

    Map<String, Object> params = new HashMap<String, Object>();
    params.put("codeList", codeIds);
    List<PassCode> passCodeList = passCodeService.queryPassCodeByParam(params);
    for (PassCode passCode : passCodeList) {
      content.append(passCode.getSmsContent());
    }

    data.put("orderId", objectId);
    data.put("visitDate", DateUtil.formatDate(order.getVisitTime(), "yyyy-MM-dd"));
    data.put("content", content.toString());
    return data;
  }
 @Override
 ProdChannelSms getSmsTemplate() {
   OrdOrder order = orderDAO.selectByPrimaryKey(objectId);
   return prodChannelSmsDAO.selectByTemplateIdAndChannelCode(
       order.getChannel(), Constant.SMS_TEMPLATE.MERGED_SMSCONTENT.name());
 }
 @Override
 public boolean isApply(OrdOrder order, Long discountAmount) {
   return null != order
       && null != order.getMainProduct()
       && order.getMainProduct().getQuantity() >= this.getArgumentX();
 }
 @Override
 ProdChannelSms getSmsTemplate() {
   return prodChannelSmsDAO.selectByTemplateIdAndChannelCode(
       order.getChannel(), Constant.SMS_TEMPLATE.PAYMENT_REMIND.name());
 }