|
@ -75,6 +75,43 @@ public class BmsChannelPointMyController { |
|
|
return R.byEmptyList(); |
|
|
return R.byEmptyList(); |
|
|
} |
|
|
} |
|
|
List<BmsChannelPoint> list = bmsChannelPointService.selectChannelPointMyList(param, Arrays.asList(AuthContextUtils.getSysUserId())); |
|
|
List<BmsChannelPoint> list = bmsChannelPointService.selectChannelPointMyList(param, Arrays.asList(AuthContextUtils.getSysUserId())); |
|
|
|
|
|
|
|
|
|
|
|
List<String> bizRegionIds = new ArrayList<>(); |
|
|
|
|
|
bizRegionIds.addAll(list.stream().filter(a->a.getBizRegionId()!=null).map(a->a.getBizRegionId()).collect(Collectors.toList())); |
|
|
|
|
|
bizRegionIds = bizRegionIds.stream().distinct().collect(Collectors.toList()); |
|
|
|
|
|
List<BmsRegion2> region2List = new ArrayList<>(); |
|
|
|
|
|
if(bizRegionIds.size()>0){ |
|
|
|
|
|
LambdaQueryWrapper<BmsRegion2> region2LambdaQueryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
|
region2LambdaQueryWrapper.in(BmsRegion2::getId,bizRegionIds); |
|
|
|
|
|
region2List = bmsRegion2Service.list(region2LambdaQueryWrapper); |
|
|
|
|
|
} |
|
|
|
|
|
Map<String,BmsRegion2> idToBizRegion = region2List.stream().collect(Collectors.toMap(BmsRegion2::getId, a->a)); |
|
|
|
|
|
|
|
|
|
|
|
for (BmsChannelPoint channelPoint : list) { |
|
|
|
|
|
if(StringUtils.hasText(channelPoint.getBizRegionPath())){ |
|
|
|
|
|
String[] bizRegions = channelPoint.getBizRegionPath().split("_"); |
|
|
|
|
|
if(bizRegions.length>0){ |
|
|
|
|
|
channelPoint.setBizRegionName(bizRegions[bizRegions.length-1]); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
BmsRegion2 region2 = idToBizRegion.get(channelPoint.getBizRegionId()); |
|
|
|
|
|
if(region2!=null){ |
|
|
|
|
|
channelPoint.setBizRegionCode(region2.getCode()); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
if(StringUtils.hasText(channelPoint.getSaleRegionPath())){ |
|
|
|
|
|
String[] regions = channelPoint.getSaleRegionPath().split("_"); |
|
|
|
|
|
if(regions.length>0){ |
|
|
|
|
|
channelPoint.setSaleRegionName(regions[regions.length-1]); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
BmsSupplierChannel searchSupplierChannel = new BmsSupplierChannel(); |
|
|
|
|
|
searchSupplierChannel.setChannelId(channelPoint.getChannelId()); |
|
|
|
|
|
List<BmsSupplierChannel> bmsSupplierChannelList = bmsSupplierChannelService.selectSupplierChannelList(searchSupplierChannel); |
|
|
|
|
|
channelPoint.setSupplierNames(bmsSupplierChannelList.stream().map(b->b.getSupplierName()).collect(Collectors.toList())); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
return R.byPageList(count,list); |
|
|
return R.byPageList(count,list); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -122,6 +159,13 @@ public class BmsChannelPointMyController { |
|
|
channelPoint.setSaleRegionName(regions[regions.length-1]); |
|
|
channelPoint.setSaleRegionName(regions[regions.length-1]); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BmsSupplierChannel searchSupplierChannel = new BmsSupplierChannel(); |
|
|
|
|
|
searchSupplierChannel.setChannelId(channelPoint.getChannelId()); |
|
|
|
|
|
List<BmsSupplierChannel> bmsSupplierChannelList = bmsSupplierChannelService.selectSupplierChannelList(searchSupplierChannel); |
|
|
|
|
|
channelPoint.setSupplierNames(bmsSupplierChannelList.stream().map(b->b.getSupplierName()).collect(Collectors.toList())); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
return R.byPageList(count,pageList); |
|
|
return R.byPageList(count,pageList); |
|
|
} |
|
|
} |
|
|