dos 1 月之前
父节点
当前提交
ee1aa9191b

+ 22 - 4
game-business/src/main/java/com/game/business/controller/AppUsersCashrecordController.java

@@ -173,7 +173,8 @@ public class AppUsersCashrecordController extends BaseController
                         throw new Exception("审核失败,用户提现账号不存在");
                     }
                 }
-                Double amount = (appUsersCashrecord.getMoney().doubleValue() - appUsersCashrecord.getService().doubleValue()) * 100;
+//                Double amount = (appUsersCashrecord.getMoney().doubleValue() - appUsersCashrecord.getService().doubleValue()) * 100;
+                Double amount = (appUsersCashrecord.getMoney().doubleValue()) * 100;
                 Map<String, Object> map = PayOrderUtils.getPayUrl(String.valueOf(appUsersCashrecord.getOrderno()),appChargeChannel.getChannelKey(),amount.intValue(),extra);
                 String url = "";
                 if("1".equals(String.valueOf(map.get("code")))){
@@ -231,9 +232,6 @@ public class AppUsersCashrecordController extends BaseController
             String tradeNo = map.get("tradeNo").toString();
             //验证回调订单
             Map<String, Object> checkMap = PayOrderUtils.checkOrder(orderNo,tradeNo);
-            if(!"1".equals(String.valueOf(checkMap.get("code")))){
-                return "failed";
-            }
             LambdaQueryWrapper<AppUsersCashrecord> queryWrapper = new LambdaQueryWrapper<>();
             queryWrapper.eq(AppUsersCashrecord::getOrderno,orderNo);
             AppUsersCashrecord appUsersCashrecord = appUsersCashrecordService.getOne(queryWrapper);
@@ -244,7 +242,27 @@ public class AppUsersCashrecordController extends BaseController
             update.setId(appUsersCashrecord.getId());
             update.setCashOutStatus(1L);
             update.setCashOutOrderId(tradeNo);
+            if(!"1".equals(String.valueOf(checkMap.get("code")))){
+                //转出失败
+                //流水 余额
+                AppUser appUser = appUserService.selectAppUserByUserid(appUsersCashrecord.getUid());
+                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);
+                appUserCountTask.updateWithdrawAble(appUser.getUserid());
+                //更新状态
+                update.setCashOutStatus(2L);
+            }
             appUsersCashrecordService.updateAppUsersCashrecord(update);
+
             return "success";
         }else{
             return "failed";

+ 1 - 1
game-ui/src/views/business/cashrecord/index.vue

@@ -195,7 +195,7 @@
               v-for="dict in dict.type.app_user_cash_status"
               :key="dict.value"
               :label="dict.label"
-              :value="parseInt(dict.value)"
+              :value="dict.value"
             ></el-option>
           </el-select>
         </el-form-item>