|
@@ -2,6 +2,8 @@ package com.iotechn.unimall.admin.api.tourism.impl;
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
+import com.iotechn.unimall.data.domain.FoodDishesInfo;
|
|
|
+import com.iotechn.unimall.data.mapper.FoodDishesInfoMapper;
|
|
|
import org.apache.ibatis.session.RowBounds;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -29,6 +31,8 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
public class DishClassifyInfoServiceImpl implements IDishClassifyInfoService{
|
|
|
@Autowired
|
|
|
private DishClassifyInfoMapper dishClassifyInfoMapper;
|
|
|
+ @Autowired
|
|
|
+ private FoodDishesInfoMapper foodDishesInfoMapper;
|
|
|
|
|
|
@Override
|
|
|
public Boolean add(DishClassifyInfo dishClassifyInfo) throws ServiceException {
|
|
@@ -61,6 +65,15 @@ public class DishClassifyInfoServiceImpl implements IDishClassifyInfoService{
|
|
|
}
|
|
|
wrapper.eq("delete_flag", 0).orderBy("top_marking",false);
|
|
|
List<DishClassifyInfo> list = dishClassifyInfoMapper.selectPage(new RowBounds((page - 1) * limit, limit), wrapper);
|
|
|
+ if (!CollectionUtils.isEmpty(list)){
|
|
|
+ for (DishClassifyInfo dishClassifyInfo:list){
|
|
|
+ List<FoodDishesInfo> foodDishesInfoList = foodDishesInfoMapper.selectList(new EntityWrapper<FoodDishesInfo>()
|
|
|
+ .eq("food_id",dishClassifyInfo.getFoodId())
|
|
|
+ .eq("classify",dishClassifyInfo.getClassifyName())
|
|
|
+ .orderBy("top_marking",false).orderBy("gmt_create",false));
|
|
|
+ dishClassifyInfo.setDishesNum(foodDishesInfoList.size());
|
|
|
+ }
|
|
|
+ }
|
|
|
Integer count = dishClassifyInfoMapper.selectCount(wrapper);
|
|
|
return new Page<DishClassifyInfo>(list, page, limit, count);
|
|
|
}
|