zhangxin 2 週間 前
コミット
431252010f

+ 43 - 0
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/app/controller/stadium/StadiumController.java

@@ -0,0 +1,43 @@
+package org.jeecg.modules.app.controller.stadium;
+
+
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.modules.app.service.IDetailService;
+import org.jeecg.modules.app.vo.PlaceInfoVO;
+import org.jeecg.modules.app.vo.stadium.StadiumConcertsVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+
+@Slf4j
+@Tag(name = "App首页体育馆")
+@RestController
+@RequestMapping("/app/stadium")
+public class StadiumController {
+
+    @Autowired
+    IDetailService iDetailService;
+
+
+    /**
+     * @Description 体育馆场次查询
+     * @Date 19:41 2025/7/11
+     * @Param id 门店id
+     * @return PlaceInfoVO {@link PlaceInfoVO}
+     **/
+    @GetMapping("/getPlaceInfo")
+    @Operation(summary = "场次详情查询-缺少已定状态和可预约数逻辑 ")
+    public Result<List<StadiumConcertsVO>> findConcerts(){
+        String site_id = "1942781931946946561";
+        String category_id = "1942391828774895617";
+        return iDetailService.findConcerts(site_id,category_id);
+    }
+
+}

+ 38 - 0
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/app/vo/stadium/ConcertsDetailsVO.java

@@ -0,0 +1,38 @@
+package org.jeecg.modules.app.vo.stadium;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+@Data
+@Accessors(chain = true)
+@EqualsAndHashCode(callSuper = false)
+@Schema(description="体育馆场次")
+public class ConcertsDetailsVO {
+    @Schema(description = "场所明细id")
+    private String id;
+    /**场所名称*/
+    @Schema(description = "场所开始时间")
+    @JsonFormat(timezone = "GMT+8",pattern = "HH:mm:ss")
+    @DateTimeFormat(pattern="HH:mm:ss")
+    private Date startTime;
+    /**场所明细*/
+    @Schema(description = "场所结束时间")
+    @JsonFormat(timezone = "GMT+8",pattern = "HH:mm:ss")
+    @DateTimeFormat(pattern="HH:mm:ss")
+    private Date endTime;
+    /**当天场次已预约数*/
+    @Schema(description = "场所状态0-未预约;1-已预约")
+    private Integer concertStatus;
+
+    @Schema(description = "价格")
+    private BigDecimal price;
+
+
+}

+ 25 - 0
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/app/vo/stadium/ConcertsVO.java

@@ -0,0 +1,25 @@
+package org.jeecg.modules.app.vo.stadium;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.util.List;
+
+@Data
+@Accessors(chain = true)
+@EqualsAndHashCode(callSuper = false)
+@Schema(description="体育馆场次")
+public class ConcertsVO {
+    @Schema(description = "场所id")
+    private String sitePlaceId;
+    /**场所名称*/
+    @Schema(description = "场所名称")
+    private String sitePlaceName;
+    /**场所明细*/
+    @Schema(description = "场所明细")
+    private List<ConcertsDetailsVO> concertsDetailsVOList;
+
+
+}

+ 38 - 0
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/app/vo/stadium/StadiumConcertsVO.java

@@ -0,0 +1,38 @@
+package org.jeecg.modules.app.vo.stadium;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.util.List;
+
+@Data
+@Accessors(chain = true)
+@EqualsAndHashCode(callSuper = false)
+@Schema(description="体育馆场次")
+public class StadiumConcertsVO {
+
+    @Schema(description = "门店id")
+    private Integer siteId;
+    @Schema(description = "运动类型Id")
+    private Integer categoryId;
+    @Schema(description = "星期")
+    private Integer weekDay;
+    /**事件类型(0: 网页链接, 1: 内部页面跳转)*/
+    @Schema(description = "日期加星期")
+    private String weekDayAndDate;
+//    /**当天场次总数*/
+//    @Schema(description = "当天场次总数")
+//    private String dayConcertsTotal;
+//    /**当天场次已预约数*/
+//    @Schema(description = "当天场次已预约数")
+//    private String dayConcertsReservationNum;
+    @Schema(description = "当天场次未预约数")
+    private String noDayConcertsReservationNum;
+    /**当天场次已预约数*/
+    @Schema(description = "当天场所明细")
+    private List<ConcertsVO> concertsVOList;
+
+
+}

