From 829f629756e5402bcd3e9f6ef1f9c6dbffbabb11 Mon Sep 17 00:00:00 2001
From: KKSU <15274802129@163.com>
Date: Wed, 17 Apr 2024 14:46:29 +0800
Subject: [PATCH] 55测试环境
---
src/main/java/com/xcong/excoin/utils/LogRecordUtils.java | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 54 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 274b052..16d42e0 100644
--- a/src/main/java/com/xcong/excoin/utils/LogRecordUtils.java
+++ b/src/main/java/com/xcong/excoin/utils/LogRecordUtils.java
@@ -1,7 +1,18 @@
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 lombok.extern.slf4j.Slf4j;
import java.math.BigDecimal;
@@ -11,9 +22,14 @@
* @author wzy
* @date 2020-07-02
**/
+@Slf4j
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) {
+ insertMemberAccountMoneyChangeWithId(memberId, content, amount, symbol, status, type, null);
+ }
+
+ public static void insertMemberAccountMoneyChangeWithId(Long memberId, String content, BigDecimal amount, String symbol, Integer status, Integer type, Long withId) {
MemberAccountMoneyChange accountRecord = new MemberAccountMoneyChange();
accountRecord.setContent(content);
accountRecord.setMemberId(memberId);
@@ -21,6 +37,43 @@
accountRecord.setStatus(status);
accountRecord.setSymbol(symbol);
accountRecord.setType(type);
+ accountRecord.setWithdrawId(withId);
SpringContextHolder.getBean(MemberAccountMoneyChangeDao.class).insert(accountRecord);
}
+
+ public static void insertMemberAccountFlow(Long memberId, BigDecimal price, BigDecimal balance, String symbol, String source, String remark) {
+ MemberAccountFlowEntity memberAccountFlowEntity = new MemberAccountFlowEntity();
+ memberAccountFlowEntity.setMemberId(memberId);
+ memberAccountFlowEntity.setPrice(price);
+ memberAccountFlowEntity.setBalance(balance);
+ memberAccountFlowEntity.setSymbol(symbol);
+ memberAccountFlowEntity.setSource(source);
+ 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)) {
+ log.info("内容:{},会员ID:{}", content,memberId);
+ selectOne.setMessageReminder(1);
+ SpringContextHolder.getBean(MemberSettingDao.class).updateById(selectOne);
+ }
+ }
+
}
--
Gitblit v1.9.1