alloc_canteen_suggestion

This commit is contained in:
sxu 2025-04-20 20:14:55 +08:00
parent 04d98c266b
commit 1a74d4f6ec
6 changed files with 528 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.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<AllocCanteenSuggestion> 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<AllocCanteenSuggestion> list = allocCanteenSuggestionService.selectAllocCanteenSuggestionList(allocCanteenSuggestion);
ExcelUtil<AllocCanteenSuggestion> util = new ExcelUtil<AllocCanteenSuggestion>(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));
}
}

View File

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

View File

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

View File

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

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.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<AllocCanteenSuggestion> 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);
}
}

View File

@ -0,0 +1,116 @@
<?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.AllocCanteenSuggestionMapper">
<resultMap type="com.bonus.canteen.core.alloc.domain.AllocCanteenSuggestion" id="AllocCanteenSuggestionResult">
<result property="id" column="id" />
<result property="complaintId" column="complaint_id" />
<result property="userId" column="user_id" />
<result property="content" column="content" />
<result property="canteenId" column="canteen_id" />
<result property="complaintPicture" column="complaint_picture" />
<result property="sourceType" column="source_type" />
<result property="mobile" column="mobile" />
<result property="replyContent" column="reply_content" />
<result property="revision" column="revision" />
<result property="replyState" column="reply_state" />
<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="selectAllocCanteenSuggestionVo">
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
</sql>
<select id="selectAllocCanteenSuggestionList" parameterType="com.bonus.canteen.core.alloc.domain.AllocCanteenSuggestion" resultMap="AllocCanteenSuggestionResult">
<include refid="selectAllocCanteenSuggestionVo"/>
<where>
<if test="complaintId != null "> and complaint_id = #{complaintId}</if>
<if test="userId != null "> and user_id = #{userId}</if>
<if test="content != null and content != ''"> and content = #{content}</if>
<if test="canteenId != null "> and canteen_id = #{canteenId}</if>
<if test="complaintPicture != null and complaintPicture != ''"> and complaint_picture = #{complaintPicture}</if>
<if test="sourceType != null "> and source_type = #{sourceType}</if>
<if test="mobile != null and mobile != ''"> and mobile = #{mobile}</if>
<if test="replyContent != null and replyContent != ''"> and reply_content = #{replyContent}</if>
<if test="revision != null "> and revision = #{revision}</if>
<if test="replyState != null "> and reply_state = #{replyState}</if>
</where>
</select>
<select id="selectAllocCanteenSuggestionById" parameterType="Long" resultMap="AllocCanteenSuggestionResult">
<include refid="selectAllocCanteenSuggestionVo"/>
where id = #{id}
</select>
<insert id="insertAllocCanteenSuggestion" parameterType="com.bonus.canteen.core.alloc.domain.AllocCanteenSuggestion" useGeneratedKeys="true" keyProperty="id">
insert into alloc_canteen_suggestion
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="complaintId != null">complaint_id,</if>
<if test="userId != null">user_id,</if>
<if test="content != null and content != ''">content,</if>
<if test="canteenId != null">canteen_id,</if>
<if test="complaintPicture != null and complaintPicture != ''">complaint_picture,</if>
<if test="sourceType != null">source_type,</if>
<if test="mobile != null">mobile,</if>
<if test="replyContent != null">reply_content,</if>
<if test="revision != null">revision,</if>
<if test="replyState != null">reply_state,</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="complaintId != null">#{complaintId},</if>
<if test="userId != null">#{userId},</if>
<if test="content != null and content != ''">#{content},</if>
<if test="canteenId != null">#{canteenId},</if>
<if test="complaintPicture != null and complaintPicture != ''">#{complaintPicture},</if>
<if test="sourceType != null">#{sourceType},</if>
<if test="mobile != null">#{mobile},</if>
<if test="replyContent != null">#{replyContent},</if>
<if test="revision != null">#{revision},</if>
<if test="replyState != null">#{replyState},</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="updateAllocCanteenSuggestion" parameterType="com.bonus.canteen.core.alloc.domain.AllocCanteenSuggestion">
update alloc_canteen_suggestion
<trim prefix="SET" suffixOverrides=",">
<if test="complaintId != null">complaint_id = #{complaintId},</if>
<if test="userId != null">user_id = #{userId},</if>
<if test="content != null and content != ''">content = #{content},</if>
<if test="canteenId != null">canteen_id = #{canteenId},</if>
<if test="complaintPicture != null and complaintPicture != ''">complaint_picture = #{complaintPicture},</if>
<if test="sourceType != null">source_type = #{sourceType},</if>
<if test="mobile != null">mobile = #{mobile},</if>
<if test="replyContent != null">reply_content = #{replyContent},</if>
<if test="revision != null">revision = #{revision},</if>
<if test="replyState != null">reply_state = #{replyState},</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 id = #{id}
</update>
<delete id="deleteAllocCanteenSuggestionById" parameterType="Long">
delete from alloc_canteen_suggestion where id = #{id}
</delete>
<delete id="deleteAllocCanteenSuggestionByIds" parameterType="String">
delete from alloc_canteen_suggestion where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>