This commit is contained in:
sxu 2025-04-14 16:50:36 +08:00
parent a52ed369b5
commit 61b5737f3d
6 changed files with 613 additions and 0 deletions

View File

@ -0,0 +1,119 @@
package com.bonus.canteen.core.alloc.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.bonus.common.log.enums.OperaType;
import com.bonus.canteen.core.common.annotation.PreventRepeatSubmit;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.bonus.common.log.annotation.SysLog;
import com.bonus.common.security.annotation.RequiresPermissions;
import com.bonus.canteen.core.alloc.domain.AllocCanteenEvaluate;
import com.bonus.canteen.core.alloc.service.IAllocCanteenEvaluateService;
import com.bonus.common.core.web.controller.BaseController;
import com.bonus.common.core.web.domain.AjaxResult;
import com.bonus.common.core.utils.poi.ExcelUtil;
import com.bonus.common.core.web.page.TableDataInfo;
/**
* 食堂评价Controller
*
* @author xsheng
* @date 2025-04-14
*/
@Api(tags = "食堂评价接口")
@RestController
@RequestMapping("/alloc_canteen_evaluate")
public class AllocCanteenEvaluateController extends BaseController {
@Autowired
private IAllocCanteenEvaluateService allocCanteenEvaluateService;
/**
* 查询食堂评价列表
*/
@ApiOperation(value = "查询食堂评价列表")
//@RequiresPermissions("alloc:evaluate:list")
@GetMapping("/list")
public TableDataInfo list(AllocCanteenEvaluate allocCanteenEvaluate) {
startPage();
List<AllocCanteenEvaluate> list = allocCanteenEvaluateService.selectAllocCanteenEvaluateList(allocCanteenEvaluate);
return getDataTable(list);
}
/**
* 导出食堂评价列表
*/
@ApiOperation(value = "导出食堂评价列表")
//@PreventRepeatSubmit
//@RequiresPermissions("alloc:evaluate:export")
@SysLog(title = "食堂评价", businessType = OperaType.EXPORT, logType = 1,module = "仓储管理->导出食堂评价")
@PostMapping("/export")
public void export(HttpServletResponse response, AllocCanteenEvaluate allocCanteenEvaluate) {
List<AllocCanteenEvaluate> list = allocCanteenEvaluateService.selectAllocCanteenEvaluateList(allocCanteenEvaluate);
ExcelUtil<AllocCanteenEvaluate> util = new ExcelUtil<AllocCanteenEvaluate>(AllocCanteenEvaluate.class);
util.exportExcel(response, list, "食堂评价数据");
}
/**
* 获取食堂评价详细信息
*/
@ApiOperation(value = "获取食堂评价详细信息")
//@RequiresPermissions("alloc:evaluate:query")
@GetMapping(value = "/{evaluateId}")
public AjaxResult getInfo(@PathVariable("evaluateId") Long evaluateId) {
return success(allocCanteenEvaluateService.selectAllocCanteenEvaluateByEvaluateId(evaluateId));
}
/**
* 新增食堂评价
*/
@ApiOperation(value = "新增食堂评价")
//@PreventRepeatSubmit
//@RequiresPermissions("alloc:evaluate:add")
@SysLog(title = "食堂评价", businessType = OperaType.INSERT, logType = 1,module = "仓储管理->新增食堂评价")
@PostMapping
public AjaxResult add(@RequestBody AllocCanteenEvaluate allocCanteenEvaluate) {
try {
return toAjax(allocCanteenEvaluateService.insertAllocCanteenEvaluate(allocCanteenEvaluate));
} catch (Exception e) {
return error("系统错误, " + e.getMessage());
}
}
/**
* 修改食堂评价
*/
@ApiOperation(value = "修改食堂评价")
//@PreventRepeatSubmit
//@RequiresPermissions("alloc:evaluate:edit")
@SysLog(title = "食堂评价", businessType = OperaType.UPDATE, logType = 1,module = "仓储管理->修改食堂评价")
@PostMapping("/edit")
public AjaxResult edit(@RequestBody AllocCanteenEvaluate allocCanteenEvaluate) {
try {
return toAjax(allocCanteenEvaluateService.updateAllocCanteenEvaluate(allocCanteenEvaluate));
} catch (Exception e) {
return error("系统错误, " + e.getMessage());
}
}
/**
* 删除食堂评价
*/
@ApiOperation(value = "删除食堂评价")
//@PreventRepeatSubmit
//@RequiresPermissions("alloc:evaluate:remove")
@SysLog(title = "食堂评价", businessType = OperaType.DELETE, logType = 1,module = "仓储管理->删除食堂评价")
@PostMapping("/del/{evaluateIds}")
public AjaxResult remove(@PathVariable Long[] evaluateIds) {
return toAjax(allocCanteenEvaluateService.deleteAllocCanteenEvaluateByEvaluateIds(evaluateIds));
}
}

