diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/controller/ProductController.java b/src/main/java/com/chaozhanggui/system/cashierservice/controller/ProductController.java index f63025f..77fcd9a 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/controller/ProductController.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/controller/ProductController.java @@ -4,6 +4,7 @@ package com.chaozhanggui.system.cashierservice.controller; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; import com.alibaba.fastjson.JSONObject; +import com.chaozhanggui.system.cashierservice.constant.TableConstant; import com.chaozhanggui.system.cashierservice.entity.TbCashierCart; import com.chaozhanggui.system.cashierservice.entity.dto.ChoseCountDTO; import com.chaozhanggui.system.cashierservice.entity.dto.ChoseEatModelDTO; @@ -18,6 +19,7 @@ import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import java.math.BigDecimal; +import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -119,12 +121,16 @@ public class ProductController { public Result choseEatModel(@Validated @RequestBody ChoseEatModelDTO choseEatModelDTO) { List cashierCartList = cartService.choseEatModel(choseEatModelDTO); BigDecimal amount = BigDecimal.ZERO; + ArrayList cashierCarts = new ArrayList<>(); for (TbCashierCart item : cashierCartList) { + if (!TableConstant.CART_SEAT_ID.equals(item.getProductId())) { + cashierCarts.add(item); + } amount = amount.add(item.getTotalAmount()); } HashMap data = new HashMap<>(); data.put("amount", amount); - data.put("info", cashierCartList); + data.put("info", cashierCarts); return Result.success(CodeEnum.SUCCESS, data); }