This commit is contained in:
zhangchenbiao
2024-05-08 11:50:17 +08:00
parent 2d6d9d03a5
commit b31c93fb96
4 changed files with 58 additions and 0 deletions

View File

@@ -89,4 +89,32 @@ public class LinePointBaseInfoVO {
return resultList;
}
public static LinePointBaseInfoVO convert(LineInfoDO lineInfo, String username, Map<Long, String> userPortraitMap, HyOpenAreaInfoDO cityArea, Map<Long, Integer> recommendShopNumMap, Map<Long, Integer> selectedShopNumMap){
LinePointBaseInfoVO linePointBaseInfo = new LinePointBaseInfoVO(lineInfo.getId(), lineInfo.getUsername(), lineInfo.getMobile());
linePointBaseInfo.setWantShopNum(lineInfo.getWantShopNum());
linePointBaseInfo.setInvestmentManagerUsername(username);
if(Objects.nonNull(cityArea)){
linePointBaseInfo.setAreaName(cityArea.getAreaName());
linePointBaseInfo.setAreaPath(cityArea.getAreaPath().replace("/", "").trim());
}
linePointBaseInfo.setRecommendShopNum(recommendShopNumMap.get(lineInfo.getId()));
linePointBaseInfo.setSelectedShopNum(selectedShopNumMap.get(lineInfo.getId()));
if(StringUtils.isNotBlank(lineInfo.getUserPortrait())){
List<String> userPortraitList = new ArrayList<>();
String[] parts = lineInfo.getUserPortrait().split(",");
for (String part : parts) {
String trimmedPart = part.trim();
if (StringUtils.isNotBlank(trimmedPart)) {
String s = userPortraitMap.get(Long.valueOf(part));
if(StringUtils.isNotBlank(s)){
userPortraitList.add(s);
}
}
}
linePointBaseInfo.setUserPortraitList(userPortraitList);
}
return linePointBaseInfo;
}
}