Parcourir la source

Merge remote-tracking branch 'origin/master'

lix il y a 2 semaines
Parent
commit
30ce201d0a

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

@@ -37,15 +37,13 @@ public class DetailServiceImpl implements IDetailService {
     private AppInstructorMapper appInstructorMapper;
     @Resource
     private AppOrderMapper appOrderMapper;
+    @Resource
+    private AppSitePlaceMapper appSitePlaceMapper;
 
     @Override
     public PlaceInfoVO getPlaceInfo(String id) {
         AppSite appSite = appSiteMapper.selectById(id);
         PlaceInfoVO placeInfo = appSiteMapper.getPlaceInfo(id);
-        AppSitePriceRules appSitePriceRules = appSitePriceRulesMapper.selectOne(Wrappers.<AppSitePriceRules>lambdaQuery()
-                .eq(AppSitePriceRules::getSitePlaceId, id)
-                .eq(AppSitePriceRules::getStatus, 0)
-                .last("limit 1"));
         List<PlaceInfoVO.InstructorVO> instructorVOList = new ArrayList<>();
         List<AppInstructor> appInstructors = appInstructorMapper.selectList(Wrappers.<AppInstructor>lambdaQuery()
                 .eq(AppInstructor::getOrgCode, appSite.getOrgCode()));
@@ -58,19 +56,24 @@ public class DetailServiceImpl implements IDetailService {
         }
         placeInfo.setInstructorVOList(instructorVOList);
         if(appSite.getType() == 0){
-            PlaceInfoVO.PlaceInfoMsgVO placeInfoMsgVO = new PlaceInfoVO.PlaceInfoMsgVO();
-            placeInfoMsgVO.setName(appSite.getName())
-                    .setSales(getPlaceSales(id))
-                    .setOriginalPrice(appSitePriceRules.getOriginalPrice())
-                    .setSellingPrice(appSitePriceRules.getSellingPrice());
-            placeInfo.setPlaceInfoMsgVO(placeInfoMsgVO);
+            List<PlaceInfoVO.PlaceInfoMsgVO> placeInfoMsgVOS = new ArrayList<>();
+            appSitePlaceMapper.selectList(Wrappers.<AppSitePlace>lambdaQuery().eq(AppSitePlace::getSiteId, id)).forEach(appSitePlace -> {
+                appSitePriceRulesMapper.selectList(Wrappers.<AppSitePriceRules>lambdaQuery()
+                        .eq(AppSitePriceRules::getSitePlaceId, id)
+                        .eq(AppSitePriceRules::getStatus, 0)
+                        .eq(AppSitePriceRules::getType,0)).forEach(appSitePriceRules -> {
+                    PlaceInfoVO.PlaceInfoMsgVO placeInfoMsgVO = new PlaceInfoVO.PlaceInfoMsgVO();
+                    placeInfoMsgVO.setName(appSite.getName())
+                            .setSales(getPlaceSales(id))
+                            .setOriginalPrice(appSitePriceRules.getOriginalPrice())
+                            .setSellingPrice(appSitePriceRules.getSellingPrice());
+                    placeInfoMsgVOS.add(placeInfoMsgVO);
+                });
+            });
+            placeInfo.setPlaceInfoMsgVO(placeInfoMsgVOS);
             return placeInfo;
         }else if(appSite.getType() == 1){
-            PlaceInfoVO.PlaceInfoMsgVO placeInfoMsgVO = new PlaceInfoVO.PlaceInfoMsgVO();
-            placeInfoMsgVO.setName(appSite.getName())
-                    .setSales(getPlaceSales(id))
-                    .setOriginalPrice(appSitePriceRules.getOriginalPrice())
-                    .setSellingPrice(appSitePriceRules.getSellingPrice());
+            List<PlaceInfoVO.PlaceInfoGymMsgVO> placeInfoMsgVO = appSitePlaceMapper.getPlaceInfoNoFixation(appSite.getId());
             placeInfo.setPlaceInfoMsgVO(placeInfoMsgVO);
             return placeInfo;
         }else {

+ 5 - 3
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/app/vo/PlaceInfoVO.java

@@ -62,18 +62,20 @@ public class PlaceInfoVO {
     @Data
     @Accessors(chain = true)
     @EqualsAndHashCode(callSuper = false)
-    @Schema(description="场地简约返回参数-体育馆")
+    @Schema(description="场地简约返回参数-体育馆(无固定)")
     public static class PlaceInfoGymMsgVO{
+        @Schema(description = "id")
+        private String id;
         @Schema(description = "场地名称")
         private String name;
         @Schema(description = "销售数量")
         private int sales;
-        @Schema(description = "类目")
-        private List<String> category;
         @Schema(description = "原价")
         private BigDecimal originalPrice;
         @Schema(description = "售价")
         private BigDecimal sellingPrice;
+        @Schema(description = "提前预约时间:0免预约 单位:时")
+        private int advanceTime;
     }
     @Data
     @Accessors(chain = true)

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

@@ -1,9 +1,10 @@
 package org.jeecg.modules.system.app.mapper;
 
-import java.util.List;
-
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.jeecg.modules.app.vo.PlaceInfoVO;
 import org.jeecg.modules.system.app.entity.AppSitePlace;
+import org.apache.ibatis.annotations.Param;
+import java.util.List;
 
 /**
  * @Description: 商户场所表
@@ -12,5 +13,12 @@ import org.jeecg.modules.system.app.entity.AppSitePlace;
  * @Version: V1.0
  */
 public interface AppSitePlaceMapper extends BaseMapper<AppSitePlace> {
-
+    /**
+     * @Author SheepHy
+     * @Description 根据商户ID查询场所信息(无固定场)
+     * @Date 9:38 2025/7/10
+     * @Param
+     * @return
+     **/
+    List<PlaceInfoVO.PlaceInfoGymMsgVO> getPlaceInfoNoFixation(@Param("id")String id);
 }

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

@@ -1,5 +1,16 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="org.jeecg.modules.system.app.mapper.AppSitePlaceMapper">
-
+    <select id="getPlaceInfoNoFixation" resultType="org.jeecg.modules.app.vo.PlaceInfoVO$PlaceInfoGymMsgVO">
+        SELECT
+            a.id,
+            a.`name`,
+            a.advance_time,
+            b.original_price,
+            b.selling_price
+        FROM
+            nm_site_place a
+                LEFT JOIN nm_site_peice_rules b ON a.id = b.site_place_id WHERE a.site_id = #{id} ORDER BY
+            b.selling_price ASC
+    </select>
 </mapper>