Commit 5a50ec4a by 林永健

refactor(integral): 优化提现单操作记录方法

- 调整saveTransferOutOperation方法,增加操作类型和操作结果参数
- 修改调用处传入具体的操作类型和结果,区分支付成功与失败
- 增强操作记录的灵活性和准确性
- 保持现有业务逻辑不变,仅改进代码可扩展性和清晰度
1 parent 3975e8d2
...@@ -1420,7 +1420,7 @@ public class IntegralTransferOutService { ...@@ -1420,7 +1420,7 @@ public class IntegralTransferOutService {
record.setStatus(IntegralTransferOutStatusEnum.NOT_ACCEPT.getValue()); record.setStatus(IntegralTransferOutStatusEnum.NOT_ACCEPT.getValue());
thiz.updateSelectiveByIds(record, failOrder.stream().map(IntegralTransferOut::getId).collect(Collectors.toList())); thiz.updateSelectiveByIds(record, failOrder.stream().map(IntegralTransferOut::getId).collect(Collectors.toList()));
// 写入付款操作记录 // 写入付款操作记录
saveTransferOutOperation(failOrder); saveTransferOutOperation(failOrder, IntegralTransferOutOperationTypeEnum.PAY.getValue(), IntegralTransferOutOperationResultEnum.FAIL.getValue());
} }
if (CollectionUtils.isNotEmpty(successOrder)) { if (CollectionUtils.isNotEmpty(successOrder)) {
record.setStatus(IntegralTransferOutStatusEnum.WAIT_THIRD.getValue()); record.setStatus(IntegralTransferOutStatusEnum.WAIT_THIRD.getValue());
...@@ -1431,7 +1431,7 @@ public class IntegralTransferOutService { ...@@ -1431,7 +1431,7 @@ public class IntegralTransferOutService {
log.info("[{}] 处理签约成功提现记录,size:{}, orderList:{}", channel, outList.size(), ids); log.info("[{}] 处理签约成功提现记录,size:{}, orderList:{}", channel, outList.size(), ids);
thiz.updateSelectiveByIds(record, ids); thiz.updateSelectiveByIds(record, ids);
// 写入付款操作记录 // 写入付款操作记录
saveTransferOutOperation(outList); saveTransferOutOperation(outList, IntegralTransferOutOperationTypeEnum.PAY.getValue(), IntegralTransferOutOperationResultEnum.SUCCESS.getValue());
// 入延迟队列发起付款 // 入延迟队列发起付款
queueBatchPay(outList, channel); queueBatchPay(outList, channel);
log.info("[{}] 推送提现队列成功", channel); log.info("[{}] 推送提现队列成功", channel);
...@@ -1506,12 +1506,12 @@ public class IntegralTransferOutService { ...@@ -1506,12 +1506,12 @@ public class IntegralTransferOutService {
/** /**
* 保存提现单操作记录 * 保存提现单操作记录
*/ */
private void saveTransferOutOperation(List<IntegralTransferOut> order) { private void saveTransferOutOperation(List<IntegralTransferOut> order, Integer operationType, Integer operationResult) {
List<IntegralTransferOutOperation> insertList = new ArrayList<>(); List<IntegralTransferOutOperation> insertList = new ArrayList<>();
for (IntegralTransferOut integralTransferOut : order) { for (IntegralTransferOut integralTransferOut : order) {
IntegralTransferOutOperation operation = new IntegralTransferOutOperation(); IntegralTransferOutOperation operation = new IntegralTransferOutOperation();
operation.setType(IntegralTransferOutOperationTypeEnum.PAY.getValue()); operation.setType(operationType);
operation.setResult(IntegralTransferOutOperationResultEnum.FAIL.getValue()); operation.setResult(operationResult);
operation.setTransferOutId(integralTransferOut.getId()); operation.setTransferOutId(integralTransferOut.getId());
operation.setUpdatedBy("system"); operation.setUpdatedBy("system");
operation.setRemark(integralTransferOut.getErrorMessage()); operation.setRemark(integralTransferOut.getErrorMessage());
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!