| | |
| | | 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
|
| | |
| | | @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);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | 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);
|
| | | }
|