feat:新增加盟商名称

This commit is contained in:
苏竹红
2025-01-17 11:29:33 +08:00
parent 9167d90424
commit 2f18f00aa0
3 changed files with 17 additions and 2 deletions

View File

@@ -214,4 +214,12 @@ public class LineInfoDAO {
return lineInfoMapper.getByLineIds(lineIds); return lineInfoMapper.getByLineIds(lineIds);
} }
public Map<Long, String> getUserNameMap(List<Long> lineIds){
if(CollectionUtils.isEmpty(lineIds)){
return Maps.newHashMap();
}
List<LineInfoDO> lineMobile = lineInfoMapper.getByLineIds(lineIds);
return lineMobile.stream().filter(o->StringUtils.isNotBlank(o.getMobile())).collect(Collectors.toMap(LineInfoDO::getId, LineInfoDO::getUsername, (k1, k2)-> k1));
}
} }

View File

@@ -25,6 +25,8 @@ public class ShopPointBaseInfoVO {
@ApiModelProperty("门店ID") @ApiModelProperty("门店ID")
private Long shopId; private Long shopId;
private String partnerName;
@ApiModelProperty("门店名称") @ApiModelProperty("门店名称")
private String shopName; private String shopName;
@@ -55,12 +57,13 @@ public class ShopPointBaseInfoVO {
this.mobile = mobile; this.mobile = mobile;
} }
public static List<ShopPointBaseInfoVO> convertList(List<ShopPointDTO> lineList, Map<String, String> userNameMap, Map<Long, String> userPortraitMap, Map<Long, HyOpenAreaInfoDO> cityMap, Map<Long, Integer> recommendShopNumMap){ public static List<ShopPointBaseInfoVO> convertList(Map<Long, String> partnerNameMap,List<ShopPointDTO> lineList, Map<String, String> userNameMap, Map<Long, String> userPortraitMap, Map<Long, HyOpenAreaInfoDO> cityMap, Map<Long, Integer> recommendShopNumMap){
List<ShopPointBaseInfoVO> resultList = new ArrayList<>(); List<ShopPointBaseInfoVO> resultList = new ArrayList<>();
for (ShopPointDTO shopPointDTO : lineList) { for (ShopPointDTO shopPointDTO : lineList) {
ShopPointBaseInfoVO shopPointBaseInfoVO = new ShopPointBaseInfoVO(shopPointDTO.getShopId(), shopPointDTO.getShopName(), shopPointDTO.getMobile()); ShopPointBaseInfoVO shopPointBaseInfoVO = new ShopPointBaseInfoVO(shopPointDTO.getShopId(), shopPointDTO.getShopName(), shopPointDTO.getMobile());
String username = userNameMap.get(shopPointDTO.getInvestmentManager()); String username = userNameMap.get(shopPointDTO.getInvestmentManager());
shopPointBaseInfoVO.setInvestmentManagerUsername(username); shopPointBaseInfoVO.setInvestmentManagerUsername(username);
shopPointBaseInfoVO.setPartnerName(partnerNameMap.get(shopPointDTO.getLineId()));
HyOpenAreaInfoDO areaInfo = cityMap.get(shopPointDTO.getWantShopAreaId()); HyOpenAreaInfoDO areaInfo = cityMap.get(shopPointDTO.getWantShopAreaId());
if(Objects.nonNull(areaInfo)){ if(Objects.nonNull(areaInfo)){
shopPointBaseInfoVO.setAreaName(areaInfo.getAreaName()); shopPointBaseInfoVO.setAreaName(areaInfo.getAreaName());

View File

@@ -469,7 +469,11 @@ public class PointServiceImpl implements PointService {
Map<Long, HyOpenAreaInfoDO> cityMap = hyOpenAreaInfoDAO.getCityMap(wantShopAreaIds); Map<Long, HyOpenAreaInfoDO> cityMap = hyOpenAreaInfoDAO.getCityMap(wantShopAreaIds);
Map<String, String> userNameMap = enterpriseUserDAO.getUserNameMap(investmentManagerUserIds); Map<String, String> userNameMap = enterpriseUserDAO.getUserNameMap(investmentManagerUserIds);
Map<Long, String> userPortraitMap = labelService.getUserPortraitMap(userPortraitList); Map<Long, String> userPortraitMap = labelService.getUserPortraitMap(userPortraitList);
List<ShopPointBaseInfoVO> resultList = ShopPointBaseInfoVO.convertList(listByDevelopmentManager, userNameMap, userPortraitMap, cityMap, recommendShopNumMap);
List<Long> lineIds = listByDevelopmentManager.stream().map(ShopPointDTO::getLineId).collect(Collectors.toList());
Map<Long, String> partnerNameMap = lineInfoDAO.getUserNameMap(lineIds);
List<ShopPointBaseInfoVO> resultList = ShopPointBaseInfoVO.convertList(partnerNameMap,listByDevelopmentManager, userNameMap, userPortraitMap, cityMap, recommendShopNumMap);
PageInfo resultPage = new PageInfo(listByDevelopmentManager); PageInfo resultPage = new PageInfo(listByDevelopmentManager);
resultPage.setList(resultList); resultPage.setList(resultList);
return resultPage; return resultPage;