From 48323fce3b4b8013755421aa1d1feb9a73cddde9 Mon Sep 17 00:00:00 2001 From: puzhibing <393733352@qq.com> Date: 星期三, 03 一月 2024 11:42:17 +0800 Subject: [PATCH] 合并代码 --- cloud-server-other/src/main/java/com/dsh/other/controller/SiteController.java | 60 +++++++++++++++++++++++++++++++++++++++++++----------------- 1 files changed, 43 insertions(+), 17 deletions(-) diff --git a/cloud-server-other/src/main/java/com/dsh/other/controller/SiteController.java b/cloud-server-other/src/main/java/com/dsh/other/controller/SiteController.java index d877677..59e44a1 100644 --- a/cloud-server-other/src/main/java/com/dsh/other/controller/SiteController.java +++ b/cloud-server-other/src/main/java/com/dsh/other/controller/SiteController.java @@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.dsh.other.entity.*; +import com.dsh.other.feignclient.CourseRecordClient; import com.dsh.other.feignclient.account.CityManagerClient; import com.dsh.other.feignclient.activity.UserCouponClient; import com.dsh.other.feignclient.activity.model.QueryUserCouponByIdAndUserId; @@ -128,7 +129,16 @@ } } - + /** + * 添加场地管理 + * + * @return + */ + @RequestMapping("/base/site/addSite1") + public Integer addSite1(@RequestBody Site site) { + boolean save = siteService.save(site); + return site.getId(); + } /** * 添加场地管理 * @@ -363,7 +373,13 @@ } } + @Autowired + private TGameConfigService gameConfigService; + @Autowired + private TGameRecordService gameRecordService; + @Resource + private CourseRecordClient courseRecordClient; /** * 启动游戏支付宝回调 * @@ -379,17 +395,26 @@ if (null != map) { String code = map.get("passback_params"); -// String trade_no = map.get("trade_no"); -// SiteBooking siteBooking = siteBookingService.getOne(new QueryWrapper<SiteBooking>().eq("orderNo", code).eq("state", 1)); -// if(siteBooking.getStatus() == 0){ -// siteBooking.setPayTime(new Date()); -// siteBooking.setStatus(1); -// siteBooking.setPayOrderNo(trade_no); -// siteBookingService.updateById(siteBooking); -// } - + String trade_no = map.get("trade_no"); String[] s = code.split("_"); Integer i = startGame(Integer.valueOf(s[0]), Integer.valueOf(s[1]), Integer.valueOf(s[2]), Integer.valueOf(s[3])); + List<TGameRecord> list = gameRecordService.list(new QueryWrapper<TGameRecord>().eq("number", s[4]).eq("payType", 2)); + TGameRecord one = list.get(0); + TGameConfig config = gameConfigService.getById(s[5]); + for (TGameRecord coursePackagePayment : list) { + coursePackagePayment.setStatus(1); + coursePackagePayment.setMoney(config.getCash()); + coursePackagePayment.setOrderNo(trade_no); + + CourseCounsum courseCounsum = new CourseCounsum(); + courseCounsum.setChangeType(3); + courseCounsum.setInsertTime(new Date()); + courseCounsum.setReason("智慧球场;" + config.getCash()); + courseCounsum.setAppUserId(Integer.valueOf(s[0])); + courseRecordClient.save(courseCounsum); + } + gameRecordService.updateBatchById(list); + System.err.println("===========游戏回调游戏回调=========" + i); PrintWriter out = response.getWriter(); out.write("success"); @@ -482,14 +507,15 @@ byId.setSid(Arrays.asList(storeId)); - List<Site> list = siteService.list(new LambdaQueryWrapper<Site>() - .eq(Site::getStoreId, storeId) - .eq(Site::getSign, 1)); - List<Integer> collect = list.stream().map(Site::getId).collect(Collectors.toList()); - byId.setRid(collect); +// List<Site> list = siteService.list(new LambdaQueryWrapper<Site>() +// .eq(Site::getStoreId, storeId) +// .eq(Site::getSign, 1)); +// List<Integer> collect = list.stream().map(Site::getId).collect(Collectors.toList()); + Integer siteId = byId.getSiteId(); + ArrayList<Integer> list1 = new ArrayList<>(); + list1.add(siteId); + byId.setRid(list1); map.put("data", byId); - - map.put("ids", ids); return ResultUtil.success(map); } catch (Exception e) { -- Gitblit v1.7.1