From 51a4ff5d777028d52a19c314a99f796334cb7b51 Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期六, 23 十一月 2019 18:30:01 +0800 Subject: [PATCH] 配置文件修改 --- fanli/src/main/java/com/yeshi/fanli/service/impl/msg/MsgOtherDetailServiceImpl.java | 28 +++++++++++++++++++++++++--- 1 files changed, 25 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..0d9b693 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,41 @@ @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); + } else if (detail.getType() == MsgTypeOtherTypeEnum.couponActivate) { + msgOtherDetailMapper.insertSelective(detail); + userMsgReadStateService.addOtherMsgUnReadCount(detail.getUser().getId(), 1); + } else if (detail.getType() == MsgTypeOtherTypeEnum.firstOrderReward) { + msgOtherDetailMapper.insertSelective(detail); + userMsgReadStateService.addOtherMsgUnReadCount(detail.getUser().getId(), 1); + }else if (detail.getType() == MsgTypeOtherTypeEnum.systemGive) { + msgOtherDetailMapper.insertSelective(detail); + userMsgReadStateService.addOtherMsgUnReadCount(detail.getUser().getId(), 1); + } else if (detail.getType() == MsgTypeOtherTypeEnum.taoLiJinExchange) { msgOtherDetailMapper.insertSelective(detail); userMsgReadStateService.addOtherMsgUnReadCount(detail.getUser().getId(), 1); } @@ -50,6 +71,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