From 61b5737f3dfa45487f8ec8a9aa7a54921a740f80 Mon Sep 17 00:00:00 2001 From: sxu <602087911@qq.com> Date: Mon, 14 Apr 2025 16:50:36 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=84=E4=BB=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AllocCanteenEvaluateController.java | 119 +++++++++++++ .../alloc/domain/AllocCanteenEvaluate.java | 120 ++++++++++++++ .../mapper/AllocCanteenEvaluateMapper.java | 60 +++++++ .../service/IAllocCanteenEvaluateService.java | 60 +++++++ .../impl/AllocCanteenEvaluateServiceImpl.java | 98 +++++++++++ .../alloc/AllocCanteenEvaluateMapper.xml | 156 ++++++++++++++++++ 6 files changed, 613 insertions(+) create mode 100644 bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/controller/AllocCanteenEvaluateController.java create mode 100644 bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/domain/AllocCanteenEvaluate.java create mode 100644 bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/mapper/AllocCanteenEvaluateMapper.java create mode 100644 bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/service/IAllocCanteenEvaluateService.java create mode 100644 bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/service/impl/AllocCanteenEvaluateServiceImpl.java create mode 100644 bonus-modules/bonus-smart-canteen/src/main/resources/mapper/alloc/AllocCanteenEvaluateMapper.xml diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/controller/AllocCanteenEvaluateController.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/controller/AllocCanteenEvaluateController.java new file mode 100644 index 0000000..4e81378 --- /dev/null +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/controller/AllocCanteenEvaluateController.java @@ -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 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 list = allocCanteenEvaluateService.selectAllocCanteenEvaluateList(allocCanteenEvaluate); + ExcelUtil util = new ExcelUtil(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)); + } +} diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/domain/AllocCanteenEvaluate.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/domain/AllocCanteenEvaluate.java new file mode 100644 index 0000000..615c30f --- /dev/null +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/domain/AllocCanteenEvaluate.java @@ -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; + + +} diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/mapper/AllocCanteenEvaluateMapper.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/mapper/AllocCanteenEvaluateMapper.java new file mode 100644 index 0000000..017a458 --- /dev/null +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/mapper/AllocCanteenEvaluateMapper.java @@ -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 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); +} diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/service/IAllocCanteenEvaluateService.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/service/IAllocCanteenEvaluateService.java new file mode 100644 index 0000000..c3d2886 --- /dev/null +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/service/IAllocCanteenEvaluateService.java @@ -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 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); +} diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/service/impl/AllocCanteenEvaluateServiceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/service/impl/AllocCanteenEvaluateServiceImpl.java new file mode 100644 index 0000000..7b75cab --- /dev/null +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/service/impl/AllocCanteenEvaluateServiceImpl.java @@ -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 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); + } +} diff --git a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/alloc/AllocCanteenEvaluateMapper.xml b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/alloc/AllocCanteenEvaluateMapper.xml new file mode 100644 index 0000000..3892be8 --- /dev/null +++ b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/alloc/AllocCanteenEvaluateMapper.xml @@ -0,0 +1,156 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + insert into alloc_canteen_evaluate + + 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, + + + #{userId}, + #{canteenId}, + #{shopstallId}, + #{evaluateDate}, + #{appearance}, + #{attitude}, + #{taste}, + #{varieties}, + #{hygiene}, + #{price}, + #{weight}, + #{customize1}, + #{customize2}, + #{customize3}, + #{customizeText1}, + #{customizeText2}, + #{proposal}, + #{revision}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + + + + + update alloc_canteen_evaluate + + user_id = #{userId}, + canteen_id = #{canteenId}, + shopstall_id = #{shopstallId}, + evaluate_date = #{evaluateDate}, + appearance = #{appearance}, + attitude = #{attitude}, + taste = #{taste}, + varieties = #{varieties}, + hygiene = #{hygiene}, + price = #{price}, + weight = #{weight}, + customize1 = #{customize1}, + customize2 = #{customize2}, + customize3 = #{customize3}, + customize_text1 = #{customizeText1}, + customize_text2 = #{customizeText2}, + proposal = #{proposal}, + revision = #{revision}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + + where evaluate_id = #{evaluateId} + + + + delete from alloc_canteen_evaluate where evaluate_id = #{evaluateId} + + + + delete from alloc_canteen_evaluate where evaluate_id in + + #{evaluateId} + + + \ No newline at end of file