View File

@ -0,0 +1,120 @@
package com.bonus.canteen.core.alloc.domain;
import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.bonus.common.core.annotation.Excel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;
import com.bonus.common.core.web.domain.BaseEntity;
/**
* 食堂评价对象 alloc_canteen_evaluate
*
* @author xsheng
* @date 2025-04-14
*/
@Data
@ToString
public class AllocCanteenEvaluate extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 主键ID */
private Long evaluateId;
/** 人员ID */
@Excel(name = "人员ID")
@ApiModelProperty(value = "人员ID")
private Long userId;
/** 食堂ID */
@Excel(name = "食堂ID")
@ApiModelProperty(value = "食堂ID")
private Long canteenId;
/** 档口ID */
@Excel(name = "档口ID")
@ApiModelProperty(value = "档口ID")
private Long shopstallId;
/** 评价日期 */
@ApiModelProperty(value = "评价日期")
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "评价日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date evaluateDate;
/** 仪容仪表评分 */
@Excel(name = "仪容仪表评分")
@ApiModelProperty(value = "仪容仪表评分")
private BigDecimal appearance;
/** 员工服务态度评分 */
@Excel(name = "员工服务态度评分")
@ApiModelProperty(value = "员工服务态度评分")
private BigDecimal attitude;
/** 菜品口味评分 */
@Excel(name = "菜品口味评分")
@ApiModelProperty(value = "菜品口味评分")
private BigDecimal taste;
/** 菜肴花色品种评分 */
@Excel(name = "菜肴花色品种评分")
@ApiModelProperty(value = "菜肴花色品种评分")
private BigDecimal varieties;
/** 菜肴食品卫生评分 */
@Excel(name = "菜肴食品卫生评分")
@ApiModelProperty(value = "菜肴食品卫生评分")
private BigDecimal hygiene;
/** 饭菜价格评分 */
@Excel(name = "饭菜价格评分")
@ApiModelProperty(value = "饭菜价格评分")
private BigDecimal price;
/** 饭菜份量评分 */
@Excel(name = "饭菜份量评分")
@ApiModelProperty(value = "饭菜份量评分")
private BigDecimal weight;
/** 自定义评分1 */
@Excel(name = "自定义评分1")
@ApiModelProperty(value = "自定义评分1")
private BigDecimal customize1;
/** 自定义评分2 */
@Excel(name = "自定义评分2")
@ApiModelProperty(value = "自定义评分2")
private BigDecimal customize2;
/** 自定义评分3 */
@Excel(name = "自定义评分3")
@ApiModelProperty(value = "自定义评分3")
private BigDecimal customize3;
/** 自定义文本1 */
@Excel(name = "自定义文本1")
@ApiModelProperty(value = "自定义文本1")
private String customizeText1;
/** 自定义文本2 */
@Excel(name = "自定义文本2")
@ApiModelProperty(value = "自定义文本2")
private String customizeText2;
/** 意见和建议 */
@Excel(name = "意见和建议")
@ApiModelProperty(value = "意见和建议")
private String proposal;
/** 乐观锁 */
@Excel(name = "乐观锁")
@ApiModelProperty(value = "乐观锁")
private Long revision;
}

View File

