|
|
@@ -6,18 +6,17 @@ import com.github.microservice.pay.client.ret.ResultState;
|
|
|
import com.github.microservice.types.OrderState;
|
|
|
import com.github.microservice.types.payment.PaymentType;
|
|
|
import com.zhongshu.card.client.model.operLogs.OperationLogsAddParam;
|
|
|
-import com.zhongshu.card.client.model.org.OrganizationMiniModel;
|
|
|
import com.zhongshu.card.client.model.payment.ExpenseRefundParam;
|
|
|
import com.zhongshu.card.client.type.LogsLevel;
|
|
|
import com.zhongshu.card.client.type.MessageType;
|
|
|
import com.zhongshu.card.client.type.RefundState;
|
|
|
+import com.zhongshu.card.client.type.payment.OrderNoType;
|
|
|
import com.zhongshu.card.client.type.payment.SettlementState;
|
|
|
import com.zhongshu.card.client.utils.DateUtils;
|
|
|
import com.zhongshu.card.client.utils.PayExceptionToShowUtil;
|
|
|
import com.zhongshu.card.server.core.dao.payment.ExpenseFlowDao;
|
|
|
import com.zhongshu.card.server.core.dao.payment.PaymentProcessDao;
|
|
|
import com.zhongshu.card.server.core.domain.org.Organization;
|
|
|
-import com.zhongshu.card.server.core.domain.paySetting.ProjectMainPaySetting;
|
|
|
import com.zhongshu.card.server.core.domain.payment.ExpenseFlow;
|
|
|
import com.zhongshu.card.server.core.domain.payment.PaymentProcess;
|
|
|
import com.zhongshu.card.server.core.domain.schedule.ScheduleTaskConfig;
|
|
|
@@ -81,6 +80,9 @@ public class PayCallService extends SuperService {
|
|
|
@Autowired
|
|
|
private CommonService commonService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private OrderNoInfoService orderNoInfoService;
|
|
|
+
|
|
|
/**
|
|
|
* 统一调用支付服务
|
|
|
*
|
|
|
@@ -105,7 +107,7 @@ public class PayCallService extends SuperService {
|
|
|
return ResultContent.buildFail(msg);
|
|
|
}
|
|
|
log.info("开始支付: {} {}", entity.getPaymentNo(), paymentTypes);
|
|
|
- int maxTime = 4 * 1000;
|
|
|
+ int maxTime = 2 * 1000;
|
|
|
boolean b = false;
|
|
|
for (PaymentType paymentType : paymentTypes) {
|
|
|
entity = expenseFlowDao.findTopById(entity.getId());
|
|
|
@@ -192,6 +194,8 @@ public class PayCallService extends SuperService {
|
|
|
paymentProcess.setPayMillis(paymentProcess.getPayEndTime() - paymentProcess.getPayStartTime());
|
|
|
paymentProcess.setTimeStr(DateUtils.paresTime(System.currentTimeMillis(), DateUtils.FORMAT_LONG));
|
|
|
paymentProcessDao.save(paymentProcess);
|
|
|
+
|
|
|
+ orderNoInfoService.saveInfo(entity.getPaymentNo(), OrderNoType.Pay, entity.getPaymentType());
|
|
|
} else {
|
|
|
String msg = resultContent.getMsg();
|
|
|
if (StringUtils.isNotEmpty(msg) && msg.contains("Connection reset")) {
|
|
|
@@ -274,6 +278,7 @@ public class PayCallService extends SuperService {
|
|
|
logsAddParam.setMessageType(MessageType.Info);
|
|
|
logsAddParam.setLevel(LogsLevel.Low);
|
|
|
logsAddParam.setContent(msg);
|
|
|
+ orderNoInfoService.saveInfo(entity.getPaymentNo(), OrderNoType.Pay, entity.getPaymentType());
|
|
|
} else {
|
|
|
String msg = resultContent.getMsg();
|
|
|
if (StringUtils.isNotEmpty(msg) && msg.contains("Connection reset")) {
|
|
|
@@ -421,6 +426,8 @@ public class PayCallService extends SuperService {
|
|
|
public ResultContent<List<TransactionLogModel>> walletRefund(ExpenseFlow entity, ExpenseRefundParam param) {
|
|
|
String refundNo = NextNoUtil.getNextPaymentNo(null);
|
|
|
entity.setRefundNo(refundNo);
|
|
|
+ orderNoInfoService.saveInfo(refundNo, OrderNoType.Refund, entity.getPaymentType());
|
|
|
+
|
|
|
com.github.microservice.pay.client.ret.ResultContent<List<TransactionLogModel>> resultContent = balancePayService.refund(entity.getProjectOid(), entity.getShopOid(), entity.getUserId(), refundNo, entity.getPayAmount(), param.getRemark());
|
|
|
if (resultContent.getState() == ResultState.Success) {
|
|
|
return ResultContent.buildSuccess(resultContent.getContent());
|
|
|
@@ -438,9 +445,9 @@ public class PayCallService extends SuperService {
|
|
|
String refundNo = NextNoUtil.getNextPaymentNo(null);
|
|
|
entity.setRefundNo(refundNo);
|
|
|
String paymentNo = entity.getPaymentNo();
|
|
|
+ orderNoInfoService.saveInfo(refundNo, OrderNoType.Refund, entity.getPaymentType());
|
|
|
|
|
|
- ResultContent resultContent = chinaumsSenselessPayService.refund(entity.getProjectOid(), entity.getShopOid(), entity.getUserId(),
|
|
|
- entity.getPayAmount(), paymentNo, refundNo, param.getRemark());
|
|
|
+ ResultContent resultContent = chinaumsSenselessPayService.refund(entity.getProjectOid(), entity.getShopOid(), entity.getUserId(), entity.getPayAmount(), paymentNo, refundNo, param.getRemark());
|
|
|
if (resultContent.isSuccess()) {
|
|
|
return ResultContent.buildSuccess(resultContent.getContent());
|
|
|
} else {
|
|
|
@@ -448,6 +455,17 @@ public class PayCallService extends SuperService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 银联云闪付 退款回调
|
|
|
+ *
|
|
|
+ * @param paymentNo
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public ResultContent unionFrictionlessPayRefundFinish(String paymentNo) {
|
|
|
+
|
|
|
+ return ResultContent.buildSuccess();
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 结算
|
|
|
*
|