From a745172a608e8a95e0f689950fa03aa9b3528de0 Mon Sep 17 00:00:00 2001 From: sxu <602087911@qq.com> Date: Thu, 5 Jun 2025 17:14:04 +0800 Subject: [PATCH] =?UTF-8?q?=E5=95=86=E5=93=81=E4=B8=8A=E6=9E=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/SupermarketProduct.java | 7 ++++ .../supermarket/SupermarketProductMapper.xml | 35 +++++++++++-------- 2 files changed, 27 insertions(+), 15 deletions(-) diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/supermarket/domain/SupermarketProduct.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/supermarket/domain/SupermarketProduct.java index 29dc834..2c0f6c5 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/supermarket/domain/SupermarketProduct.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/supermarket/domain/SupermarketProduct.java @@ -1,6 +1,7 @@ package com.bonus.canteen.core.supermarket.domain; import java.math.BigDecimal; +import com.bonus.canteen.core.common.utils.FileUrlUtil; import com.bonus.common.core.annotation.Excel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -73,5 +74,11 @@ public class SupermarketProduct extends BaseEntity { @ApiModelProperty(value = "库存数") private BigDecimal inventoryNum; + private String materialName; + private String unitName; + + public String getImgUrl() { + return FileUrlUtil.getFileUrl(this.imgUrl); + } } diff --git a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/supermarket/SupermarketProductMapper.xml b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/supermarket/SupermarketProductMapper.xml index 715925f..d3e28cd 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/supermarket/SupermarketProductMapper.xml +++ b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/supermarket/SupermarketProductMapper.xml @@ -19,38 +19,43 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + - select product_id, supermarket_id, material_id, putaway_state, if_online, sale_price, pref_price, - person_limit, one_day_limit, img_url, inventory_num, create_by, create_time, update_by, update_time - from supermarket_product + select sp.product_id, sp.supermarket_id, sp.material_id, sp.putaway_state, sp.if_online, sp.sale_price, + sp.pref_price, sp.person_limit, sp.one_day_limit, sp.img_url, sp.inventory_num, sp.create_by, + sp.create_time, sp.update_by, sp.update_time, sm.material_name, spu.unit_name + from supermarket_product sp + left join supermarket_material sm on sm.material_id = sp.material_id + left join supply_product_unit spu on spu.unit_id = sm.unit_id