fix: 商品列表返回单位

This commit is contained in:
张松
2024-11-29 11:16:22 +08:00
parent 5162a9cf7c
commit 625b1b2fb5
2 changed files with 3 additions and 5 deletions

View File

@@ -87,7 +87,7 @@ public class TbProduct implements Serializable {
private String specInfo;
private String selectSpec;
@TableField(exist = false)
private TbShopUnit unitName;
private String unitName;
}

View File

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