dos 1 сар өмнө
parent
commit
1d5991253a

+ 13 - 8
game-business/src/main/java/com/game/business/controller/AppUsersCashrecordController.java

@@ -241,6 +241,7 @@ public class AppUsersCashrecordController extends BaseController
             if(null == appUsersCashrecord){
                 return "failed";
             }
+
             AppUsersCashrecord update = new AppUsersCashrecord();
             update.setId(appUsersCashrecord.getId());
             update.setCashOutStatus(1L);
@@ -252,14 +253,18 @@ public class AppUsersCashrecordController extends BaseController
                 if(null == appUser){
                     return "failed";
                 }
-                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);
+                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);
+                }else{
+                    logger.info("订单{},当前状态非转出中,停止更新失败逻辑",orderNo);
+                }
                 //更新状态
                 update.setCashOutStatus(2L);
             }