diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/domain/KitchenSubPlace.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/domain/KitchenSubPlace.java index 7158eed..014712c 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/domain/KitchenSubPlace.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/domain/KitchenSubPlace.java @@ -1,5 +1,6 @@ package com.bonus.canteen.core.kitchen.domain; +import com.bonus.canteen.core.common.utils.FileUrlUtil; import com.bonus.common.core.annotation.Excel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -37,10 +38,16 @@ public class KitchenSubPlace extends BaseEntity { @ApiModelProperty(value = "关联食堂id") private Long canteenId; + private String canteenName; + + private String areaName; + /** 仓库id */ @Excel(name = "仓库id") @ApiModelProperty(value = "仓库id") private Long warehouseId; - + public String getImgUrl() { + return FileUrlUtil.getFileUrl(this.imgUrl); + } } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/service/impl/KitchenSubPlaceServiceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/service/impl/KitchenSubPlaceServiceImpl.java index cd75dec..1af01e5 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/service/impl/KitchenSubPlaceServiceImpl.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/service/impl/KitchenSubPlaceServiceImpl.java @@ -3,6 +3,7 @@ package com.bonus.canteen.core.kitchen.service.impl; import java.util.List; import com.bonus.common.core.exception.ServiceException; import com.bonus.common.core.utils.DateUtils; +import com.bonus.common.security.utils.SecurityUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.bonus.canteen.core.kitchen.mapper.KitchenSubPlaceMapper; @@ -51,6 +52,7 @@ public class KitchenSubPlaceServiceImpl implements IKitchenSubPlaceService { @Override public int insertKitchenSubPlace(KitchenSubPlace kitchenSubPlace) { kitchenSubPlace.setCreateTime(DateUtils.getNowDate()); + kitchenSubPlace.setCreateBy(SecurityUtils.getUsername()); try { return kitchenSubPlaceMapper.insertKitchenSubPlace(kitchenSubPlace); } catch (Exception e) { @@ -67,6 +69,7 @@ public class KitchenSubPlaceServiceImpl implements IKitchenSubPlaceService { @Override public int updateKitchenSubPlace(KitchenSubPlace kitchenSubPlace) { kitchenSubPlace.setUpdateTime(DateUtils.getNowDate()); + kitchenSubPlace.setUpdateBy(SecurityUtils.getUsername()); try { return kitchenSubPlaceMapper.updateKitchenSubPlace(kitchenSubPlace); } catch (Exception e) { diff --git a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/kitchen/KitchenSubPlaceMapper.xml b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/kitchen/KitchenSubPlaceMapper.xml index 60c3fc4..dee5413 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/kitchen/KitchenSubPlaceMapper.xml +++ b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/kitchen/KitchenSubPlaceMapper.xml @@ -8,6 +8,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + @@ -16,22 +18,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select sub_place_id, sub_place_name, img_url, canteen_id, warehouse_id, create_by, create_time, update_by, update_time from kitchen_sub_place + select ksp.sub_place_id, ksp.sub_place_name, ksp.img_url, ksp.canteen_id, ksp.warehouse_id, + ksp.create_by, ksp.create_time, ksp.update_by, ksp.update_time, bc.canteen_name, ba.area_name + from kitchen_sub_place ksp + left join basic_canteen bc on bc.canteen_id = ksp.canteen_id + left join basic_area ba on ba.area_id = bc.area_id