@ -0,0 +1,60 @@
package com.bonus.canteen.core.alloc.mapper;
import java.util.List;
import com.bonus.canteen.core.alloc.domain.AllocCanteenEvaluate;
/**
* 食堂评价Mapper接口
*
* @author xsheng
* @date 2025-04-14
*/
public interface AllocCanteenEvaluateMapper {
/**
* 查询食堂评价
*
* @param evaluateId 食堂评价主键
* @return 食堂评价
*/
public AllocCanteenEvaluate selectAllocCanteenEvaluateByEvaluateId(Long evaluateId);
/**
* 查询食堂评价列表
*
* @param allocCanteenEvaluate 食堂评价
* @return 食堂评价集合
*/
public List<AllocCanteenEvaluate> selectAllocCanteenEvaluateList(AllocCanteenEvaluate allocCanteenEvaluate);
/**
* 新增食堂评价
*
* @param allocCanteenEvaluate 食堂评价
* @return 结果
*/
public int insertAllocCanteenEvaluate(AllocCanteenEvaluate allocCanteenEvaluate);
/**
* 修改食堂评价
*
* @param allocCanteenEvaluate 食堂评价
* @return 结果
*/
public int updateAllocCanteenEvaluate(AllocCanteenEvaluate allocCanteenEvaluate);
/**
* 删除食堂评价
*
* @param evaluateId 食堂评价主键
* @return 结果
*/
public int deleteAllocCanteenEvaluateByEvaluateId(Long evaluateId);
/**
* 批量删除食堂评价
*
* @param evaluateIds 需要删除的数据主键集合
* @return 结果
*/
public int deleteAllocCanteenEvaluateByEvaluateIds(Long[] evaluateIds);
}

View File

@ -0,0 +1,60 @@
package com.bonus.canteen.core.alloc.service;
import java.util.List;
import com.bonus.canteen.core.alloc.domain.AllocCanteenEvaluate;
/**
* 食堂评价Service接口
*
* @author xsheng
* @date 2025-04-14
*/
public interface IAllocCanteenEvaluateService {
/**
* 查询食堂评价
*
* @param evaluateId 食堂评价主键
* @return 食堂评价
*/
public AllocCanteenEvaluate selectAllocCanteenEvaluateByEvaluateId(Long evaluateId);
/**
* 查询食堂评价列表
*
* @param allocCanteenEvaluate 食堂评价
* @return 食堂评价集合
*/
public List<AllocCanteenEvaluate> selectAllocCanteenEvaluateList(AllocCanteenEvaluate allocCanteenEvaluate);
/**
* 新增食堂评价
*
* @param allocCanteenEvaluate 食堂评价
* @return 结果
*/
public int insertAllocCanteenEvaluate(AllocCanteenEvaluate allocCanteenEvaluate);
/**
* 修改食堂评价
*
* @param allocCanteenEvaluate 食堂评价
* @return 结果
*/
public int updateAllocCanteenEvaluate(AllocCanteenEvaluate allocCanteenEvaluate);
/**
* 批量删除食堂评价
*
* @param evaluateIds 需要删除的食堂评价主键集合
* @return 结果
*/
public int deleteAllocCanteenEvaluateByEvaluateIds(Long[] evaluateIds);
/**
* 删除食堂评价信息
*
* @param evaluateId 食堂评价主键
* @return 结果
*/
public int deleteAllocCanteenEvaluateByEvaluateId(Long evaluateId);
}

View File

@ -0,0 +1,98 @@
package com.bonus.canteen.core.alloc.service.impl;
import java.util.List;
import com.bonus.common.core.exception.ServiceException;
import com.bonus.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.bonus.canteen.core.alloc.mapper.AllocCanteenEvaluateMapper;
import com.bonus.canteen.core.alloc.domain.AllocCanteenEvaluate;
import com.bonus.canteen.core.alloc.service.IAllocCanteenEvaluateService;
/**
* 食堂评价Service业务层处理
*
* @author xsheng
* @date 2025-04-14
*/
@Service
public class AllocCanteenEvaluateServiceImpl implements IAllocCanteenEvaluateService {
@Autowired
private AllocCanteenEvaluateMapper allocCanteenEvaluateMapper;
/**
* 查询食堂评价
*
* @param evaluateId 食堂评价主键
* @return 食堂评价
*/
@Override
public AllocCanteenEvaluate selectAllocCanteenEvaluateByEvaluateId(Long evaluateId) {
return allocCanteenEvaluateMapper.selectAllocCanteenEvaluateByEvaluateId(evaluateId);
}
/**
* 查询食堂评价列表
*
* @param allocCanteenEvaluate 食堂评价
* @return 食堂评价
*/
@Override
public List<AllocCanteenEvaluate> selectAllocCanteenEvaluateList(AllocCanteenEvaluate allocCanteenEvaluate) {
return allocCanteenEvaluateMapper.selectAllocCanteenEvaluateList(allocCanteenEvaluate);
}
/**
* 新增食堂评价
*
* @param allocCanteenEvaluate 食堂评价
* @return 结果
*/
@Override
public int insertAllocCanteenEvaluate(AllocCanteenEvaluate allocCanteenEvaluate) {
allocCanteenEvaluate.setCreateTime(DateUtils.getNowDate());
try {
return allocCanteenEvaluateMapper.insertAllocCanteenEvaluate(allocCanteenEvaluate);
} catch (Exception e) {
throw new ServiceException("错误信息描述");
}
}
/**
* 修改食堂评价
*
* @param allocCanteenEvaluate 食堂评价
* @return 结果
*/
@Override
public int updateAllocCanteenEvaluate(AllocCanteenEvaluate allocCanteenEvaluate) {
allocCanteenEvaluate.setUpdateTime(DateUtils.getNowDate());
try {
return allocCanteenEvaluateMapper.updateAllocCanteenEvaluate(allocCanteenEvaluate);
} catch (Exception e) {
throw new ServiceException("错误信息描述");
}
}
/**
* 批量删除食堂评价
*
* @param evaluateIds 需要删除的食堂评价主键
* @return 结果
*/
@Override
public int deleteAllocCanteenEvaluateByEvaluateIds(Long[] evaluateIds) {
return allocCanteenEvaluateMapper.deleteAllocCanteenEvaluateByEvaluateIds(evaluateIds);
}
/**
* 删除食堂评价信息
*
* @param evaluateId 食堂评价主键
* @return 结果
*/
@Override
public int deleteAllocCanteenEvaluateByEvaluateId(Long evaluateId) {
return allocCanteenEvaluateMapper.deleteAllocCanteenEvaluateByEvaluateId(evaluateId);
}
}

