/** @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()); }
private void addComLog(PassCode passCode, String logContent, String logName) { ComLog log = new ComLog(); log.setObjectType("PASS_CODE"); log.setParentId(passCode.getOrderId()); log.setObjectId(passCode.getCodeId()); log.setOperatorName("SYSTEM"); log.setLogType(Constant.COM_LOG_ORDER_EVENT.systemApprovePass.name()); log.setLogName(logName); log.setContent(logContent); comLogService.addComLog(log); }