소스 검색

优化转出失败场景

dos 1 개월 전
부모
커밋
a06e3b771f
1개의 변경된 파일19개의 추가작업 그리고 0개의 파일을 삭제
  1. 19 0
      game-business/src/main/java/com/game/business/controller/AppUsersCashrecordController.java

+ 19 - 0
game-business/src/main/java/com/game/business/controller/AppUsersCashrecordController.java

@@ -278,6 +278,25 @@ public class AppUsersCashrecordController extends BaseController
                 }
                 //更新状态
                 update.setCashOutStatus(2L);
+            }else{
+                AppUser appUser = appUserService.selectAppUserByUserid(appUsersCashrecord.getUid());
+                if(null == appUser){
+                    return "failed";
+                }
+                if(null != appUsersCashrecord.getCashOutStatus() && appUsersCashrecord.getCashOutStatus().intValue() == 3) {
+                    FinTranAddedInfo addedInfo = FinTranAddedInfo.createTranInfo(appUser.getUserid(), 0, 0, AppSceneType.Scene_None, "");
+                    FinTranRecord tran = FinTranRecord.initFinTranRecordSomeParams(addedInfo, FinTranType3.CASH_DIAMOND_INCOME_BACK, FinTranType1.U_Income_Coin_Balance, appUser);
+                    tran.setDiamondCoinChange(appUsersCashrecord.getVotes().doubleValue());
+                    tran.setAfterDiamondCoin(appUser.getDiamondCoin());
+                    tran.setCurrencyType(TranCurrencyType.Balance.getType());
+                    tran.setTranGroupId(IdUtil.getSnowflakeNextId());
+                    tran.setRemarks("转出失败:回退金额");
+                    appUserService.updateUserAmount(tran,true);
+                }else{
+                    logger.info("订单{},当前状态非转出中,停止更新失败逻辑",orderNo);
+                }
+                //更新状态
+                update.setCashOutStatus(2L);
             }
             appUsersCashrecordService.updateAppUsersCashrecord(update);
             //更新用户可提现余额