| | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.xiaopeng.api.dto.account.UserResourcesDto; |
| | | import com.xiaopeng.api.dto.account.UcUserInfo; |
| | | import com.xiaopeng.api.feignClient.account.UserResourcesClient; |
| | | import com.xiaopeng.api.model.operation.XpFeedbackType; |
| | | import com.xiaopeng.api.model.operation.XpUserFeedback; |
| | | import com.xiaopeng.api.vo.account.GetUserListByUidsVo; |
| | | import com.xiaopeng.common.core.web.page.PageInfo; |
| | | import com.xiaopeng.operation.mapper.XpUserFeedbackMapper; |
| | | import com.xiaopeng.operation.query.UserFeedBackQuery; |
| | |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Collections; |
| | |
| | | //获取小鹏用户信息 |
| | | List<Long> xpUid = xpUserFeedbackVOS.stream().map(XpUserFeedback::getFeedbackUserId).distinct().collect(Collectors.toList()); |
| | | if (CollUtil.isNotEmpty(xpUid)) { |
| | | GetUserListByUidsVo getUserListByUidsVo = new GetUserListByUidsVo(); |
| | | getUserListByUidsVo.setUids(xpUid); |
| | | getUserListByUidsVo.setGetPreCarOwner(Boolean.TRUE); |
| | | UserResourcesDto resultData = userResourcesClient.getUserListByUids(getUserListByUidsVo); |
| | | if (resultData.getCode().equals(HttpStatus.OK.value())) { |
| | | JSONObject jsonObject = JSONObject.parseObject(resultData.getData().toString()); |
| | | Map<String, UcUserInfo> userInfoMap = userResourcesClient.getUserListByUids(xpUid, false); |
| | | if (userInfoMap != null && !userInfoMap.isEmpty()) { |
| | | for (XpUserFeedbackVO xpUserFeedbackVO : xpUserFeedbackVOS) { |
| | | JSONObject userInfo = jsonObject.getJSONObject(xpUserFeedbackVO.getFeedbackUserId().toString()); |
| | | UcUserInfo userInfo = userInfoMap.get(xpUserFeedbackVO.getFeedbackUserId().toString()); |
| | | if (Objects.nonNull(userInfo)) { |
| | | xpUserFeedbackVO.setNickname(userInfo.getString("nickName")); |
| | | xpUserFeedbackVO.setAvatar(userInfo.getString("headImg")); |
| | | xpUserFeedbackVO.setPhone(userInfo.getString("mobile")); |
| | | xpUserFeedbackVO.setNickname(userInfo.getNickName()); |
| | | xpUserFeedbackVO.setAvatar(userInfo.getHeadImg()); |
| | | xpUserFeedbackVO.setPhone(userInfo.getMobile()); |
| | | } |
| | | } |
| | | } |