View File

@ -0,0 +1,156 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.bonus.canteen.core.alloc.mapper.AllocCanteenEvaluateMapper">
<resultMap type="com.bonus.canteen.core.alloc.domain.AllocCanteenEvaluate" id="AllocCanteenEvaluateResult">
<result property="evaluateId" column="evaluate_id" />
<result property="userId" column="user_id" />
<result property="canteenId" column="canteen_id" />
<result property="shopstallId" column="shopstall_id" />
<result property="evaluateDate" column="evaluate_date" />
<result property="appearance" column="appearance" />
<result property="attitude" column="attitude" />
<result property="taste" column="taste" />
<result property="varieties" column="varieties" />
<result property="hygiene" column="hygiene" />
<result property="price" column="price" />
<result property="weight" column="weight" />
<result property="customize1" column="customize1" />
<result property="customize2" column="customize2" />
<result property="customize3" column="customize3" />
<result property="customizeText1" column="customize_text1" />
<result property="customizeText2" column="customize_text2" />
<result property="proposal" column="proposal" />
<result property="revision" column="revision" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectAllocCanteenEvaluateVo">
select evaluate_id, user_id, canteen_id, shopstall_id, evaluate_date, appearance, attitude, taste, varieties, hygiene, price, weight, customize1, customize2, customize3, customize_text1, customize_text2, proposal, revision, create_by, create_time, update_by, update_time from alloc_canteen_evaluate
</sql>
<select id="selectAllocCanteenEvaluateList" parameterType="com.bonus.canteen.core.alloc.domain.AllocCanteenEvaluate" resultMap="AllocCanteenEvaluateResult">
<include refid="selectAllocCanteenEvaluateVo"/>
<where>
<if test="userId != null "> and user_id = #{userId}</if>
<if test="canteenId != null "> and canteen_id = #{canteenId}</if>
<if test="shopstallId != null "> and shopstall_id = #{shopstallId}</if>
<if test="evaluateDate != null "> and evaluate_date = #{evaluateDate}</if>
<if test="appearance != null "> and appearance = #{appearance}</if>
<if test="attitude != null "> and attitude = #{attitude}</if>
<if test="taste != null "> and taste = #{taste}</if>
<if test="varieties != null "> and varieties = #{varieties}</if>
<if test="hygiene != null "> and hygiene = #{hygiene}</if>
<if test="price != null "> and price = #{price}</if>
<if test="weight != null "> and weight = #{weight}</if>
<if test="customize1 != null "> and customize1 = #{customize1}</if>
<if test="customize2 != null "> and customize2 = #{customize2}</if>
<if test="customize3 != null "> and customize3 = #{customize3}</if>
<if test="customizeText1 != null and customizeText1 != ''"> and customize_text1 = #{customizeText1}</if>
<if test="customizeText2 != null and customizeText2 != ''"> and customize_text2 = #{customizeText2}</if>
<if test="proposal != null and proposal != ''"> and proposal = #{proposal}</if>
<if test="revision != null "> and revision = #{revision}</if>
</where>
</select>
<select id="selectAllocCanteenEvaluateByEvaluateId" parameterType="Long" resultMap="AllocCanteenEvaluateResult">
<include refid="selectAllocCanteenEvaluateVo"/>
where evaluate_id = #{evaluateId}
</select>
<insert id="insertAllocCanteenEvaluate" parameterType="com.bonus.canteen.core.alloc.domain.AllocCanteenEvaluate" useGeneratedKeys="true" keyProperty="evaluateId">
insert into alloc_canteen_evaluate
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="userId != null">user_id,</if>
<if test="canteenId != null">canteen_id,</if>
<if test="shopstallId != null">shopstall_id,</if>
<if test="evaluateDate != null">evaluate_date,</if>
<if test="appearance != null">appearance,</if>
<if test="attitude != null">attitude,</if>
<if test="taste != null">taste,</if>
<if test="varieties != null">varieties,</if>
<if test="hygiene != null">hygiene,</if>
<if test="price != null">price,</if>
<if test="weight != null">weight,</if>
<if test="customize1 != null">customize1,</if>
<if test="customize2 != null">customize2,</if>
<if test="customize3 != null">customize3,</if>
<if test="customizeText1 != null">customize_text1,</if>
<if test="customizeText2 != null">customize_text2,</if>
<if test="proposal != null">proposal,</if>
<if test="revision != null">revision,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="userId != null">#{userId},</if>
<if test="canteenId != null">#{canteenId},</if>
<if test="shopstallId != null">#{shopstallId},</if>
<if test="evaluateDate != null">#{evaluateDate},</if>
<if test="appearance != null">#{appearance},</if>
<if test="attitude != null">#{attitude},</if>
<if test="taste != null">#{taste},</if>
<if test="varieties != null">#{varieties},</if>
<if test="hygiene != null">#{hygiene},</if>
<if test="price != null">#{price},</if>
<if test="weight != null">#{weight},</if>
<if test="customize1 != null">#{customize1},</if>
<if test="customize2 != null">#{customize2},</if>
<if test="customize3 != null">#{customize3},</if>
<if test="customizeText1 != null">#{customizeText1},</if>
<if test="customizeText2 != null">#{customizeText2},</if>
<if test="proposal != null">#{proposal},</if>
<if test="revision != null">#{revision},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateAllocCanteenEvaluate" parameterType="com.bonus.canteen.core.alloc.domain.AllocCanteenEvaluate">
update alloc_canteen_evaluate
<trim prefix="SET" suffixOverrides=",">
<if test="userId != null">user_id = #{userId},</if>
<if test="canteenId != null">canteen_id = #{canteenId},</if>
<if test="shopstallId != null">shopstall_id = #{shopstallId},</if>
<if test="evaluateDate != null">evaluate_date = #{evaluateDate},</if>
<if test="appearance != null">appearance = #{appearance},</if>
<if test="attitude != null">attitude = #{attitude},</if>
<if test="taste != null">taste = #{taste},</if>
<if test="varieties != null">varieties = #{varieties},</if>
<if test="hygiene != null">hygiene = #{hygiene},</if>
<if test="price != null">price = #{price},</if>
<if test="weight != null">weight = #{weight},</if>
<if test="customize1 != null">customize1 = #{customize1},</if>
<if test="customize2 != null">customize2 = #{customize2},</if>
<if test="customize3 != null">customize3 = #{customize3},</if>
<if test="customizeText1 != null">customize_text1 = #{customizeText1},</if>
<if test="customizeText2 != null">customize_text2 = #{customizeText2},</if>
<if test="proposal != null">proposal = #{proposal},</if>
<if test="revision != null">revision = #{revision},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where evaluate_id = #{evaluateId}
</update>
<delete id="deleteAllocCanteenEvaluateByEvaluateId" parameterType="Long">
delete from alloc_canteen_evaluate where evaluate_id = #{evaluateId}
</delete>
<delete id="deleteAllocCanteenEvaluateByEvaluateIds" parameterType="String">
delete from alloc_canteen_evaluate where evaluate_id in
<foreach item="evaluateId" collection="array" open="(" separator="," close=")">
#{evaluateId}
</foreach>
</delete>
</mapper>