|  |  |  | 
|---|
|  |  |  | import com.xcong.excoin.modules.member.entity.MemberSettingEntity; | 
|---|
|  |  |  | import com.xcong.excoin.modules.otc.dao.OtcMsgHistoryDao; | 
|---|
|  |  |  | import com.xcong.excoin.modules.otc.dao.OtcMsgUserListDao; | 
|---|
|  |  |  | import com.xcong.excoin.modules.otc.dto.ChatBoxDto; | 
|---|
|  |  |  | import com.xcong.excoin.modules.otc.dto.ConnectDto; | 
|---|
|  |  |  | import com.xcong.excoin.modules.otc.dto.MsgListDto; | 
|---|
|  |  |  | import com.xcong.excoin.modules.otc.dto.SendMsgDto; | 
|---|
|  |  |  | import com.xcong.excoin.modules.otc.dao.OtcOrderDao; | 
|---|
|  |  |  | import com.xcong.excoin.modules.otc.dto.*; | 
|---|
|  |  |  | import com.xcong.excoin.modules.otc.entity.OtcMsgHistoryEntity; | 
|---|
|  |  |  | import com.xcong.excoin.modules.otc.entity.OtcMsgUserListEntity; | 
|---|
|  |  |  | import com.xcong.excoin.modules.otc.service.OtcMsgService; | 
|---|
|  |  |  | import com.xcong.excoin.modules.otc.vo.ChatBoxVo; | 
|---|
|  |  |  | import com.xcong.excoin.modules.otc.vo.ChatOrderVo; | 
|---|
|  |  |  | import com.xcong.excoin.modules.otc.vo.MsgListVo; | 
|---|
|  |  |  | import lombok.RequiredArgsConstructor; | 
|---|
|  |  |  | import org.springframework.stereotype.Service; | 
|---|
|  |  |  | import org.springframework.transaction.annotation.Transactional; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import javax.annotation.Resource; | 
|---|
|  |  |  | import java.util.ArrayList; | 
|---|
|  |  |  | import java.util.List; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Service | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | private final OtcMsgUserListDao otcMsgUserListDao; | 
|---|
|  |  |  | private final OtcMsgHistoryDao otcMsgHistoryDao; | 
|---|
|  |  |  | private final OtcOrderDao otcOrderDao; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | private final MemberSettingDao memberSettingDao; | 
|---|
|  |  |  | private final MemberDao memberDao; | 
|---|
|  |  |  | 
|---|
|  |  |  | return Result.ok(chatBoxVos); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public Result getChatOrder(ChatOrderDto chatOrderDto) { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | MemberEntity member = LoginUserUtils.getAppLoginUser(); | 
|---|
|  |  |  | Long memberId = member.getId(); | 
|---|
|  |  |  | //        Long memberId = 443L; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | long targetId = chatOrderDto.getTargetId(); | 
|---|
|  |  |  | if(ObjectUtil.isEmpty(targetId)){ | 
|---|
|  |  |  | return Result.fail("请返回重试"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | ArrayList<ChatOrderVo> chatOrderVoList = new ArrayList<>(); | 
|---|
|  |  |  | List<ChatOrderVo> chatOrderVos = otcOrderDao.selectByMemberIdAndTargetId(memberId,targetId); | 
|---|
|  |  |  | if(CollUtil.isNotEmpty(chatOrderVos)){ | 
|---|
|  |  |  | for(ChatOrderVo chatOrderVo : chatOrderVos){ | 
|---|
|  |  |  | if(memberId == chatOrderVo.getMemberId()){ | 
|---|
|  |  |  | chatOrderVoList.add(chatOrderVo); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return Result.ok(chatOrderVoList); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|