From 572df690f72ed4a077d934823f261dec39b3cc7d Mon Sep 17 00:00:00 2001
From: 刘帅 <rr.iii@qq.com>
Date: 星期二, 08 九月 2026 17:11:34 +0800
Subject: [PATCH] feat&bug:文档内容修改
---
cloud-server-other/src/main/java/com/dsh/other/controller/GameController.java | 39 ++++++++++++++++++++++++++++-----------
1 files changed, 28 insertions(+), 11 deletions(-)
diff --git a/cloud-server-other/src/main/java/com/dsh/other/controller/GameController.java b/cloud-server-other/src/main/java/com/dsh/other/controller/GameController.java
index 0562ff8..d0c6c61 100644
--- a/cloud-server-other/src/main/java/com/dsh/other/controller/GameController.java
+++ b/cloud-server-other/src/main/java/com/dsh/other/controller/GameController.java
@@ -110,15 +110,15 @@
Integer uid = tokenUtil.getUserIdFormRedis();
AppUser appUser = appUserClient.queryAppUser(uid);
List<TGameConfig> tGameConfigs = new ArrayList<>();
- if (appUser.getAddUserId() == null) {
- List<SiteLock> lock = lockService.list(new QueryWrapper<SiteLock>().eq("siteId", siteId));
- Date now = new Date();
- for (SiteLock siteLock : lock) {
- if (now.after(siteLock.getStartTime()) && now.before(siteLock.getEndTime())) {
- return ResultUtil.error("当前场地已被锁定");
- }
- }
- }
+// if (appUser.getAddUserId() == null) {
+// List<SiteLock> lock = lockService.list(new QueryWrapper<SiteLock>().eq("siteId", siteId));
+// Date now = new Date();
+// for (SiteLock siteLock : lock) {
+// if (now.after(siteLock.getStartTime()) && now.before(siteLock.getEndTime())) {
+// return ResultUtil.error("当前场地已被锁定");
+// }
+// }
+// }
List<TGame> list = gameService.list(new LambdaQueryWrapper<TGame>().eq(TGame::getSiteId, siteId).eq(TGame::getStoreId, storeId).eq(TGame::getState, 0));
if (list.size() > 0) {
Integer id = list.get(0).getId();
@@ -227,8 +227,16 @@
System.err.println("启动游戏支付");
if (type == 1) {
+
tGameRecord.setMoney(config.getCash());
gameRecordService.updateById(tGameRecord);
+ if(config.getCash().compareTo(BigDecimal.ZERO)==0){
+ // 零元不获取支付
+ tGameRecord.setStatus(1);
+ gameRecordService.updateById(tGameRecord);
+ startGame(uid, gameType, gameId, spaceId, sutuId);
+ return ResultUtil.success();
+ }
String params = uid + "_" + gameId + "_" + spaceId + "_" + sutuId+"_"+code+"_"+configId + "_" + gameType;
// ResultUtil weixinpay = payMoneyUtil.weixinpay("游戏支付-"+isFenZhang, params, code, config.getCash().toString(),
// "/base/game/wechatPaymentGameCallback", "APP", "");
@@ -254,6 +262,13 @@
} else if (type == 2) {
tGameRecord.setMoney(config.getCash());
gameRecordService.updateById(tGameRecord);
+ if(config.getCash().compareTo(BigDecimal.ZERO)==0){
+ // 零元不获取支付
+ tGameRecord.setStatus(1);
+ gameRecordService.updateById(tGameRecord);
+ startGame(uid, gameType, gameId, spaceId, sutuId);
+ return ResultUtil.success();
+ }
String smid1="";
String params = uid + "_" + gameId + "_" + spaceId + "_" + sutuId+"_"+code+"_"+ configId + "_" + gameType;
// 判断属于哪个运营商 根据运营商 id 获取对应的商户号
@@ -271,6 +286,7 @@
ResultUtil alipay = payMoneyUtil.alipay(smid1,"游戏支付", "游戏支付", params, code, config.getCash().toString(),
"/base/game/aliPaymentGameCallback");
if (alipay.getCode() == 200) {
+ String finalSmid = smid1;
new Thread(new Runnable() {
@Override
public void run() {
@@ -314,7 +330,8 @@
}
gameRecordService.updateBatchById(list);
Integer integer = startGame(uid, gameType, gameId, spaceId, sutuId);
-
+ Thread.sleep(30000);
+ payMoneyUtil.confirm(finalSmid, code, one.getOrderNo(), config.getCash().toString());
break;
}
if ("WAIT_BUYER_PAY".equals(s)) {
@@ -395,7 +412,7 @@
map.put("space_id", spaceId + "");
map.put("red_sutu_id", game.getRed());
map.put("blue_sutu_id", game.getBlue());
- map.put("api_url", "http://221.182.45.100:56666/communityWorldCup/base/worldCup/endWorldCupCallback");
+ map.put("api_url", "http://8.137.22.229:56666/communityWorldCup/base/worldCup/endWorldCupCallback");
map.put("custom", "{\"gameType\": 2}");
String s = HttpRequestUtil.postRequest("https://port.daowepark.com/v7/user_api/general/quickStart", map);
--
Gitblit v1.7.1