|
@@ -1,6 +1,7 @@
|
|
|
package com.zhongshu.card.server.core.service.pay;
|
|
package com.zhongshu.card.server.core.service.pay;
|
|
|
|
|
|
|
|
import com.github.microservice.components.data.base.util.PageEntityUtil;
|
|
import com.github.microservice.components.data.base.util.PageEntityUtil;
|
|
|
|
|
+import com.github.microservice.components.data.mongo.queue.service.ExecQueueService;
|
|
|
import com.github.microservice.core.util.JsonUtil;
|
|
import com.github.microservice.core.util.JsonUtil;
|
|
|
import com.github.microservice.pay.client.model.AccountModel;
|
|
import com.github.microservice.pay.client.model.AccountModel;
|
|
|
import com.github.microservice.pay.client.model.PayProductChannelConf;
|
|
import com.github.microservice.pay.client.model.PayProductChannelConf;
|
|
@@ -26,6 +27,7 @@ import com.zhongshu.card.client.model.pay.WithdrawOrderModel;
|
|
|
import com.zhongshu.card.client.model.pay.WithdrawPageParam;
|
|
import com.zhongshu.card.client.model.pay.WithdrawPageParam;
|
|
|
import com.zhongshu.card.client.model.pay.WithdrawParam;
|
|
import com.zhongshu.card.client.model.pay.WithdrawParam;
|
|
|
import com.zhongshu.card.client.model.paySetting.paySetting.OrgPayConfigModel;
|
|
import com.zhongshu.card.client.model.paySetting.paySetting.OrgPayConfigModel;
|
|
|
|
|
+import com.zhongshu.card.client.type.AuditStatus;
|
|
|
import com.zhongshu.card.client.type.WithdrawStatus;
|
|
import com.zhongshu.card.client.type.WithdrawStatus;
|
|
|
import com.zhongshu.card.client.type.paySetting.WithdrawMethodType;
|
|
import com.zhongshu.card.client.type.paySetting.WithdrawMethodType;
|
|
|
import com.zhongshu.card.client.utils.DateUtils;
|
|
import com.zhongshu.card.client.utils.DateUtils;
|
|
@@ -90,6 +92,9 @@ public class WithdrawService extends SuperService {
|
|
|
@Autowired
|
|
@Autowired
|
|
|
PayProductAccountService payProductAccountService;
|
|
PayProductAccountService payProductAccountService;
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ ExecQueueService execQueueService;
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 查询可提现余额
|
|
* 查询可提现余额
|
|
|
*/
|
|
*/
|
|
@@ -149,13 +154,16 @@ public class WithdrawService extends SuperService {
|
|
|
PayProductParameter<Object> parameter = new PayProductParameter<>();
|
|
PayProductParameter<Object> parameter = new PayProductParameter<>();
|
|
|
parameter.setAccountName(projectAccount);
|
|
parameter.setAccountName(projectAccount);
|
|
|
parameter.setMeta(Map.of("mchntNo", withdrawMchId));
|
|
parameter.setMeta(Map.of("mchntNo", withdrawMchId));
|
|
|
- ResultContent<Object> resultContent = senselessPayService.withdrawAmountQuery(parameter);
|
|
|
|
|
|
|
+ ResultContent<Object> resultContent = senselessPayService.withdrawAmountQuery(parameter);
|
|
|
if (!resultContent.getState().equals(ResultState.Success)){
|
|
if (!resultContent.getState().equals(ResultState.Success)){
|
|
|
- return null;
|
|
|
|
|
|
|
+ return com.github.microservice.net.ResultContent.buildFail(resultContent.getMsg());
|
|
|
}
|
|
}
|
|
|
String data = JsonUtil.toJson(resultContent.getContent());
|
|
String data = JsonUtil.toJson(resultContent.getContent());
|
|
|
Map map = JsonUtil.toObject(data, Map.class);
|
|
Map map = JsonUtil.toObject(data, Map.class);
|
|
|
- return com.github.microservice.net.ResultContent.buildContent(Long.parseLong((String) map.get("t0WithdrawAmt")));
|
|
|
|
|
|
|
+ if (!map.get("respCode").equals("000000")){
|
|
|
|
|
+ return com.github.microservice.net.ResultContent.buildFail((String) map.get("respDesc"));
|
|
|
|
|
+ }
|
|
|
|
|
+ return com.github.microservice.net.ResultContent.buildContent(Long.parseLong((String) map.get("tzWithdrawAmt")));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
PayAccount settleAccount = payAccountService.getOrgChildren(projectOid, oid, PaymentChannelType.Settle);
|
|
PayAccount settleAccount = payAccountService.getOrgChildren(projectOid, oid, PaymentChannelType.Settle);
|
|
@@ -200,7 +208,7 @@ public class WithdrawService extends SuperService {
|
|
|
//校验提现金额是否大约可以提现金额
|
|
//校验提现金额是否大约可以提现金额
|
|
|
com.github.microservice.net.ResultContent<Long> resultContent = queryWithdrawAmountByPaymentType(projectOid, oid, paymentType);
|
|
com.github.microservice.net.ResultContent<Long> resultContent = queryWithdrawAmountByPaymentType(projectOid, oid, paymentType);
|
|
|
|
|
|
|
|
- if (!resultContent.getState().equals(ResultState.Success)){
|
|
|
|
|
|
|
+ if (!resultContent.getState().equals(com.github.microservice.net.ResultState.Success)){
|
|
|
return com.github.microservice.net.ResultContent.buildFail(resultContent.getMsg());
|
|
return com.github.microservice.net.ResultContent.buildFail(resultContent.getMsg());
|
|
|
}
|
|
}
|
|
|
Long waitAmount = resultContent.getContent();
|
|
Long waitAmount = resultContent.getContent();
|
|
@@ -248,9 +256,10 @@ public class WithdrawService extends SuperService {
|
|
|
withdrawOrder.setBankAccountNumber(orgPayConfig.getBankSubName() + orgPayConfig.getBankName() + orgPayConfig.getBankAccountNumber());
|
|
withdrawOrder.setBankAccountNumber(orgPayConfig.getBankSubName() + orgPayConfig.getBankName() + orgPayConfig.getBankAccountNumber());
|
|
|
withdrawOrder.setOrderNo(withdrawOrderNo);
|
|
withdrawOrder.setOrderNo(withdrawOrderNo);
|
|
|
withdrawOrder.setAmount(amount);
|
|
withdrawOrder.setAmount(amount);
|
|
|
- withdrawOrder.setWithdrawStatus(WithdrawStatus.Processing);
|
|
|
|
|
- withdrawOrder.setSort(WithdrawStatus.Processing.getSort());
|
|
|
|
|
- withdrawOrder.setWithdrawUser(userAccounts.get(0));
|
|
|
|
|
|
|
+ withdrawOrder.setAuditStatus(AuditStatus.Wait);
|
|
|
|
|
+ withdrawOrder.setSort(AuditStatus.Wait.getSort());
|
|
|
|
|
+ withdrawOrder.setWithdrawUser(userAccounts.get(0).getName());
|
|
|
|
|
+ withdrawOrder.setWithdrawUserId(userAccounts.get(0).getUserId());
|
|
|
withdrawOrder.setFrozenTransactionLogs(transfer.getContent());
|
|
withdrawOrder.setFrozenTransactionLogs(transfer.getContent());
|
|
|
withdrawOrder.setProjectOid(projectOid);
|
|
withdrawOrder.setProjectOid(projectOid);
|
|
|
withdrawOrder.setOid(oid);
|
|
withdrawOrder.setOid(oid);
|
|
@@ -262,6 +271,7 @@ public class WithdrawService extends SuperService {
|
|
|
/**
|
|
/**
|
|
|
* 审核
|
|
* 审核
|
|
|
*/
|
|
*/
|
|
|
|
|
+ @SneakyThrows
|
|
|
public com.github.microservice.net.ResultContent withdraw(ProcessWithdrawParam param){
|
|
public com.github.microservice.net.ResultContent withdraw(ProcessWithdrawParam param){
|
|
|
String userId = param.getUserId();
|
|
String userId = param.getUserId();
|
|
|
if (StringUtils.isBlank(userId)){
|
|
if (StringUtils.isBlank(userId)){
|
|
@@ -288,7 +298,7 @@ public class WithdrawService extends SuperService {
|
|
|
return com.github.microservice.net.ResultContent.buildFail("数据不存在");
|
|
return com.github.microservice.net.ResultContent.buildFail("数据不存在");
|
|
|
}
|
|
}
|
|
|
//判断状态是否为待审核
|
|
//判断状态是否为待审核
|
|
|
- if (!withdrawOrder.getWithdrawStatus().equals(WithdrawStatus.Processing)){
|
|
|
|
|
|
|
+ if (!withdrawOrder.getAuditStatus().equals(AuditStatus.Wait)){
|
|
|
return com.github.microservice.net.ResultContent.buildFail("只能操作处理中的订单");
|
|
return com.github.microservice.net.ResultContent.buildFail("只能操作处理中的订单");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -296,72 +306,30 @@ public class WithdrawService extends SuperService {
|
|
|
PayAccount projectAccount = payAccountService.getProjectChildren(withdrawOrder.getProjectOid(), PaymentChannelType.SecretFreePayment);
|
|
PayAccount projectAccount = payAccountService.getProjectChildren(withdrawOrder.getProjectOid(), PaymentChannelType.SecretFreePayment);
|
|
|
PayAccount settleAccount = payAccountService.getOrgChildren(withdrawOrder.getProjectOid(), withdrawOrder.getOid(), PaymentChannelType.Settle);
|
|
PayAccount settleAccount = payAccountService.getOrgChildren(withdrawOrder.getProjectOid(), withdrawOrder.getOid(), PaymentChannelType.Settle);
|
|
|
|
|
|
|
|
- //TODO 审批通过, 判断当前可提现余额是否大于提现订单金额
|
|
|
|
|
- if (param.getStatus().equals(WithdrawStatus.Success)){//审批通过
|
|
|
|
|
-
|
|
|
|
|
|
|
+ withdrawOrder.setAttachInfo(param.getAttachInfo());
|
|
|
|
|
+ withdrawOrder.setAttachFile(param.getAttachFile());
|
|
|
|
|
|
|
|
- //TODO 判断是否线上提现,调用支付渠道对应的提现接口
|
|
|
|
|
|
|
+ //TODO 审批通过, 判断当前可提现余额是否大于提现订单金额
|
|
|
|
|
+ if (param.getStatus().equals(AuditStatus.Success)){//审批通过
|
|
|
|
|
+ withdrawOrder.setAuditStatus(AuditStatus.Success);
|
|
|
|
|
+ withdrawOrder.setSort(AuditStatus.Success.getSort());
|
|
|
|
|
+ //判断是否线上提现,调用支付渠道对应的提现接口
|
|
|
if (withdrawOrder.getWithdrawMethodType().equals(WithdrawMethodType.OnLine)) {
|
|
if (withdrawOrder.getWithdrawMethodType().equals(WithdrawMethodType.OnLine)) {
|
|
|
- switch (withdrawOrder.getPaymentType()){
|
|
|
|
|
- case UnionFrictionlessPay-> {
|
|
|
|
|
- String orgAccount = orgPayAccountService.queryOgPayAccount(withdrawOrder.getOid(), PaymentType.UnionFrictionlessPay);
|
|
|
|
|
- String projectPayAccount = orgPayAccountService.queryOgPayAccount(projectOid, PaymentType.UnionFrictionlessPay);
|
|
|
|
|
-
|
|
|
|
|
- ResultContent<AccountModel> accountModelResultContent = payProductAccountService.get(orgAccount);
|
|
|
|
|
-
|
|
|
|
|
- if (!accountModelResultContent.getState().equals(ResultState.Success)){
|
|
|
|
|
- return com.github.microservice.net.ResultContent.buildFail(accountModelResultContent.getMsg());
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- ChinaumsSenselessConf conf = (ChinaumsSenselessConf)accountModelResultContent.getContent().getConf();
|
|
|
|
|
- String withdrawMchId = conf.getWithdrawMchId();
|
|
|
|
|
- if (StringUtils.isEmpty(withdrawMchId)){
|
|
|
|
|
- return com.github.microservice.net.ResultContent.buildFail("未配置提现商户号");
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- PayProductParameter<Object> parameter = new PayProductParameter<>();
|
|
|
|
|
- parameter.setAccountName(projectPayAccount);
|
|
|
|
|
- parameter.setMeta(Map.of("mchntNo", withdrawMchId,"orderNo", withdrawOrder.getOrderNo(), "amount", withdrawOrder.getAmount()));
|
|
|
|
|
- ResultContent<Object> withdrawRet = senselessPayService.withdraw(parameter);
|
|
|
|
|
- withdrawOrder.setExpand(withdrawRet.getContent());
|
|
|
|
|
- if (!withdrawRet.getState().equals(ResultState.Success)){//银联提现失败
|
|
|
|
|
- withdrawOrder.setWithdrawStatusDesc("银行处理失败");
|
|
|
|
|
- //划账退回金额: 机构已冻结金额- 机构已结算 +
|
|
|
|
|
- TransferTransactionsModel transferTransactionsModel = buildTransferModel(settleAccount, withdrawFrozenAccount, withdrawOrder.getOrderNo(),
|
|
|
|
|
- withdrawOrder.getAmount(), TransactionType.WithdrawRefund,
|
|
|
|
|
- Map.of("paymentType", withdrawOrder.getPaymentType(), "paymentChannelType", withdrawOrder.getPaymentType().getChannelType(), "description", "提现退回"));
|
|
|
|
|
- ResultContent<List<TransactionLogModel>> transfer = transactionLogService.transfer(transferTransactionsModel);
|
|
|
|
|
- if (!transfer.getState().equals(ResultState.Success)){
|
|
|
|
|
- withdrawOrder.setWithdrawStatusDesc("银行处理失败,余额退回失败");
|
|
|
|
|
- withdrawOrderDao.save(withdrawOrder);
|
|
|
|
|
- return com.github.microservice.net.ResultContent.buildFail("银行处理失败,余额退回失败");
|
|
|
|
|
- }
|
|
|
|
|
- withdrawOrder.setWithdrawTransactionLogs(transfer.getContent());
|
|
|
|
|
- withdrawOrder.setWithdrawStatus(WithdrawStatus.Fail);
|
|
|
|
|
- withdrawOrderDao.save(withdrawOrder);
|
|
|
|
|
- return com.github.microservice.net.ResultContent.buildFail(withdrawRet.getMsg());
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ return onlineWithdraw(withdrawOrder, userAccounts.get(0), settleAccount, withdrawFrozenAccount);
|
|
|
|
|
+ }else {
|
|
|
|
|
+ //划账,机构已冻结金额- 项目无感支付+
|
|
|
|
|
+ TransferTransactionsModel transferTransactionsModel = buildTransferModel(projectAccount, withdrawFrozenAccount, withdrawOrder.getOrderNo(),
|
|
|
|
|
+ withdrawOrder.getAmount(), TransactionType.Withdrawal,
|
|
|
|
|
+ Map.of("paymentType", withdrawOrder.getPaymentType(), "paymentChannelType", withdrawOrder.getPaymentType().getChannelType(), "description", "提现"));
|
|
|
|
|
+ ResultContent<List<TransactionLogModel>> transferResult = transactionLogService.transfer(transferTransactionsModel);
|
|
|
|
|
+ if (!transferResult.getState().equals(ResultState.Success)){
|
|
|
|
|
+ return com.github.microservice.net.ResultContent.buildFail(transferResult.getMsg());
|
|
|
}
|
|
}
|
|
|
|
|
+ withdrawOrder.setWithdrawTransactionLogs(transferResult.getContent());
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- //划账,机构已冻结金额- 项目无感支付+
|
|
|
|
|
- TransferTransactionsModel transferTransactionsModel = buildTransferModel(projectAccount, withdrawFrozenAccount, withdrawOrder.getOrderNo(),
|
|
|
|
|
- withdrawOrder.getAmount(), TransactionType.Withdrawal,
|
|
|
|
|
- Map.of("paymentType", withdrawOrder.getPaymentType(), "paymentChannelType", withdrawOrder.getPaymentType().getChannelType(), "description", "提现"));
|
|
|
|
|
- ResultContent<List<TransactionLogModel>> transferResult = transactionLogService.transfer(transferTransactionsModel);
|
|
|
|
|
- if (!transferResult.getState().equals(ResultState.Success)){
|
|
|
|
|
- return com.github.microservice.net.ResultContent.buildFail(transferResult.getMsg());
|
|
|
|
|
- }
|
|
|
|
|
- withdrawOrder.setWithdrawTransactionLogs(transferResult.getContent());
|
|
|
|
|
-
|
|
|
|
|
- withdrawOrder.setWithdrawStatus(WithdrawStatus.Success);
|
|
|
|
|
- withdrawOrder.setSort(WithdrawStatus.Success.getSort());
|
|
|
|
|
-// withdrawOrder.setReceiveAmount(withdrawOrder.getAmount().movePointLeft(2));
|
|
|
|
|
- }else if (param.getStatus().equals(WithdrawStatus.Fail)){ //审批拒绝
|
|
|
|
|
- withdrawOrder.setWithdrawStatus(WithdrawStatus.Fail);
|
|
|
|
|
- withdrawOrder.setSort(WithdrawStatus.Fail.getSort());
|
|
|
|
|
|
|
+ }else if (param.getStatus().equals(AuditStatus.Fail)){ //审批拒绝
|
|
|
|
|
+ withdrawOrder.setAuditStatus(AuditStatus.Fail);
|
|
|
|
|
+ withdrawOrder.setSort(AuditStatus.Fail.getSort());
|
|
|
//划账退回金额: 机构已冻结金额- 机构已结算 +
|
|
//划账退回金额: 机构已冻结金额- 机构已结算 +
|
|
|
TransferTransactionsModel transferTransactionsModel = buildTransferModel(settleAccount, withdrawFrozenAccount, withdrawOrder.getOrderNo(),
|
|
TransferTransactionsModel transferTransactionsModel = buildTransferModel(settleAccount, withdrawFrozenAccount, withdrawOrder.getOrderNo(),
|
|
|
withdrawOrder.getAmount(), TransactionType.WithdrawRefund,
|
|
withdrawOrder.getAmount(), TransactionType.WithdrawRefund,
|
|
@@ -374,12 +342,74 @@ public class WithdrawService extends SuperService {
|
|
|
}
|
|
}
|
|
|
withdrawOrder.setAttachInfo(param.getAttachInfo());
|
|
withdrawOrder.setAttachInfo(param.getAttachInfo());
|
|
|
withdrawOrder.setAttachFile(param.getAttachFile());
|
|
withdrawOrder.setAttachFile(param.getAttachFile());
|
|
|
- withdrawOrder.setProcessUser(userAccounts.get(0));
|
|
|
|
|
|
|
+ withdrawOrder.setProcessUser(userAccounts.get(0).getName());
|
|
|
|
|
+ withdrawOrder.setWithdrawUserId(userAccounts.get(0).getUserId());
|
|
|
withdrawOrder.setProcessTime(System.currentTimeMillis());
|
|
withdrawOrder.setProcessTime(System.currentTimeMillis());
|
|
|
withdrawOrderDao.save(withdrawOrder);
|
|
withdrawOrderDao.save(withdrawOrder);
|
|
|
return com.github.microservice.net.ResultContent.buildSuccess();
|
|
return com.github.microservice.net.ResultContent.buildSuccess();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @SneakyThrows
|
|
|
|
|
+ private com.github.microservice.net.ResultContent onlineWithdraw(WithdrawOrder withdrawOrder, UserAccount userAccount, PayAccount settleAccount, PayAccount withdrawFrozenAccount) {
|
|
|
|
|
+ switch (withdrawOrder.getPaymentType()){
|
|
|
|
|
+ case UnionFrictionlessPay-> {
|
|
|
|
|
+ String orgAccount = orgPayAccountService.queryOgPayAccount(withdrawOrder.getOid(), PaymentType.UnionFrictionlessPay);
|
|
|
|
|
+ String projectPayAccount = orgPayAccountService.queryOgPayAccount(withdrawOrder.getProjectOid(), PaymentType.UnionFrictionlessPay);
|
|
|
|
|
+
|
|
|
|
|
+ ResultContent<AccountModel> accountModelResultContent = payProductAccountService.get(orgAccount);
|
|
|
|
|
+
|
|
|
|
|
+ if (!accountModelResultContent.getState().equals(ResultState.Success)){
|
|
|
|
|
+ return com.github.microservice.net.ResultContent.buildFail(accountModelResultContent.getMsg());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ ChinaumsSenselessConf conf = (ChinaumsSenselessConf)accountModelResultContent.getContent().getConf();
|
|
|
|
|
+ String withdrawMchId = conf.getWithdrawMchId();
|
|
|
|
|
+ if (StringUtils.isEmpty(withdrawMchId)){
|
|
|
|
|
+ return com.github.microservice.net.ResultContent.buildFail("未配置提现商户号");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ PayProductParameter<Object> parameter = new PayProductParameter<>();
|
|
|
|
|
+ parameter.setAccountName(projectPayAccount);
|
|
|
|
|
+ parameter.setMeta(Map.of("mchntNo", withdrawMchId,"orderNo", withdrawOrder.getOrderNo(), "amount", withdrawOrder.getAmount().toString()));
|
|
|
|
|
+ ResultContent<Object> withdrawRet = senselessPayService.withdraw(parameter);
|
|
|
|
|
+ withdrawOrder.setExpand(withdrawRet.getContent());
|
|
|
|
|
+
|
|
|
|
|
+ Map bodyMap = JsonUtil.toObject(JsonUtil.toJson(withdrawRet.getContent()), Map.class);
|
|
|
|
|
+
|
|
|
|
|
+ if (!bodyMap.get("respCode").equals("000000")){//银联提现失败
|
|
|
|
|
+ withdrawOrder.setWithdrawStatusDesc("银行处理失败");
|
|
|
|
|
+ //划账退回金额: 机构已冻结金额- 机构已结算 +
|
|
|
|
|
+ TransferTransactionsModel transferTransactionsModel = buildTransferModel(settleAccount, withdrawFrozenAccount, withdrawOrder.getOrderNo(),
|
|
|
|
|
+ withdrawOrder.getAmount(), TransactionType.WithdrawRefund,
|
|
|
|
|
+ Map.of("paymentType", withdrawOrder.getPaymentType(), "paymentChannelType", withdrawOrder.getPaymentType().getChannelType(), "description", "提现退回"));
|
|
|
|
|
+ ResultContent<List<TransactionLogModel>> transfer = transactionLogService.transfer(transferTransactionsModel);
|
|
|
|
|
+ if (!transfer.getState().equals(ResultState.Success)){
|
|
|
|
|
+ withdrawOrder.setWithdrawStatusDesc("银行处理失败,余额退回失败");
|
|
|
|
|
+ withdrawOrderDao.save(withdrawOrder);
|
|
|
|
|
+ return com.github.microservice.net.ResultContent.buildFail("银行处理失败,余额退回失败");
|
|
|
|
|
+ }
|
|
|
|
|
+ withdrawOrder.setWithdrawTransactionLogs(transfer.getContent());
|
|
|
|
|
+ withdrawOrder.setWithdrawStatus(WithdrawStatus.Fail);
|
|
|
|
|
+ withdrawOrderDao.save(withdrawOrder);
|
|
|
|
|
+ return com.github.microservice.net.ResultContent.buildFail((String) bodyMap.get("respDesc"));
|
|
|
|
|
+ }else {
|
|
|
|
|
+ withdrawOrder.setWithdrawStatus(WithdrawStatus.Accepted);
|
|
|
|
|
+ withdrawOrder.setWithdrawStatusDesc("银行已受理");
|
|
|
|
|
+ }
|
|
|
|
|
+ withdrawOrder.setProcessUser(userAccount.getName());
|
|
|
|
|
+ withdrawOrder.setProcessUserId(userAccount.getUserId());
|
|
|
|
|
+ withdrawOrder.setProcessTime(System.currentTimeMillis());
|
|
|
|
|
+ withdrawOrderDao.save(withdrawOrder);
|
|
|
|
|
+ execQueueService.add(Map.of("withdrawOrderId", withdrawOrder.getId()), 5, data->{
|
|
|
|
|
+ withdrawQuery((String) data.get("withdrawOrderId"));
|
|
|
|
|
+ return false;
|
|
|
|
|
+ });
|
|
|
|
|
+ return com.github.microservice.net.ResultContent.buildSuccess();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ return com.github.microservice.net.ResultContent.buildFail("该支付产品不支持线上提现方式");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
private TransferTransactionsModel buildTransferModel(PayAccount credit, PayAccount debit, String orderNo, BigDecimal amount, TransactionType type, Map<String, Object> meta){
|
|
private TransferTransactionsModel buildTransferModel(PayAccount credit, PayAccount debit, String orderNo, BigDecimal amount, TransactionType type, Map<String, Object> meta){
|
|
|
TransferTransactionsModel transferModel = new TransferTransactionsModel();
|
|
TransferTransactionsModel transferModel = new TransferTransactionsModel();
|
|
|
//构建出账账户
|
|
//构建出账账户
|
|
@@ -431,12 +461,6 @@ public class WithdrawService extends SuperService {
|
|
|
WithdrawOrderModel model = new WithdrawOrderModel();
|
|
WithdrawOrderModel model = new WithdrawOrderModel();
|
|
|
if (withdrawOrder!=null){
|
|
if (withdrawOrder!=null){
|
|
|
BeanUtils.copyProperties(withdrawOrder, model, "withdrawUser", "processUser");
|
|
BeanUtils.copyProperties(withdrawOrder, model, "withdrawUser", "processUser");
|
|
|
- if (withdrawOrder.getWithdrawUser()!=null){
|
|
|
|
|
- model.setWithdrawUser(withdrawOrder.getWithdrawUser().getName());
|
|
|
|
|
- }
|
|
|
|
|
- if (withdrawOrder.getProcessUser()!=null){
|
|
|
|
|
- model.setProcessUser(withdrawOrder.getProcessUser().getName());
|
|
|
|
|
- }
|
|
|
|
|
}
|
|
}
|
|
|
return model;
|
|
return model;
|
|
|
}
|
|
}
|
|
@@ -451,6 +475,11 @@ public class WithdrawService extends SuperService {
|
|
|
if (withdrawOrder == null){
|
|
if (withdrawOrder == null){
|
|
|
return com.github.microservice.net.ResultContent.buildFail("数据不存在");
|
|
return com.github.microservice.net.ResultContent.buildFail("数据不存在");
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ if (!WithdrawStatus.Accepted.equals(withdrawOrder.getWithdrawStatus())){
|
|
|
|
|
+// return ResultContent.buildContent(withdrawOrder.getWithdrawStatus())
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
switch (withdrawOrder.getPaymentType()){
|
|
switch (withdrawOrder.getPaymentType()){
|
|
|
case UnionFrictionlessPay -> {
|
|
case UnionFrictionlessPay -> {
|
|
|
|
|
|