From facab577702e7c34182ce8fb13faf03f74363d93 Mon Sep 17 00:00:00 2001 From: xiaoyong931011 <15274802129@163.com> Date: Thu, 25 Mar 2021 12:17:37 +0800 Subject: [PATCH] Merge branch 'activity' of http://120.27.238.55:7000/r/exchange into activity --- src/main/java/com/xcong/excoin/utils/LogRecordUtils.java | 34 +++++++++++++++++++++++++++++++++- 1 files changed, 33 insertions(+), 1 deletions(-) diff --git a/src/main/java/com/xcong/excoin/utils/LogRecordUtils.java b/src/main/java/com/xcong/excoin/utils/LogRecordUtils.java index 6bf4189..d3697ab 100644 --- a/src/main/java/com/xcong/excoin/utils/LogRecordUtils.java +++ b/src/main/java/com/xcong/excoin/utils/LogRecordUtils.java @@ -1,9 +1,17 @@ package com.xcong.excoin.utils; +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.xcong.excoin.modules.coin.dao.MemberAccountFlowEntityDao; import com.xcong.excoin.modules.coin.dao.MemberAccountMoneyChangeDao; import com.xcong.excoin.modules.coin.entity.MemberAccountFlowEntity; import com.xcong.excoin.modules.coin.entity.MemberAccountMoneyChange; +import com.xcong.excoin.modules.documentary.dao.FollowFollowerNoticeDao; +import com.xcong.excoin.modules.documentary.entity.FollowFollowerNoticeEntity; +import com.xcong.excoin.modules.member.dao.MemberSettingDao; +import com.xcong.excoin.modules.member.entity.MemberSettingEntity; + +import cn.hutool.core.util.ObjectUtil; import java.math.BigDecimal; @@ -15,7 +23,7 @@ **/ public class LogRecordUtils { - public static void insertMemberAccountMoneyChange(Long memberId,String content, BigDecimal amount, String symbol, Integer status, Integer type) { + public static void insertMemberAccountMoneyChange(Long memberId, String content, BigDecimal amount, String symbol, Integer status, Integer type) { MemberAccountMoneyChange accountRecord = new MemberAccountMoneyChange(); accountRecord.setContent(content); accountRecord.setMemberId(memberId); @@ -36,4 +44,28 @@ memberAccountFlowEntity.setRemark(remark); SpringContextHolder.getBean(MemberAccountFlowEntityDao.class).insert(memberAccountFlowEntity); } + + /** + * 插入跟随者消息,更新消息状态 + * + * @param memberId 跟随者用户ID + * @param title 消息标题 + * @param content 消息内容 + */ + public static void insertFollowerNotice(Long memberId, String title, String content) { + FollowFollowerNoticeEntity noticeEntity = new FollowFollowerNoticeEntity(); + noticeEntity.setMemberId(memberId); + noticeEntity.setTitle(title); + noticeEntity.setContent(content); + SpringContextHolder.getBean(FollowFollowerNoticeDao.class).insert(noticeEntity); + + QueryWrapper<MemberSettingEntity> queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("member_id", memberId); + MemberSettingEntity selectOne = SpringContextHolder.getBean(MemberSettingDao.class).selectOne(queryWrapper); + if(ObjectUtil.isNotEmpty(selectOne)) { + selectOne.setMessageReminder(1); + SpringContextHolder.getBean(MemberSettingDao.class).updateById(selectOne); + } + } + } -- Gitblit v1.9.1