Explorar o código

提现失败自动补偿一次

wujiefeng hai 11 meses
pai
achega
12b96b7874

+ 2 - 1
RewardServer/src/main/java/com/zhongshu/reward/server/core/dao/WalletReceiptsDao.java

@@ -1,6 +1,7 @@
 package com.zhongshu.reward.server.core.dao;
 
 import com.github.microservice.components.data.mongo.mongo.dao.MongoDao;
+import com.zhongshu.reward.client.type.ReceiptsStatus;
 import com.zhongshu.reward.server.core.dao.extend.WalletReceiptsDaoExtend;
 import com.zhongshu.reward.server.core.domain.WalletReceipts;
 
@@ -12,7 +13,7 @@ import java.util.List;
  */
 public interface WalletReceiptsDao extends MongoDao<WalletReceipts>, WalletReceiptsDaoExtend {
 
-    List<WalletReceipts> findByWallet_IdOrderByCreateTimeDesc(String walletId);
+    List<WalletReceipts> findByWallet_IdAndStatusOrderByCreateTimeDesc(String walletId, ReceiptsStatus status);
 
     WalletReceipts findTopByOutTradeNo(String outTradeNo);
 

+ 1 - 1
RewardServer/src/main/java/com/zhongshu/reward/server/core/service/WalletReceiptsService.java

@@ -275,7 +275,7 @@ public class WalletReceiptsService {
     public Object listByWallet(){
         String userId = authHelper.getCurrentUser().getUserId();
         Wallet wallet = walletService.getWalletByUserId(userId);
-        List<WalletReceipts> list = walletReceiptsDao.findByWallet_IdOrderByCreateTimeDesc(wallet.getId());
+        List<WalletReceipts> list = walletReceiptsDao.findByWallet_IdAndStatusOrderByCreateTimeDesc(wallet.getId(), ReceiptsStatus.WAIT);
         return ResultContent.buildContent(list.stream().map(this::toModel).collect(Collectors.toList()));
     }