From f4a0f2acc63d7785eab108419a4e16f5f688cb95 Mon Sep 17 00:00:00 2001
From: yujian <yujian@163.com>
Date: 星期六, 18 一月 2020 12:06:27 +0800
Subject: [PATCH] 用户注册信息

---
 fanli/src/main/java/com/yeshi/fanli/service/impl/msg/UserMsgReadStateServiceImpl.java |   48 +++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 43 insertions(+), 5 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/msg/UserMsgReadStateServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/msg/UserMsgReadStateServiceImpl.java
index c7e3add..a723677 100644
--- a/fanli/src/main/java/com/yeshi/fanli/service/impl/msg/UserMsgReadStateServiceImpl.java
+++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/msg/UserMsgReadStateServiceImpl.java
@@ -10,12 +10,13 @@
 import com.yeshi.fanli.dao.mybatis.msg.UserMsgUnReadNumMapper;
 import com.yeshi.fanli.entity.bus.msg.UserMsgUnReadNum;
 import com.yeshi.fanli.entity.bus.user.UserInfo;
-import com.yeshi.fanli.service.inter.msg.MsgAccountDetailService;
-import com.yeshi.fanli.service.inter.msg.MsgInviteDetailService;
-import com.yeshi.fanli.service.inter.msg.MsgMoneyDetailService;
-import com.yeshi.fanli.service.inter.msg.MsgOrderDetailService;
+import com.yeshi.fanli.service.inter.money.msg.MsgMoneyDetailService;
+import com.yeshi.fanli.service.inter.msg.MsgOtherDetailService;
 import com.yeshi.fanli.service.inter.msg.UserMsgReadStateService;
 import com.yeshi.fanli.service.inter.msg.UserSystemMsgService;
+import com.yeshi.fanli.service.inter.order.msg.MsgOrderDetailService;
+import com.yeshi.fanli.service.inter.user.invite.MsgInviteDetailService;
+import com.yeshi.fanli.service.inter.user.msg.MsgAccountDetailService;
 
 @Service
 public class UserMsgReadStateServiceImpl implements UserMsgReadStateService {
@@ -34,6 +35,9 @@
 
 	@Resource
 	private MsgMoneyDetailService msgMoneyDetailService;
+
+	@Resource
+	private MsgOtherDetailService msgOtherDetailService;
 
 	@Resource
 	private UserSystemMsgService userSystemMsgService;
@@ -101,10 +105,21 @@
 	}
 
 	@Override
+	public void addOtherMsgUnReadCount(Long uid, int count) {
+		UserMsgUnReadNum num = getUserMsgUnReadNum(uid);
+		UserMsgUnReadNum update = new UserMsgUnReadNum();
+		update.setId(num.getId());
+		update.setTypeOther(num.getTypeOther() + count);
+		update.setUpdateTime(new Date());
+		userMsgUnReadNumMapper.updateByPrimaryKeySelective(update);
+	}
+
+	@Override
 	public UserMsgUnReadNum getReadStateByUid(Long uid) {
 		return getUserMsgUnReadNum(uid);
 	}
 
+	@Transactional
 	@Override
 	public void readOrderMsg(Long uid) {
 		msgOrderDetailService.readMsgByUid(uid);
@@ -117,6 +132,7 @@
 
 	}
 
+	@Transactional
 	@Override
 	public void readAccountMsg(Long uid) {
 		msgAccountDetailService.readMsgByUid(uid);
@@ -128,6 +144,7 @@
 		userMsgUnReadNumMapper.updateByPrimaryKeySelective(update);
 	}
 
+	@Transactional
 	@Override
 	public void readMoneyMsg(Long uid) {
 		msgMoneyDetailService.readMsgByUid(uid);
@@ -139,6 +156,7 @@
 		userMsgUnReadNumMapper.updateByPrimaryKeySelective(update);
 	}
 
+	@Transactional
 	@Override
 	public void readInviteMsg(Long uid) {
 		msgInviteDetailService.readMsgByUid(uid);
@@ -150,10 +168,10 @@
 		userMsgUnReadNumMapper.updateByPrimaryKeySelective(update);
 	}
 
+	@Transactional
 	@Override
 	public void readUserSystemMsg(Long uid) {
 		userSystemMsgService.readMsgByUid(uid);
-
 		UserMsgUnReadNum num = getUserMsgUnReadNum(uid);
 		UserMsgUnReadNum update = new UserMsgUnReadNum();
 		update.setId(num.getId());
@@ -174,13 +192,33 @@
 		update.setTypeOrder(0);
 		update.setTypeScore(0);
 		update.setTypeSystem(0);
+		update.setTypeOrder(0);
 		update.setUpdateTime(new Date());
+		update.setGuanXuanReadTime(new Date());
 		userMsgUnReadNumMapper.updateByPrimaryKeySelective(update);
 		readAccountMsg(uid);
 		readOrderMsg(uid);
 		readMoneyMsg(uid);
 		readInviteMsg(uid);
 		readUserSystemMsg(uid);
+		readOtherMsg(uid);
+	}
+
+	@Override
+	public void readOtherMsg(Long uid) {
+		msgOtherDetailService.readMsgByUid(uid);
+		UserMsgUnReadNum num = getUserMsgUnReadNum(uid);
+		UserMsgUnReadNum update = new UserMsgUnReadNum();
+		update.setId(num.getId());
+		update.setTypeOther(0);
+		update.setUpdateTime(new Date());
+		userMsgUnReadNumMapper.updateByPrimaryKeySelective(update);
+	}
+
+	@Override
+	public void updateSelective(UserMsgUnReadNum num) {
+		if (num != null)
+			userMsgUnReadNumMapper.updateByPrimaryKeySelective(num);
 	}
 
 }

--
Gitblit v1.8.0