点餐机商品支持套餐点餐

This commit is contained in:
谭凯凯
2024-12-03 17:44:52 +08:00
committed by Tankaikai
parent 0c5421bdc1
commit a4963408ab
2 changed files with 9 additions and 3 deletions

View File

@@ -1,6 +1,7 @@
package com.chaozhanggui.system.cashierservice.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.chaozhanggui.system.cashierservice.entity.vo.ProductGroupVo;
import lombok.Data;
import org.springframework.data.annotation.Transient;
@@ -88,6 +89,9 @@ public class TbProduct implements Serializable {
private String selectSpec;
@TableField(exist = false)
private String unitName;
@Transient
@TableField(exist = false)
private List<ProductGroupVo> proGroupVo;
}

View File

@@ -1,15 +1,13 @@
package com.chaozhanggui.system.cashierservice.service;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.chaozhanggui.system.cashierservice.dao.*;
import com.chaozhanggui.system.cashierservice.entity.*;
import com.chaozhanggui.system.cashierservice.entity.dto.ProductStatusDTO;
import com.chaozhanggui.system.cashierservice.entity.dto.ProductStockDTO;
import com.chaozhanggui.system.cashierservice.entity.dto.QuerySpecDTO;
import com.chaozhanggui.system.cashierservice.entity.vo.ProductGroupVo;
import com.chaozhanggui.system.cashierservice.entity.vo.ShopCategoryVo;
import com.chaozhanggui.system.cashierservice.exception.MsgException;
import com.chaozhanggui.system.cashierservice.interceptor.LimitSubmitAspect;
@@ -18,6 +16,7 @@ import com.chaozhanggui.system.cashierservice.rabbit.RabbitProducer;
import com.chaozhanggui.system.cashierservice.sign.CodeEnum;
import com.chaozhanggui.system.cashierservice.sign.Result;
import com.chaozhanggui.system.cashierservice.util.DateUtils;
import com.chaozhanggui.system.cashierservice.util.JSONUtil;
import com.chaozhanggui.system.cashierservice.util.PageHelperUtil;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
@@ -160,6 +159,9 @@ public class ProductService {
it.setGroundingSpecInfo(querySpec(Integer.valueOf(shopId), it.getId()));
TbShopUnit tbShopUnit = finalShopUnitsMap.get(it.getUnitId());
it.setUnitName(tbShopUnit == null ? null : tbShopUnit.getName());
if ("package".equals(it.getType())) {
it.setProGroupVo(JSONUtil.parseListTNewList(it.getGroupSnap(), ProductGroupVo.class));
}
});
}
PageInfo pageInfo=new PageInfo(tbProductWithBLOBs);