yujian
2020-01-18 f4a0f2acc63d7785eab108419a4e16f5f688cb95
fanli/src/main/java/com/yeshi/fanli/service/impl/msg/MsgOtherDetailServiceImpl.java
@@ -21,20 +21,47 @@
   @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);
      } else if (detail.getType() == MsgTypeOtherTypeEnum.passVIPApply
            || detail.getType() == MsgTypeOtherTypeEnum.rejectVIPApply
            || detail.getType() == MsgTypeOtherTypeEnum.teamVIPCallBoss
            || detail.getType() == MsgTypeOtherTypeEnum.teamSplitCallBoss) {
         msgOtherDetailMapper.insertSelective(detail);
         userMsgReadStateService.addOtherMsgUnReadCount(detail.getUser().getId(), 1);
      }
@@ -50,6 +77,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);
      }