|
@@ -2,8 +2,8 @@ package com.iotechn.unimall.admin.api.tourism.impl;
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
-import com.iotechn.unimall.data.domain.CommonUserInfo;
|
|
|
-import com.iotechn.unimall.data.domain.FoodGroupDetailInfo;
|
|
|
+import com.iotechn.unimall.data.domain.*;
|
|
|
+import com.iotechn.unimall.data.mapper.DishClassifyInfoMapper;
|
|
|
import com.iotechn.unimall.data.mapper.FoodGroupDetailInfoMapper;
|
|
|
import org.apache.ibatis.session.RowBounds;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -16,7 +16,6 @@ import com.baomidou.mybatisplus.mapper.Wrapper;
|
|
|
import com.iotechn.unimall.core.exception.ServiceException;
|
|
|
import com.iotechn.unimall.data.util.ExcelUtil;
|
|
|
import com.iotechn.unimall.data.mapper.FoodGroupInfoMapper;
|
|
|
-import com.iotechn.unimall.data.domain.FoodGroupInfo;
|
|
|
import com.iotechn.unimall.admin.api.tourism.IFoodGroupInfoService;
|
|
|
import com.iotechn.unimall.data.model.Page;
|
|
|
import java.util.Date;
|
|
@@ -34,18 +33,18 @@ public class FoodGroupInfoServiceImpl implements IFoodGroupInfoService{
|
|
|
private FoodGroupInfoMapper foodGroupInfoMapper;
|
|
|
@Autowired
|
|
|
private FoodGroupDetailInfoMapper foodGroupDetailInfoMapper;
|
|
|
+ @Autowired
|
|
|
+ private DishClassifyInfoMapper dishClassifyInfoMapper;
|
|
|
|
|
|
@Override
|
|
|
public Boolean add(FoodGroupInfo foodGroupInfo) throws ServiceException {
|
|
|
Date now = new Date();
|
|
|
- FoodGroupInfo foodGroupInfo1=new FoodGroupInfo();
|
|
|
- foodGroupInfo1.setGmtCreate(now);
|
|
|
- foodGroupInfo1.setGmtUpdate(now);
|
|
|
- foodGroupInfoMapper.insert(foodGroupInfo1);
|
|
|
- foodGroupInfo1=foodGroupInfoMapper.selectById(foodGroupInfo1.getId());
|
|
|
+ foodGroupInfo.setGmtCreate(now);
|
|
|
+ foodGroupInfo.setGmtUpdate(now);
|
|
|
+ foodGroupInfoMapper.insert(foodGroupInfo);
|
|
|
if (!CollectionUtils.isEmpty(foodGroupInfo.getFoodGroupDetailInfoList())){
|
|
|
for (FoodGroupDetailInfo foodGroupDetailInfo:foodGroupInfo.getFoodGroupDetailInfoList()){
|
|
|
- foodGroupDetailInfo.setGroupId(foodGroupInfo1.getId());
|
|
|
+ foodGroupDetailInfo.setGroupId(foodGroupInfo.getId());
|
|
|
foodGroupDetailInfo.setGmtCreate(now);
|
|
|
foodGroupDetailInfo.setGmtUpdate(now);
|
|
|
return foodGroupDetailInfoMapper.insert(foodGroupDetailInfo)>0;
|
|
@@ -152,7 +151,16 @@ public class FoodGroupInfoServiceImpl implements IFoodGroupInfoService{
|
|
|
|
|
|
@Override
|
|
|
public FoodGroupInfo get(Long id) throws ServiceException {
|
|
|
- return foodGroupInfoMapper.selectById(id);
|
|
|
+ FoodGroupInfo foodGroupInfo=foodGroupInfoMapper.selectById(id);
|
|
|
+ if (foodGroupInfo!=null){
|
|
|
+ List<FoodGroupDetailInfo> foodGroupDetailInfoList=foodGroupDetailInfoMapper.selectList(new EntityWrapper<FoodGroupDetailInfo>()
|
|
|
+ .eq("group_id",foodGroupInfo.getId())
|
|
|
+ );
|
|
|
+ if (!CollectionUtils.isEmpty(foodGroupDetailInfoList)){
|
|
|
+ foodGroupInfo.setFoodGroupDetailInfoList(foodGroupDetailInfoList);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return foodGroupInfo;
|
|
|
}
|
|
|
|
|
|
@Override
|