feat:新增加盟商名称
This commit is contained in:
@@ -214,4 +214,12 @@ public class LineInfoDAO {
|
||||
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));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -25,6 +25,8 @@ public class ShopPointBaseInfoVO {
|
||||
@ApiModelProperty("门店ID")
|
||||
private Long shopId;
|
||||
|
||||
private String partnerName;
|
||||
|
||||
@ApiModelProperty("门店名称")
|
||||
private String shopName;
|
||||
|
||||
@@ -55,12 +57,13 @@ public class ShopPointBaseInfoVO {
|
||||
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<>();
|
||||
for (ShopPointDTO shopPointDTO : lineList) {
|
||||
ShopPointBaseInfoVO shopPointBaseInfoVO = new ShopPointBaseInfoVO(shopPointDTO.getShopId(), shopPointDTO.getShopName(), shopPointDTO.getMobile());
|
||||
String username = userNameMap.get(shopPointDTO.getInvestmentManager());
|
||||
shopPointBaseInfoVO.setInvestmentManagerUsername(username);
|
||||
shopPointBaseInfoVO.setPartnerName(partnerNameMap.get(shopPointDTO.getLineId()));
|
||||
HyOpenAreaInfoDO areaInfo = cityMap.get(shopPointDTO.getWantShopAreaId());
|
||||
if(Objects.nonNull(areaInfo)){
|
||||
shopPointBaseInfoVO.setAreaName(areaInfo.getAreaName());
|
||||
|
||||
@@ -469,7 +469,11 @@ public class PointServiceImpl implements PointService {
|
||||
Map<Long, HyOpenAreaInfoDO> cityMap = hyOpenAreaInfoDAO.getCityMap(wantShopAreaIds);
|
||||
Map<String, String> userNameMap = enterpriseUserDAO.getUserNameMap(investmentManagerUserIds);
|
||||
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);
|
||||
resultPage.setList(resultList);
|
||||
return resultPage;
|
||||
|
||||
Reference in New Issue
Block a user