From 625b1b2fb5ff5de94d996d2b5aee46fde5ab33ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=9D=BE?= <8605635+zhang3064194730@user.noreply.gitee.com> Date: Fri, 29 Nov 2024 11:16:22 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=95=86=E5=93=81=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E8=BF=94=E5=9B=9E=E5=8D=95=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/cashierservice/entity/TbProduct.java | 2 +- .../system/cashierservice/service/ProductService.java | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbProduct.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbProduct.java index b201125..9144866 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbProduct.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbProduct.java @@ -87,7 +87,7 @@ public class TbProduct implements Serializable { private String specInfo; private String selectSpec; @TableField(exist = false) - private TbShopUnit unitName; + private String unitName; } 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 24e5943..ca7666b 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/service/ProductService.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/service/ProductService.java @@ -158,10 +158,8 @@ public class ProductService { it.setSkuList(skuWithBLOBs); it.setGroundingSpecInfo(querySpec(Integer.valueOf(shopId), it.getId())); - if (it.getUnitId() != null) { - - } - it.setUnitName(finalShopUnitsMap.get(it.getUnitId())); + TbShopUnit tbShopUnit = finalShopUnitsMap.get(it.getUnitId()); + it.setUnitName(tbShopUnit == null ? null : tbShopUnit.getName()); }); } PageInfo pageInfo=new PageInfo(tbProductWithBLOBs);