src/main/java/com/xcong/excoin/modules/otc/dto/MsgListDto.java
@@ -14,4 +14,7 @@ @ApiModelProperty(value = "页码", example = "1") private Integer pageNum; @ApiModelProperty(value = "昵称", example = "1") private String nickname; } src/main/java/com/xcong/excoin/modules/otc/entity/OtcMsgUserListEntity.java
@@ -1,5 +1,6 @@ package com.xcong.excoin.modules.otc.entity; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; import com.xcong.excoin.common.system.base.BaseEntity; import lombok.Data; @@ -27,4 +28,7 @@ //最后聊天时间 private Date lastMsgTime; @TableField(exist = false) private String nickname; } src/main/java/com/xcong/excoin/modules/otc/service/impl/OtcMarketBussinessServiceImpl.java
@@ -160,6 +160,7 @@ } BigDecimal totalAmount = otcOrderDao.selectOrderTotalAmount(member.getId()); totalAmount = totalAmount == null ? BigDecimal.ZERO : totalAmount; if (setting.getTotalAmount().compareTo(totalAmount) > 0) { applyConditionsVo.setTotalAmountStatus(2); }else{ src/main/java/com/xcong/excoin/modules/otc/service/impl/OtcMsgServiceImpl.java
@@ -53,6 +53,7 @@ OtcMsgUserListEntity otcMsgUserListEntity = new OtcMsgUserListEntity(); otcMsgUserListEntity.setMemberId(memberId); otcMsgUserListEntity.setNickname(msgListDto.getNickname()); IPage<MsgListVo> msgList = otcMsgUserListDao.getMsgList(otcMsgUserListEntity, page); List<MsgListVo> records = msgList.getRecords(); //更新最外层的消息提醒 @@ -60,8 +61,8 @@ if(CollUtil.isNotEmpty(records)){ for(MsgListVo msgListVo : records){ long targetId = msgListVo.getTargetId(); MemberEntity memberEntity = memberDao.selectById(targetId); msgListVo.setNickname(memberEntity.getName()); // MemberEntity memberEntity = memberDao.selectById(targetId); // msgListVo.setNickname(memberEntity.getName()); ChatOrderVo chatOrderVo = new ChatOrderVo(); List<ChatOrderVo> chatOrderVos = otcOrderDao.selectOneByMemberIdAndTargetId(memberId,targetId); src/main/resources/mapper/otc/OtcMsgUserListDao.xml
@@ -8,11 +8,19 @@ a.is_read isRead, a.target_id targetId, a.member_id memberId, a.last_msg_time lastMsgTime a.last_msg_time lastMsgTime, b.name nickname from otc_msg_user_list a left join member b on a.target_id = b.id <where> <if test="record!=null"> a.member_id = #{record.memberId} <if test="record.nickname != null and record.nickname == ''"> and b.name like concat('%', #{record.nickname},'%') </if> </if> <if test="record!=null"> a.member_id = #{record.memberId} </if> </where> order by a.create_time desc