From 117838304a9b2f26ec617ccf7a639350dd31b879 Mon Sep 17 00:00:00 2001 From: SongZhang <2064194730@qq.com> Date: Wed, 9 Oct 2024 15:24:22 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E5=88=97=E8=A1=A8=E4=B8=8D?= =?UTF-8?q?=E8=BF=94=E5=9B=9E=E9=A4=90=E4=BD=8D=E8=B4=B9=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cashierservice/controller/ProductController.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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); }