zhangyuewww 2 tahun lalu
induk
melakukan
6212487818

+ 4 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/tourism/IFoodDishesInfoService.java

@@ -1,6 +1,7 @@
 package com.iotechn.unimall.admin.api.tourism;
 package com.iotechn.unimall.admin.api.tourism;
 
 
 
 
+import com.iotechn.unimall.data.domain.DishClassifyInfo;
 import com.iotechn.unimall.data.domain.FoodDishesInfo;
 import com.iotechn.unimall.data.domain.FoodDishesInfo;
 import com.iotechn.unimall.core.annotation.HttpMethod;
 import com.iotechn.unimall.core.annotation.HttpMethod;
 import com.iotechn.unimall.core.annotation.HttpOpenApi;
 import com.iotechn.unimall.core.annotation.HttpOpenApi;
@@ -42,6 +43,9 @@ public interface IFoodDishesInfoService{
 	@HttpMethod(description = "修改",  permissionName = "餐饮菜品信息管理")
 	@HttpMethod(description = "修改",  permissionName = "餐饮菜品信息管理")
 	public Boolean update(@NotNull @HttpParam(name = "foodDishesInfo", type = HttpParamType.COMMON, description = "餐饮菜品信息") FoodDishesInfo foodDishesInfo)throws ServiceException;
 	public Boolean update(@NotNull @HttpParam(name = "foodDishesInfo", type = HttpParamType.COMMON, description = "餐饮菜品信息") FoodDishesInfo foodDishesInfo)throws ServiceException;
 
 
+	@HttpMethod(description = "置顶",  permissionName = "餐饮菜品信息管理")
+	public Boolean top(@NotNull @HttpParam(name = "foodDishesInfo", type = HttpParamType.COMMON, description = "餐饮菜品信息") FoodDishesInfo foodDishesInfo)throws ServiceException;
+
 	@HttpMethod(description = "查询", permissionName = "餐饮菜品信息管理")
 	@HttpMethod(description = "查询", permissionName = "餐饮菜品信息管理")
 	public FoodDishesInfo get(@NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "")Long id)throws ServiceException;
 	public FoodDishesInfo get(@NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "")Long id)throws ServiceException;
 	
 	

+ 1 - 1
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/tourism/impl/DishClassifyInfoServiceImpl.java

