From f15251f01d6c55fb3e3b706af79744d00481b39d Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期三, 21 八月 2019 10:14:30 +0800
Subject: [PATCH] 拼多多订单修改
---
fanli/src/main/java/com/yeshi/fanli/service/impl/msg/MsgOtherDetailServiceImpl.java | 19 +++++++++++++++++--
1 files changed, 17 insertions(+), 2 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 284ea93..2c5b725 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
@@ -13,6 +13,7 @@
import com.yeshi.fanli.entity.bus.msg.MsgOtherDetail.MsgTypeOtherTypeEnum;
import com.yeshi.fanli.exception.msg.MsgOtherDetailException;
import com.yeshi.fanli.service.inter.msg.MsgOtherDetailService;
+import com.yeshi.fanli.service.inter.msg.UserMsgReadStateService;
import com.yeshi.fanli.util.Constant;
@Service
@@ -21,17 +22,30 @@
@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);
+ } else if (detail.getType() == MsgTypeOtherTypeEnum.give) {
+ msgOtherDetailMapper.insertSelective(detail);
+ userMsgReadStateService.addOtherMsgUnReadCount(detail.getUser().getId(), 1);
+ } else if (detail.getType() == MsgTypeOtherTypeEnum.exchange) {
+ msgOtherDetailMapper.insertSelective(detail);
+ userMsgReadStateService.addOtherMsgUnReadCount(detail.getUser().getId(), 1);
}
}
@@ -45,6 +59,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