basic canteen

This commit is contained in:
sxu 2025-05-25 21:14:57 +08:00
parent 57351213c5
commit c71d676532
6 changed files with 61 additions and 22 deletions

View File

@ -1,6 +1,8 @@
package com.bonus.canteen.core.basic.domain;
import java.util.Date;
import com.bonus.canteen.core.common.utils.FileUrlUtil;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.bonus.common.core.annotation.Excel;
import io.swagger.annotations.ApiModelProperty;
@ -34,6 +36,8 @@ public class BasicCanteen extends BaseEntity {
@ApiModelProperty(value = "区域id")
private Long areaId;
private String areaName;
/** 负责人 */
@Excel(name = "负责人")
@ApiModelProperty(value = "负责人")
@ -106,5 +110,7 @@ public class BasicCanteen extends BaseEntity {
@ApiModelProperty(value = "是否启用收款码 默认:否")
private Integer ifPayCode;
public String getImgUrl() {
return FileUrlUtil.getFileUrl(this.imgUrl);
}
}

View File

@ -1,5 +1,6 @@
package com.bonus.canteen.core.basic.domain;
import com.bonus.canteen.core.common.utils.FileUrlUtil;
import com.bonus.common.core.annotation.Excel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -32,5 +33,7 @@ public class BasicCanteenSuggestionPicture extends BaseEntity {
@ApiModelProperty(value = "图片路径")
private String imgUrl;
public String getImgUrl() {
return FileUrlUtil.getFileUrl(this.imgUrl);
}
}

View File

@ -1,6 +1,9 @@
package com.bonus.canteen.core.basic.domain;
import java.util.Date;
import java.util.List;
import com.bonus.canteen.core.common.utils.FileUrlUtil;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.bonus.common.core.annotation.Excel;
import io.swagger.annotations.ApiModelProperty;
@ -34,6 +37,10 @@ public class BasicStall extends BaseEntity {
@ApiModelProperty(value = "区域id")
private Long areaId;
private String areaName;
private String canteenName;
/** 食堂id */
@Excel(name = "食堂id")
@ApiModelProperty(value = "食堂id")
@ -106,5 +113,9 @@ public class BasicStall extends BaseEntity {
@ApiModelProperty(value = "档口收款码链接")
private String payCodeUrl;
private List<BasicStallMealtime> basicStallMealtimeList;
public String getImgUrl() {
return FileUrlUtil.getFileUrl(this.imgUrl);
}
}

View File

@ -1,6 +1,9 @@
package com.bonus.canteen.core.basic.service.impl;
import java.util.List;
import com.bonus.canteen.core.basic.domain.BasicStallMealtime;
import com.bonus.canteen.core.basic.mapper.BasicStallMealtimeMapper;
import com.bonus.common.core.exception.ServiceException;
import com.bonus.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -19,6 +22,8 @@ import com.bonus.canteen.core.basic.service.IBasicStallService;
public class BasicStallServiceImpl implements IBasicStallService {
@Autowired
private BasicStallMapper basicStallMapper;
@Autowired
private BasicStallMealtimeMapper basicStallMealtimeMapper;
/**
* 查询档口信息
@ -28,7 +33,12 @@ public class BasicStallServiceImpl implements IBasicStallService {
*/
@Override
public BasicStall selectBasicStallByStallId(Long stallId) {
return basicStallMapper.selectBasicStallByStallId(stallId);
BasicStallMealtime basicStallMealtime = new BasicStallMealtime();
basicStallMealtime.setStallId(stallId);
List<BasicStallMealtime> basicStallMealtimes = basicStallMealtimeMapper.selectBasicStallMealtimeList(basicStallMealtime);
BasicStall basicStall = basicStallMapper.selectBasicStallByStallId(stallId);
basicStall.setBasicStallMealtimeList(basicStallMealtimes);
return basicStall;
}
/**

View File

@ -7,6 +7,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="canteenId" column="canteen_id" />
<result property="canteenName" column="canteen_name" />
<result property="areaId" column="area_id" />
<result property="areaName" column="area_name" />
<result property="manager" column="manager" />
<result property="contactTel" column="contact_tel" />
<result property="bizState" column="biz_state" />
@ -31,7 +32,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select bc.canteen_id, bc.canteen_name, bc.area_id, bc.manager, bc.contact_tel, bc.biz_state,
bc.biz_start_time, bc.biz_end_time, bc.img_url, bc.enable_pay, bc.pay_types,
bc.if_delivery, bc.deliveries, bc.if_order, bc.if_book, bc.if_reserve, bc.if_pay_code,
bc.create_by, bc.create_time, bc.update_by, bc.update_time
bc.create_by, bc.create_time, bc.update_by, bc.update_time, ba.area_name
from basic_canteen bc
left join basic_area ba on bc.area_id = ba.area_id
</sql>

View File

@ -7,7 +7,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="stallId" column="stall_id" />
<result property="stallName" column="stall_name" />
<result property="areaId" column="area_id" />
<result property="areaName" column="area_name" />
<result property="canteenId" column="canteen_id" />
<result property="canteenName" column="canteen_name" />
<result property="manager" column="manager" />
<result property="contactTel" column="contact_tel" />
<result property="bizState" column="biz_state" />
@ -28,34 +30,40 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectBasicStallVo">
select stall_id, stall_name, area_id, canteen_id, manager, contact_tel, biz_state, biz_start_time, biz_end_time, if_delivery, deliveries, if_order, img_url, if_book, if_reserve, if_pay_code, pay_code_url, create_by, create_time, update_by, update_time from basic_stall
select bs.stall_id, bs.stall_name, bs.area_id, bs.canteen_id, bs.manager, bs.contact_tel, bs.biz_state,
bs.biz_start_time, bs.biz_end_time, bs.if_delivery, bs.deliveries, bs.if_order, bs.img_url,
bs.if_book, bs.if_reserve, bs.if_pay_code, bs.pay_code_url, bs.create_by, bs.create_time,
bs.update_by, bs.update_time, bc.canteen_name, ba.area_name
from basic_stall bs
left join basic_canteen bc on bc.canteen_id = bs.canteen_id
left join basic_area ba on bc.area_id = ba.area_id
</sql>
<select id="selectBasicStallList" parameterType="com.bonus.canteen.core.basic.domain.BasicStall" resultMap="BasicStallResult">
<include refid="selectBasicStallVo"/>
<where>
<if test="stallName != null and stallName != ''"> and stall_name like concat('%', #{stallName}, '%')</if>
<if test="areaId != null "> and area_id = #{areaId}</if>
<if test="canteenId != null "> and canteen_id = #{canteenId}</if>
<if test="manager != null and manager != ''"> and manager = #{manager}</if>
<if test="contactTel != null and contactTel != ''"> and contact_tel = #{contactTel}</if>
<if test="bizState != null "> and biz_state = #{bizState}</if>
<if test="bizStartTime != null "> and biz_start_time = #{bizStartTime}</if>
<if test="bizEndTime != null "> and biz_end_time = #{bizEndTime}</if>
<if test="ifDelivery != null "> and if_delivery = #{ifDelivery}</if>
<if test="deliveries != null and deliveries != ''"> and deliveries = #{deliveries}</if>
<if test="ifOrder != null "> and if_order = #{ifOrder}</if>
<if test="imgUrl != null and imgUrl != ''"> and img_url = #{imgUrl}</if>
<if test="ifBook != null "> and if_book = #{ifBook}</if>
<if test="ifReserve != null "> and if_reserve = #{ifReserve}</if>
<if test="ifPayCode != null "> and if_pay_code = #{ifPayCode}</if>
<if test="payCodeUrl != null and payCodeUrl != ''"> and pay_code_url = #{payCodeUrl}</if>
<if test="stallName != null and stallName != ''"> and bs.stall_name like concat('%', #{stallName}, '%')</if>
<if test="areaId != null "> and bs.area_id = #{areaId}</if>
<if test="canteenId != null "> and bs.canteen_id = #{canteenId}</if>
<if test="manager != null and manager != ''"> and bs.manager = #{manager}</if>
<if test="contactTel != null and contactTel != ''"> and bs.contact_tel = #{contactTel}</if>
<if test="bizState != null "> and bs.biz_state = #{bizState}</if>
<if test="bizStartTime != null "> and bs.biz_start_time = #{bizStartTime}</if>
<if test="bizEndTime != null "> and bs.biz_end_time = #{bizEndTime}</if>
<if test="ifDelivery != null "> and bs.if_delivery = #{ifDelivery}</if>
<if test="deliveries != null and deliveries != ''"> and bs.deliveries = #{deliveries}</if>
<if test="ifOrder != null "> and bs.if_order = #{ifOrder}</if>
<if test="imgUrl != null and imgUrl != ''"> and bs.img_url = #{imgUrl}</if>
<if test="ifBook != null "> and bs.if_book = #{ifBook}</if>
<if test="ifReserve != null "> and bs.if_reserve = #{ifReserve}</if>
<if test="ifPayCode != null "> and bs.if_pay_code = #{ifPayCode}</if>
<if test="payCodeUrl != null and payCodeUrl != ''"> and bs.pay_code_url = #{payCodeUrl}</if>
</where>
</select>
<select id="selectBasicStallByStallId" parameterType="Long" resultMap="BasicStallResult">
<include refid="selectBasicStallVo"/>
where stall_id = #{stallId}
where bs.stall_id = #{stallId}
</select>
<select id="selectBasicStallCountByCanteenIds" resultType="Integer">