diff --git a/src/main/java/com/example/demo/serviceImpl/cash/CashRefundServiceImpl.java b/src/main/java/com/example/demo/serviceImpl/cash/CashRefundServiceImpl.java index 3315d64..e6e97f6 100644 --- a/src/main/java/com/example/demo/serviceImpl/cash/CashRefundServiceImpl.java +++ b/src/main/java/com/example/demo/serviceImpl/cash/CashRefundServiceImpl.java @@ -507,12 +507,12 @@ public class CashRefundServiceImpl implements RefundService { // 钱包更新 - 按原始充值流水 wallet_id 优先级顺序原路退回(1-10,越小优先级越高) String orderCodeA = "XJ" + orderCode.substring(4); -// 1. 查询原始充值流水(type=3 充值,status=0 正常) +// 1. 查询原始充值流水(type=0 充值,status=0 正常) List originalRecords = walletService.selectUserWalletRecord(userGoldRecord.getJwcode(), orderCodeA); if (!CollectionUtils.isEmpty(originalRecords)) { // 过滤充值记录并按 wallet_id 升序排序 originalRecords = originalRecords.stream() - .filter(r -> r.getType() == 3 && r.getStatus() == 0) + .filter(r -> r.getType() == 0 && r.getStatus() == 0) .sorted(Comparator.comparing(UserWalletRecord::getWalletId)) .collect(Collectors.toList()); @@ -554,7 +554,7 @@ public class CashRefundServiceImpl implements RefundService { // 5. 插入退款流水(amount 存负数,表示扣减) UserWalletRecord refundRecord = new UserWalletRecord(); - refundRecord.setType(4); // 充值退款类型 + refundRecord.setType(2); // 充值退款类型 refundRecord.setJwcode(userGoldRecord.getJwcode()); refundRecord.setWalletId(walletId); refundRecord.setAmount(refundAmount.negate().intValue()); // 🔥 负数扣款 diff --git a/src/main/resources/mapper/WalletMapper.xml b/src/main/resources/mapper/WalletMapper.xml index 7a6d01d..cd25c87 100644 --- a/src/main/resources/mapper/WalletMapper.xml +++ b/src/main/resources/mapper/WalletMapper.xml @@ -88,6 +88,5 @@ #{item} - /> \ No newline at end of file