From 3027abd140787e6c40f61a6fdd5064ae0ec720a9 Mon Sep 17 00:00:00 2001
From: haotian <2421912570@qq.com>
Date: Tue, 15 Apr 2025 14:38:14 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9--=E5=8F=96=E6=B6=88=E5=85=B3?=
=?UTF-8?q?=E6=B3=A8=E6=97=B6=E5=88=A0=E9=99=A4sys=5Fuser=5Fnotification?=
=?UTF-8?q?=E4=B8=AD=E7=9A=84=E6=95=B0=E6=8D=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../ruoyi/web/controller/app/AppSystemController.java | 5 +++++
.../web/controller/backstage/SysMarketController.java | 8 ++++----
.../ruoyi/system/mapper/SysUserNotificationMapper.java | 7 +++++++
.../system/service/ISysUserNotificationService.java | 7 +++++++
.../service/impl/SysUserNotificationServiceImpl.java | 9 +++++++++
.../mapper/system/SysUserNotificationMapper.xml | 3 +++
6 files changed, 35 insertions(+), 4 deletions(-)
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/app/AppSystemController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/app/AppSystemController.java
index c3c1b7a5..2c8d9cf3 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/app/AppSystemController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/app/AppSystemController.java
@@ -126,6 +126,8 @@ public class AppSystemController extends BaseController {
private IDailySourceService dailySourceService;
+
+
/**
* 账号密码登录
*
@@ -1728,6 +1730,9 @@ public class AppSystemController extends BaseController {
userInfo1.setFollowers(userInfo1.getFollowers()-1);
userInfoService.updateUserInfo(userInfo1);
+ // 删除消息通知
+ userNotificationService.deleteSysUserNotificationBySenderIdAndUserId(userId, followedUserId);
+
return success("取消关注成功");
}
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/backstage/SysMarketController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/backstage/SysMarketController.java
index 6b51ae89..fb08bec0 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/backstage/SysMarketController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/backstage/SysMarketController.java
@@ -54,18 +54,18 @@ public class SysMarketController extends BaseController {
Long income2 = sysIncomeDtoList.get(0).gettIncome();
Long income1 = sysIncomeDtoList.get(1).gettIncome();
- Long incomeChange = income1 - income2;
+ Long incomeChange = income2 - income1;
- success.put("income", income1);
+ success.put("income", income2);
success.put("incomeChange", incomeChange);
Long refund2 = sysIncomeDtoList.get(0).gettRefund();
Long refund1 = sysIncomeDtoList.get(1).gettRefund();
- Long refundChange = refund1 - refund2;
+ Long refundChange = refund2 - refund1;
- success.put("refund", refund1);
+ success.put("refund", refund2);
success.put("refundChange", refundChange);
//---------------------------------------------真实接口end----------------------------------------------------------------
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserNotificationMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserNotificationMapper.java
index 99038fee..998c040d 100644
--- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserNotificationMapper.java
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserNotificationMapper.java
@@ -95,4 +95,11 @@ public interface SysUserNotificationMapper
* 注销账户是 删除通知数据
* */
public int deleteSysUserNotificationBySenderId(Long userId);
+
+
+ /**
+ * 取消关注时删除关注通知
+ *
+ */
+ public int deleteSysUserNotificationBySenderIdAndUserId(@Param("userId") Long userId, @Param("followedUserId") Long followedUserId);
}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserNotificationService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserNotificationService.java
index 1a2ccd08..0064eb11 100644
--- a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserNotificationService.java
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserNotificationService.java
@@ -95,4 +95,11 @@ public interface ISysUserNotificationService
* 注销账户是 删除通知数据
* */
public int deleteSysUserNotificationBySenderId(Long userId);
+
+
+ /**
+ * 取消关注时删除关注通知
+ *
+ */
+ public int deleteSysUserNotificationBySenderIdAndUserId(Long userId, Long followedUserId);
}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserNotificationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserNotificationServiceImpl.java
index 71999c9f..a59d7d3f 100644
--- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserNotificationServiceImpl.java
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserNotificationServiceImpl.java
@@ -206,4 +206,13 @@ public class SysUserNotificationServiceImpl implements ISysUserNotificationServi
public int deleteSysUserNotificationBySenderId(Long userId){
return sysUserNotificationMapper.deleteSysUserNotificationBySenderId(userId);
}
+
+ /**
+ * 取消关注时删除关注通知
+ *
+ */
+ @Override
+ public int deleteSysUserNotificationBySenderIdAndUserId(Long userId, Long followedUserId){
+ return sysUserNotificationMapper.deleteSysUserNotificationBySenderIdAndUserId(userId, followedUserId);
+ }
}
diff --git a/ruoyi-system/src/main/resources/mapper/system/SysUserNotificationMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysUserNotificationMapper.xml
index 33e52249..b90d8129 100644
--- a/ruoyi-system/src/main/resources/mapper/system/SysUserNotificationMapper.xml
+++ b/ruoyi-system/src/main/resources/mapper/system/SysUserNotificationMapper.xml
@@ -152,4 +152,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
delete from sys_user_notification where sender_id = #{userId}
+
+ delete from sys_user_notification where sender_id = #{userId} and user_id = #{followedUserId} and type = '1'
+
\ No newline at end of file