zhangyuewww 2 年之前
父节点
当前提交
1f63e37869

+ 2 - 1
uni_applet/pages/food/food.vue

@@ -245,11 +245,12 @@
 						uni.showLoading({
 							title: '数据加载中'
 						})
-						await that.$request.baseRequest('admin.tourism.foodInfo', 'list', {
+						await that.$request.baseRequest('admin.tourism.foodInfo', 'foodList', {
 							page: page.num,
 							limit: page.size,
 							searchType: this.searchType,
 							label: this.label,
+							place:this.detailedAddress,
 						}, failres => {
 							uni.showToast({
 								icon: "none",

+ 20 - 3
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/tourism/impl/FoodGroupInfoServiceImpl.java

@@ -2,9 +2,13 @@ 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.mapper.FoodGroupDetailInfoMapper;
 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;
@@ -28,13 +32,26 @@ import org.springframework.transaction.annotation.Transactional;
 public class FoodGroupInfoServiceImpl implements IFoodGroupInfoService{
 	@Autowired
 	private FoodGroupInfoMapper foodGroupInfoMapper;
+	@Autowired
+	private FoodGroupDetailInfoMapper foodGroupDetailInfoMapper;
 	
 	@Override
 	public Boolean add(FoodGroupInfo foodGroupInfo) throws ServiceException {
 		Date now = new Date();
-		foodGroupInfo.setGmtCreate(now);
-		foodGroupInfo.setGmtUpdate(now);
-		return foodGroupInfoMapper.insert(foodGroupInfo)>0;
+		FoodGroupInfo foodGroupInfo1=new FoodGroupInfo();
+		foodGroupInfo1.setGmtCreate(now);
+		foodGroupInfo1.setGmtUpdate(now);
+		foodGroupInfoMapper.insert(foodGroupInfo1);
+		foodGroupInfo1=foodGroupInfoMapper.selectById(foodGroupInfo1.getId());
+		if (!CollectionUtils.isEmpty(foodGroupInfo.getFoodGroupDetailInfoList())){
+			for (FoodGroupDetailInfo foodGroupDetailInfo:foodGroupInfo.getFoodGroupDetailInfoList()){
+				foodGroupDetailInfo.setGroupId(foodGroupInfo1.getId());
+				foodGroupDetailInfo.setGmtCreate(now);
+				foodGroupDetailInfo.setGmtUpdate(now);
+				return foodGroupDetailInfoMapper.insert(foodGroupDetailInfo)>0;
+			}
+		}
+		return true;
 	}
 
 	@Override

+ 15 - 0
unimall-data/src/main/java/com/iotechn/unimall/data/domain/FoodGroupInfo.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;
 
 /**
  * 餐饮团购信息对象 food_group_info
@@ -103,6 +104,18 @@ public class FoodGroupInfo extends SuperDO{
     @Excel(name = "餐位费")
     @TableField("space_fee")
     private Double spaceFee;
+    /** 原价合计 */
+    @Excel(name = "原价合计")
+    @TableField("original_price")
+    private Double originalPrice;
+    /** 团购价 */
+    @Excel(name = "团购价")
+    @TableField("group_price")
+    private Double groupPrice;
+    /** 折扣 */
+    @Excel(name = "折扣")
+    @TableField("discount")
+    private Double discount;
 
     /** 商品外带打包(0支持1不支持) */
     @Excel(name = "商品外带打包(0支持1不支持)")
@@ -166,6 +179,8 @@ public class FoodGroupInfo extends SuperDO{
     /** 未用数 */
     @TableField(exist = false)
     private Integer notUseNum;
+    @TableField(exist = false)
+    private List<FoodGroupDetailInfo> foodGroupDetailInfoList;
     @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

+ 1 - 1
unimall-data/src/main/resources/com/iotechn/unimall/data/mapper/FoodInfoMapper.xml

@@ -59,6 +59,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <if test="searchType != null and searchType == 1">
             order by f.weight_sort DESC,f.gmt_create DESC
         </if>
-        limit #{offset},#{limit}
+        limit #{i},#{limit}
     </select>
 </mapper>