From d28bed1a1275131a5ca37f7da37961e2b518ac07 Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期一, 26 八月 2019 13:44:00 +0800 Subject: [PATCH] 淘礼金创建异常处理 --- fanli/src/main/java/com/yeshi/fanli/service/impl/msg/UserMsgReadStateServiceImpl.java | 35 ++++++++++++++++++++++++++++++++++- 1 files changed, 34 insertions(+), 1 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 1c7d774..4e20a38 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 @@ -14,6 +14,7 @@ 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.msg.MsgOtherDetailService; import com.yeshi.fanli.service.inter.msg.UserMsgReadStateService; import com.yeshi.fanli.service.inter.msg.UserSystemMsgService; @@ -34,6 +35,9 @@ @Resource private MsgMoneyDetailService msgMoneyDetailService; + + @Resource + private MsgOtherDetailService msgOtherDetailService; @Resource private UserSystemMsgService userSystemMsgService; @@ -101,6 +105,16 @@ } @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); } @@ -158,7 +172,6 @@ @Override public void readUserSystemMsg(Long uid) { userSystemMsgService.readMsgByUid(uid); - UserMsgUnReadNum num = getUserMsgUnReadNum(uid); UserMsgUnReadNum update = new UserMsgUnReadNum(); update.setId(num.getId()); @@ -179,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