|
|
@@ -1,6 +1,7 @@
|
|
|
package com.zhongshu.payment.server.core.service;
|
|
|
|
|
|
import com.github.microservice.auth.security.helper.AuthHelper;
|
|
|
+import com.github.microservice.types.OrderState;
|
|
|
import com.wechat.pay.java.service.transferbatch.model.*;
|
|
|
import com.zhongshu.card.client.model.feign.ProjectWxPayParam;
|
|
|
import com.zhongshu.card.client.model.org.OrgUserDetailParam;
|
|
|
@@ -15,7 +16,6 @@ import com.zhongshu.payment.client.model.param.ExamineParam;
|
|
|
import com.zhongshu.payment.client.model.param.RechargeParam;
|
|
|
import com.github.microservice.net.ResultContent;
|
|
|
import com.zhongshu.payment.client.types.DataState;
|
|
|
-import com.zhongshu.payment.client.types.RechargeState;
|
|
|
import com.zhongshu.payment.client.types.TradeType;
|
|
|
import com.zhongshu.payment.client.types.WalletType;
|
|
|
import com.zhongshu.payment.server.core.dao.RechargeRecordDao;
|
|
|
@@ -105,7 +105,7 @@ public class TransferService {
|
|
|
rechargeRecord.setTotal(BigDecimal.valueOf(param.getTotal()));
|
|
|
rechargeRecord.setOid(userWallet.getOid());
|
|
|
rechargeRecord.setTradeType(TradeType.Take);
|
|
|
- rechargeRecord.setRechargeState(RechargeState.Taking);
|
|
|
+ rechargeRecord.setRechargeState(OrderState.Taking);
|
|
|
rechargeRecord.setWallet(userWallet);
|
|
|
rechargeRecord.setUserId(userId);
|
|
|
rechargeRecord.setId(CommonUtil.UUID());
|
|
|
@@ -142,16 +142,16 @@ public class TransferService {
|
|
|
BeanUtils.copyProperties(initiateBatchTransferResponse, transferModel);
|
|
|
rechargeRecord.setTransferModel(transferModel);
|
|
|
if (initiateBatchTransferResponse.getBatchStatus().equals("ACCEPTED")) {
|
|
|
- rechargeRecord.setRechargeState(RechargeState.Taking);
|
|
|
+ rechargeRecord.setRechargeState(OrderState.Taking);
|
|
|
}
|
|
|
if (initiateBatchTransferResponse.getBatchStatus().equals("PROCESSING")) {
|
|
|
- rechargeRecord.setRechargeState(RechargeState.Taking);
|
|
|
+ rechargeRecord.setRechargeState(OrderState.Taking);
|
|
|
}
|
|
|
if (initiateBatchTransferResponse.getBatchStatus().equals("FINISHED")) {
|
|
|
- rechargeRecord.setRechargeState(RechargeState.TakeSuccess);
|
|
|
+ rechargeRecord.setRechargeState(OrderState.TakeSuccess);
|
|
|
}
|
|
|
if (initiateBatchTransferResponse.getBatchStatus().equals("CLOSED")) {
|
|
|
- rechargeRecord.setRechargeState(RechargeState.CLOSED);
|
|
|
+ rechargeRecord.setRechargeState(OrderState.CLOSED);
|
|
|
return ResultContent.buildFail("该订单已关闭");
|
|
|
}
|
|
|
|
|
|
@@ -203,7 +203,7 @@ public class TransferService {
|
|
|
rechargeRecord.setTotal(BigDecimal.valueOf(param.getTotal()));
|
|
|
rechargeRecord.setOid(userWallet.getOid());
|
|
|
rechargeRecord.setTradeType(TradeType.Take);
|
|
|
- rechargeRecord.setRechargeState(RechargeState.TakeReview);
|
|
|
+ rechargeRecord.setRechargeState(OrderState.TakeReview);
|
|
|
rechargeRecord.setWallet(userWallet);
|
|
|
rechargeRecord.setUserId(userId);
|
|
|
rechargeRecord.setOpenid(param.getOpenid());
|
|
|
@@ -274,13 +274,13 @@ public class TransferService {
|
|
|
// record.setRechargeState(RechargeState.RECHARGING);
|
|
|
}
|
|
|
if (initiateBatchTransferResponse.getBatchStatus().equals("PROCESSING")) {
|
|
|
- record.setRechargeState(RechargeState.Taking);
|
|
|
+ record.setRechargeState(OrderState.Taking);
|
|
|
}
|
|
|
if (initiateBatchTransferResponse.getBatchStatus().equals("FINISHED")) {
|
|
|
- record.setRechargeState(RechargeState.TakeSuccess);
|
|
|
+ record.setRechargeState(OrderState.TakeSuccess);
|
|
|
}
|
|
|
if (initiateBatchTransferResponse.getBatchStatus().equals("CLOSED")) {
|
|
|
- record.setRechargeState(RechargeState.CLOSED);
|
|
|
+ record.setRechargeState(OrderState.CLOSED);
|
|
|
}
|
|
|
rechargeRecordDao.save(record);
|
|
|
return ResultContent.buildSuccess(record);
|
|
|
@@ -292,7 +292,7 @@ public class TransferService {
|
|
|
if (record == null) {
|
|
|
return ResultContent.buildFail("充值订单:" + param.getOutTradeNo() + "不存在");
|
|
|
}
|
|
|
- record.setRechargeState(RechargeState.TakeRefuse);
|
|
|
+ record.setRechargeState(OrderState.TakeRefuse);
|
|
|
record.setRemark(param.getRemark());
|
|
|
rechargeRecordDao.save(record);
|
|
|
|
|
|
@@ -322,24 +322,24 @@ public class TransferService {
|
|
|
request.setOutDetailNo(record.getOutTradeNo());
|
|
|
TransferDetailEntity transferDetailByOutNo = wxTransferBatchService.getTransferDetailByOutNo(request, configResult.getContent());
|
|
|
if (transferDetailByOutNo.getDetailStatus().equals("INIT")) {
|
|
|
- record.setRechargeState(RechargeState.Taking);
|
|
|
+ record.setRechargeState(OrderState.Taking);
|
|
|
record.setRechargeStateDesc("系统转账校验中");
|
|
|
}
|
|
|
if (transferDetailByOutNo.getDetailStatus().equals("WAIT_PAY")) {
|
|
|
- record.setRechargeState(RechargeState.Taking);
|
|
|
+ record.setRechargeState(OrderState.Taking);
|
|
|
record.setRechargeStateDesc("待商户确认");
|
|
|
}
|
|
|
|
|
|
if (transferDetailByOutNo.getDetailStatus().equals("PROCESSING")) {
|
|
|
- record.setRechargeState(RechargeState.Taking);
|
|
|
+ record.setRechargeState(OrderState.Taking);
|
|
|
record.setRechargeStateDesc("正在处理中");
|
|
|
}
|
|
|
if (transferDetailByOutNo.getDetailStatus().equals("SUCCESS")) {
|
|
|
- record.setRechargeState(RechargeState.TakeSuccess);
|
|
|
+ record.setRechargeState(OrderState.TakeSuccess);
|
|
|
record.setRechargeStateDesc("提现成功");
|
|
|
}
|
|
|
if (transferDetailByOutNo.getDetailStatus().equals("FAIL")) {
|
|
|
- record.setRechargeState(RechargeState.TakeFail);
|
|
|
+ record.setRechargeState(OrderState.TakeFail);
|
|
|
record.setRechargeStateDesc(transferDetailByOutNo.getFailReason().name());
|
|
|
AmountUpdateParam amountUpdateParam = new AmountUpdateParam();
|
|
|
amountUpdateParam.setOutTradeNo(record.getOutTradeNo());
|