dos há 1 mês atrás
pai
commit
fc93b2361c

+ 1 - 3
game-business/src/main/java/com/game/business/controller/AppUsersCashrecordController.java

@@ -236,9 +236,7 @@ public class AppUsersCashrecordController extends BaseController
             String tradeNo = map.get("tradeNo").toString();
             //验证回调订单
             Map<String, Object> checkMap = PayOrderUtils.checkOrder(orderNo,tradeNo);
-            LambdaQueryWrapper<AppUsersCashrecord> queryWrapper = new LambdaQueryWrapper<>();
-            queryWrapper.eq(AppUsersCashrecord::getOrderno,orderNo);
-            AppUsersCashrecord appUsersCashrecord = appUsersCashrecordService.getOne(queryWrapper);
+            AppUsersCashrecord appUsersCashrecord = appUsersCashrecordService.getByOrderNo(orderNo);
             if(null == appUsersCashrecord){
                 return "failed";
             }

+ 2 - 0
game-business/src/main/java/com/game/business/service/IAppUsersCashrecordService.java

@@ -66,4 +66,6 @@ public interface IAppUsersCashrecordService extends IService<AppUsersCashrecord>
     public List<AppUsersCashrecord> getUserCashList(Long userId,String beginTime,String endTime);
 
     public Double sumWithdraw(Long userId);
+
+    public AppUsersCashrecord getByOrderNo(String orderNo);
 }

+ 8 - 0
game-business/src/main/java/com/game/business/service/impl/AppUsersCashrecordServiceImpl.java

@@ -112,4 +112,12 @@ public class AppUsersCashrecordServiceImpl extends ServiceImpl<AppUsersCashrecor
     public Double sumWithdraw(Long userId) {
         return appUsersCashrecordMapper.sumWithdraw(userId);
     }
+
+    @Override
+    @DataSource(DataSourceType.SLAVE)
+    public AppUsersCashrecord getByOrderNo(String orderNo) {
+        LambdaQueryWrapper<AppUsersCashrecord> queryWrapper = new LambdaQueryWrapper<>();
+        queryWrapper.eq(AppUsersCashrecord::getOrderno,orderNo);
+        return appUsersCashrecordMapper.selectOne(queryWrapper);
+    }
 }