fix: 增加购物车商品类型,单位展示

This commit is contained in:
张松
2024-12-04 14:22:07 +08:00
parent ad27d30d4e
commit cddbe8d195
2 changed files with 7 additions and 1 deletions

View File

@@ -183,6 +183,8 @@ public class TbCashierCart implements Serializable {
private Integer isWaitCall;
// 套餐商品,选择的商品信息
private String proGroupInfo;
// 商品类型
private String typeEnum;
public void copy(TbCashierCart source) {
BeanUtil.copyProperties(source, this, CopyOptions.create().setIgnoreNullValue(true));

View File

@@ -610,7 +610,11 @@ public class TbShopTableServiceImpl implements TbShopTableService {
if (tbCashierCart == null) {
tbCashierCart = new TbCashierCart();
resetGroupProductCart(addCartDTO.getGroupProductIdList(), product, tbCashierCart);
TbShopUnit tbShopUnit = mpShopUnitMapper.selectById(product.getId());
if (tbShopUnit != null) {
tbCashierCart.setUnit(tbShopUnit.getName());
}
tbCashierCart.setTypeEnum(product.getTypeEnum());
tbCashierCart.setUseType(shopEatTypeInfoDTO.getUseType());
tbCashierCart.setCoverImg(product.getCoverImg());
tbCashierCart.setCreatedAt(System.currentTimeMillis());