puzhibing
2024-02-05 640ff18d2d7f4be02ddb7f8f75e899f05545eb98
cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/system/BallController.java
@@ -273,26 +273,23 @@
        // 添加门禁 红蓝方
        TSite si = siteService.getById(site);
        TStore st = storeService.getById(store);
        map3.put("sign", "0DB011836143EEE2C2E072967C9F4E4B");
        map3.put("space_id", si.getId() + "");
        map3.put("name", sutuName);
        map3.put("city_code", "");
        String s3 = HttpRequestUtil.postRequest("https://try.daowepark.com/v7/user_api/general/addDevice", map3);
        System.out.println("---------------------------"+s3);
        JSONObject jsonObject = new JSONObject(s3);
        // 获取 data 字段的值
        JSONObject dataObject = jsonObject.getJSONObject("data");
        // 获取 sutu_id 字段的值
        String sutuIdValue = dataObject.getString("sutu_id");
        Integer sutuId = Integer.valueOf(sutuIdValue);
        game.setSutuId(sutuId);
//        map3.put("sign", "0DB011836143EEE2C2E072967C9F4E4B");
//        map3.put("space_id", si.getId() + "");
//        map3.put("name", ToolUtil.isEmpty(sutuName) ? "" : sutuName);
//        map3.put("city_code", "");
//        String s3 = HttpRequestUtil.postRequest("https://try.daowepark.com/v7/user_api/general/addDevice", map3);
//        System.out.println("---------------------------"+s3);
//        JSONObject jsonObject = new JSONObject(s3);
//        // 获取 data 字段的值
//        JSONObject dataObject = jsonObject.getJSONObject("data");
//        // 获取 sutu_id 字段的值
//        String sutuIdValue = dataObject.getString("sutu_id");
//        Integer sutuId = Integer.valueOf(sutuIdValue);
//        game.setSutuId(sutuId);
        Integer gameId = ballClient.save(game);
List<TGameConfig> gameConfigList = new ArrayList<>();
        List<TGameConfig> gameConfigList = new ArrayList<>();
//玩湃跨城赛
        //玩湃跨城赛
        TGameConfig gameConfigkuacheng = new TGameConfig();
        gameConfigkuacheng.setId(kcId);
        gameConfigkuacheng.setGameId(kuachengId);
@@ -304,7 +301,7 @@
        gameConfigkuacheng.setOtherId(gameId);
        System.out.println("========gameConfig======"+gameConfigkuacheng);
        gameConfigList.add(gameConfigkuacheng);
System.out.println("======gameConfigList======="+gameConfigList);
        System.out.println("======gameConfigList======="+gameConfigList);
        //社区冠军赛
@@ -1363,42 +1360,25 @@
        String[] dates = times.split(";");
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm");
        try {
            String start = dates[0];
            String startDateStr = start.substring(0, start.lastIndexOf("-"));
            Date startDate = format.parse(startDateStr);
        Date minDate = null;
        Date maxDate = null;
        for (String dateStr : dates) {
            String[] dateRange = dateStr.split("-");
            String startDateStr = dateRange[0].trim();
            String endDateStr = dateRange[1].trim();
            try {
                Date startDate = format.parse(startDateStr);
                Date endDate = format.parse(endDateStr);
                if (minDate == null || startDate.before(minDate)) {
                    minDate = startDate;
                }
                if (maxDate == null || endDate.after(maxDate)) {
                    maxDate = endDate;
                }
            } catch (Exception e) {
                e.printStackTrace();
            }
            String end = dates[dates.length - 1];
            String[] str = end.split(" ");
            String endDateStr = str[0] + " " + str[1].substring(str[1].indexOf("-") + 1);
            Date endDate = format.parse(endDateStr);
            siteBooking.setStartTime(startDate);
            siteBooking.setEndTime(endDate);
        } catch (Exception e) {
            e.printStackTrace();
        }
        System.out.println("最小日期:" + minDate);
        System.out.println("最大日期:" + maxDate);
        siteBooking.setStartTime(minDate);
        siteBooking.setEndTime(maxDate);
        siteBooking.setPayType(2);
        //存多少钱
        String money = siteBooking.getMoney();
        String[] moneys = money.split(",");
        siteBooking.setPayMoney(Double.valueOf(moneys[0]));
        // 查询当前预约人是否是会员
        String phone = siteBooking.getPhone();
        String booker = siteBooking.getBooker();