|
@@ -14,6 +14,7 @@ import com.jeeplus.psimanage.dishManage.domain.PsiDishType;
|
|
|
import com.jeeplus.psimanage.dishManage.mapper.PsiDishLibraryMapper;
|
|
import com.jeeplus.psimanage.dishManage.mapper.PsiDishLibraryMapper;
|
|
|
import com.jeeplus.psimanage.dishManage.mapper.PsiDishMenuDishMapper;
|
|
import com.jeeplus.psimanage.dishManage.mapper.PsiDishMenuDishMapper;
|
|
|
import com.jeeplus.psimanage.dishManage.mapper.PsiDishMenuMapper;
|
|
import com.jeeplus.psimanage.dishManage.mapper.PsiDishMenuMapper;
|
|
|
|
|
+import com.jeeplus.psimanage.dishManage.mapper.PsiDishTypeMapper;
|
|
|
import com.jeeplus.sys.feign.IUserApi;
|
|
import com.jeeplus.sys.feign.IUserApi;
|
|
|
import com.jeeplus.sys.service.dto.UserDTO;
|
|
import com.jeeplus.sys.service.dto.UserDTO;
|
|
|
import com.jeeplus.utils.StringUtils;
|
|
import com.jeeplus.utils.StringUtils;
|
|
@@ -46,6 +47,9 @@ public class PsiDishMenuService extends ServiceImpl<PsiDishMenuDishMapper, PsiDi
|
|
|
@Resource
|
|
@Resource
|
|
|
private PsiDishLibraryMapper dishLibraryMapper;
|
|
private PsiDishLibraryMapper dishLibraryMapper;
|
|
|
|
|
|
|
|
|
|
+ @Resource
|
|
|
|
|
+ private PsiDishTypeMapper dishTypeMapper;
|
|
|
|
|
+
|
|
|
public IPage<PsiDishMenuDish> list(Page<PsiDishMenuDish> page, PsiDishMenuDish info) {
|
|
public IPage<PsiDishMenuDish> list(Page<PsiDishMenuDish> page, PsiDishMenuDish info) {
|
|
|
getOrCreateCurrentMenu();
|
|
getOrCreateCurrentMenu();
|
|
|
QueryWrapper<PsiDishMenuDish> wrapper = buildMenuDishQuery(info);
|
|
QueryWrapper<PsiDishMenuDish> wrapper = buildMenuDishQuery(info);
|
|
@@ -349,7 +353,13 @@ public class PsiDishMenuService extends ServiceImpl<PsiDishMenuDishMapper, PsiDi
|
|
|
wrapper.like("dl.dish_name", info.getDishName());
|
|
wrapper.like("dl.dish_name", info.getDishName());
|
|
|
}
|
|
}
|
|
|
if (StringUtils.isNotBlank(info.getTypeId())) {
|
|
if (StringUtils.isNotBlank(info.getTypeId())) {
|
|
|
- wrapper.eq("dl.type_id", info.getTypeId());
|
|
|
|
|
|
|
+ // 左树点击父分类时,需连同其所有下级分类的菜品一起查询
|
|
|
|
|
+ List<String> typeIds = new ArrayList<>();
|
|
|
|
|
+ typeIds.add(info.getTypeId());
|
|
|
|
|
+ LambdaQueryWrapper<PsiDishType> typeWrapper = new LambdaQueryWrapper<>();
|
|
|
|
|
+ typeWrapper.like(PsiDishType::getParentIds, info.getTypeId());
|
|
|
|
|
+ dishTypeMapper.selectList(typeWrapper).forEach(item -> typeIds.add(item.getId()));
|
|
|
|
|
+ wrapper.in("dl.type_id", typeIds);
|
|
|
}
|
|
}
|
|
|
if (StringUtils.isNotBlank(info.getStatus())) {
|
|
if (StringUtils.isNotBlank(info.getStatus())) {
|
|
|
wrapper.eq("dl.status", info.getStatus());
|
|
wrapper.eq("dl.status", info.getStatus());
|