| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.mindskip.xzs.context.WebContext; |
| | | import com.mindskip.xzs.domain.Feedback; |
| | | import com.mindskip.xzs.domain.Notify; |
| | | import com.mindskip.xzs.domain.enums.NotifyRefType; |
| | | import com.mindskip.xzs.domain.question.QuestionObject; |
| | | import com.mindskip.xzs.domain.vo.FeedbackVO; |
| | | import com.mindskip.xzs.repository.FeedbackMapper; |
| | | import com.mindskip.xzs.repository.UserMapper; |
| | | import com.mindskip.xzs.service.FeedbackService; |
| | | import com.mindskip.xzs.service.NotifyService; |
| | | import com.mindskip.xzs.utility.JsonUtil; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.apache.commons.lang3.time.DateUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.Date; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | public class FeedbackServiceImpl extends ServiceImpl<FeedbackMapper, Feedback> implements FeedbackService { |
| | | |
| | | private final FeedbackMapper feedbackMapper; |
| | | private final WebContext webContext; |
| | | private final NotifyService notifyService; |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void saveFeedback(FeedbackVO feedbackVO) { |
| | | Feedback feedback = new Feedback(); |
| | | BeanUtils.copyProperties(feedbackVO, feedback); |
| | | feedbackMapper.insert(feedback); |
| | | // 添加通知 |
| | | Notify notify = new Notify(); |
| | | notify.setCreateTime(new Date()); |
| | | notify.setReadStatus(2); |
| | | notify.setRefId(feedback.getId()); |
| | | notify.setRefType(NotifyRefType.FEEDBACK.getValue()); |
| | | notify.setCreateUserId(webContext.getCurrentUser().getId()); |
| | | notifyService.add(notify); |
| | | } |
| | | |
| | | @Override |