@@ -95,7 +95,7 @@ public class DishClassifyInfoServiceImpl implements IDishClassifyInfoService{
 	public Boolean top(DishClassifyInfo dishClassifyInfo) throws ServiceException {
 	public Boolean top(DishClassifyInfo dishClassifyInfo) throws ServiceException {
 		DishClassifyInfo dishClassifyInfo1 = dishClassifyInfoMapper.selectById(dishClassifyInfo.getId());
 		DishClassifyInfo dishClassifyInfo1 = dishClassifyInfoMapper.selectById(dishClassifyInfo.getId());
 		List<DishClassifyInfo> dishClassifyInfoList = dishClassifyInfoMapper.selectList(new EntityWrapper<DishClassifyInfo>()
 		List<DishClassifyInfo> dishClassifyInfoList = dishClassifyInfoMapper.selectList(new EntityWrapper<DishClassifyInfo>()
-				.eq("common_id", dishClassifyInfo1.getFoodId())
+				.eq("food_id", dishClassifyInfo1.getFoodId())
 				.orderBy("top_marking", false)
 				.orderBy("top_marking", false)
 				.eq("delete_flag", 0));
 				.eq("delete_flag", 0));
 		Long sort=0l;
 		Long sort=0l;

+ 17 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/tourism/impl/FoodDishesInfoServiceImpl.java

@@ -5,6 +5,7 @@ import java.util.List;
 import org.apache.ibatis.session.RowBounds;
 import org.apache.ibatis.session.RowBounds;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
 import org.springframework.util.StringUtils;
 import org.springframework.util.StringUtils;
 
 
 import com.baomidou.mybatisplus.mapper.EntityWrapper;
 import com.baomidou.mybatisplus.mapper.EntityWrapper;
@@ -91,6 +92,22 @@ public class FoodDishesInfoServiceImpl implements IFoodDishesInfoService{
 		return foodDishesInfoMapper.updateById(foodDishesInfo)>0;
 		return foodDishesInfoMapper.updateById(foodDishesInfo)>0;
 	}
 	}
 
 
+	@Override
+	public Boolean top(FoodDishesInfo foodDishesInfo) throws ServiceException {
+		FoodDishesInfo foodDishesInfo1 = foodDishesInfoMapper.selectById(foodDishesInfo.getId());
+		List<FoodDishesInfo> foodDishesInfoList = foodDishesInfoMapper.selectList(new EntityWrapper<FoodDishesInfo>()
+				.eq("food_id", foodDishesInfo1.getFoodId())
+				.orderBy("top_marking", false)
+				.eq("delete_flag", 0));
+		Long sort=0l;
+		if (!CollectionUtils.isEmpty(foodDishesInfoList)) {
+			sort=foodDishesInfoList.get(0).getTopMarking()+1;
+		}
+		foodDishesInfo1.setTopMarking(sort);
+		foodDishesInfo1.setGmtUpdate(new Date());
+		return foodDishesInfoMapper.updateById(foodDishesInfo1) > 0;
+	}
+
 	@Override
 	@Override
 	public FoodDishesInfo get(Long id) throws ServiceException {
 	public FoodDishesInfo get(Long id) throws ServiceException {
 		return foodDishesInfoMapper.selectById(id);
 		return foodDishesInfoMapper.selectById(id);

+ 18 - 10
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/tourism/impl/FoodGroupInfoServiceImpl.java

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

+ 5 - 0
unimall-data/src/main/java/com/iotechn/unimall/data/domain/FoodDishesInfo.java

@@ -52,6 +52,11 @@ public class FoodDishesInfo extends SuperDO{
     @TableField("dish_image")
     @TableField("dish_image")
     private String dishImage;
     private String dishImage;
 
 
+    /** 置顶标识 */
+    @Excel(name = "置顶标识")
+    @TableField("top_marking")
+    private Long topMarking;
+
     /**  */
     /**  */
     @Excel(name = "", width = 30, dateFormat = "yyyy-MM-dd")
     @Excel(name = "", width = 30, dateFormat = "yyyy-MM-dd")
     @TableField("gmt_create")
     @TableField("gmt_create")

+ 3 - 3
unimall-data/src/main/java/com/iotechn/unimall/data/domain/FoodGroupInfo.java

@@ -81,7 +81,7 @@ public class FoodGroupInfo extends SuperDO{
     /** 指定不可用天数 */
     /** 指定不可用天数 */
     @Excel(name = "指定不可用天数")
     @Excel(name = "指定不可用天数")
     @TableField("unavailable_day")
     @TableField("unavailable_day")
-    private Long unavailableDay;
+    private String unavailableDay;
     /** 可团购总数量 */
     /** 可团购总数量 */
     @Excel(name = "可团购总数量")
     @Excel(name = "可团购总数量")
     @TableField("total_quantity")
     @TableField("total_quantity")
@@ -166,6 +166,8 @@ public class FoodGroupInfo extends SuperDO{
     @Excel(name = "删除标识")
     @Excel(name = "删除标识")
     @TableField("delete_flag")
     @TableField("delete_flag")
     private Long deleteFlag;
     private Long deleteFlag;
+    @TableField(exist = false)
+    private List<FoodGroupDetailInfo> foodGroupDetailInfoList;
     /** 状态(未开始/活动中/已停止/已过期) */
     /** 状态(未开始/活动中/已停止/已过期) */
     @Excel(name = "状态")
     @Excel(name = "状态")
     @TableField("status")
     @TableField("status")
@@ -179,8 +181,6 @@ public class FoodGroupInfo extends SuperDO{
     /** 未用数 */
     /** 未用数 */
     @TableField(exist = false)
     @TableField(exist = false)
     private Integer notUseNum;
     private Integer notUseNum;
-    @TableField(exist = false)
-    private List<FoodGroupDetailInfo> foodGroupDetailInfoList;
     @Override
     @Override
     public String toString() {
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)