| | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.xcong.excoin.common.contants.AppContants; |
| | | import com.xcong.excoin.configurations.RabbitMqConfig; |
| | | import com.xcong.excoin.modules.member.dao.MemberSettingDao; |
| | | import com.xcong.excoin.modules.otc.dao.OtcMsgHistoryDao; |
| | | import com.xcong.excoin.modules.otc.dao.OtcMsgUserListDao; |
| | | import com.xcong.excoin.modules.otc.entity.OtcMsgHistoryEntity; |
| | |
| | | @Autowired |
| | | private RedisUtils redisUtils; |
| | | |
| | | @Autowired |
| | | private MemberSettingDao memberSettingDao; |
| | | |
| | | @RabbitListener(queues = RabbitMqConfig.QUEUE_MSG_HISTORY) |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void msgHistoryConsumer(String content) { |
| | |
| | | Long toId = chat.getTargetId(); |
| | | Long fromId = chat.getFromMemberId(); |
| | | |
| | | log.info("--->{}, {}", toId, fromId); |
| | | // 发送人是否存在聊天框 |
| | | OtcMsgUserListEntity fromList = otcMsgUserListDao.selectChatListByToAndFrom(toId, fromId); |
| | | if (fromList == null) { |
| | |
| | | fromHistory.setIsSelf(OtcMsgHistoryEntity.ISSELF_ONE); |
| | | fromHistory.setMemberId(fromId); |
| | | |
| | | memberSettingDao.updateMessageReminderByMemberId(toId); |
| | | |
| | | otcMsgHistoryDao.insert(fromHistory); |
| | | otcMsgHistoryDao.insert(toHistory); |
| | | } |