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());