浏览代码

feat(app): 添加体育馆无固定场预览页功能

- 在 AppSitePlaceMapper 中添加预览订单场所的查询方法
- 在 IOrderService 和 OrderServiceImpl 中实现预览订单场所的业务逻辑
- 在 OrderController 中添加预览订单场所的 API 接口
- 新增 OrderVO.PreviewOrderPlaceGymnasiumNoFixation 类用于预览页数据传输
- 优化 DetailServiceImpl 中的设施信息处理逻辑
SheepHy 2 天之前
父节点
当前提交
4b7123f7c1

+ 13 - 0
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/app/controller/OrderController.java

@@ -117,4 +117,17 @@ public class OrderController {
     public Result<UserPayForm> createOrder(@RequestBody CreateOrderForm createOrderForm) {
         return Result.ok(appOrderService.createOrder(createOrderForm));
     }
+
+    /**
+     * @Author SheepHy
+     * @Description 体育馆无固定场-预览页
+     * @Date 17:22 2025/8/4
+     * @Param
+     * @return
+     **/
+    @Operation(summary="体育馆无固定场-预览页")
+    @GetMapping("/PreviewOrderPlaceGymnasiumNoFixation")
+    public Result<OrderVO.PreviewOrderPlaceGymnasiumNoFixation> previewOrderPlaceGymnasiumNoFixation(@RequestParam("placeId") @Schema(description = "场地ID")String placeId){
+        return Result.ok(appOrderService.previewOrderPlaceGymnasiumNoFixation(placeId));
+    }
 }

+ 9 - 0
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/app/service/IOrderService.java

@@ -64,4 +64,13 @@ public interface IOrderService {
     List<OrderVO.PreviewOrderPlaceSchoolTime> previewOrderPlaceSchoolTime(String placeId);
 
     UserPayForm createOrder(CreateOrderForm createOrderForm);
+
+    /**
+     * @Author SheepHy
+     * @Description 体育馆无固定场-预览页
+     * @Date 17:22 2025/8/4
+     * @Param
+     * @return
+     **/
+    OrderVO.PreviewOrderPlaceGymnasiumNoFixation previewOrderPlaceGymnasiumNoFixation(String placeId);
 }

+ 8 - 6
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/app/service/impl/DetailServiceImpl.java

@@ -79,13 +79,15 @@ public class DetailServiceImpl implements IDetailService {
         PlaceInfoVO placeInfo = appSiteMapper.getPlaceInfo(id);
         List<DictModel> dictModels = sysDictMapper.queryDictItemsByCode(FACILITY_INFO);
         List<String> facilityInfo = new ArrayList<>();
-        Arrays.stream(placeInfo.getFacility().split(",")).forEach(facility -> {
-            dictModels.forEach(dictModel -> {
-                if(facility.equals(dictModel.getValue())){
-                    facilityInfo.add(dictModel.getTitle());
-                }
+        if(null != placeInfo.getFacility()){
+            Arrays.stream(placeInfo.getFacility().split(",")).forEach(facility -> {
+                dictModels.forEach(dictModel -> {
+                    if(facility.equals(dictModel.getValue())){
+                        facilityInfo.add(dictModel.getTitle());
+                    }
+                });
             });
-        });
+        }
         placeInfo.setFacilityInfo(facilityInfo);
         List<PlaceInfoVO.InstructorVO> instructorVOList = new ArrayList<>();
         List<AppInstructor> appInstructors = appInstructorMapper.selectList(Wrappers.<AppInstructor>lambdaQuery()

+ 5 - 0
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/app/service/impl/OrderServiceImpl.java

@@ -580,6 +580,11 @@ public class OrderServiceImpl implements IOrderService {
         return payForm;
     }
 
+    @Override
+    public OrderVO.PreviewOrderPlaceGymnasiumNoFixation previewOrderPlaceGymnasiumNoFixation(String placeId) {
+        return appSitePlaceMapper.previewOrderPlaceGymnasiumNoFixation(placeId);
+    }
+
 
     /**
      * @return boolean

+ 34 - 0
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/app/vo/OrderVO.java

@@ -106,6 +106,40 @@ public class OrderVO {
         private List<PreviewOrderTimePeriod> timePeriod;
 
     }
+
+    @Data
+    @Accessors(chain = true)
+    @EqualsAndHashCode(callSuper = false)
+    @Schema(description="体育馆无固定场-预览页")
+    public static class PreviewOrderPlaceGymnasiumNoFixation {
+        @Schema(description = "场地ID")
+        private String placeId;
+        @Schema(description = "场地名称")
+        private String name;
+        @Schema(description = "原价")
+        private BigDecimal originalPrice;
+        @Schema(description = "售价")
+        private BigDecimal sellingPrice;
+        @Schema(description = "购买须知")
+        private String reminder;
+        @Schema(description = "有效期")
+        private int indate;
+        @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 = "提前预约时间")
+        private int advanceTime;
+        @Schema(description = "适用人数")
+        private int usableCount;
+        @Schema(description = "退款规则 退款类型;0可退/到期自动退 1限时退 2不可退")
+        private int refundType;
+    }
+
     @Data
     @Accessors(chain = true)
     @EqualsAndHashCode(callSuper = false)

+ 10 - 0
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/mapper/AppSitePlaceMapper.java

@@ -2,6 +2,7 @@ package org.jeecg.modules.system.app.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.apache.ibatis.annotations.Param;
+import org.jeecg.modules.app.vo.OrderVO;
 import org.jeecg.modules.app.vo.PlaceInfoVO;
 import org.jeecg.modules.app.vo.stadium.ConcertsVO;
 import org.jeecg.modules.app.vo.stadium.StadiumConcertsResponseVO;
@@ -28,4 +29,13 @@ public interface AppSitePlaceMapper extends BaseMapper<AppSitePlace> {
     List<ConcertsVO> findByConcerts(@Param("weekDay")Integer weekDay, @Param("siteId")String siteId, @Param("categoryId")String categoryId);
 
     StadiumConcertsResponseVO findBySidAndCid(@Param("siteId")String siteId,@Param("categoryId") String categoryId);
+
+    /**
+     * @Author SheepHy
+     * @Description 体育馆无固定场-预览页
+     * @Date 17:22 2025/8/4
+     * @Param
+     * @return
+     **/
+    OrderVO.PreviewOrderPlaceGymnasiumNoFixation previewOrderPlaceGymnasiumNoFixation(@Param("placeId")String placeId);
 }

+ 20 - 0
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/mapper/xml/AppSitePlaceMapper.xml

@@ -45,4 +45,24 @@
     <select id="findBySidAndCid" resultType="org.jeecg.modules.app.vo.stadium.StadiumConcertsResponseVO">
         select early_refund_time,buy_limit from nm_site_place where site_id = #{siteId} and category_id =#{categoryId} limit 1
     </select>
+    <select id="previewOrderPlaceGymnasiumNoFixation" resultType="org.jeecg.modules.app.vo.OrderVO$PreviewOrderPlaceGymnasiumNoFixation">
+        SELECT
+            a.id AS placeId,
+            a.NAME AS name,
+            g.original_price,
+            g.selling_price,
+            a.reminder,
+            a.indate,
+            g.start_time,
+            g.end_time,
+            a.advance_time,
+            a.usable_count,
+            a.refund_type
+        FROM
+            nm_site_place a
+                LEFT JOIN nm_site_price_rules g ON a.id = g.site_place_id
+                AND g.day_of_week = ( WEEKDAY( NOW()) + 1 )
+        WHERE
+            a.id = #{placeId}
+    </select>
 </mapper>