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 index 5d8559e..8b74637 100644 --- 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 @@ -19,9 +19,6 @@ import com.bonus.common.core.web.domain.BaseEntity; public class AllocCanteenSuggestion extends BaseEntity { private static final long serialVersionUID = 1L; - /** 主键自增 */ - private Long id; - /** 投诉建议id */ @Excel(name = "投诉建议id") @ApiModelProperty(value = "投诉建议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 index 6961628..a4bdfc0 100644 --- 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 @@ -1,8 +1,11 @@ package com.bonus.canteen.core.alloc.service.impl; 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.utils.DateUtils; +import com.bonus.common.security.utils.SecurityUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.bonus.canteen.core.alloc.mapper.AllocCanteenSuggestionMapper; @@ -51,6 +54,10 @@ public class AllocCanteenSuggestionServiceImpl implements IAllocCanteenSuggestio @Override public int insertAllocCanteenSuggestion(AllocCanteenSuggestion allocCanteenSuggestion) { allocCanteenSuggestion.setCreateTime(DateUtils.getNowDate()); + allocCanteenSuggestion.setCreateBy(SecurityUtils.getUsername()); + allocCanteenSuggestion.setUserId(SecurityUtils.getUserId()); + allocCanteenSuggestion.setSourceType(7L); + allocCanteenSuggestion.setReplyState(YesOrNoEnum.NO.key().longValue()); try { return allocCanteenSuggestionMapper.insertAllocCanteenSuggestion(allocCanteenSuggestion); } catch (Exception e) { @@ -67,6 +74,7 @@ public class AllocCanteenSuggestionServiceImpl implements IAllocCanteenSuggestio @Override public int updateAllocCanteenSuggestion(AllocCanteenSuggestion allocCanteenSuggestion) { allocCanteenSuggestion.setUpdateTime(DateUtils.getNowDate()); + allocCanteenSuggestion.setUpdateBy(SecurityUtils.getUsername()); try { return allocCanteenSuggestionMapper.updateAllocCanteenSuggestion(allocCanteenSuggestion); } catch (Exception e) { 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 index 5f8e2b1..bd9601c 100644 --- 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 @@ -4,7 +4,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - @@ -22,7 +21,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - 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 - where id = #{id} + where complaint_id = #{complaintId} - + insert into alloc_canteen_suggestion - complaint_id, user_id, content, canteen_id, @@ -65,7 +65,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" update_time, - #{complaintId}, #{userId}, #{content}, #{canteenId}, @@ -85,7 +84,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" update alloc_canteen_suggestion - complaint_id = #{complaintId}, user_id = #{userId}, content = #{content}, canteen_id = #{canteenId}, @@ -100,17 +98,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" update_by = #{updateBy}, update_time = #{updateTime}, - where id = #{id} + where complaint_id = #{complaintId} - delete from alloc_canteen_suggestion where id = #{id} + delete from alloc_canteen_suggestion where complaint_id = #{complaintId} - delete from alloc_canteen_suggestion where id in - - #{id} + delete from alloc_canteen_suggestion where complaint_id in + + #{complaintId} \ No newline at end of file