From a0ddc67f8f71dbb6ab720f72dfe501e574a5e1b1 Mon Sep 17 00:00:00 2001 From: wangw <1594593906@qq.com> Date: Fri, 13 Sep 2024 16:20:31 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=95=E4=BD=8D=E4=B8=BA=E7=A9=BA=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/cashierservice/service/ProductService.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/service/ProductService.java b/src/main/java/com/chaozhanggui/system/cashierservice/service/ProductService.java index e1df7ef..f96fb6c 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/service/ProductService.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/service/ProductService.java @@ -389,7 +389,12 @@ public class ProductService { */ public List handleDate(List products,boolean check,Integer isSale,boolean isVip){ if (!CollectionUtils.isEmpty(products)) { - products.forEach(it -> { + products.parallelStream().forEach(it -> { + TbShopUnit tbShopUnit = unitMapper.selectByPrimaryKey(Integer.valueOf(it.getUnitId())); + if (it.getName().equals("烤牛肉")) { + System.out.println("单位:"+tbShopUnit.getName()); + } + it.setUnitSnap(tbShopUnit != null ? tbShopUnit.getName() : ""); if(check){ List tbProductGroups = tbProductGroupMapper.selectByProductId(it.getShopId(), it.getId().toString()); for (TbProductGroup g : tbProductGroups) { @@ -403,8 +408,6 @@ public class ProductService { }else { it.setIsSale(isSale); } - TbShopUnit tbShopUnit = unitMapper.selectByPrimaryKey(Integer.valueOf(it.getUnitId())); - it.setUnitSnap(tbShopUnit != null ? tbShopUnit.getName() : ""); //购物车数量 it.setCartNumber("0"); List tbProductSkus = tbProductSkuMapper.selectGroundingByProId(it.getId());