This commit is contained in:
sxu 2025-05-07 11:32:51 +08:00
parent f4402c8d34
commit 6af64d586b
3 changed files with 18 additions and 15 deletions

View File

@ -19,9 +19,6 @@ import com.bonus.common.core.web.domain.BaseEntity;
public class AllocCanteenSuggestion extends BaseEntity { public class AllocCanteenSuggestion extends BaseEntity {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** 主键自增 */
private Long id;
/** 投诉建议id */ /** 投诉建议id */
@Excel(name = "投诉建议id") @Excel(name = "投诉建议id")
@ApiModelProperty(value = "投诉建议id") @ApiModelProperty(value = "投诉建议id")

View File

@ -1,8 +1,11 @@
package com.bonus.canteen.core.alloc.service.impl; package com.bonus.canteen.core.alloc.service.impl;
import java.util.List; import java.util.List;
import com.bonus.canteen.core.nutrition.common.enums.YesOrNoEnum;
import com.bonus.common.core.exception.ServiceException; import com.bonus.common.core.exception.ServiceException;
import com.bonus.common.core.utils.DateUtils; import com.bonus.common.core.utils.DateUtils;
import com.bonus.common.security.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.bonus.canteen.core.alloc.mapper.AllocCanteenSuggestionMapper; import com.bonus.canteen.core.alloc.mapper.AllocCanteenSuggestionMapper;
@ -51,6 +54,10 @@ public class AllocCanteenSuggestionServiceImpl implements IAllocCanteenSuggestio
@Override @Override
public int insertAllocCanteenSuggestion(AllocCanteenSuggestion allocCanteenSuggestion) { public int insertAllocCanteenSuggestion(AllocCanteenSuggestion allocCanteenSuggestion) {
allocCanteenSuggestion.setCreateTime(DateUtils.getNowDate()); allocCanteenSuggestion.setCreateTime(DateUtils.getNowDate());
allocCanteenSuggestion.setCreateBy(SecurityUtils.getUsername());
allocCanteenSuggestion.setUserId(SecurityUtils.getUserId());
allocCanteenSuggestion.setSourceType(7L);
allocCanteenSuggestion.setReplyState(YesOrNoEnum.NO.key().longValue());
try { try {
return allocCanteenSuggestionMapper.insertAllocCanteenSuggestion(allocCanteenSuggestion); return allocCanteenSuggestionMapper.insertAllocCanteenSuggestion(allocCanteenSuggestion);
} catch (Exception e) { } catch (Exception e) {
@ -67,6 +74,7 @@ public class AllocCanteenSuggestionServiceImpl implements IAllocCanteenSuggestio
@Override @Override
public int updateAllocCanteenSuggestion(AllocCanteenSuggestion allocCanteenSuggestion) { public int updateAllocCanteenSuggestion(AllocCanteenSuggestion allocCanteenSuggestion) {
allocCanteenSuggestion.setUpdateTime(DateUtils.getNowDate()); allocCanteenSuggestion.setUpdateTime(DateUtils.getNowDate());
allocCanteenSuggestion.setUpdateBy(SecurityUtils.getUsername());
try { try {
return allocCanteenSuggestionMapper.updateAllocCanteenSuggestion(allocCanteenSuggestion); return allocCanteenSuggestionMapper.updateAllocCanteenSuggestion(allocCanteenSuggestion);
} catch (Exception e) { } catch (Exception e) {

View File

@ -4,7 +4,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.bonus.canteen.core.alloc.mapper.AllocCanteenSuggestionMapper"> <mapper namespace="com.bonus.canteen.core.alloc.mapper.AllocCanteenSuggestionMapper">
<resultMap type="com.bonus.canteen.core.alloc.domain.AllocCanteenSuggestion" id="AllocCanteenSuggestionResult"> <resultMap type="com.bonus.canteen.core.alloc.domain.AllocCanteenSuggestion" id="AllocCanteenSuggestionResult">
<result property="id" column="id" />
<result property="complaintId" column="complaint_id" /> <result property="complaintId" column="complaint_id" />
<result property="userId" column="user_id" /> <result property="userId" column="user_id" />
<result property="content" column="content" /> <result property="content" column="content" />
@ -22,7 +21,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectAllocCanteenSuggestionVo"> <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 select 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> </sql>
<select id="selectAllocCanteenSuggestionList" parameterType="com.bonus.canteen.core.alloc.domain.AllocCanteenSuggestion" resultMap="AllocCanteenSuggestionResult"> <select id="selectAllocCanteenSuggestionList" parameterType="com.bonus.canteen.core.alloc.domain.AllocCanteenSuggestion" resultMap="AllocCanteenSuggestionResult">
@ -43,13 +44,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectAllocCanteenSuggestionById" parameterType="Long" resultMap="AllocCanteenSuggestionResult"> <select id="selectAllocCanteenSuggestionById" parameterType="Long" resultMap="AllocCanteenSuggestionResult">
<include refid="selectAllocCanteenSuggestionVo"/> <include refid="selectAllocCanteenSuggestionVo"/>
where id = #{id} where complaint_id = #{complaintId}
</select> </select>
<insert id="insertAllocCanteenSuggestion" parameterType="com.bonus.canteen.core.alloc.domain.AllocCanteenSuggestion" useGeneratedKeys="true" keyProperty="id"> <insert id="insertAllocCanteenSuggestion" parameterType="com.bonus.canteen.core.alloc.domain.AllocCanteenSuggestion" useGeneratedKeys="true" keyProperty="complaintId">
insert into alloc_canteen_suggestion insert into alloc_canteen_suggestion
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="complaintId != null">complaint_id,</if>
<if test="userId != null">user_id,</if> <if test="userId != null">user_id,</if>
<if test="content != null and content != ''">content,</if> <if test="content != null and content != ''">content,</if>
<if test="canteenId != null">canteen_id,</if> <if test="canteenId != null">canteen_id,</if>
@ -65,7 +65,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateTime != null">update_time,</if> <if test="updateTime != null">update_time,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="complaintId != null">#{complaintId},</if>
<if test="userId != null">#{userId},</if> <if test="userId != null">#{userId},</if>
<if test="content != null and content != ''">#{content},</if> <if test="content != null and content != ''">#{content},</if>
<if test="canteenId != null">#{canteenId},</if> <if test="canteenId != null">#{canteenId},</if>
@ -85,7 +84,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<update id="updateAllocCanteenSuggestion" parameterType="com.bonus.canteen.core.alloc.domain.AllocCanteenSuggestion"> <update id="updateAllocCanteenSuggestion" parameterType="com.bonus.canteen.core.alloc.domain.AllocCanteenSuggestion">
update alloc_canteen_suggestion update alloc_canteen_suggestion
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
<if test="complaintId != null">complaint_id = #{complaintId},</if>
<if test="userId != null">user_id = #{userId},</if> <if test="userId != null">user_id = #{userId},</if>
<if test="content != null and content != ''">content = #{content},</if> <if test="content != null and content != ''">content = #{content},</if>
<if test="canteenId != null">canteen_id = #{canteenId},</if> <if test="canteenId != null">canteen_id = #{canteenId},</if>
@ -100,17 +98,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateBy != null">update_by = #{updateBy},</if> <if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if> <if test="updateTime != null">update_time = #{updateTime},</if>
</trim> </trim>
where id = #{id} where complaint_id = #{complaintId}
</update> </update>
<delete id="deleteAllocCanteenSuggestionById" parameterType="Long"> <delete id="deleteAllocCanteenSuggestionById" parameterType="Long">
delete from alloc_canteen_suggestion where id = #{id} delete from alloc_canteen_suggestion where complaint_id = #{complaintId}
</delete> </delete>
<delete id="deleteAllocCanteenSuggestionByIds" parameterType="String"> <delete id="deleteAllocCanteenSuggestionByIds" parameterType="String">
delete from alloc_canteen_suggestion where id in delete from alloc_canteen_suggestion where complaint_id in
<foreach item="id" collection="array" open="(" separator="," close=")"> <foreach item="complaintId" collection="array" open="(" separator="," close=")">
#{id} #{complaintId}
</foreach> </foreach>
</delete> </delete>
</mapper> </mapper>