yujian
2020-04-13 a5bc9c4e52f98032b287a42fd243c2ffcb7d58f6
fanli/src/main/java/com/yeshi/fanli/service/impl/msg/MsgOtherDetailServiceImpl.java
@@ -21,23 +21,14 @@
   @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());
         msgOtherDetailMapper.insertSelective(detail);
         userMsgReadStateService.addOtherMsgUnReadCount(detail.getUser().getId(), 1);
      }
      msgOtherDetailMapper.insertSelective(detail);
      userMsgReadStateService.addOtherMsgUnReadCount(detail.getUser().getId(), 1);
   }
   @Override
@@ -50,6 +41,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);
      }