+ 47 - 8
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/utils/TimeRangeFinder.java

@@ -1,11 +1,13 @@
 package org.jeecg.modules.system.app.utils;
 
-import org.apache.poi.ss.formula.functions.T;
-import org.jeecg.modules.system.app.dto.AppCoursesRuleDTO;
-import org.w3c.dom.stylesheets.LinkStyle;
+import com.alibaba.fastjson.JSONObject;
+import org.jeecg.modules.system.app.vo.time.NextSevenDayVo;
 
+import java.time.DayOfWeek;
+import java.time.LocalDate;
 import java.time.LocalTime;
 import java.time.format.DateTimeFormatter;
+import java.time.format.TextStyle;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -79,13 +81,50 @@ public class TimeRangeFinder {
         return merged.stream().map(TimeRange::toString).collect(Collectors.joining(","));
     }
 
+    //获取当前时间及后面6天的
+    public static List<NextSevenDayVo> getNextSevenDays() {
+        List<NextSevenDayVo> dates = new ArrayList<>();
+        LocalDate today = LocalDate.now();
+        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MM-dd");
+        for (int i = 0; i < 7; i++) { // 包含今天共8天
+            NextSevenDayVo nextSevenDayVo= new NextSevenDayVo();
+            LocalDate localDate = today.plusDays(i);
+            Locale locale = Locale.CHINA;
+            String format = localDate.format(formatter);
+            DayOfWeek dayOfWeek = localDate.getDayOfWeek();
+            int dayOfWeekNum = dayOfWeek.getValue();
+            String display;
+            switch (i) {
+                case 0:
+                    display = "今天(" + format + ")";
+                    break;
+                case 1:
+                    display = "明天(" + format + ")";
+                    break;
+                case 2:
+                    display = "后天(" + format + ")";
+                    break;
+                default:
+
+                    String weekday = dayOfWeek.getDisplayName(TextStyle.SHORT, locale);
+                    display = weekday + "(" + format + ")";
+            }
+            nextSevenDayVo.setWeekDay(dayOfWeekNum);
+            nextSevenDayVo.setWeekDayAndDate(display);
+            dates.add(nextSevenDayVo);
+        }
+        return dates;
+    }
+
     // 主方法示例
     public static void main(String[] args) {
-        String input = "6:00-7:00, 6:30-8:00, 18:00-20:00, 19:30-21:00";
-        List<TimeRange> parsed = parseTimeRanges(input);
-        List<TimeRange> merged = mergeTimeRanges(parsed);
-        String result = formatMergedRanges(merged);
-        System.out.println(result); // 输出:6:00-8:00,18:00-21:00
+//        String input = "6:00-7:00, 6:30-8:00, 18:00-20:00, 19:30-21:00";
+//        List<TimeRange> parsed = parseTimeRanges(input);
+//        List<TimeRange> merged = mergeTimeRanges(parsed);
+//        String result = formatMergedRanges(merged);
+        List<NextSevenDayVo> nextSevenDays = getNextSevenDays();
+        System.out.println(JSONObject.toJSONString(nextSevenDays));
+//        System.out.println(result); // 输出:6:00-8:00,18:00-21:00
     }
 
 }

+ 27 - 0
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/vo/time/NextSevenDayVo.java

@@ -0,0 +1,27 @@
+package org.jeecg.modules.system.app.vo.time;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import lombok.experimental.Accessors;
+
+/**
+ * @author DM
+ * @date 2025/7/7 15:41
+ * @description
+ */
+
+@Data
+@Accessors(chain = true)
+@EqualsAndHashCode(callSuper = false)
+@AllArgsConstructor
+@NoArgsConstructor
+@Schema(description="获取当前时间后续七天的日期")
+public class NextSevenDayVo {
+    @Schema(description ="星期几")
+    private Integer weekDay;
+    @Schema(description ="星期配合日期")
+    private String weekDayAndDate;
+}