zhangyuewww 2 سال پیش
والد
کامیت
4472929072

+ 4 - 1
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/tourism/IDishClassifyInfoService.java

@@ -42,7 +42,10 @@ public interface IDishClassifyInfoService{
 
 	@HttpMethod(description = "查询", permissionName = "菜品分类管理")
 	public DishClassifyInfo get(@NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "")Long id)throws ServiceException;
-	
+
+	@HttpMethod(description = "置顶",  permissionName = "菜品分类管理")
+	public Boolean top(@NotNull @HttpParam(name = "dishClassifyInfo", type = HttpParamType.COMMON, description = "菜品分类") DishClassifyInfo dishClassifyInfo)throws ServiceException;
+
 	@HttpMethod(description = "导出excl表",  permissionName = "菜品分类管理")
 	public String export(
 								@HttpParam(name = "foodId", type = HttpParamType.COMMON, description = "餐饮入驻表id") Long foodId,

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

@@ -5,6 +5,7 @@ import java.util.List;
 import org.apache.ibatis.session.RowBounds;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
 import org.springframework.util.StringUtils;
 
 import com.baomidou.mybatisplus.mapper.EntityWrapper;
@@ -58,7 +59,7 @@ public class DishClassifyInfoServiceImpl implements IDishClassifyInfoService{
 												if (!StringUtils.isEmpty(deleteFlag)) {
 					wrapper.eq("delete_flag", deleteFlag);
 				}
-							wrapper.eq("delete_flag", 0);
+							wrapper.eq("delete_flag", 0).orderBy("top_marking",false);
 		List<DishClassifyInfo> list = dishClassifyInfoMapper.selectPage(new RowBounds((page - 1) * limit, limit), wrapper);
 		Integer count = dishClassifyInfoMapper.selectCount(wrapper);
 		return new Page<DishClassifyInfo>(list, page, limit, count);
@@ -89,7 +90,23 @@ public class DishClassifyInfoServiceImpl implements IDishClassifyInfoService{
 	public DishClassifyInfo get(Long id) throws ServiceException {
 		return dishClassifyInfoMapper.selectById(id);
 	}
-	
+
+	@Override
+	public Boolean top(DishClassifyInfo dishClassifyInfo) throws ServiceException {
+		DishClassifyInfo dishClassifyInfo1 = dishClassifyInfoMapper.selectById(dishClassifyInfo.getId());
+		List<DishClassifyInfo> dishClassifyInfoList = dishClassifyInfoMapper.selectList(new EntityWrapper<DishClassifyInfo>()
+				.eq("common_id", dishClassifyInfo1.getFoodId())
+				.orderBy("top_marking", false)
+				.eq("delete_flag", 0));
+		Long sort=0l;
+		if (!CollectionUtils.isEmpty(dishClassifyInfoList)) {
+			sort=dishClassifyInfoList.get(0).getTopMarking()+1;
+		}
+		dishClassifyInfo1.setTopMarking(sort);
+		dishClassifyInfo1.setGmtUpdate(new Date());
+		return dishClassifyInfoMapper.updateById(dishClassifyInfo1) > 0;
+	}
+
 	@Override
 	public String export(Long foodId,String classifyName,Long topMarking,Date gmtCreate,Date gmtUpdate,Long deleteFlag, Integer page, Integer limit)throws ServiceException {
 		Wrapper<DishClassifyInfo> wrapper = new EntityWrapper<DishClassifyInfo>();

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

@@ -34,6 +34,7 @@ public class FoodGroupOrderInfoServiceImpl implements IFoodGroupOrderInfoService
 		Date now = new Date();
 		foodGroupOrderInfo.setGmtCreate(now);
 		foodGroupOrderInfo.setGmtUpdate(now);
+		foodGroupOrderInfo.setStatus("0");
 		return foodGroupOrderInfoMapper.insert(foodGroupOrderInfo)>0;
 	}
 

+ 41 - 4
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/tourism/impl/FoodInfoServiceImpl.java

@@ -39,6 +39,8 @@ public class FoodInfoServiceImpl implements IFoodInfoService{
 	@Autowired
 	private FoodGroupInfoMapper foodGroupInfoMapper;
 	@Autowired
+	private FoodGroupOrderInfoMapper foodGroupOrderInfoMapper;
+	@Autowired
 	private UserService userService;
 	
 	@Override
@@ -133,12 +135,41 @@ public class FoodInfoServiceImpl implements IFoodInfoService{
 		List<FoodInfo> list = foodInfoMapper.selectPage(new RowBounds((page - 1) * limit, limit), wrapper);
 		if (!CollectionUtils.isEmpty(list)){
 			for (FoodInfo foodInfo:list) {
-				List<FoodDishesInfo> foodDishesInfoList = foodDishesInfoMapper.selectList(new EntityWrapper<FoodDishesInfo>()
-						.eq("food_id",foodInfo.getId()));
-				foodInfo.setFoodDishesInfoList(foodDishesInfoList);
-				foodInfo.setDishesNum(foodDishesInfoList.size());
+				Integer displaysNum=0;
+				//查询店铺菜品分类
+				List<DishClassifyInfo> dishClassifyInfoList = dishClassifyInfoMapper.selectList(new EntityWrapper<DishClassifyInfo>()
+						.eq("food_id",foodInfo.getId())
+						.orderBy("top_marking",false));
+				if (!CollectionUtils.isEmpty(dishClassifyInfoList)){
+					for (DishClassifyInfo dishClassifyInfo:dishClassifyInfoList){
+						List<FoodDishesInfo> foodDishesInfoList = foodDishesInfoMapper.selectList(new EntityWrapper<FoodDishesInfo>()
+								.eq("food_id",foodInfo.getId())
+								.eq("classify",dishClassifyInfo.getClassifyName()));
+						if (!CollectionUtils.isEmpty(foodDishesInfoList)){
+							dishClassifyInfo.setFoodDishesInfoList(foodDishesInfoList);
+							dishClassifyInfo.setDishesNum(foodDishesInfoList.size());
+							displaysNum=displaysNum+foodDishesInfoList.size();
+						}
+					}
+					foodInfo.setDisplaysNum(displaysNum);
+					foodInfo.setDishClassifyInfoList(dishClassifyInfoList);
+				}
 				List<FoodGroupInfo> foodGroupInfoList = foodGroupInfoMapper.selectList(new EntityWrapper<FoodGroupInfo>()
 						.eq("food_id",foodInfo.getId()));
+				if (!CollectionUtils.isEmpty(foodGroupInfoList)){
+					for (FoodGroupInfo foodGroupInfo:foodGroupInfoList){
+						//查询已售数量
+						List<FoodGroupOrderInfo> foodGroupOrderInfoList=foodGroupOrderInfoMapper.selectList(new EntityWrapper<FoodGroupOrderInfo>()
+								.eq("group_id",foodGroupInfo.getId()));
+						foodGroupInfo.setSoldNum(foodGroupOrderInfoList.size());
+						//查询已使用数量
+						List<FoodGroupOrderInfo> foodGroupOrderInfoList1=foodGroupOrderInfoMapper.selectList(new EntityWrapper<FoodGroupOrderInfo>()
+								.eq("group_id",foodGroupInfo.getId())
+								.eq("status","1"));
+						foodGroupInfo.setUsedNum(foodGroupOrderInfoList1.size());
+						foodGroupInfo.setNotUseNum(foodGroupOrderInfoList.size()-foodGroupOrderInfoList1.size());
+					}
+				}
 				foodInfo.setFoodGroupInfoList(foodGroupInfoList);
 				foodInfo.setGroupNum(foodGroupInfoList.size());
 			}
@@ -194,18 +225,24 @@ public class FoodInfoServiceImpl implements IFoodInfoService{
 			DishClassifyInfo dishClassifyInfo=new DishClassifyInfo();
 			dishClassifyInfo.setFoodId(foodInfo1.getId());
 			dishClassifyInfo.setClassifyName("荤菜");
+			dishClassifyInfo.setTopMarking(6l);
 			dishClassifyInfo.setGmtCreate(now);
 			dishClassifyInfo.setGmtUpdate(now);
 			dishClassifyInfoMapper.insert(dishClassifyInfo);
 			dishClassifyInfo.setClassifyName("素菜");
+			dishClassifyInfo.setTopMarking(5l);
 			dishClassifyInfoMapper.insert(dishClassifyInfo);
 			dishClassifyInfo.setClassifyName("主食");
+			dishClassifyInfo.setTopMarking(4l);
 			dishClassifyInfoMapper.insert(dishClassifyInfo);
 			dishClassifyInfo.setClassifyName("汤品");
+			dishClassifyInfo.setTopMarking(3l);
 			dishClassifyInfoMapper.insert(dishClassifyInfo);
 			dishClassifyInfo.setClassifyName("凉菜");
+			dishClassifyInfo.setTopMarking(2l);
 			dishClassifyInfoMapper.insert(dishClassifyInfo);
 			dishClassifyInfo.setClassifyName("串类");
+			dishClassifyInfo.setTopMarking(1l);
 			dishClassifyInfoMapper.insert(dishClassifyInfo);
 		}
 		return foodInfoMapper.updateById(foodInfo) > 0;

+ 12 - 2
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/tourism/impl/HomestayInfoServiceImpl.java

@@ -117,7 +117,12 @@ public class HomestayInfoServiceImpl implements IHomestayInfoService{
 		if ("已驳回".equals(homestayInfo.getStatus())){
 			NoticeMessageInfo noticeMessageInfo=new NoticeMessageInfo();
 			noticeMessageInfo.setNewsTitle("系统消息");
-			noticeMessageInfo.setNewsContent("您的入驻申请(餐饮),未通过审核。");
+			if ("1".equals(homestayInfo1.getType())){
+				noticeMessageInfo.setNewsContent("您的入驻申请(民宿),未通过审核。");
+			}
+			else {
+				noticeMessageInfo.setNewsContent("您的入驻申请(酒店),未通过审核。");
+			}
 			noticeMessageInfo.setReceiveId(homestayInfo1.getCommonId());
 			noticeMessageInfo.setGmtCreate(now);
 			noticeMessageInfo.setGmtUpdate(now);
@@ -127,7 +132,12 @@ public class HomestayInfoServiceImpl implements IHomestayInfoService{
 		else{
 			NoticeMessageInfo noticeMessageInfo=new NoticeMessageInfo();
 			noticeMessageInfo.setNewsTitle("系统消息");
-			noticeMessageInfo.setNewsContent("您的入驻申请(餐饮),已通过审核。");
+			if ("1".equals(homestayInfo1.getType())){
+				noticeMessageInfo.setNewsContent("您的入驻申请(民宿),已通过审核。");
+			}
+			else {
+				noticeMessageInfo.setNewsContent("您的入驻申请(酒店),已通过审核。");
+			}
 			noticeMessageInfo.setReceiveId(homestayInfo1.getCommonId());
 			noticeMessageInfo.setGmtCreate(now);
 			noticeMessageInfo.setGmtUpdate(now);

+ 6 - 2
unimall-data/src/main/java/com/iotechn/unimall/data/domain/DishClassifyInfo.java

@@ -11,6 +11,7 @@ import com.baomidou.mybatisplus.annotations.TableField;
 import com.baomidou.mybatisplus.enums.FieldFill;
 import com.iotechn.unimall.core.util.StringUtils;
 import java.util.Date;
+import java.util.List;
 
 /**
  * 菜品分类对象 dish_classify_info
@@ -56,8 +57,11 @@ public class DishClassifyInfo extends SuperDO{
     @Excel(name = "删除标识")
     @TableField("delete_flag")
     private Long deleteFlag;
-
-
+    @TableField(exist = false)
+    private List<FoodDishesInfo> foodDishesInfoList;
+    /** 菜数 */
+    @TableField(exist = false)
+    private Integer dishesNum;
     @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

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

@@ -140,7 +140,15 @@ public class FoodGroupInfo extends SuperDO{
     @Excel(name = "状态")
     @TableField("status")
     private String status;
-
+    /** 已售数 */
+    @TableField(exist = false)
+    private Integer soldNum;
+    /** 已用数 */
+    @TableField(exist = false)
+    private Integer usedNum;
+    /** 未用数 */
+    @TableField(exist = false)
+    private Integer notUseNum;
     @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

+ 1 - 1
unimall-data/src/main/java/com/iotechn/unimall/data/domain/FoodGroupOrderInfo.java

@@ -37,7 +37,7 @@ public class FoodGroupOrderInfo extends SuperDO{
     @TableField("group_id")
     private Long groupId;
 
-    /** 状态 */
+    /** 状态(默认0已售未使用 1已使用 商家端,客户端状态文字区分显示) */
     @Excel(name = "状态")
     @TableField("status")
     private String status;

+ 2 - 2
unimall-data/src/main/java/com/iotechn/unimall/data/domain/FoodInfo.java

@@ -163,7 +163,7 @@ public class FoodInfo extends SuperDO{
     @TableField(exist = false)
     private String verifyCode;
     @TableField(exist = false)
-    private List<FoodDishesInfo> foodDishesInfoList;
+    private List<DishClassifyInfo> dishClassifyInfoList;
     @TableField(exist = false)
     private List<FoodGroupInfo> foodGroupInfoList;
     /** 团购数 */
@@ -171,7 +171,7 @@ public class FoodInfo extends SuperDO{
     private Integer groupNum;
     /** 商品展示数 */
     @TableField(exist = false)
-    private Integer dishesNum;
+    private Integer displaysNum;
     @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)