Browse Source

feat(app): 添加场地价格规则查询功能

- 在详情服务中集成场地价格规则查询逻辑
- 根据组织代码和分类ID查询最低售价- 将查询到的售价设置到场馆信息对象中
- 支持按星期几筛选价格规则
- 实现价格规则的排序和限制返回一条记录
- 确保VR信息正常加载不受影响
SheepHy 3 weeks ago
parent
commit
5b998bb399

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

@@ -322,6 +322,15 @@ public class DetailServiceImpl implements IDetailService {
 
         }
         if(!collect.isEmpty()){
+            collect.forEach(theGymnasiumIsCharteredInfoVO -> {
+                AppSitePriceRules appSitePriceRules = appSitePriceRulesMapper.selectById(theGymnasiumIsCharteredInfoVO.getId());
+                theGymnasiumIsCharteredInfoVO.setSellingPrice(appSitePriceRulesMapper.selectOne(Wrappers.<AppSitePriceRules>lambdaQuery()
+                        .eq(AppSitePriceRules::getOrgCode, appSitePriceRules.getOrgCode())
+                        .eq(AppSitePriceRules::getCategoryId, categoryId)
+                        .eq(AppSitePriceRules::getDayOfWeek, appSitePriceRules.getDayOfWeek())
+                        .orderByAsc(AppSitePriceRules::getSellingPrice).last("LIMIT 1"))
+                        .getSellingPrice());
+            });
             theGymnasiumIsCharteredVO.setVr(appSiteMapper.selectById(id).getVr());
         }
         theGymnasiumIsCharteredVO.setTimeSlot(collect);