Merge remote-tracking branch 'origin/master'

This commit is contained in:
gaowdong 2025-06-23 16:39:11 +08:00
commit de96c9a9c8
3 changed files with 23 additions and 7 deletions

View File

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

View File

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

View File

@ -8,6 +8,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="subPlaceName" column="sub_place_name" />
<result property="imgUrl" column="img_url" />
<result property="canteenId" column="canteen_id" />
<result property="canteenName" column="canteen_name" />
<result property="areaName" column="area_name" />
<result property="warehouseId" column="warehouse_id" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
@ -16,22 +18,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectKitchenSubPlaceVo">
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
</sql>
<select id="selectKitchenSubPlaceList" parameterType="com.bonus.canteen.core.kitchen.domain.KitchenSubPlace" resultMap="KitchenSubPlaceResult">
<include refid="selectKitchenSubPlaceVo"/>
<where>
<if test="subPlaceName != null and subPlaceName != ''"> and sub_place_name like concat('%', #{subPlaceName}, '%')</if>
<if test="imgUrl != null and imgUrl != ''"> and img_url = #{imgUrl}</if>
<if test="canteenId != null "> and canteen_id = #{canteenId}</if>
<if test="warehouseId != null "> and warehouse_id = #{warehouseId}</if>
<if test="subPlaceName != null and subPlaceName != ''"> and ksp.sub_place_name like concat('%', #{subPlaceName}, '%')</if>
<if test="imgUrl != null and imgUrl != ''"> and ksp.img_url = #{imgUrl}</if>
<if test="canteenId != null "> and ksp.canteen_id = #{canteenId}</if>
<if test="warehouseId != null "> and ksp.warehouse_id = #{warehouseId}</if>
</where>
</select>
<select id="selectKitchenSubPlaceBySubPlaceId" parameterType="Long" resultMap="KitchenSubPlaceResult">
<include refid="selectKitchenSubPlaceVo"/>
where sub_place_id = #{subPlaceId}
where ksp.sub_place_id = #{subPlaceId}
</select>
<insert id="insertKitchenSubPlace" parameterType="com.bonus.canteen.core.kitchen.domain.KitchenSubPlace" useGeneratedKeys="true" keyProperty="subPlaceId">