From e9a3f108de4f79fe6f246cd30f4427fc6aad5450 Mon Sep 17 00:00:00 2001 From: yujian <yujian@123.com> Date: 星期四, 05 九月 2019 18:00:06 +0800 Subject: [PATCH] Merge branch 'div' of ssh://193.112.35.168:29418/fanli-server into div --- fanli/src/main/java/com/yeshi/fanli/service/impl/msg/UserSystemMsgServiceImpl.java | 11 ++++++++--- 1 files changed, 8 insertions(+), 3 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/msg/UserSystemMsgServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/msg/UserSystemMsgServiceImpl.java index b8667b1..3eb3e3c 100644 --- a/fanli/src/main/java/com/yeshi/fanli/service/impl/msg/UserSystemMsgServiceImpl.java +++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/msg/UserSystemMsgServiceImpl.java @@ -6,6 +6,7 @@ import javax.annotation.Resource; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import com.yeshi.fanli.dao.mybatis.UserInfoMapper; import com.yeshi.fanli.dao.mybatis.msg.UserSystemMsgMapper; @@ -34,6 +35,7 @@ @Resource private SystemZnxService systemZnxService; + @Transactional @Override public void addUserSystemMsg(Long uid, UserSystemMsgTypeEnum type, String title, String content, int timeTag, SystemZnx sz) throws UserSystemMsgException { @@ -41,7 +43,7 @@ throw new UserSystemMsgException(1, "淇℃伅涓嶅畬鏁�"); UserSystemMsg msg = new UserSystemMsg(); if (sz != null) { - if (userSystemMsgMapper.selectBySystemZNXId(sz.getId()) == null) { + if (userSystemMsgMapper.selectBySystemZNXId(sz.getId(), uid) == null) { msg.setCreateTime(new Date(sz.getCreateTime())); msg.setRead(false); msg.setSolved(false); @@ -49,6 +51,8 @@ msg.setUser(new UserInfo(uid)); msg.setType(type); msg.setTimeTag(timeTag); + msg.setTitle(sz.getTitle()); + msg.setContent(sz.getContent()); } else throw new UserSystemMsgException(1, "娑堟伅宸插瓨鍦�"); } else { @@ -121,10 +125,11 @@ List<SystemZnx> list = systemZnxService.listbyCreateTime(createTime); if (list != null && list.size() > 0) { for (SystemZnx znx : list) { - UserSystemMsg msg = userSystemMsgMapper.selectBySystemZNXId(znx.getId()); + UserSystemMsg msg = userSystemMsgMapper.selectBySystemZNXId(znx.getId(), uid); if (msg == null) try { - addUserSystemMsg(uid, UserSystemMsgTypeEnum.common, null, null, UserSystemMsg.TIME_TAG_COMMON, znx); + addUserSystemMsg(uid, UserSystemMsgTypeEnum.common, null, null, UserSystemMsg.TIME_TAG_COMMON, + znx); } catch (UserSystemMsgException e) { e.printStackTrace(); } -- Gitblit v1.8.0