|
|
@@ -354,11 +354,13 @@ public class StoreMenuServiceImpl extends ServiceImpl<StoreMenuMapper, StoreMenu
|
|
|
// 先查询该门店的所有菜单数据(不应用筛选条件),用于统计
|
|
|
List<StoreMenuVo> allMenuList = storeMenuMapper.getClientMenuByStoreId(storeId, null, null);
|
|
|
|
|
|
- // 按照四种组合进行分组统计(基于所有菜单数据,不受筛选条件影响):
|
|
|
+ // 按照六种组合进行分组统计(基于所有菜单数据,不受筛选条件影响):
|
|
|
// 1. dish_menu_type = 1(菜单),dish_type = 0(全部)
|
|
|
// 2. dish_menu_type = 1(菜单),dish_type = 1(推荐)
|
|
|
// 3. dish_menu_type = 2(酒水),dish_type = 0(全部)
|
|
|
// 4. dish_menu_type = 2(酒水),dish_type = 1(推荐)
|
|
|
+ // 5. dish_menu_type = 1和2(全部),dish_type = 0(全部)
|
|
|
+ // 6. dish_menu_type = 1和2(全部),dish_type = 1(推荐)
|
|
|
Map<String, Integer> countMap = new HashMap<>();
|
|
|
|
|
|
if (CollectionUtils.isNotEmpty(allMenuList)) {
|
|
|
@@ -389,12 +391,22 @@ public class StoreMenuServiceImpl extends ServiceImpl<StoreMenuMapper, StoreMenu
|
|
|
&& (item.getDishType() == null || DISH_TYPE_NON_RECOMMEND.equals(item.getDishType())))
|
|
|
.count();
|
|
|
countMap.put("drink_all", (int) drinkAllCount + (int) drinkRecommendCount);
|
|
|
+
|
|
|
+ // 新增统计:dist_type 为全部,dish_menu_type 为 1 和 2(菜单和酒水都包含)
|
|
|
+ int allMenuAllCount = countMap.get("menu_all") + countMap.get("drink_all");
|
|
|
+ countMap.put("all_menu_all", allMenuAllCount);
|
|
|
+
|
|
|
+ // 新增统计:dist_type 为 1(推荐),dish_menu_type 为 1 和 2(菜单和酒水都包含)
|
|
|
+ int allMenuRecommendCount = countMap.get("menu_recommend") + countMap.get("drink_recommend");
|
|
|
+ countMap.put("all_menu_recommend", allMenuRecommendCount);
|
|
|
} else {
|
|
|
// 如果没有数据,返回0
|
|
|
countMap.put("menu_all", 0);
|
|
|
countMap.put("menu_recommend", 0);
|
|
|
countMap.put("drink_all", 0);
|
|
|
countMap.put("drink_recommend", 0);
|
|
|
+ countMap.put("all_menu_all", 0);
|
|
|
+ countMap.put("all_menu_recommend", 0);
|
|
|
}
|
|
|
|
|
|
// 处理菜品类型参数:当dishType为0时,转换为null以查询所有类型
|
|
|
@@ -432,10 +444,11 @@ public class StoreMenuServiceImpl extends ServiceImpl<StoreMenuMapper, StoreMenu
|
|
|
result.put("list", sortedMenuList);
|
|
|
result.put("count", countMap);
|
|
|
|
|
|
- log.info("获取用户端菜单完成,门店ID:{},返回菜单数量:{},统计信息:菜单-全部={},菜单-推荐={},酒水-全部={},酒水-推荐={}",
|
|
|
+ log.info("获取用户端菜单完成,门店ID:{},返回菜单数量:{},统计信息:菜单-全部={},菜单-推荐={},酒水-全部={},酒水-推荐={},全部-全部={},全部-推荐={}",
|
|
|
storeId, sortedMenuList.size(),
|
|
|
countMap.get("menu_all"), countMap.get("menu_recommend"),
|
|
|
- countMap.get("drink_all"), countMap.get("drink_recommend"));
|
|
|
+ countMap.get("drink_all"), countMap.get("drink_recommend"),
|
|
|
+ countMap.get("all_menu_all"), countMap.get("all_menu_recommend"));
|
|
|
|
|
|
return result;
|
|
|
}
|