| | |
| | | import com.dsh.other.model.vo.siteVo.ExpireSiteSearchVO; |
| | | import com.dsh.other.model.vo.siteVo.SiteSearchVO; |
| | | import com.dsh.other.service.*; |
| | | import com.dsh.other.util.PayMoneyUtil; |
| | | import com.dsh.other.util.RedisUtil; |
| | | import com.dsh.other.util.ResultUtil; |
| | | import com.dsh.other.util.TokenUtil; |
| | | import com.dsh.other.util.*; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | @ApiImplicitParam(value = "半场名称", name = "halfName", dataType = "string", required = false), |
| | | @ApiImplicitParam(value = "选择场地的名称", name = "siteName", dataType = "string", required = false) |
| | | }) |
| | | public ResultUtil<List<QuerySiteTimes>> querySiteTimes(Integer id, String day,String halfName,String siteName){ |
| | | public ResultUtil<List<QuerySiteTimes>> querySiteTimes(Integer id, String day,String halfName,String siteName){ |
| | | try { |
| | | List<QuerySiteTimes> list = siteService.querySiteTimes(id, day,halfName,siteName); |
| | | return ResultUtil.success(list); |
| | |
| | | |
| | | |
| | | /** |
| | | * 购买课程支付宝回调 |
| | | * 预约场地支付宝回调 |
| | | * @param request |
| | | * @param response |
| | | */ |
| | |
| | | } |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 启动游戏支付宝回调 |
| | | * @param request |
| | | * @param response |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/base/site/gameCallback") |
| | | public void gameCallback(HttpServletRequest request, HttpServletResponse response){ |
| | | try { |
| | | System.out.println("回调回调回调"); |
| | | Map<String, String> map = payMoneyUtil.alipayCallback(request); |
| | | 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[] s = code.split("_"); |
| | | Integer i = startGame(Integer.valueOf(s[0]), Integer.valueOf(s[1]), Integer.valueOf(s[2]), Integer.valueOf(s[3])); |
| | | System.err.println("===========游戏回调游戏回调========="+i); |
| | | PrintWriter out = response.getWriter(); |
| | | out.write("success"); |
| | | out.flush(); |
| | | out.close(); |
| | | } |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | |
| | | private static Integer startGame(Integer uid,Integer gameId,Integer spaceId,Integer sutuId){ |
| | | HashMap<String, String> map = new HashMap<>(); |
| | | map.put("sign","0DB011836143EEE2C2E072967C9F4E4B"); |
| | | map.put("app_user_id",uid+""); |
| | | map.put("game_id",gameId+""); |
| | | map.put("space_id",spaceId+""); |
| | | map.put("sutu_id",sutuId+""); |
| | | |
| | | String s = HttpRequestUtil.postRequest("https://try.daowepark.com/v7/user_api/general/gameStart", map); |
| | | JSONObject jsonObject = JSONObject.parseObject(s); |
| | | Object code = jsonObject.get("code"); |
| | | if(String.valueOf(code)!=null && "200".equals(String.valueOf(code))){ |
| | | return 200; |
| | | }else { |
| | | return 500; |
| | | } |
| | | } |
| | | |
| | |
| | | Integer storeId = byId.getStoreId(); |
| | | Store byId1 = service.getById(storeId); |
| | | Site site = siteService.getById(byId.getSiteId()); |
| | | |
| | | map.put("siteName",byId1.getName()); |
| | | SiteType siteType = siteTypeService.getById(site.getSiteTypeId()); |
| | | map.put("siteType",siteType.getName()); |
| | | map.put("shopName",byId1.getName()); |
| | | map.put("shopAddress",byId1.getAddress()); |
| | | |
| | | map.put("name",site.getName()); |
| | | |
| | | |
| | | |
| | | List<Integer> ids = getIds(byId.getSiteId()); |
| | |
| | | |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/site/counts") |
| | | public Integer counts(@RequestBody Integer stuId){ |
| | | return siteBookingService.count(new QueryWrapper<SiteBooking>().eq("appUserId",stuId)); |
| | | |
| | | } |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/site/queryOperator") |
| | | public OperatorUser queryOperator(@RequestBody List<Integer> stores){ |