/** @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()); }
@Action( value = "/offlinePay/loadPaymentAmount", results = @Result( name = "payPayments", type = "json", params = {"includeProperties", "actualPayFloat"})) public String loadPaymentAmount() { PayPayment payment = payPaymentService.selectByPaymentTradeNoAndObjectId(paymentTradeNo, orderId + ""); this.setActualPayFloat(PriceUtil.convertToYuan(payment.getAmount())); return "payPayments"; }
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; }
@Action( value = "/offlinePay/loadPayPayments", results = @Result( name = "payPayments", type = "json", params = { "includeProperties", "payPaymentList\\[\\d+\\]\\.paymentTradeNo,payPaymentList\\[\\d+\\]\\.paymentTradeNo" })) public String loadPayments() { payPaymentList = payPaymentService.selectPayPaymentByObjectIdAndPaymentGatewayAndStatuss( orderId, paymentGateway, "'" + Constant.PAYMENT_SERIAL_STATUS.CREATE.name() + "','" + Constant.PAYMENT_SERIAL_STATUS.FAIL.name() + "'"); return "payPayments"; }