diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/controller/AllocCanteenSuggestionController.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/controller/AllocCanteenSuggestionController.java new file mode 100644 index 0000000..ebdf17a --- /dev/null +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/controller/AllocCanteenSuggestionController.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.AllocCanteenSuggestion; +import com.bonus.canteen.core.alloc.service.IAllocCanteenSuggestionService; +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-20 + */ +@Api(tags = "投诉建议 接口") +@RestController +@RequestMapping("/alloc_canteen_suggestion") +public class AllocCanteenSuggestionController extends BaseController { + @Autowired + private IAllocCanteenSuggestionService allocCanteenSuggestionService; + + /** + * 查询投诉建议 列表 + */ + @ApiOperation(value = "查询投诉建议 列表") + //@RequiresPermissions("alloc:suggestion:list") + @GetMapping("/list") + public TableDataInfo list(AllocCanteenSuggestion allocCanteenSuggestion) { + startPage(); + List list = allocCanteenSuggestionService.selectAllocCanteenSuggestionList(allocCanteenSuggestion); + return getDataTable(list); + } + + /** + * 导出投诉建议 列表 + */ + @ApiOperation(value = "导出投诉建议 列表") + //@PreventRepeatSubmit + //@RequiresPermissions("alloc:suggestion:export") + @SysLog(title = "投诉建议 ", businessType = OperaType.EXPORT, logType = 1,module = "仓储管理->导出投诉建议 ") + @PostMapping("/export") + public void export(HttpServletResponse response, AllocCanteenSuggestion allocCanteenSuggestion) { + List list = allocCanteenSuggestionService.selectAllocCanteenSuggestionList(allocCanteenSuggestion); + ExcelUtil util = new ExcelUtil(AllocCanteenSuggestion.class); + util.exportExcel(response, list, "投诉建议 数据"); + } + + /** + * 获取投诉建议 详细信息 + */ + @ApiOperation(value = "获取投诉建议 详细信息") + //@RequiresPermissions("alloc:suggestion:query") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) { + return success(allocCanteenSuggestionService.selectAllocCanteenSuggestionById(id)); + } + + /** + * 新增投诉建议 + */ + @ApiOperation(value = "新增投诉建议 ") + //@PreventRepeatSubmit + //@RequiresPermissions("alloc:suggestion:add") + @SysLog(title = "投诉建议 ", businessType = OperaType.INSERT, logType = 1,module = "仓储管理->新增投诉建议 ") + @PostMapping + public AjaxResult add(@RequestBody AllocCanteenSuggestion allocCanteenSuggestion) { + try { + return toAjax(allocCanteenSuggestionService.insertAllocCanteenSuggestion(allocCanteenSuggestion)); + } catch (Exception e) { + return error("系统错误, " + e.getMessage()); + } + } + + /** + * 修改投诉建议 + */ + @ApiOperation(value = "修改投诉建议 ") + //@PreventRepeatSubmit + //@RequiresPermissions("alloc:suggestion:edit") + @SysLog(title = "投诉建议 ", businessType = OperaType.UPDATE, logType = 1,module = "仓储管理->修改投诉建议 ") + @PostMapping("/edit") + public AjaxResult edit(@RequestBody AllocCanteenSuggestion allocCanteenSuggestion) { + try { + return toAjax(allocCanteenSuggestionService.updateAllocCanteenSuggestion(allocCanteenSuggestion)); + } catch (Exception e) { + return error("系统错误, " + e.getMessage()); + } + } + + /** + * 删除投诉建议 + */ + @ApiOperation(value = "删除投诉建议 ") + //@PreventRepeatSubmit + //@RequiresPermissions("alloc:suggestion:remove") + @SysLog(title = "投诉建议 ", businessType = OperaType.DELETE, logType = 1,module = "仓储管理->删除投诉建议 ") + @PostMapping("/del/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) { + return toAjax(allocCanteenSuggestionService.deleteAllocCanteenSuggestionByIds(ids)); + } +} diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/domain/AllocCanteenSuggestion.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/domain/AllocCanteenSuggestion.java new file mode 100644 index 0000000..5d8559e --- /dev/null +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/domain/AllocCanteenSuggestion.java @@ -0,0 +1,75 @@ +package com.bonus.canteen.core.alloc.domain; + +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_suggestion + * + * @author xsheng + * @date 2025-04-20 + */ + + +@Data +@ToString +public class AllocCanteenSuggestion extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** 主键自增 */ + private Long id; + + /** 投诉建议id */ + @Excel(name = "投诉建议id") + @ApiModelProperty(value = "投诉建议id") + private Long complaintId; + + /** 人员id */ + @Excel(name = "人员id") + @ApiModelProperty(value = "人员id") + private Long userId; + + /** 投诉内容 */ + @Excel(name = "投诉内容") + @ApiModelProperty(value = "投诉内容") + private String content; + + /** 餐厅id */ + @Excel(name = "餐厅id") + @ApiModelProperty(value = "餐厅id") + private Long canteenId; + + /** 投诉图片 */ + @Excel(name = "投诉图片") + @ApiModelProperty(value = "投诉图片") + private String complaintPicture; + + /** 来源 */ + @Excel(name = "来源") + @ApiModelProperty(value = "来源") + private Long sourceType; + + /** 联系方式 */ + @Excel(name = "联系方式") + @ApiModelProperty(value = "联系方式") + private String mobile; + + /** 回复内容 */ + @Excel(name = "回复内容") + @ApiModelProperty(value = "回复内容") + private String replyContent; + + /** 乐观锁 */ + @Excel(name = "乐观锁") + @ApiModelProperty(value = "乐观锁") + private Long revision; + + /** $column.columnComment */ + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private Long replyState; + + +} diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/mapper/AllocCanteenSuggestionMapper.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/mapper/AllocCanteenSuggestionMapper.java new file mode 100644 index 0000000..3c96ba2 --- /dev/null +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/mapper/AllocCanteenSuggestionMapper.java @@ -0,0 +1,60 @@ +package com.bonus.canteen.core.alloc.mapper; + +import java.util.List; +import com.bonus.canteen.core.alloc.domain.AllocCanteenSuggestion; + +/** + * 投诉建议 Mapper接口 + * + * @author xsheng + * @date 2025-04-20 + */ +public interface AllocCanteenSuggestionMapper { + /** + * 查询投诉建议 + * + * @param id 投诉建议 主键 + * @return 投诉建议 + */ + public AllocCanteenSuggestion selectAllocCanteenSuggestionById(Long id); + + /** + * 查询投诉建议 列表 + * + * @param allocCanteenSuggestion 投诉建议 + * @return 投诉建议 集合 + */ + public List selectAllocCanteenSuggestionList(AllocCanteenSuggestion allocCanteenSuggestion); + + /** + * 新增投诉建议 + * + * @param allocCanteenSuggestion 投诉建议 + * @return 结果 + */ + public int insertAllocCanteenSuggestion(AllocCanteenSuggestion allocCanteenSuggestion); + + /** + * 修改投诉建议 + * + * @param allocCanteenSuggestion 投诉建议 + * @return 结果 + */ + public int updateAllocCanteenSuggestion(AllocCanteenSuggestion allocCanteenSuggestion); + + /** + * 删除投诉建议 + * + * @param id 投诉建议 主键 + * @return 结果 + */ + public int deleteAllocCanteenSuggestionById(Long id); + + /** + * 批量删除投诉建议 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteAllocCanteenSuggestionByIds(Long[] ids); +} diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/service/IAllocCanteenSuggestionService.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/service/IAllocCanteenSuggestionService.java new file mode 100644 index 0000000..81c0cf6 --- /dev/null +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/service/IAllocCanteenSuggestionService.java @@ -0,0 +1,60 @@ +package com.bonus.canteen.core.alloc.service; + +import java.util.List; +import com.bonus.canteen.core.alloc.domain.AllocCanteenSuggestion; + +/** + * 投诉建议 Service接口 + * + * @author xsheng + * @date 2025-04-20 + */ +public interface IAllocCanteenSuggestionService { + /** + * 查询投诉建议 + * + * @param id 投诉建议 主键 + * @return 投诉建议 + */ + public AllocCanteenSuggestion selectAllocCanteenSuggestionById(Long id); + + /** + * 查询投诉建议 列表 + * + * @param allocCanteenSuggestion 投诉建议 + * @return 投诉建议 集合 + */ + public List selectAllocCanteenSuggestionList(AllocCanteenSuggestion allocCanteenSuggestion); + + /** + * 新增投诉建议 + * + * @param allocCanteenSuggestion 投诉建议 + * @return 结果 + */ + public int insertAllocCanteenSuggestion(AllocCanteenSuggestion allocCanteenSuggestion); + + /** + * 修改投诉建议 + * + * @param allocCanteenSuggestion 投诉建议 + * @return 结果 + */ + public int updateAllocCanteenSuggestion(AllocCanteenSuggestion allocCanteenSuggestion); + + /** + * 批量删除投诉建议 + * + * @param ids 需要删除的投诉建议 主键集合 + * @return 结果 + */ + public int deleteAllocCanteenSuggestionByIds(Long[] ids); + + /** + * 删除投诉建议 信息 + * + * @param id 投诉建议 主键 + * @return 结果 + */ + public int deleteAllocCanteenSuggestionById(Long id); +} diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/service/impl/AllocCanteenSuggestionServiceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/service/impl/AllocCanteenSuggestionServiceImpl.java new file mode 100644 index 0000000..6961628 --- /dev/null +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/service/impl/AllocCanteenSuggestionServiceImpl.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.AllocCanteenSuggestionMapper; +import com.bonus.canteen.core.alloc.domain.AllocCanteenSuggestion; +import com.bonus.canteen.core.alloc.service.IAllocCanteenSuggestionService; + +/** + * 投诉建议 Service业务层处理 + * + * @author xsheng + * @date 2025-04-20 + */ +@Service +public class AllocCanteenSuggestionServiceImpl implements IAllocCanteenSuggestionService { + @Autowired + private AllocCanteenSuggestionMapper allocCanteenSuggestionMapper; + + /** + * 查询投诉建议 + * + * @param id 投诉建议 主键 + * @return 投诉建议 + */ + @Override + public AllocCanteenSuggestion selectAllocCanteenSuggestionById(Long id) { + return allocCanteenSuggestionMapper.selectAllocCanteenSuggestionById(id); + } + + /** + * 查询投诉建议 列表 + * + * @param allocCanteenSuggestion 投诉建议 + * @return 投诉建议 + */ + @Override + public List selectAllocCanteenSuggestionList(AllocCanteenSuggestion allocCanteenSuggestion) { + return allocCanteenSuggestionMapper.selectAllocCanteenSuggestionList(allocCanteenSuggestion); + } + + /** + * 新增投诉建议 + * + * @param allocCanteenSuggestion 投诉建议 + * @return 结果 + */ + @Override + public int insertAllocCanteenSuggestion(AllocCanteenSuggestion allocCanteenSuggestion) { + allocCanteenSuggestion.setCreateTime(DateUtils.getNowDate()); + try { + return allocCanteenSuggestionMapper.insertAllocCanteenSuggestion(allocCanteenSuggestion); + } catch (Exception e) { + throw new ServiceException("错误信息描述, " + e.getMessage()); + } + } + + /** + * 修改投诉建议 + * + * @param allocCanteenSuggestion 投诉建议 + * @return 结果 + */ + @Override + public int updateAllocCanteenSuggestion(AllocCanteenSuggestion allocCanteenSuggestion) { + allocCanteenSuggestion.setUpdateTime(DateUtils.getNowDate()); + try { + return allocCanteenSuggestionMapper.updateAllocCanteenSuggestion(allocCanteenSuggestion); + } catch (Exception e) { + throw new ServiceException("错误信息描述, " + e.getMessage()); + } + } + + /** + * 批量删除投诉建议 + * + * @param ids 需要删除的投诉建议 主键 + * @return 结果 + */ + @Override + public int deleteAllocCanteenSuggestionByIds(Long[] ids) { + return allocCanteenSuggestionMapper.deleteAllocCanteenSuggestionByIds(ids); + } + + /** + * 删除投诉建议 信息 + * + * @param id 投诉建议 主键 + * @return 结果 + */ + @Override + public int deleteAllocCanteenSuggestionById(Long id) { + return allocCanteenSuggestionMapper.deleteAllocCanteenSuggestionById(id); + } +} diff --git a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/alloc/AllocCanteenSuggestionMapper.xml b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/alloc/AllocCanteenSuggestionMapper.xml new file mode 100644 index 0000000..5f8e2b1 --- /dev/null +++ b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/alloc/AllocCanteenSuggestionMapper.xml @@ -0,0 +1,116 @@ + + + + + + + + + + + + + + + + + + + + + + + select id, complaint_id, user_id, content, canteen_id, complaint_picture, source_type, mobile, reply_content, revision, reply_state, create_by, create_time, update_by, update_time from alloc_canteen_suggestion + + + + + + + + insert into alloc_canteen_suggestion + + complaint_id, + user_id, + content, + canteen_id, + complaint_picture, + source_type, + mobile, + reply_content, + revision, + reply_state, + create_by, + create_time, + update_by, + update_time, + + + #{complaintId}, + #{userId}, + #{content}, + #{canteenId}, + #{complaintPicture}, + #{sourceType}, + #{mobile}, + #{replyContent}, + #{revision}, + #{replyState}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + + + + + update alloc_canteen_suggestion + + complaint_id = #{complaintId}, + user_id = #{userId}, + content = #{content}, + canteen_id = #{canteenId}, + complaint_picture = #{complaintPicture}, + source_type = #{sourceType}, + mobile = #{mobile}, + reply_content = #{replyContent}, + revision = #{revision}, + reply_state = #{replyState}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + + where id = #{id} + + + + delete from alloc_canteen_suggestion where id = #{id} + + + + delete from alloc_canteen_suggestion where id in + + #{id} + + + \ No newline at end of file