From 573c491b4a1ba60e12a5678a01c1546c0077c1ee Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期二, 30 七月 2019 09:07:42 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 fanli/src/main/java/com/yeshi/fanli/service/impl/msg/MsgOtherDetailServiceImpl.java |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/msg/MsgOtherDetailServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/msg/MsgOtherDetailServiceImpl.java
index 610b34c..2ad8708 100644
--- a/fanli/src/main/java/com/yeshi/fanli/service/impl/msg/MsgOtherDetailServiceImpl.java
+++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/msg/MsgOtherDetailServiceImpl.java
@@ -21,20 +21,23 @@
 
 	@Resource
 	private MsgOtherDetailMapper msgOtherDetailMapper;
-	
+
 	@Resource
 	private UserMsgReadStateService userMsgReadStateService;
 
 	@Override
 	public void addMsgOtherDetail(MsgOtherDetail detail) throws MsgOtherDetailException {
-
 		if (detail.getType() == MsgTypeOtherTypeEnum.couponMianDan
 				|| detail.getType() == MsgTypeOtherTypeEnum.couponReward
 				|| detail.getType() == MsgTypeOtherTypeEnum.couponWelfareMianDan) {
 			if (detail.getCoupnContent() == null)
 				throw new MsgOtherDetailException(1, "鍐呭涓虹┖");
 			detail.setContent(new Gson().toJson(detail.getCoupnContent()));
-			detail.setCreateTime(new Date());
+			if (detail.getCreateTime() == null)
+				detail.setCreateTime(new Date());
+			msgOtherDetailMapper.insertSelective(detail);
+			userMsgReadStateService.addOtherMsgUnReadCount(detail.getUser().getId(), 1);
+		} else if (detail.getType() == MsgTypeOtherTypeEnum.taoLiJin) {
 			msgOtherDetailMapper.insertSelective(detail);
 			userMsgReadStateService.addOtherMsgUnReadCount(detail.getUser().getId(), 1);
 		}
@@ -50,6 +53,7 @@
 			if (detail.getCoupnContent() == null)
 				throw new MsgOtherDetailException(1, "鍐呭涓虹┖");
 			detail.setContent(new Gson().toJson(detail.getCoupnContent()));
+			if(detail.getUpdateTime()==null)
 			detail.setUpdateTime(new Date());
 			msgOtherDetailMapper.updateByPrimaryKeySelective(detail);
 		}

--
Gitblit v1.8.0