| | |
| | | |
| | | import com.yeshi.fanli.service.inter.msg.MsgOverViewsService; |
| | | import com.yeshi.fanli.util.RedisManager; |
| | | import com.yeshi.fanli.util.factory.msg.MsgOverViewsFactory; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.yeshi.fanli.dao.mybatis.msg.MsgOrderDetailMapper; |
| | |
| | | import com.yeshi.fanli.util.Constant; |
| | | import com.yeshi.fanli.util.StringUtil; |
| | | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import redis.clients.jedis.Jedis; |
| | | import redis.clients.jedis.JedisPool; |
| | | |
| | |
| | | private MsgOverViewsService msgOverViewsService; |
| | | |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | | public void addMsgOrderDetail(MsgOrderDetail detail, boolean needNotify) throws MsgOrderDetailException { |
| | | if (detail == null) |
| | |
| | | detail.setUpdateTime(new Date()); |
| | | detail.setRead(false); |
| | | msgOrderDetailMapper.insertSelective(detail); |
| | | / |
| | | //加入消息索引 |
| | | msgOverViewsService.save(MsgOverViewsFactory.create(detail)); |
| | | // 消息内容 |
| | | msgExtraService.addMsgExtra(detail.getId(), detail.getExtraInfo(), MsgExtra.MSG_TYPE_ORDER); |
| | | } else { |
| | |
| | | update.setHongBaoMoney(detail.getHongBaoMoney()); |
| | | update.setRead(false); |
| | | update.setBeiZhu(detail.getBeiZhu()); |
| | | |
| | | msgOrderDetailMapper.updateByPrimaryKeySelective(update); |
| | | / |
| | | //更新消息索引时间 |
| | | update.setUser(old.getUser()); |
| | | msgOverViewsService.updateTime(MsgOverViewsFactory.create(update).getId(), update.getUpdateTime()); |
| | | msgExtraService.addMsgExtra(update.getId(), detail.getExtraInfo(), MsgExtra.MSG_TYPE_ORDER); |
| | | } |
| | | if (needNotify) |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<MsgOrderDetail> listDetail(List<Long> ids) { |
| | | return msgOrderDetailMapper.listByPrimaryKeys(ids); |
| | | } |
| | | |
| | | @Override |
| | | public long countMsgOrderDetail(Long uid) { |
| | | return msgOrderDetailMapper.countByUid(uid); |
| | | } |